Zero-Trust Architecture for Enterprise AI Agents: Preventing Token Hijacking and Secret Sprawl in MCP
An architectural deep dive based on the Model Context Protocol (MCP) Authorization Specification (2025-03-26), MCP Security Best Practices, IETF RFC 8707, and OWASP Top 10 for LLM Applications 2025 (LLM02 & LLM06).
Disclaimer: This publication provides objective technical and architectural analysis based on primary specifications and security standards. It does not constitute commercial endorsement.
1. The Hidden Danger of Shared Credentials in Enterprise AI
When organizations connect AI agents to internal ticketing systems, databases, and repositories via the Model Context Protocol (MCP) or external APIs, a common anti-pattern emerges: embedding static service-account API keys or personal access tokens directly into shared agent configurations.
According to OWASP Top 10 for LLM Applications 2025, two critical risks converge in these deployments:
- LLM02:2025 (Sensitive Information Disclosure): Secret keys, credentials, and proprietary data exposed through prompts, tool configurations, or unisolated runtime contexts.
- LLM06:2025 (Excessive Agency): Granting AI agents overly broad permissions, unrestricted functions, or autonomous execution authority without per-user scoping or human approval gates.

2. MCP Authorization Specification (2025-03-26) & OAuth 2.1 + PKCE
To eliminate static secret sharing and confused-deputy attacks, the MCP Authorization Specification (2025-03-26) establishes strict protocol boundaries:
- OAuth 2.1 with PKCE: Authorization flows for MCP clients must enforce OAuth 2.1 and Proof Key for Code Exchange (PKCE) to prevent authorization code interception.
- RFC 8707 Resource Indicators: Clients must explicitly bind requested tokens to a specific target MCP server URI using the
resourceparameter (RFC 8707), preventing tokens issued for one tool server from being replayed against another. - No Token Passthrough: MCP Security Best Practices explicitly prohibit forwarding client-supplied upstream tokens blindly to downstream APIs. Each server must validate audience claims and issue narrowly scoped, short-lived credentials.
flowchart LR
User["Authenticated User"] -->|"OAuth 2.1 + PKCE"| Auth["Authorization Server"]
Auth -->|"Audience-Bound Token (RFC 8707)"| Client["MCP Client"]
Client -->|"Scoped Token (No Passthrough)"| Server["MCP Server"]
Server -->|"Least-Privilege Check + HITL Gate"| API["Internal System"]

3. Three Practical Guardrails for Production Deployments
- Eliminate Shared Static Secrets: Replace environment-wide static API keys with per-user OAuth 2.1 short-lived tokens bound to specific
RFC 8707resource URIs. - Enforce Token Isolation (No Passthrough): Verify token audience (
aud) and scope at every MCP server boundary, and isolate sensitive credentials behind brokered vaults rather than passing them into model context. - Constrain Agency with Human-in-the-Loop (HITL) Gates: Following OWASP LLM06:2025, separate read-only discovery from state-mutating actions, requiring explicit user confirmation for destructive or external-facing operations.