MCP Proxy Policy Lab: Design a Sandboxing Gateway
This is a hands-on lab for writing the policy of a proxy between an AI agent and its MCP servers. A proxy can check arguments, refuse tokens meant for someone else, pin what you approved and log every call, but only if you decide those rules. You make 12 scored calls and see which source backs each answer.
The scenario is fictional. The rules come from the MCP specification and security best practices, OWASP and published research, listed below. To review a server you already have, use the MCP Server Security Checklist or the MCP Linter.
You are Priya Raman, platform security lead at Harbourline Insurance. Your AI agent Atlas talks to several MCP servers: a ticketing server, a finance server and a few third-party ones. You are putting a sandboxing proxy between the agent and those servers, and you write its policy. Over 12 scored decisions you choose what the proxy validates, which authority it lets through, how it notices changed tool descriptions, what it does with results and what it cannot do for you. Everything is invented. Each call scores 0 to 10 with the source behind the feedback.
Make it yours
Replace the sample names so the scenario and the debrief you export are about your organisation.
TL;DRWhat this is
5 points
- A scenario lab about the policy of a sandboxing proxy (a gateway) that sits between an AI agent and its MCP servers. You act as platform security lead at a fictional company and write the rules.
- You make 12 scored decisions: default deny for tools, validating arguments against each tool's JSON Schema, ranges and allow-lists beyond type, refusing borrowed authority (confused deputy), not forwarding tokens (token passthrough), rejecting tokens meant for someone else (audience), pinning tool descriptions against rug pulls, treating descriptions as untrusted (tool poisoning), per-tool scopes, handling results, logging and rate limits, and what a proxy cannot fix.
- It draws on the MCP specification and its security best practices, the MCP authorization draft, OWASP guidance on excessive agency and agentic threats, Invariant Labs' published tool-poisoning research and the JSON Schema reference.
- Free to play, no account needed. Every name is invented. No attack steps appear and no real key or host is shown.
- Defensive and educational only.
How this differs from our other agent labs
The MCP Rug Pull Lab asks you to name the attack on a server you are reviewing (poisoning, rug pull, shadowing, over-broad scope) and pick the control. This lab starts one step later: you already know those attacks exist, and you write the standing policy of the gateway that enforces the controls on every call. The MCP Linter and MCP Malicious Scan inspect a server’s tool definitions before you connect; the MCP Server Security Checklist covers building or hosting a server.
Other agent labs look at neighbouring questions: the Agent Tool Scope Lab asks which tools an agent should have, the Agent Credential Broker Lab where its credentials live, and the Delegated Agent OAuth Lab how it gets a token to act for a user. This one is about the checkpoint in the middle.
Frequently asked questions
What is an MCP proxy or gateway?
It is a service placed between an AI agent (the MCP client) and one or more MCP servers. It sees the traffic in both directions, so it can apply a policy the servers do not control: which tools exist, which arguments are acceptable, which identity may call what, and what gets logged. The lab teaches what to put in that policy. A proxy is not part of the MCP specification itself; it is a deployment pattern.
What is the confused deputy problem in MCP?
It is when a component that holds authority is tricked into using it for a party that should not have it. The MCP security best practices describe it for MCP proxy servers that use one static client ID with a third-party authorization server: consent that was given once can be reused by an attacker's crafted request. The same shape appears when a low-privilege agent borrows a high-privilege server's authority. The lab covers the second form: check what the caller may do, not what the server may do.
What is token passthrough and why is it forbidden?
Token passthrough is when an MCP server accepts a token from a client without checking it was issued to that server, then passes it on to a downstream API. The MCP security best practices call it an anti-pattern and say the authorization spec explicitly forbids it. Their listed risks include bypassed security controls, a confusing audit trail and broken trust boundaries.
Can JSON Schema validation stop a malicious tool call?
It stops malformed ones: wrong types, missing fields, unexpected properties and values outside a range or list you define. It does not judge intent. A well-formed call with an in-range value can still be harmful, and a poisoned tool description is text, not a parameter. The lab treats schema checks as one layer.
How does a proxy detect a rug pull?
By pinning. At review time the proxy stores a hash of each approved tool's name, description and input schema; later it compares. Invariant Labs recommends verifying a hash or checksum of the tool description before use. A mismatch should stop the tool being shown to the agent until someone re-reviews it. This is detection of change, not of intent.
What can a proxy not fix?
It cannot make a malicious server or a poisoned but allowed tool harmless, it cannot judge intent inside an allowed call, it sees nothing that bypasses it, and it cannot decide whether a business action is wise. Approvals for risky actions, least-privilege servers and monitoring remain necessary.
Is the scenario based on a real incident?
No. The organisation, agent and servers are invented. The research referred to (Invariant Labs, 1 April 2025 on its page) is named as research, and Invariant is a vendor of agent-security tooling.
How is the lab scored?
Each of the 12 decisions scores 0 to 10 and the result is your share of the maximum, with a short band saying what it means. The debrief shows the source behind each rationale. Lines labelled PlayCISO practice are our reasoning, not a statement by a source.
Sources
All read on 4 November 2026. Lines in the feedback marked “PlayCISO practice” are our own reasoning, not a statement by any source. The scenarios are fictional. We cite primary sources, not vendor advisories, and say where a page could not be fully read.
- Model Context Protocol specification: Tools (specification 2025-06-18) (Version 2025-06-18) Used for inputSchema, the note that clients must treat tool annotations as untrusted unless the server is trusted, and the security-considerations list.
- Model Context Protocol specification: Authorization (draft specification) (Draft version on 4 Nov 2026) A draft that can change. We cite its rules on the resource parameter (RFC 8707) and on servers accepting only tokens meant for them.
- Model Context Protocol documentation: Security Best Practices (Current version on 4 Nov 2026)
- Invariant Labs: MCP Security Notification: Tool Poisoning Attacks (1 April 2025 (as dated on the page)) Research by a vendor of agent-security tooling. It describes tool poisoning and rug pulls and recommends pinning tool descriptions by hash or checksum.
- JSON Schema project: Understanding JSON Schema: reference (Current version on 4 Nov 2026) Used for the existence of type, numeric range, string, array and object constraints (required, additionalProperties, enum).
- OWASP GenAI Security Project: LLM06:2025 Excessive Agency (2025 edition)
- OWASP GenAI Security Project (Agentic Security Initiative): Agentic AI: Threats and Mitigations (17 February 2025 (as dated on the page)) We read the introduction and cite the guide as a threat-model reference; we quote no individual threat entry.
More security tools
The tools people use most on PlayCISO.
Catch injected instructions hiding in content your AI agent should only read.
Score your readiness against the first international standard for AI security threats.
Critical CVEs across 21 major vendors, month by month — and what the 2026 surge means.
Build an ordered ruleset, replay labelled packets and catch shadowed and any-to-any rules.
Self-assess all six Functions, from Govern to Recover, and see your weakest one.
Search 172 threat actors across Microsoft, CrowdStrike, Mandiant and community names.