<- All 20 Essays rafaelbenavi.com

Why Enterprise MCP Deployments Fail Security Review (And the Gateway Pattern That Fixes It)

Connecting an LLM agent to GitHub, Jira, or Confluence on a laptop takes ten minutes. Taking it to multi-account production without creating a god-mode service account requires an identity-aware MCP Gateway.

MCPOAuth 2.1OBOZero-TrustEntra IDVPC Lattice

Most enterprise Model Context Protocol (MCP) deployments die in their first InfoSec review for one boring reason: static API keys.

On a developer laptop, dropping a personal access token or a broad service-account key into a local MCP server config works immediately. The demo looks magical. Then someone asks how to roll it out across 300 engineers and multiple AWS and Azure accounts, and security shuts the whole initiative down.

They are right to shut it down. If an autonomous agent holds a static Jira or GitHub service token, any employee prompting that agent inherits the service account's full blast radius. Prompt injection stops being a theoretical AI risk and turns into a straightforward privilege-escalation exploit.

The Core Anti-Pattern: Distributed Servers with Local Secrets

When teams rush into agentic workflows, every squad spins up its own MCP server next to its own tooling: one for GitHub Enterprise, one for Jira, one for Confluence, one for internal deployment pipelines. Each server ends up re-implementing authentication, logging, and rate limiting poorly, usually with long-lived secrets stored in environment variables.

That architecture fails three enterprise non-negotiables simultaneously: least privilege, non-repudiation (who actually triggered that write action?), and centralized kill-switch control.

The Centralized Multi-Account MCP Gateway Pattern

In production, we eliminated direct agent-to-tool credentials entirely and routed every tool invocation through a centralized, identity-aware MCP Gateway:

[Human / Autonomous Client]
        |  (1) Entra ID User JWT (OAuth 2.1)
        v
+---------------------------------------------------+
|          Centralized AgentCore MCP Gateway        |
|  - Token Validation & Policy Enforcement          |
|  - Entra ID OBO Exchange (private_key_jwt)        |
|  - Tool Registry, Rate Limits, Audit Stream       |
+---------------------------------------------------+
        |  (2) Scoped User-Delegated Token over VPC Lattice
        +-------------------+-------------------+
        v                   v                   v
 [GitHub MCP]          [Jira MCP]        [Internal Ops MCP]

1. Identity Propagation via OAuth 2.1 On-Behalf-Of (OBO)

The agent never acts as a superuser. When a user initiates an agent session, the client sends the user's Entra ID token to the gateway. The gateway executes an OAuth 2.1 On-Behalf-Of (OBO) exchange to mint a narrowly scoped downstream token for the exact target tool.

The result is simple: if the human user cannot read a restricted repository or transition a production ticket, neither can the agent acting on their behalf. Downstream systems continue enforcing their native RBAC without duplicating permission trees inside the AI layer.

2. Zero Shared Secrets with private_key_jwt

Even with OBO, the gateway itself must prove its workload identity to the identity provider. Using a static client_secret just shifts the secret-sprawl problem one hop upstream. Instead, authenticate the gateway workload using asymmetric private_key_jwt assertions backed by hardware-protected keys or short-lived workload certificates:

{
  "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer",
  "client_id": "mcp-gateway-prod-01",
  "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
  "client_assertion": "<RS256 signed 60s assertion>",
  "assertion": "<incoming_user_access_token>",
  "requested_token_use": "on_behalf_of",
  "scope": "api://github-mcp-tool/repo.read"
}

3. Network Isolation and Centralized Policy

Each downstream MCP server runs in its own isolated VPC or account and is reachable only over private service-network links (such as AWS VPC Lattice) from the gateway. That single choke point lets platform teams enforce:

  • Immutable audit logs: Every tool call records user principal, agent session ID, arguments hash, latency, and response status.
  • Mutation guardrails: Read-only tools execute autonomously; state-mutating tools require explicit step-up confirmation or scoped policy grants.
  • Instant circuit breaking: If a downstream API degrades or a tool schema misbehaves, you disable it in one registry instead of chasing 20 deployments.

The Takeaway

Agentic AI in the enterprise is no longer a prompting problem. It is an identity, network boundary, and distributed systems problem. Solve the gateway once, and every new MCP server becomes a five-day onboarding instead of a six-month security battle.

Building production AI infrastructure or scaling distributed platforms?

Open to Principal / Distinguished Architect, VP of Engineering, and CTO conversations with high-bar engineering organizations.

Email Rafael Connect on LinkedIn
Earlier Essay (2026-09-10)Federated Spec-Driven AI-SDLC: Why Repo-Level Governance Beats IDE Lock-In