TL;DR: MCP turns LLMs into tool-using agents, but that also creates risks from prompt injection, token leakage, overbroad permissions, unverified endpoints, and replayable sessions, according to WorkOS. The practical lesson is that security teams must treat MCP connections as identity and trust boundaries, not just integration plumbing.
At a glance
What this is: This is a practical guide to securing MCP servers and clients, with the central finding that every MCP connection creates a trust boundary between untrusted model output and sensitive systems.
Why it matters: It matters because IAM, PAM, and NHI teams now have to govern model-issued tool calls, token handling, endpoint trust, and session integrity as part of access control, not as a separate AI concern.
Context
Model Context Protocol gives large language models a structured way to call tools and APIs, which means the identity problem shifts from human login flows to model-driven access paths. Once a model can fetch data, trigger workflows, or execute tasks, every connection has to be treated as a governed trust boundary.
The security gap is not just that MCP adds more integrations. It is that untrusted prompts, tool metadata, tokens, and endpoints can all influence execution, so access control, verification, and auditability have to be designed around the protocol rather than layered on after deployment.
For IAM teams, the practical question is how to preserve least privilege, session integrity, and provenance when the actor making the request is a model-mediated client rather than a human user or a conventional service account.
Key questions
Q: How should teams secure MCP when models can invoke tools directly?
A: Start by treating every MCP connection as a trust boundary. Limit the tools a model can reach, require strong client authentication, validate server identity, and isolate high-risk actions so a single prompt cannot become a broad execution path across multiple systems.
Q: Why do short-lived tokens matter for MCP and agent access?
A: Short-lived tokens limit how long a request can be abused, but they also force the enterprise to make authorization decisions in real time. That is useful only if policy, context, and server-specific scope boundaries are precise enough to support it.
Q: What breaks when MCP servers do not verify endpoints and tool metadata?
A: Clients can be tricked into trusting rogue servers or poisoned tools that look legitimate. That breaks provenance, makes credential handoff unsafe, and turns discovery into a supply-chain attack surface instead of a controlled onboarding process.
Q: How should security teams govern model-driven tool access versus ordinary API access?
A: Model-driven tool access needs tighter control because the request path is mediated by untrusted prompt content and runtime decisioning. Ordinary API access usually assumes the caller is already known, while MCP requires explicit control over discovery, consent, scope, and session binding.
Technical breakdown
Why MCP creates a new trust boundary
MCP sits between model output and downstream tools, so it becomes an interpreter layer for actions that can affect data, systems, and workflows. That changes the security model because the protocol is not merely moving API calls around, it is deciding which requests a model can translate into action. Prompt injection, tool poisoning, and unverified tool metadata matter because they influence that translation step. If the model is tricked into choosing the wrong tool or the wrong parameters, the damage happens through a legitimate-looking execution path. The architectural issue is trust propagation: a weak decision at the model layer becomes a privileged action downstream.
Practical implication: Treat MCP policy as an access boundary and restrict which tools a model can ever reach.
Token leakage and replay in MCP sessions
MCP depends on tokens, audience checks, and session state to authenticate clients and authorize tool use. If those credentials are logged, cached, passed in URLs, or left long-lived, attackers can reuse them outside the intended session. Sender-constrained tokens such as mTLS- or DPoP-bound credentials reduce replay risk because the token is tied to the presenting client rather than being reusable anywhere it appears. Nonces, short expiry, and strict audience validation matter for the same reason: they narrow the time window and the replay surface. In an MCP environment, credential hygiene is not a background control. It is the difference between a bounded tool call and persistent unauthorized access.
Practical implication: Use short-lived, sender-constrained tokens and validate audience and expiry on every MCP request.
Endpoint verification and tool integrity for MCP
Dynamic discovery makes MCP flexible, but it also creates a server impersonation problem. If a client cannot verify the identity and integrity of a server or tool registry, it may hand credentials or sensitive requests to a malicious endpoint that looks legitimate. Signed metadata, certificate pinning, trusted registries, and package hash verification are the controls that convert discovery from blind trust into verifiable trust. Without them, spoofed servers and poisoned tools become supply-chain risks rather than simple configuration mistakes. The important technical point is that integrity has to cover both the server endpoint and the tool definitions it exposes, because either one can redirect execution.
Practical implication: Require cryptographic verification of MCP servers, registries, and tool definitions before any trust is granted.
Threat narrative
Attacker objective: The attacker wants to turn model-mediated tool access into unauthorized execution and data exposure through trusted-looking MCP pathways.
- Entry occurs when a poisoned prompt, malicious tool description, or spoofed MCP server influences what the model chooses to do.
- Credential access follows when leaked, replayable, or overbroad tokens are captured from logs, URLs, or weak session handling.
- Escalation happens when the model is induced to invoke high-privilege tools or proxy OAuth flows beyond intended consent.
- Impact is unauthorized data access, command execution, or workflow abuse that looks like legitimate model activity.
Breaches seen in the wild
- Nx s1ngularity attack 2025: Attackers stole Nx's npm token via a GitHub Actions flaw and shipped malware that stole 2,349 secrets and abused developers' AI CLIs.
Read and download The State of NHI & AI Agent Breach Report 2026, covering 150+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
MCP trust is now an identity problem, not just an integration problem: The protocol turns model output into actionable requests, which means trust has to be enforced at the point of tool selection, token issuance, and server discovery. If teams still treat MCP as plumbing, they will miss the fact that the identity boundary has moved into the runtime decision path. The practical conclusion is that access governance for MCP must be built as part of identity architecture, not bolted onto the AI stack after deployment.
Prompt injection and tool poisoning expose a broader governance weakness: The weak point is not only malicious content, but the assumption that a model can safely mediate action without strict authorization boundaries. That assumption breaks when untrusted input can redirect a tool call, because the model becomes an execution proxy rather than a passive interpreter. This is where least privilege has to be enforced at the tool and session level, not merely at the application perimeter.
Ephemeral tool use creates a new form of identity blast radius: Once a token or session can be replayed, a single compromised interaction can outlive the intended request and spread into downstream services. That makes the decisive control question one of trust boundaries, token scope, and session binding rather than model quality. Teams that can segment MCP access by audience, action, and server are closer to governable AI; teams that cannot are exposing their systems to silent privilege drift.
Unverified endpoints are the MCP version of shadow infrastructure: Dynamic discovery without cryptographic verification lets rogue servers enter the trust chain with little friction. The governance lesson is that client-side trust decisions now need the same scrutiny as third-party vendor onboarding, because the protocol can hand over both data and authority in a single exchange. Practitioners should treat every new MCP endpoint as an identity event with security consequences, not a convenience feature.
Model Context Protocol authorization debt: MCP deployments accumulate risk when teams adopt the protocol faster than they design the controls that prove who or what is allowed to act. That debt shows up in overbroad scopes, replayable sessions, and weak endpoint verification. The implication for practitioners is simple: the more MCP expands agentic reach, the more the organisation needs explicit authority boundaries, audit trails, and revocation paths.
From our research library:
- 24,008 unique secrets were exposed in MCP configuration files in 2025 alone, the protocol's first year of widespread adoption, according to the State of Secrets Sprawl 2026.
- Read next: MCP Security Guide
What this signals
MCP adoption is creating credential sprawl faster than teams can govern it: 24,008 unique secrets were exposed in MCP configuration files in 2025 alone, according to the State of Secrets Sprawl 2026. That is a clear sign that model-facing integrations are already generating a secrets-management problem, not just an AI architecture problem.
Teams should expect MCP to pull access governance deeper into runtime operations. The control point shifts from static integration approval to continuous verification of tools, endpoints, and token scope, which is exactly where identity teams need more visibility.
The protocol also sharpens the case for verifiable trust chains. When discovery is dynamic and the actor is model-mediated, unverified endpoints and replayable sessions are not edge cases, they are the conditions that define whether the deployment is governable at all.
For practitioners
- Define MCP trust boundaries Map which tools, servers, and workflows a model may reach, then separate read and write actions so a single MCP session cannot cross into unrelated systems.
- Bind tokens to the client Use short-lived credentials with strict audience validation and sender constraints so stolen MCP tokens cannot be replayed from another endpoint.
- Verify servers and tool metadata Require signed metadata, certificate pinning, and trusted registries before a new MCP endpoint is allowed to accept requests or receive credentials.
- Sandbox high-risk tool execution Run file writes, shell commands, and other privileged MCP actions in isolated environments with explicit approval gates for destructive operations.
- Centralise MCP audit trails Log tool invocations, auth events, scope requests, and session revocation actions so security teams can correlate model activity with downstream effects.
Key takeaways
- MCP changes the security problem from simple tool integration to governed model-mediated access.
- The main failure modes are prompt injection, token leakage, broad permissions, endpoint impersonation, and replayable sessions.
- Teams need identity-grade controls for discovery, token binding, and auditability before MCP can be treated as production-safe.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10, OWASP Agentic AI Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0 sets the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-04 — Insecure Authentication | MCP clients rely on tokened access and server trust, making weak auth central here. |
| NHI-05 — Overprivileged NHI | The article repeatedly warns against overbroad scopes and excess tool permissions. | |
| NHI-07 — Long-Lived Secrets | Leaked or replayable tokens are a primary MCP abuse path discussed throughout the guide. | |
| Recommendation — Enforce strong client authentication and validate every MCP server before issuing access. Limit each MCP tool to the smallest viable scope and separate read from write access. Replace long-lived MCP credentials with short-lived, audience-bound tokens and revoke them quickly. | ||
| OWASP Agentic AI Top 10 | ASI02 — Tool Misuse | MCP security risks centre on the model invoking the wrong tool or an unsafe tool path. |
| ASI03 — Identity & Privilege Abuse | The guide focuses on permission overreach, replay, and confused deputy conditions in agentic access. | |
| Recommendation — Constrain agent tool access so the model can only invoke approved actions in approved contexts. Bind agent privileges to explicit consent, scoped tokens, and auditable session boundaries. | ||
| MITRE ATT&CK | TA0006;TA0008 — Credential Access; Lateral Movement | The article describes token theft, replay, and movement from one trusted tool path to another. |
| Recommendation — Map MCP token theft and tool abuse to TA0006 and TA0008 to improve detection coverage. | ||
| NIST CSF 2.0 | PR.AA-05 — Access Permissions, Entitlements and Authorizations | Least-privilege scoping and authorization are the central governance themes of the article. |
| Recommendation — Apply PR.AA-05 to enforce narrow entitlements for every MCP client, server, and tool. | ||
Key terms
- Model Context Protocol: Model Context Protocol is an open protocol that lets AI agents connect to tools and data sources. It expands what an agent can reach, so governance has to cover not only the model and its prompts, but also every system that can receive or return agent-driven data.
- Prompt Injection (Agentic): An attack where malicious instructions are embedded in content that an AI agent reads, causing the agent to execute unintended actions using its own legitimate credentials. A primary vector for agent goal hijacking and identity abuse.
- Sender-constrained token: A sender-constrained token is tied to a specific client or cryptographic proof, rather than being usable by anyone who steals it. This reduces replay risk and is especially important where tokens can reach automation, services, or agents with broad API access.
- Tool Poisoning: Tool poisoning is an attack in which malicious instructions are hidden inside tool descriptions, examples, or schemas that an AI agent reads when deciding what to do. The danger is not only in the tool's code, but in the metadata that shapes the agent's behaviour and trust decisions.
Deepen your knowledge
NHI governance, agentic AI identity, and machine identity security are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
Published by the NHIMG editorial team on June 8, 2026.
Updated on October 7, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org