MCP and Agent Tool Security: Put the Boundary Outside the Model
By Harpreet Singh, CISSP, CCSP

When an AI assistant can call a tool, the model's choice is only one part of the security decision. A connected service may read a document, query an API or change business data. The control that matters is the authorization enforced by the system that performs the action. Prompts can describe intended behavior, but they do not replace identity checks, resource permissions or approval rules in the tool server and downstream application.
This guide gives application and platform teams a defensive review for Model Context Protocol (MCP) clients and servers and for similar agent integrations. MCP evolves, and implementations may support different protocol versions. Check the version negotiated by the products you deploy and compare it with the current official specification; do not assume an older integration implements every current requirement.
Map the complete action path
For one representative workflow, draw the path from requester to model, context sources, tool selection, tool server, upstream API and resulting state. Include background workers, stored conversation state, approval services, queues and logging. Mark which component authenticates the user, which authorizes access to each object, and which component can stop execution.
For every tool, record its owner, purpose, inputs, outputs, data sensitivity, read/write capability, credentials, network destinations, rate limits and downstream effects. A read-only tool may still reveal restricted data; a write tool may affect a high-impact system even when it has a narrow name. If the integration can execute code or initiate outbound requests, treat that as an explicitly controlled capability with a bounded environment and destination policy.
Enforce permissions at the service boundary
Give each integration the minimum functions and data it needs. Use separate identities and credentials for distinct workflows when practical. Check tenant, object and action authorization on every operation using the authenticated principal and the requested resource. Do not rely on a model-generated user ID, object ID or “approval” string as proof of authority.
The MCP authorization specification requires protected servers to validate that access tokens were issued for the intended resource and warns against passing a token received from a client through to an upstream API. A server that needs upstream access should obtain an appropriate token for that upstream resource. Follow the exact flow supported by the server and identity provider, including secure token storage and least-privilege scopes. MCP authorization security considerations
The current MCP authorization documentation also describes OAuth-related protections such as PKCE and issuer validation. Implementers should use supported, well-tested identity libraries, validate the intended audience and issuer, and follow the specification version actually in use. These protocol requirements protect a token flow; they do not determine whether a particular user may access a particular business record. That authorization remains an application responsibility. MCP authorization specification
Treat tool requests and returned content as untrusted
Validate tool arguments against a strict schema and business rules before execution. Resolve object ownership and permission server-side. Reject unknown operations and unexpected fields. Apply timeouts, size limits and rate limits. Keep secrets out of model context, tool responses and routine logs wherever possible.
Treat tool descriptions, names and returned content as inputs that may be misleading or compromised. The OWASP secure-use guide for third-party MCP servers discusses risks such as tool poisoning and prompt injection. An instruction embedded in an issue, document or tool result must not silently expand the agent's allowed permissions or destination list. OWASP third-party MCP server security guide
For outbound connections, define approved destinations at a trusted network or service boundary. Validate redirects and resolved addresses where a component fetches URLs; block access to sensitive internal services unless explicitly required. A model instruction saying “use the approved host” is not an egress control. Record what destination policy is enforced and how operators will review a denied or unusual request.
Put approval in the transaction path
Require a human decision for actions with material or hard-to-reverse consequences, but make the approval meaningful. Show the authenticated user, target object, requested operation and relevant arguments. Bind the approval to those exact values, expire it, and reauthorize at execution time. If the arguments change, obtain a new approval. A generic confirmation that does not show the actual change is weak evidence of intent.
Prefer a staged operation: the agent prepares a proposed change; a trusted service validates it; an authorized person approves it; and the service executes that exact change. Where feasible, provide a dry-run view and an idempotency control. Define how to cancel queued work and what happens if cancellation races an in-flight request.
Test the boundary with synthetic data
In an authorized test environment, exercise allowed and denied cases:
- A permitted user reads a synthetic object they own.
- A second test user requests the same object and should be denied by the tool service.
- A write request with a changed target after approval is rejected or reauthorized.
- Misleading retrieved content cannot add a tool, scope, identity or destination.
- A revoked credential and a stop request have documented effects on queued and new work.
Record the request, principal, policy decision, resulting state and relevant correlation IDs without capturing real secrets. A user-interface refusal alone does not prove that the server enforced the denial. Confirm there was no side effect in the underlying system.
Logging, stopping and recovery
Record enough to reconstruct who requested the workflow, which identity acted, what tool and target were used, which approval applied, and whether the downstream action succeeded. Avoid retaining full prompts or sensitive tool output unless justified and protected; logs themselves can become a secondary data store. Set an owner and retention period for the evidence.
Define a stop procedure that reaches the trusted execution layer. Pausing a chat window may not stop a queued job, background process or already-issued API request. Test stopping new work, revoking credentials, cancelling queued operations and reconciling partial completion separately. Document recovery steps for an action that cannot be rolled back cleanly.
The NIST Generative AI Profile can help teams assign lifecycle responsibilities and manage broader AI risks. Pair that governance with concrete service authorization, identity and logging evidence. A protocol-compliant connection is not, by itself, proof that the workflow is appropriately permissioned. NIST AI RMF Generative AI Profile
Hypothetical example: a ticketing agent
Suppose a support agent reads customer tickets and can prepare account changes. A malicious instruction appears in a ticket asking the assistant to change a different customer's account and export its records. The defensive test should use two synthetic customers and verify that the tool service checks the authenticated user's permission for each requested record. The approval screen should display the exact customer and change. If the target changes after approval, execution should stop or require a new approval. This example is hypothetical; it does not describe a reported incident.
Keep the workflow's authority visible and testable: authenticated principal, resource, action, approval and downstream result. That evidence helps teams distinguish a model behavior problem from an authorization failure and prioritize the right control.