Agentic Security & MCP Tool Poisoning
Separate tool discovery (`tools/list`) from tool invocation permission (`tools/call`). Validate JSON-RPC envelopes and Pydantic schemas in `D2`, pin tool descriptions/schemas to block shadow-tool/rug-pull poisoning, and enforce per-user scopes.
Stage detail
When: Agent authorization Weeks 5--6. Build MCP only after ordinary tool authorization works.
- MCP client/server roles, tool discovery, schemas, transports, authentication, authorization, and trust boundaries.
- JSON-RPC message validation and safe error handling.
- Tool poisoning: misleading tool descriptions/metadata that manipulate model tool selection.
- Shadow/conflicting tools and unexpected tool changes.
- Least-privilege scopes, confused-deputy risk, cancellation, timeouts, rate limits, audit events, and safe tool-output handling.
Core practice: the agent may request a tool, but the server independently checks the authenticated principal, tenant, permission, resource ownership, and allowed arguments.
Extra practice: implement a local MCP server with one or two safe tools. Validate with Pydantic, authenticate the client, enforce per-tool scopes, and test malicious descriptions, conflicting names, unauthorized admin-tool requests, malformed JSON-RPC, and cancellation.
Do not learn yet: publishing a public MCP server, supporting every transport, or building an agent-to-agent network. First prove one local server is secure.
Study days for this stage
10- 6Implement a small tool registry with calculate and search_notesW1S3S7R01 R07
- 8Study confused-deputy risks and least privilegeW2S1S3R02 R10
- 29Build a bounded agent loop from scratch with three tools and…W5S3M5R24 R41
- 30Study MCP architectureW5S3D2R21
- 31JSON-RPC & Schema ValidationW6S3S7D2R02 R07 R21
- 32Study MCP tool poisoning and metadata changesW6S3M1D2R05 R21
- 33Add audit events, timeouts, cancellation, and error boundaries…W6S3D2R21 R27
- 77Review tool registryW13S2S3R04 R05 R21
- 85Agent State Machine & Sandboxed Code DiagnosisW15S3M5D2D3R02 R21 R24 R41
- 97Simulate agent runaway or unsafe browser actionW17S3M9D2D7D9D11R33 R41