QuotaCheap Playbook

MCP Security: permissions, secrets, sandbox và blast radius

Checklist bảo mật MCP cho production: least privilege, secret handling, read/write tools, per user authorization, audit logs, rate limits, human approval,…

MCP làm agent chạm được vào hệ thống thật. Vì vậy security phải là thiết kế gốc, không phải lớp vá sau demo.

Checklist bảo mật MCP cho production: least privilege, secret handling, read/write tools, per-user authorization, audit logs, rate limits, human approval, kill switch và blast radius control.

MCP Security: permissions, secrets, sandbox và blast radius MCP làm agent hữu dụng hơn vì agent có thể gọi tools và truy cập context ngoài model.

Nhưng cũng chính điều đó làm MCP nguy hiểm hơn một chatbot chỉ trả lời text.

Nếu agent có thể đọc repo, gọi API, tạo ticket, gửi message hoặc sửa dữ liệu, MCP server trở thành một phần của security boundary.

Least privilege trước tiên Đừng cấp tool theo kiểu “agent cần gì thì cho hết”.

Hãy bắt đầu từ câu hỏi: Agent này phục vụ workflow nào?

Workflow đó cần read tools nào?

Có thật sự cần write tools không?

Tool có giới hạn theo workspace/user không?

Có scope riêng cho môi trường dev/staging/prod không?

Một support agent không cần tool deploy.

Một content agent không cần đọc billing settings.

Một coding agent không nên có production database write nếu chưa có approval.

Secrets không được trôi vào prompt MCP server thường cần secrets để gọi service thật.

Nhưng secrets phải nằm ở server/runtime, không nằm trong prompt, tool output hoặc logs.

Checklist: Không trả API key/token trong tool output.

Redact headers, cookies, credentials.

Không đưa .env vào resource text.

Không log raw request chứa secrets.

Rotate token nếu nghi ngờ leak.

Read và write phải tách quyền Read action và write action có rủi ro khác nhau.

Tách chúng giúp policy rõ hơn.

Ví dụ: listDraftPosts là read.

createDraftPost là write nhẹ.

publishPost là external write mạnh.

Guide topic

Build Playbooks: Practical guides for building agents by use case.

Related path

MCP for Builders: Architecture and implementation playbooks for building useful MCP servers.

MCP Security: permissions, secrets, sandbox và blast radius MCP làm agent hữu dụng hơn vì agent có thể gọi tools và truy cập context ngoài model. Nhưng cũng chính điều đó làm MCP nguy hiểm hơn một chatbot chỉ trả lời text. Nếu agent có thể đọc repo, gọi API, tạo ticket, gửi message hoặc sửa dữ liệu, MCP server trở thành một phần của security boundary. Least privilege trước

tiên Đừng cấp tool theo kiểu “agent cần gì thì cho hết”. Hãy bắt đầu từ câu hỏi: Agent này phục vụ workflow nào? Workflow đó cần read tools nào? Có thật sự cần write tools không? Tool có giới hạn theo workspace/user không? Có scope riêng cho môi trường dev/staging/prod không? Một support agent không cần tool deploy. Một content agent không cần đọc billing settings. Một coding agent

không nên có production database write nếu chưa có approval. Secrets không được trôi vào prompt MCP server thường cần secrets để gọi service thật. Nhưng secrets phải nằm ở server/runtime, không nằm trong prompt, tool output hoặc logs. Checklist: Không trả API key/token trong tool output. Redact headers, cookies, credentials. Không đưa .env vào resource text. Không log raw request chứa secrets. Rotate token nếu nghi ngờ leak. Read

và write phải tách quyền Read action và write action có rủi ro khác nhau. Tách chúng giúp policy rõ hơn. Ví dụ: listDraftPosts là read. createDraftPost là write nhẹ. publishPost là external write mạnh. deletePost là destructive. Mỗi nhóm cần policy riêng. Không nên để một token duy nhất làm tất cả. Per user authorization Nếu MCP server phục vụ nhiều users/workspaces, auth không thể chỉ là “agent được

phép gọi server”. Server phải biết user/workspace nào đang gọi và enforce quyền ở backend. Cần có: user id workspace id role/scope resource ownership check audit trail Nếu không, một agent session có thể vô tình truy cập dữ liệu sai tenant. Human approval cho action nhạy cảm Một số action nên luôn cần approval: gửi email/broadcast publish social post refund/payment delete data deploy production thay đổi security settings MCP

tool nên hỗ trợ draft/preview trước execute. Agent trình bày ý định, human duyệt, sau đó mới thực thi. Rate limit và quota Security không chỉ là data leak. Một agent loop lỗi có thể spam tool calls, gọi model liên tục hoặc tạo quá nhiều external actions. Cần có: per user rate limit per tool rate limit per workflow quota daily/monthly budget circuit breaker khi lỗi tăng QuotaCheap có

thể hỗ trợ lớp model usage/budget visibility; MCP server vẫn cần tool level rate limit riêng. Blast radius control Hãy