MCP Security and Gateway Engineering
Engineering secure, governed and observable connections between artificial intelligence agents, enterprise applications, external tools and critical infrastructure.
From AI conversations to infrastructure operations
Traditional AI applications generate responses. Agentic AI applications can also retrieve information, invoke tools, interact with APIs and initiate operations across distributed enterprise systems.
The Model Context Protocol (MCP) provides a standardized mechanism through which AI applications discover and interact with capabilities exposed by MCP servers. These capabilities include tools, resources and reusable prompts.
This creates an important architectural challenge. A model may influence which operation is requested, but the model must never become the ultimate authority that determines whether that operation is permitted.
Enterprise MCP infrastructure therefore requires explicit identity boundaries, deterministic authorization, secure transport, controlled execution environments and comprehensive operational visibility.
Inside the enterprise MCP security fortress
Explore how an agent-generated request travels through a host-managed MCP client, an enterprise gateway and a protected MCP server before reaching a backend system.
The token is valid, the requested tool is permitted and the arguments satisfy the configured execution policy.
[IDENTITY] Token validated [POLICY] Tool access permitted [INSPECTION] Arguments accepted [GATEWAY] Request forwarded [AUDIT] Decision recorded
Educational simulation of configurable gateway controls. No live credentials, external tools or infrastructure are accessed. MCP does not require a centralized gateway.
What actually travels through MCP?
MCP uses JSON-RPC messages to exchange protocol requests, responses and notifications. Following initialization and capability negotiation, a client can discover available tools and invoke supported operations.
{
"jsonrpc": "2.0",
"id": 42,
"method": "tools/call",
"params": {
"name": "get_network_status",
"arguments": {
"device": "core-router-01"
}
}
}
This illustrative request asks an MCP server to execute a network status tool. The message describes the requested operation, but does not independently establish the identity of the caller or grant permission to execute it.
In an OAuth-protected HTTP deployment, the access token is carried through the HTTP authorization mechanism rather than embedded in the JSON-RPC tool arguments. The protected resource must validate the token and enforce the applicable access policy.
Executable capabilities that can retrieve information, perform computations or initiate external operations.
Contextual information exposed by servers, including documents, application data and infrastructure state.
Reusable prompt templates and structured interaction patterns exposed through the protocol.
Local MCP integrations can use standard input and output (stdio), while remote integrations can use Streamable HTTP. These transport choices introduce different identity, isolation and operational security requirements.
Six pillars of secure MCP infrastructure
Establish the caller's identity and validate applicable token issuer, audience, expiry and authorization context.
Determine which tools, resources and operations a principal can access using deterministic security policies.
Separate model-generated instructions from trusted application controls and protected execution environments.
Validate arguments, restrict privileges, isolate workloads and require approval for sensitive operations.
Control sensitive information disclosure, outbound connectivity, credential handling and backend access.
Record security decisions, correlate tool invocations, enforce usage limits and investigate anomalous behavior.
MCP gateways versus traditional API gateways
Traditional API gateways commonly enforce controls around HTTP endpoints, methods, identities, request quotas and application routing.
An MCP-aware gateway may additionally understand protocol initialization, capability discovery, tool names, tool arguments and the context surrounding agent-generated operations.
HTTP routing, API authentication, quotas, transformation and application protection.
Model access, inference routing, token consumption, model quotas and AI-specific governance.
Protocol-aware routing, capability filtering, tool authorization and agent-to-tool governance.
These responsibilities can overlap within a single platform. The appropriate architecture depends on the organization's identity model, deployment topology, security requirements and gateway implementation.
A gateway is not a replacement for server-side authorization. MCP servers and downstream systems must continue to enforce their own security boundaries. Access tokens intended for one protected resource must not simply be passed through to an unrelated downstream API.
The model proposes. The security architecture decides.
Treat every model-generated tool invocation as a request rather than an authorization decision. Tool access must be independently evaluated against trusted identity, policy, execution context and resource ownership. Prompt injection detection can supplement these controls, but cannot replace them or guarantee that malicious instructions are detected.
From protocol fundamentals to production security
This engineering guide combines architecture-led explanations with interactive engineering experiences that explore how secure MCP infrastructure behaves under normal operations, policy violations and production failure conditions.
Explore the Architecture. Understand the Security.
Navigate nine connected engineering modules covering Model Context Protocol architecture, enterprise identity, tool authorization, secure execution, cloud infrastructure and production security operations.
Model Context Protocol Architecture
Explore the architectural foundations of MCP.
The Enterprise MCP Request Journey
An illustrative enterprise architecture. MCP gateways are optional deployment components; authorization must also be enforced at the appropriate protected resources.
Nine Connected Engineering Sections
Select a module to explore its engineering concepts, architecture diagrams and interactive learning experience.
Understanding the Model Context Protocol
Exploring the architectural foundations that connect artificial intelligence applications to external tools, contextual information, enterprise services and distributed infrastructure.
Why does the Model Context Protocol exist?
Large language models are capable of interpreting instructions, generating responses and reasoning over information supplied to them. However, the model itself does not inherently possess access to enterprise databases, network devices, cloud platforms, source code repositories or operational applications.
Historically, connecting an AI application to these external systems required application-specific integrations. Each integration introduced its own interface, data representation, discovery mechanism and operational requirements.
The Model Context Protocol (MCP) establishes a standardized application-layer interface through which AI applications can discover and interact with capabilities exposed by external servers.
MCP separates the AI application from the implementation details of external capabilities. A compatible client can communicate with different MCP servers using a common protocol architecture, while each server implements the integration required for its underlying systems.
Standardized integration
A common protocol interface reduces the need to build entirely different communication mechanisms for every AI application and external service.
Capability discovery
Clients can discover supported tools, resources and prompts instead of requiring every capability to be permanently hard-coded into the host application.
Architectural separation
AI reasoning, protocol communication, tool implementation and backend execution remain distinct architectural responsibilities.
Inside the MCP host, client and server model
MCP follows a client-server architecture. The host application manages the AI experience and creates MCP clients that communicate with individual MCP servers.
A single host can maintain multiple client-server relationships, allowing an AI application to interact with different external capabilities while preserving distinct connection and capability boundaries.
Illustrative multi-server MCP architecture. Individual servers may expose any supported combination of protocol capabilities.
MCP Host
The AI application responsible for user interaction, model orchestration, context management, security decisions and the lifecycle of its MCP clients.
MCP Client
A protocol component managed by the host that maintains a relationship with a particular MCP server, negotiates capabilities and exchanges protocol messages.
MCP Server
A service or local process exposing supported capabilities through MCP and implementing the integration with underlying applications, data or infrastructure.
Important security boundary
The AI model is not necessarily the MCP client. The host mediates model-generated requests and controls how its clients interact with external servers. A model-generated tool selection is not an authorization decision.
Tools, resources and prompts
MCP servers can expose different categories of capabilities. These protocol primitives represent distinct interaction patterns between the AI application and external systems.
Tools
Callable operations that allow an application to request computation, information retrieval or an external action. Tools normally describe their expected input through a structured schema.
tools/list tools/call
Examples include querying routing state, retrieving incident records or requesting an infrastructure change.
Resources
Contextual information exposed through resource identifiers. Resources allow clients to retrieve information that can support application or model reasoning.
resources/list resources/read
Examples include network configuration snapshots, documentation, application records and system state.
Prompts
Reusable prompt templates exposed by a server that can help structure user interactions or establish repeatable application workflows.
prompts/list prompts/get
Examples include incident investigation templates, configuration reviews and troubleshooting workflows.
| Primitive | Typical control model | Primary purpose | Security consideration |
|---|---|---|---|
| Tools | Model-controlled selection, host-mediated execution | Request an operation | Authorization, side effects and argument validation |
| Resources | Application-controlled | Retrieve contextual information | Data access, confidentiality and untrusted content |
| Prompts | Typically user-controlled | Reusable interaction templates | Template integrity and instruction trust |
These control models describe intended interaction patterns, not automatic security guarantees. Hosts and servers must enforce the authorization and consent requirements appropriate to their deployment.
Client-side capabilities
MCP is not exclusively a mechanism for clients to request server operations. Depending on the negotiated protocol version and capabilities, servers may also request supported client-side functionality.
Sampling
Allows a server to request supported model-generation functionality through the client, subject to host controls and applicable user approval.
Roots
Allows a client to communicate relevant filesystem roots to a server. Roots are contextual boundaries, not a substitute for operating-system access controls.
Elicitation
Allows a server to request additional information through a supporting client. The available interaction mechanisms depend on the negotiated protocol version.
Understanding JSON-RPC 2.0
MCP uses JSON-RPC 2.0 as its underlying message format. JSON-RPC defines structured requests, responses and notifications that can be exchanged between communicating protocol participants.
The JSON-RPC envelope identifies the protocol operation being requested and carries the parameters required for that operation. MCP defines the methods and associated message structures used for its capabilities.
{
"jsonrpc": "2.0",
"id": 42,
"method": "tools/call",
"params": {
"name": "get_bgp_neighbors",
"arguments": {
"device": "core-router-01"
}
}
}
jsonrpc
Identifies the JSON-RPC message format version. This is distinct from the negotiated MCP protocol version.
id
Correlates a request with its corresponding response. It is not an authentication token, session identifier or proof of authorization.
method
Identifies the protocol operation being requested, such as tool discovery, resource retrieval or tool execution.
params
Contains method-specific parameters. For a tool call, this includes the tool name and applicable input arguments.
Successful tool response
{
"jsonrpc": "2.0",
"id": 42,
"result": {
"content": [
{
"type": "text",
"text": "Neighbor 192.0.2.10: Established"
}
],
"isError": false
}
}
The response carries the same request identifier, allowing the client to associate the returned information with the original tool invocation.
The host can then incorporate the returned content into its application workflow or provide relevant information to the AI model, subject to applicable context and security controls.
JSON-RPC protocol error
{
"jsonrpc": "2.0",
"id": 42,
"error": {
"code": -32602,
"message": "Invalid params"
}
}
Protocol errors must be distinguished from errors occurring
inside a successfully invoked tool. MCP tools can report
execution failures through a tool result with
isError: true, while JSON-RPC errors represent
applicable protocol-level failures.
| Message type | Identifier | Response expected? | Purpose |
|---|---|---|---|
| Request | Required | Yes | Invoke a protocol operation |
| Response | Correlates with request | No | Return a result or protocol error |
| Notification | Omitted | No | Communicate an event or state change |
From connection establishment to tool execution
An MCP client-server relationship begins with initialization. During this process, the participants establish protocol compatibility and communicate their supported capabilities.
The following lifecycle illustrates a typical client connecting to a server, discovering a tool and invoking it. Authentication requirements may need to be satisfied before initialization in a protected remote deployment.
Establish the transport
The host creates an MCP client and establishes the appropriate communication mechanism. For a protected remote server, this may involve obtaining an access token before sending protocol requests.
Initialize the protocol relationship
initializeThe client communicates its proposed MCP protocol version, supported capabilities and implementation information.
Negotiate compatibility
The server returns its selected protocol version, supported capabilities and implementation information. The client must determine whether the returned version is compatible before continuing.
Complete initialization
notifications/initializedThe client sends an initialized notification, indicating that initialization has completed and the relationship can proceed into normal protocol operation.
Discover available capabilities
tools/listWhere supported, the client requests available tools and receives their names, descriptions and input schemas. Similar discovery operations exist for resources and prompts.
Request tool execution
tools/callThe host mediates the requested operation. The client sends the tool invocation, while the server validates the request and applies its authorization and execution controls.
Process the result
The server returns the execution result or applicable error. The host determines how the returned content should be processed, displayed or incorporated into subsequent model reasoning.
Maintain or terminate the relationship
The participants continue exchanging supported messages as required. When the relationship is no longer needed, the application uses the relevant transport and session termination mechanisms.
How MCP participants establish supported functionality
Different MCP implementations may support different protocol versions and optional capabilities. Capability negotiation allows participants to communicate the functionality available during a protocol relationship.
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-11-25",
"capabilities": {
"roots": {
"listChanged": true
}
},
"clientInfo": {
"name": "NetworkInsightClient",
"version": "1.0.0"
}
}
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2025-11-25",
"capabilities": {
"tools": {
"listChanged": true
},
"resources": {
"subscribe": true,
"listChanged": true
}
},
"serverInfo": {
"name": "NetworkOperationsServer",
"version": "1.0.0"
}
}
}
Illustrative messages using a fixed example protocol revision. Production implementations should use a mutually supported revision and its corresponding specification.
Protocol version
Determines the compatible MCP message structures, lifecycle requirements and supported protocol behavior.
Capability declaration
Communicates which optional categories of protocol functionality the participant supports.
Implementation information
Describes the communicating client or server software. This metadata does not independently authenticate the participant.
Change notifications
Where supported, notifications can inform clients that available capabilities have changed, allowing them to refresh their discovered information.
Capability is not permission
A server advertising support for tools does not mean that every connected identity is authorized to invoke every tool. Capability negotiation establishes protocol functionality. Authorization establishes what a particular principal is permitted to do.
Streamable HTTP and standard input/output
The MCP message architecture is distinct from the transport mechanism used to carry those messages. Transport selection determines how participants communicate and influences deployment, authentication, isolation and operational design.
Standard input/output — stdio
In a typical stdio deployment, the client launches an MCP server as a subprocess. JSON-RPC messages are exchanged using the process's standard input and standard output streams.
Protocol messages are newline-delimited. Diagnostic logging can use standard error, preventing ordinary logging output from corrupting the protocol stream.
Security depends heavily on executable integrity, operating-system permissions, process isolation, environment variables and filesystem access.
Streamable HTTP
Streamable HTTP allows clients to communicate with independently deployed MCP servers through an HTTP endpoint, supporting distributed and remote deployments.
Client messages are sent using HTTP POST. Responses can use JSON or Server-Sent Events where applicable. Servers may also support GET-based SSE streams.
Remote deployments introduce network security, TLS, authentication, origin validation, authorization, session handling and service availability requirements.
| Characteristic | stdio | Streamable HTTP |
|---|---|---|
| Typical deployment | Local subprocess | Remote or independently deployed service |
| Communication | Standard input and output | HTTP requests and optional SSE streaming |
| Message format | JSON-RPC | JSON-RPC |
| Identity boundary | Process and operating-system context | Application and network authentication |
| Isolation | Process permissions and sandboxing | Service, network and workload boundaries |
| Typical failures | Process exit, malformed output, permission failure | HTTP errors, token failure, connectivity or session loss |
| Scaling | Host-managed process lifecycle | Service deployment and load balancing |
Transport security is not tool security
TLS can protect data in transit, but it does not determine whether an authenticated caller is authorized to execute a particular tool. Similarly, a local stdio connection does not automatically make a server trustworthy. Both deployment models require independent security controls.
Example: an AI-assisted BGP troubleshooting workflow
Consider an enterprise network operations platform that provides an AI-assisted troubleshooting interface. The platform connects to an MCP server exposing approved network diagnostic capabilities.
{
"name": "get_bgp_neighbors",
"description": "Retrieve BGP neighbor state from an approved network device.",
"inputSchema": {
"type": "object",
"properties": {
"device": {
"type": "string"
}
},
"required": ["device"],
"additionalProperties": false
},
"annotations": {
"readOnlyHint": true
}
}
Engineer submits a question
"Investigate the BGP neighbor relationships on core-router-01."
Host evaluates available tools
The AI application provides relevant tool definitions to its model, which identifies the diagnostic capability appropriate to the request.
Client submits the tool invocation
The host mediates the model-generated request and its MCP client sends a structured tools/call message to the appropriate server.
Server enforces the execution boundary
The server validates the arguments, checks access to the requested device and uses its approved backend integration to retrieve network state.
Host processes the returned evidence
The tool result provides operational information that the AI application can use to support its troubleshooting explanation.
Device: core-router-01 Neighbor Remote AS State -------------------------------------- 192.0.2.10 65002 Established 192.0.2.20 65003 Active Observation: One neighbor is not established. Suggested investigation: - Verify IP reachability. - Check TCP connectivity to port 179. - Review neighbor configuration. - Inspect applicable security policies. - Examine BGP event logs.
The model can interpret the returned evidence and recommend further investigation. It does not need unrestricted administrative access to the underlying network device.
The server can expose narrowly scoped diagnostic operations while retaining control over backend credentials, device access and execution permissions.
Tool annotations are not security guarantees
A tool declaring readOnlyHint does not prove that its implementation is read-only. Tool metadata must be treated according to the trustworthiness of its source. Actual restrictions must be enforced through implementation, authorization and backend permissions.
What engineers must understand before deploying MCP
MCP standardizes connectivity. It does not eliminate trust boundaries.
The Model Context Protocol provides a common architectural interface between AI applications and external capabilities. Its value comes from standardized communication, capability discovery and architectural separation. Secure production deployments must build upon these foundations with trusted identities, deterministic authorization, constrained execution, protected data flows and operational governance.
Continue exploring the protocol
Consult the official MCP specification for normative message definitions, lifecycle requirements, supported transports and revision-specific behavior.
Official Model Context Protocol Specification
The network devices, tool definitions and protocol exchanges in this section are illustrative engineering examples. No live infrastructure or external services are accessed.
MCP Architecture &
Request Journey Explorer
Investigate the communication architecture connecting AI applications to external tools, resources and prompts. Follow JSON-RPC messages through MCP clients, optional enterprise gateways and capability-providing servers.
Select any component in the topology to inspect its responsibilities and architectural boundaries.
// Awaiting protocol activity. // Select a journey and press Run Journey. // Protocol messages will appear here.
Understanding MCP initialization
MCP initialization establishes a common protocol version and exchanges client and server capabilities. The client subsequently sends an initialized notification before normal operation begins.
Requests, responses and notifications provide a structured messaging model. Notifications do not carry request identifiers and do not receive JSON-RPC responses.
Clients and servers advertise supported features during initialization. A client must not assume that every server exposes tools, resources or prompts.
MCP connectivity does not automatically grant permission to execute tools. Hosts, servers and optional gateways must enforce appropriate authorization and execution controls.
MCP Threat Modeling and Trust Boundaries
Engineering secure agentic infrastructure by understanding adversarial inputs, compromised capabilities, delegated authority, excessive privileges and the security boundaries separating artificial intelligence from enterprise execution.
Why agentic infrastructure changes enterprise threat modeling
Traditional application security focuses heavily on protecting interfaces, validating inputs, authenticating identities and restricting access to sensitive operations.
Agentic AI introduces another dimension. Information retrieved from an external system can influence the model's reasoning and potentially affect which operation the application requests next.
An MCP server might return a document, operational record, tool description or diagnostic result. Although that content may be useful to the application, it can also contain misleading information or adversarial instructions.
The resulting security challenge extends beyond protecting an API endpoint. Engineers must protect the complete chain connecting information retrieval, model reasoning, delegated identity, tool selection and backend execution.
Content attack surface
Documents, resources, prompts, tool descriptions and returned results can introduce untrusted information into the model's context.
Authority attack surface
Access tokens, delegated identities, backend credentials and overly broad permissions can amplify the consequences of an incorrect execution decision.
Execution attack surface
Tools can interact with sensitive applications, files, cloud resources, network devices and external services, creating real operational consequences.
The fundamental security problem
Information that influences an AI model must not automatically inherit the authority to initiate operations. Content, identity and execution authority must remain independently controlled.
Visualizing the MCP trust boundaries
A secure MCP deployment contains multiple independently enforced trust boundaries. Each boundary represents a transition where information, identity or execution authority moves between architectural components.
Illustrative enterprise deployment. Gateway enforcement supplements rather than replaces host, server and backend authorization.
Boundary A — Information to reasoning
External content enters the model's context. Its provenance and authority must remain distinguishable from trusted application instructions.
Boundary B — Reasoning to execution
A model-generated action becomes a proposed tool invocation. Trusted application controls evaluate whether the action is appropriate and permitted.
Boundary C — Client to server
The MCP request crosses a protocol and potentially a network boundary. Authentication, authorization and transport protections become essential.
Boundary D — Server to backend
The server invokes an underlying application or infrastructure service. Backend permissions must independently constrain the resulting operation.
Indirect prompt injection
Direct prompt injection occurs when adversarial instructions are supplied directly through an interaction with an AI application.
Indirect prompt injection occurs when adversarial instructions are embedded within information retrieved from another source, such as a document, website, application record or MCP tool result.
The application may retrieve this information for a legitimate purpose. However, the model may incorrectly interpret instructions embedded in the retrieved content as authoritative directions.
Prompt injection becomes particularly consequential when the affected application has access to powerful tools, sensitive information or privileged backend services.
A compromised reasoning process should not automatically result in compromised infrastructure. Independent authorization boundaries can constrain the consequences even when the model produces an inappropriate action.
Defensive architecture
Preserve content provenance, distinguish external data from trusted instructions, minimize tool permissions, validate proposed operations, restrict sensitive destinations and require appropriate approval for high-impact actions. Detection mechanisms can supplement these controls but cannot guarantee detection of every adversarial instruction.
Tool poisoning and untrusted capability metadata
MCP tool discovery allows clients to retrieve descriptions and input schemas for available operations. Hosts may subsequently provide this information to a model so that it can identify relevant capabilities.
Tool poisoning describes a class of attacks in which capability metadata or related content is manipulated to influence the application's reasoning or behavior.
A tool description should describe what the operation does. It must not be treated as an independent source of application authority.
Approved capability definition
A reviewed tool has a narrowly defined purpose, documented arguments, an approved server identity and independently enforced execution permissions.
Untrusted capability definition
Unexpected instructions, misleading descriptions or undocumented behavior can influence tool selection or misrepresent the actual consequences of execution.
{
"name": "get_network_status",
"description": "Retrieve status from an approved network device.",
"inputSchema": {
"type": "object",
"properties": {
"device": {
"type": "string"
}
},
"required": ["device"],
"additionalProperties": false
},
"annotations": {
"readOnlyHint": true
}
}
Even this apparently benign definition does not prove that the implementation behaves as described. The server and backend must independently enforce read-only access.
Metadata integrity
Maintain reviewed capability inventories and detect unexpected changes to tool descriptions and schemas.
Implementation integrity
Review server code, dependencies, deployment artifacts and backend integrations rather than relying solely on descriptive metadata.
Runtime enforcement
Independently constrain actual tool behavior through authorization, isolation and backend permissions.
Capability drift
A previously approved server can change its advertised capabilities or underlying implementation. Capability change notifications may support inventory refresh, but they do not establish the security integrity of the updated capability.
Malicious and compromised MCP servers
An MCP server is executable software operating within a particular security context. Depending on its deployment, it may have access to local files, environment variables, application credentials, network services or enterprise APIs.
A server may be intentionally malicious, compromised after deployment or affected by vulnerabilities in its dependencies. Protocol compatibility does not establish server trustworthiness.
Local MCP server risks
A local server process may inherit access to sensitive files, credentials and operating-system capabilities. Restrict its execution context and avoid unnecessary environment variable exposure.
Remote MCP server risks
Remote services introduce network exposure, service identity, multitenancy, token handling, availability and third-party operational trust requirements.
Dependency compromise
Vulnerable or compromised libraries can affect otherwise legitimate MCP implementations. Maintain dependency inventories, version controls and vulnerability management.
Uncontrolled updates
Software updates can alter server behavior and introduce new capabilities. Apply review, integrity verification and controlled deployment procedures.
Enterprise server onboarding
Maintain an approved server inventory, verify software provenance, review dependencies, isolate execution, restrict outbound connectivity, assign dedicated workload identities and continuously monitor runtime behavior. A signed artifact establishes integrity and provenance relative to its signer, not an absence of vulnerabilities.
The confused deputy problem
A confused deputy vulnerability arises when a component with legitimate authority is induced to exercise that authority on behalf of a party that should not possess the corresponding access.
In an MCP architecture, a server or gateway may have privileged access to downstream applications. If it authenticates the requesting client but fails to enforce the original principal's authorization, it can become a confused deputy.
Authentication establishes the identity associated with a request. Authorization determines whether that identity can perform the requested operation against the requested resource.
A server's own access to a backend system must not automatically become available to every authenticated MCP client.
Principal binding
Associate the requested operation with the verified principal and applicable delegation context.
Resource authorization
Evaluate access to the specific tenant, record, device or application resource being requested.
Permission attenuation
Constrain downstream authority to the permissions required for the approved operation.
Preserve the authorization chain
Validate token audiences and scopes where applicable, retain verified principal context, use appropriately scoped downstream credentials and independently enforce resource ownership. OAuth-based MCP proxies must also address applicable client consent and confused deputy protections described by the MCP specification.
Data exfiltration and cross-tool information flows
Agentic applications frequently combine multiple tools within a single workflow. One tool may retrieve enterprise information, while another communicates with an external application.
Although both capabilities may be legitimate independently, their combination can create an unauthorized information transfer if the architecture does not enforce appropriate data-handling and destination policies.
Data source
Enterprise records, operational configurations, customer information, documents or other protected information.
Agent context
Retrieved information becomes available to the application and potentially the model during subsequent reasoning.
External destination
A separate tool or service may attempt to transfer information outside its approved security boundary.
Effective information protection requires more than checking whether a principal can invoke an individual tool. The architecture must also evaluate what information is being transferred, where it is being sent and whether that transfer is permitted.
Data-centric security controls
Apply data classification, destination allowlists, outbound network restrictions, context minimization, sensitive field redaction and operation-specific approval. Ensure that downstream tools cannot bypass the organization's information-handling policies.
Privilege escalation and excessive agent authority
Privilege escalation occurs when a principal or workload gains access beyond its intended authorization boundary.
Excessive privilege is a related but distinct problem: an application may already possess more authority than its legitimate workflow requires.
Both conditions increase the potential impact of compromised reasoning, malicious content, server vulnerabilities and application authorization failures.
Horizontal privilege escalation
Accessing resources belonging to another user, tenant or organizational unit without the required resource-level authorization.
Vertical privilege escalation
Obtaining access to higher-privilege operations, administrative capabilities or protected execution contexts.
Excessive delegated authority
Assigning broad access tokens or service permissions to workflows that require only a narrow subset of those capabilities.
Cross-tool privilege composition
Combining individually permitted operations in a workflow whose aggregate effect exceeds the intended authorization boundary.
| Capability | Overprivileged design | Constrained design |
|---|---|---|
| Network diagnostics | Administrative device credentials | Read-only diagnostic identity |
| Document retrieval | Organization-wide document access | User and resource-specific permissions |
| Cloud monitoring | Subscription administrator | Scoped monitoring permissions |
| Incident management | Unrestricted incident modification | Assigned incident and operation permissions |
| External communication | Unrestricted outbound destinations | Approved destinations and data policies |
Reduce the authority available to every execution path.
The potential impact of an agentic security failure depends heavily on the permissions, data access and execution capabilities available to the affected application. Least privilege reduces the blast radius even when upstream preventive controls fail.
Investigating the enterprise MCP attack surface
Select a threat category to examine its affected trust boundary, potential consequence, recommended security controls and illustrative defensive telemetry.
Threat: Retrieved content contains instructions that may influence the model's proposed actions.
Potential consequence: An inappropriate tool invocation or unauthorized information transfer.
Security response: Preserve content provenance and independently authorize every proposed sensitive operation.
[CONTEXT] External resource retrieved [HOST] Proposed operation evaluated [POLICY] Operation outside approved intent [EXECUTION] Request denied [AUDIT] Security decision recorded
Educational threat analysis. Impact labels are illustrative, not measured risk scores. Actual risk depends on deployment, exposure, available privileges and control effectiveness. No live tools or external infrastructure are accessed.
Applying STRIDE to MCP infrastructure
STRIDE provides a structured approach to identifying security threats across distributed application components, data flows and trust boundaries.
Applying STRIDE to MCP infrastructure helps engineers examine conventional security threats alongside AI-specific risks such as adversarial content and model-influenced execution.
| Category | MCP architectural concern | Defensive controls |
|---|---|---|
| S — Spoofing | Impersonated clients, servers or workload identities | Verified identity, TLS, token validation |
| T — Tampering | Modified tool metadata, messages or software artifacts | Integrity verification, protected transport, reviewed artifacts |
| R — Repudiation | Inability to attribute tool invocations or security decisions | Correlated audit events, protected logs, principal attribution |
| I — Information disclosure | Unauthorized retrieval or transfer of sensitive information | Resource authorization, DLP, egress controls |
| D — Denial of service | Excessive tool calls, resource exhaustion or unavailable servers | Quotas, timeouts, concurrency limits, resilience |
| E — Elevation of privilege | Unauthorized access to higher-privilege operations | Least privilege, delegation controls, backend authorization |
STRIDE should be combined with AI-specific threat analysis. It does not by itself fully characterize the risks associated with untrusted model context, indirect prompt injection or complex multi-tool workflows.
Enterprise MCP defensive control matrix
| Threat | Potential impact* | Primary enforcement | Supporting controls |
|---|---|---|---|
| Indirect prompt injection | HIGH | Host and tool authorization | Provenance, content handling, approval |
| Tool poisoning | HIGH | Capability governance | Metadata review, change monitoring |
| Compromised MCP server | CRITICAL | Workload and backend isolation | Provenance, runtime monitoring |
| Confused deputy | CRITICAL | Delegated resource authorization | Principal binding, scoped credentials |
| Data exfiltration | CRITICAL | Information flow enforcement | DLP, destination restrictions |
| Supply chain compromise | CRITICAL | Software deployment governance | Artifact verification, dependency review |
| Privilege escalation | CRITICAL | Server and backend authorization | Least privilege, tenant isolation |
| Resource exhaustion | HIGH | Gateway and server limits | Quotas, timeouts, circuit breakers |
*Illustrative potential impact in a sensitive enterprise deployment. These categories are not standardized severity ratings or substitutes for an organization-specific likelihood and impact assessment.
Protecting an AI-assisted network operations platform
Consider an enterprise network operations platform that connects an AI application to multiple MCP servers. One server provides network diagnostics, another retrieves incident documentation and a third exposes approved infrastructure management operations.
The engineer requests an investigation into a BGP connectivity incident. During the investigation, the application retrieves an operational document containing untrusted instructions unrelated to the engineer's request.
Legitimate investigation
The engineer authorizes diagnostic activity against an approved network device.
Untrusted information enters the context
The documentation server returns operational content containing instructions that have no independent execution authority.
Unexpected operation is proposed
The model proposes a configuration-changing action outside the scope of the approved diagnostic workflow.
Independent authorization evaluates the request
Trusted controls identify that the current principal and workflow do not authorize the proposed configuration change.
Execution is prevented
The unauthorized request is denied. Backend read-only permissions provide an additional independent protection layer.
Evidence is retained for investigation
Security telemetry records the affected capability, principal, policy decision and relevant correlation identifiers without unnecessarily exposing sensitive document contents.
{
"event": "tool.authorization.denied",
"trace_id": "example-trace-0042",
"principal": "network-diagnostics-user",
"workflow": "bgp-incident-investigation",
"requested_operation": "configuration_change",
"resource": "core-router-01",
"decision": "deny",
"reason": "operation_outside_authorized_scope",
"execution_performed": false
}
This event represents an illustrative application audit schema rather than a standardized MCP protocol message.
Defense in depth
The architecture does not depend exclusively on detecting malicious instructions. Host controls, operation-specific authorization, server enforcement and read-only backend credentials independently reduce the risk of unauthorized infrastructure changes.
Building an enterprise MCP threat model
Never confuse information with authority.
An MCP resource can provide information. A tool description can describe a capability. A model can propose an operation. None of these independently grants permission to access sensitive information or modify enterprise infrastructure. Secure agentic systems preserve explicit trust boundaries and enforce authorization at every consequential execution layer.
Further security architecture reading
Official Model Context Protocol Specification
MITRE ATLAS — Adversarial Threat Landscape for AI Systems
NIST SP 800-207 — Zero Trust Architecture
The threat scenarios, security events and architectural examples are illustrative educational material. Production implementations should be evaluated against their applicable protocol revision, security requirements and organizational threat model.
MCP Threat Modeling &
Attack Surface Explorer
Investigate how untrusted content, compromised capability providers and excessive permissions can affect enterprise AI agents. Deploy defensive controls, examine security boundaries and observe where simulated threats are contained.
Select any architectural component to examine its security responsibilities and trust assumptions.
// No incident evidence collected. // Select a threat scenario. // Configure defensive controls. // Start the simulation. // All events are synthetic.
Indirect Prompt Injection
Untrusted content can influence an agent's interpretation of a task. Security depends on separating content from authority and independently validating proposed actions.
Untrusted Resource
Unauthorized Action
Layered Enforcement
Coverage measures enabled defensive checks associated with the selected synthetic scenario. It is not a measured probability of compromise, a vulnerability score or a production security certification.
MCP Authentication and Authorization
Engineering trusted identity boundaries between AI hosts, MCP clients, authorization servers, protected resources and downstream enterprise infrastructure through standards-based authentication, scoped access tokens and independently enforced authorization.
Why MCP requires an independent authorization architecture
The Model Context Protocol provides a standardized mechanism through which AI applications can discover and interact with external capabilities.
However, protocol connectivity does not establish permission to access enterprise resources. A client that successfully connects to an MCP server must not automatically inherit unrestricted access to every tool exposed by that server.
For protected HTTP-based MCP deployments, the MCP authorization framework uses OAuth-based mechanisms to enable clients to obtain access tokens intended for protected MCP resources.
Authentication, delegated authorization and actual resource execution remain distinct architectural concerns.
Authentication
Establishes the identity associated with a user, client or workload. Authentication does not independently grant permission to execute a tool.
Authorization
Determines whether a verified principal can perform a particular operation against a protected resource under applicable security policies.
Execution
Performs the approved operation using appropriately constrained backend permissions and an isolated execution environment.
Transport considerations
MCP authorization for HTTP-based deployments differs from local stdio-based integrations. Local processes commonly obtain credentials through their execution environment or other application-specific mechanisms. They still require appropriate operating-system, secret-management and resource-access controls.
The MCP OAuth authorization model
In an OAuth-protected MCP architecture, the MCP server operates as a protected resource server. The MCP client obtains an access token from an appropriate authorization server and presents that token when accessing the protected MCP endpoint.
Illustrative enterprise architecture. The gateway is an optional deployment component, not a mandatory element of the MCP protocol.
Resource owner
The entity capable of granting access to a protected resource, subject to organizational authorization policies.
MCP client
Requests authorization and presents an appropriate access token when interacting with the protected MCP resource.
Authorization server
Authenticates users where applicable, evaluates authorization requests and issues access tokens according to its security policies.
MCP resource server
Validates access tokens and independently determines whether the requested MCP operation is permitted.
Protected resource metadata and authorization server discovery
An MCP client needs to determine which authorization server is associated with a protected MCP resource. Hard-coding identity infrastructure into every client creates operational complexity and reduces interoperability.
OAuth Protected Resource Metadata, defined by RFC 9728, provides a standardized mechanism for describing a protected resource and identifying its associated authorization servers.
Access protected MCP endpoint
The client attempts to communicate with a protected MCP server without an acceptable access token.
Receive authentication challenge
The server returns an HTTP 401 response and can advertise its protected resource metadata location through the WWW-Authenticate header.
Discover protected resource metadata
The client retrieves metadata describing the MCP resource and its associated authorization servers.
Discover authorization server capabilities
Authorization server metadata or OpenID Connect discovery, as applicable, provides endpoint information and supported authorization mechanisms.
Establish the client identity
The client uses a supported registration or provisioning mechanism to establish the client identifier required by the authorization server.
Begin the authorization flow
The client requests authorization for the intended MCP resource and appropriate permissions.
HTTP/1.1 401 Unauthorized WWW-Authenticate: Bearer resource_metadata="https://mcp.example.com/.well-known/oauth-protected-resource/mcp"
{
"resource": "https://mcp.example.com/mcp",
"authorization_servers": [
"https://identity.example.com"
],
"scopes_supported": [
"network.read",
"incident.read"
],
"bearer_methods_supported": [
"header"
]
}
{
"issuer": "https://identity.example.com",
"authorization_endpoint":
"https://identity.example.com/authorize",
"token_endpoint":
"https://identity.example.com/token",
"jwks_uri":
"https://identity.example.com/jwks",
"response_types_supported": ["code"],
"grant_types_supported": ["authorization_code"],
"code_challenge_methods_supported": ["S256"]
}
Discovery is not a trust guarantee
Discovered metadata must be processed according to applicable protocol validation requirements. Enterprise clients should also apply approved issuer policies, secure transport validation and appropriate restrictions on outbound discovery requests. Metadata must not automatically establish trust in arbitrary authorization infrastructure.
Authorization Code Flow with PKCE
Proof Key for Code Exchange, or PKCE, binds an authorization code to a secret value generated by the client before the authorization request.
The client generates a cryptographically random code verifier and derives an S256 code challenge. The challenge is sent during authorization, while the original verifier is supplied when exchanging the authorization code for tokens.
response_type=code client_id=network-insight-agent redirect_uri=https://client.example.com/callback scope=network.read state=<random-session-bound-value> code_challenge=<S256-challenge> code_challenge_method=S256 resource=https://mcp.example.com/mcp
grant_type=authorization_code client_id=network-insight-agent code=<authorization-code> redirect_uri=https://client.example.com/callback code_verifier=<original-random-verifier> resource=https://mcp.example.com/mcp
These examples omit transport encoding and any additional client authentication required for a particular confidential-client deployment.
What PKCE protects
PKCE reduces the risk that an intercepted authorization code can be redeemed by a party that does not possess the original code verifier.
What PKCE does not protect
PKCE does not independently prevent access token theft, malicious tool execution, excessive authorization scopes or compromised resource servers.
Secure authorization requirements
Use secure random values, S256 PKCE, appropriate redirect URI validation, TLS, authorization response correlation and applicable issuer validation. Do not treat successful OAuth authorization as unrestricted permission to execute every MCP tool.
Resource indicators and token audiences
OAuth Resource Indicators, defined by RFC 8707, allow clients to identify the protected resource for which an access token is requested.
This distinction is especially important when an AI application connects to multiple MCP servers. A token issued for one protected resource must not automatically become valid at another resource.
Resource indicator
Identifies the intended protected resource during the OAuth authorization and token request process.
Token audience
Identifies the intended recipient or recipients of an access token. The resource server must establish that the token is intended for it.
Authorization scope
Describes permissions associated with the token. Scopes do not replace operation-specific and resource-specific authorization.
Understanding access token validation
OAuth access tokens may be structured tokens, such as JWTs, or opaque values whose validity and associated authorization information must be established through an appropriate mechanism.
MCP does not require every access token to be a JWT. Resource servers must use the validation mechanism appropriate to their authorization infrastructure.
JWT header
Describes token metadata such as its signing algorithm and key identifier. These values must not override trusted verification policy.
JWT payload
Contains claims describing the issuer, audience, expiration and other authorization context according to the applicable token profile.
JWT signature
Enables cryptographic integrity and authenticity verification when evaluated against trusted keys and permitted algorithms.
{
"alg": "RS256",
"typ": "at+jwt",
"kid": "enterprise-signing-key-01"
}
{
"iss": "https://identity.example.com",
"sub": "network-engineer-42",
"aud": "https://mcp.example.com/mcp",
"client_id": "network-insight-agent",
"scope": "network.read incident.read",
"iat": 1800000000,
"exp": 1800000900,
"jti": "example-token-0042"
}
| Claim | Purpose | Validation consideration |
|---|---|---|
iss |
Token issuer | Match the trusted authorization server. |
sub |
Token subject | Interpret according to the issuer and grant type. |
aud |
Intended audience | Verify the token is intended for this resource. |
exp |
Expiration time | Reject expired tokens subject to controlled clock skew. |
nbf |
Not-before time | When present, reject premature token use. |
scope |
Granted permissions | Evaluate permissions required by the operation. |
client_id |
Associated OAuth client | Apply client restrictions where appropriate. |
jti |
Token identifier | Supports correlation and applicable replay controls. |
Decoding is not validation
Reading the claims of a JWT does not establish that the token is authentic. A resource server must cryptographically validate the token using trusted issuer configuration, appropriate keys and approved algorithms. It must also enforce applicable claim and authorization requirements.
Opaque access tokens can instead be evaluated through a trusted token introspection mechanism, such as RFC 7662, where supported by the authorization server.
Delegated identity and downstream authorization
Enterprise MCP servers frequently integrate with downstream systems such as Microsoft Graph, cloud management APIs, databases, network controllers and operational applications.
The identity used to authenticate an MCP request is not necessarily the identity or credential that should be used to access a downstream service.
Delegated user access
The downstream operation retains an appropriate relationship to the original user's authorization. Access remains constrained by the applicable delegation and resource policies.
Application or workload access
A dedicated service identity performs operations under independently assigned application permissions. The MCP server must still authorize the initiating principal and requested operation.
OAuth token exchange
RFC 8693 defines a framework for exchanging security tokens to obtain another token, potentially carrying a different audience, scope or delegation context.
On-Behalf-Of flows
Identity platforms such as Microsoft Entra ID support platform-specific delegated authorization flows for middle-tier services accessing downstream APIs.
Token exchange and On-Behalf-Of flows are integration patterns supported by particular identity platforms. They are not mandatory capabilities of every MCP server or authorization server.
Why token passthrough must be prevented
Token passthrough occurs when an MCP server accepts a token that was not issued for that MCP resource and forwards it to another service, rather than maintaining the appropriate resource-specific authorization boundary.
This undermines audience validation, security accountability and the ability to independently control access to the MCP resource.
Insecure passthrough
The MCP server accepts a token intended for a different service and forwards it without establishing that the incoming token authorizes access to the MCP resource itself.
Resource-bound authorization
The MCP server validates a token intended for itself, evaluates the requested operation and obtains a separate appropriate credential for downstream access.
Preserve token audience boundaries
MCP security requirements prohibit accepting tokens that were not issued for the MCP server. Downstream integration must not become a mechanism for bypassing incoming resource authorization.
Mapping OAuth scopes to MCP tool permissions
OAuth scopes can describe broad categories of delegated permissions. Enterprise MCP deployments frequently require additional policy decisions involving specific tools, operations, tenants, resources and workflow conditions.
| Illustrative MCP tool | Required scope | Additional authorization |
|---|---|---|
get_bgp_neighbors |
network.read |
Approved device and tenant access |
get_route_table |
network.read |
Routing domain authorization |
read_incident |
incident.read |
Incident ownership or assigned access |
update_incident |
incident.write |
Approved fields and workflow permissions |
apply_network_change |
network.write |
Change approval, device policy and backend IAM |
These scope names and tool definitions are illustrative application conventions, not standardized MCP scopes.
{
"tool": "get_bgp_neighbors",
"required_scope": "network.read",
"conditions": {
"tenant_membership_required": true,
"device_access_required": true,
"operation_class": "read_only"
},
"default_decision": "deny"
}
Authorization is multidimensional
A valid token with the required scope may still be insufficient. The requested operation must satisfy resource ownership, tenant isolation, workflow restrictions and any applicable approval requirements.
Inspecting MCP authorization decisions
Select a token or authorization scenario to examine where an enterprise MCP request is accepted or rejected across the identity validation pipeline.
Scenario: A valid access token is presented for an approved network diagnostic operation.
Security decision: Token validation and operation-specific authorization checks succeed.
Execution: The approved read-only operation can proceed.
[TOKEN] Cryptographic validation passed [ISSUER] Trusted issuer confirmed [AUDIENCE] Intended resource confirmed [LIFETIME] Token currently valid [SCOPE] Required permission present [POLICY] Resource access authorized [EXECUTION] Approved operation permitted
Educational JWT-oriented validation model. No real tokens are generated, verified or transmitted. Actual validation order and HTTP or JSON-RPC error mapping depend on the implementation and failure type.
Understanding authorization failure responses
Correct failure handling enables MCP clients to distinguish authentication problems from insufficient permissions and application-level authorization denials.
| Condition | Typical response | Client consideration |
|---|---|---|
| Missing access token | 401 Unauthorized | Discover authorization requirements. |
| Invalid or expired token | 401 / invalid_token | Obtain a valid token through an appropriate flow. |
| Wrong token audience | 401 / invalid_token | Request a token for the correct protected resource. |
| Insufficient OAuth scope | 403 / insufficient_scope | Evaluate whether additional authorization is appropriate. |
| Resource policy denial | 403 or application-level error | Respect the resource authorization decision. |
HTTP/1.1 403 Forbidden WWW-Authenticate: Bearer error="insufficient_scope", scope="network.write"
Do not automatically escalate permissions
An authorization failure must not trigger unrestricted requests for broader permissions. Additional access should be requested only when justified by the legitimate workflow and permitted by the user and organizational security policy.
Integrating MCP with enterprise IAM infrastructure
Organizations can integrate MCP authorization with existing identity infrastructure rather than introducing isolated identity systems for each AI application.
Microsoft Entra ID
Enterprise application identities, delegated permissions, application roles, conditional access and platform-specific On-Behalf-Of integration patterns.
Keycloak
Self-managed identity infrastructure with OAuth, OpenID Connect, client configuration, identity federation and authorization capabilities.
Okta and Auth0
Managed identity services supporting OAuth-based application authorization, enterprise identity integration and configurable access policies.
Workload identity infrastructure
Dedicated non-human identities for services, containers and automated workloads accessing approved enterprise resources.
Integration requires evaluating the identity platform's actual support for the applicable MCP authorization requirements, resource indicators, discovery mechanisms, client provisioning and token validation model.
OAuth or OpenID Connect support alone does not establish complete compatibility with every MCP authorization deployment.
Authorizing an AI-assisted BGP troubleshooting workflow
Consider an enterprise network engineer investigating an unexpected BGP neighbor failure through an AI-assisted network operations application.
The application connects to an MCP server exposing approved diagnostic capabilities. The engineer is authorized to retrieve operational information but does not possess permission to modify production router configurations.
Establish enterprise identity
The engineer authenticates through the approved enterprise authorization infrastructure.
Obtain resource-specific authorization
The MCP client obtains an access token intended for the network operations MCP resource with appropriate diagnostic permissions.
Request BGP neighbor information
The application invokes an approved read-only diagnostic tool against a router within the engineer's authorized device inventory.
Validate identity and permissions
The MCP server evaluates the token, required scope, tenant membership and device-specific authorization policy.
Execute through constrained backend identity
A dedicated read-only network identity retrieves the required BGP operational information.
Prevent unauthorized configuration changes
Any proposed configuration-changing operation remains outside the granted permissions and is denied by independent authorization controls.
{
"jsonrpc": "2.0",
"id": 42,
"method": "tools/call",
"params": {
"name": "get_bgp_neighbors",
"arguments": {
"device": "core-router-01"
}
}
}
For an OAuth-protected HTTP MCP connection, the access token is presented through the HTTP Authorization header rather than embedded in the JSON-RPC tool arguments.
{
"event": "mcp.tool.authorization",
"trace_id": "example-trace-0042",
"principal": "network-engineer-42",
"client": "network-insight-agent",
"tool": "get_bgp_neighbors",
"resource": "core-router-01",
"required_scope": "network.read",
"audience_valid": true,
"resource_authorized": true,
"decision": "allow",
"backend_permission": "read_only"
}
Securing enterprise MCP authorization
Identity establishes who is requesting. Authorization determines what they may do.
A secure MCP architecture never treats connectivity, successful authentication or possession of an access token as unrestricted execution authority. Every consequential operation must remain constrained by the intended resource, granted permissions, verified principal context and independently enforced backend authorization.
Protocol specifications and further reading
Official Model Context Protocol Specification
RFC 9700 — Best Current Practice for OAuth 2.0 Security
RFC 9728 — OAuth Protected Resource Metadata
RFC 8414 — OAuth Authorization Server Metadata
RFC 7636 — Proof Key for Code Exchange
RFC 8707 — Resource Indicators for OAuth 2.0
RFC 9068 — JWT Profile for OAuth Access Tokens
RFC 8693 — OAuth Token Exchange
RFC 7662 — OAuth Token Introspection
Architecture diagrams, tokens, policies and telemetry are illustrative educational examples. Production deployments must follow their applicable MCP protocol revision, identity provider capabilities and enterprise security requirements.
MCP OAuth &
Authorization Flow Simulator
Follow the complete authorization journey connecting an AI application to protected MCP infrastructure. Investigate metadata discovery, authorization codes, PKCE, resource-bound access tokens and enterprise authorization enforcement.
Select any interactive component to examine its role in the OAuth authorization lifecycle.
// Awaiting authorization activity. // Select an experiment and run the journey. // All endpoints and credentials are synthetic.
Access Token Intelligence
NOT ISSUEDIllustrative decoded JWT access token claims. OAuth access tokens may also be opaque. Decoding a JWT is not equivalent to validating its signature, issuer, audience, expiration or authorization. No usable credentials are generated by this laboratory.
Understanding protected MCP access
OAuth enables a client to obtain constrained access to protected resources. The MCP server must still independently enforce authorization for the requested operation.
PKCE and Code Binding
PKCE binds authorization code redemption to the client instance that initiated the authorization request. S256 derives a challenge from a high-entropy code verifier using SHA-256.
Resource-Bound Tokens
Access tokens must be intended for the protected resource receiving them. Resource indicators and audience validation help prevent inappropriate token reuse across services.
Delegated Authorization
A downstream API requires an appropriately issued credential for its own audience. An MCP server must not simply pass the incoming MCP access token through to unrelated services.
MCP Gateway Architecture and Policy Enforcement
Engineering a centralized security and governance layer between AI applications, autonomous agents, distributed MCP servers and protected enterprise infrastructure.
Why enterprise MCP deployments need a governance layer
As organizations introduce AI assistants and autonomous agents into production environments, the number of external capabilities available to those applications can increase significantly.
An enterprise AI platform may connect to MCP servers exposing network management systems, cloud APIs, databases, incident management platforms, source code repositories and internal business applications.
Managing every connection independently creates inconsistent authorization policies, fragmented telemetry, duplicated security controls and operational complexity.
An MCP gateway introduces a centralized architectural enforcement point through which approved MCP communication can be mediated, governed and observed.
Centralized control
Establish consistent server registration, identity requirements, access policies and approved tool inventories.
Policy enforcement
Evaluate MCP operations against trusted identity, resource authorization, schema requirements and organizational security policy.
Operational visibility
Collect correlated security decisions, request metadata, performance measurements and execution outcomes.
An architectural pattern, not a mandatory protocol component
MCP does not require every deployment to use a gateway. Gateway capabilities described here are enterprise architectural patterns layered around the protocol. Individual implementations differ in their supported transports, authorization models and enforcement features.
The centralized MCP security gateway
A protocol-aware gateway can terminate incoming MCP connections, evaluate security requirements and establish appropriately authorized connections to approved upstream MCP servers.
Logical enterprise architecture. The central server path represents gateway-mediated routing, not request processing by the policy control plane.
Defense in depth
The gateway is an additional enforcement layer. Upstream MCP servers and downstream resources must retain their own appropriate authorization controls. Centralized enforcement must not become the sole security boundary.
Reverse proxies, protocol brokers and federated gateways
MCP gateways can be implemented at different architectural layers. The appropriate design depends on whether the gateway needs to forward transport traffic, inspect MCP operations or aggregate multiple upstream capabilities.
HTTP reverse proxy
Provides TLS termination, HTTP routing, authentication integration, connection limits and transport-level security controls. MCP-specific inspection requires additional logic.
Protocol-aware gateway
Understands JSON-RPC messages, MCP methods, tool discovery, tool invocation, negotiated capabilities and protocol lifecycle requirements.
Federated gateway
Presents selected capabilities from multiple upstream MCP servers through a governed interface, with explicit routing, identity mapping and tool namespace management.
| Capability | HTTP proxy | Protocol-aware gateway | Federated gateway |
|---|---|---|---|
| TLS termination | Typical | Typical | Typical |
| JSON-RPC inspection | Requires extension | Supported by design | Supported by design |
| Tool-specific authorization | Requires extension | Possible | Possible |
| Tool aggregation | Not inherent | Optional | Core capability |
| Upstream session management | Transport forwarding | Implementation dependent | Typically required |
| Operational complexity | Lower | Moderate to high | Higher |
These categories describe architectural patterns, not standardized MCP gateway product classifications.
Separating gateway management from request execution
A scalable enterprise gateway should distinguish the management of security configuration from the execution of individual MCP requests.
Control plane
Manages approved server definitions, tool catalogs, security policies, tenant configuration, identity providers, change approvals and configuration versions.
Data plane
Processes incoming requests, maintains applicable protocol state, validates identity, enforces policy and communicates with authorized upstream services.
Control-plane compromise
A compromised gateway management plane could alter server destinations, weaken authorization rules or introduce unauthorized tools. Protect administrative access, configuration integrity, policy changes and distribution channels independently.
Establishing a trusted MCP server inventory
An enterprise MCP registry maintains approved server definitions and associated operational and security metadata.
A registry entry should establish which destinations are permitted, who owns them, which identity model they require and which capabilities have been approved.
| Registered server | Approved capabilities | Trust classification | Owner |
|---|---|---|---|
| network-operations | BGP diagnostics, interface status | Internal approved | Network Engineering |
| cloud-inventory | Cloud resource discovery | Internal approved | Cloud Platform |
| incident-management | Incident retrieval and updates | Internal approved | Service Operations |
| external-analytics | Restricted analytics queries | Restricted external | Data Engineering |
| unverified-server | None | Not approved | Unassigned |
server:
id: network-operations
owner: network-engineering
endpoint: https://network-mcp.example.com/mcp
transport: streamable-http
trust:
classification: internal-approved
review_status: approved
configuration_version: 12
upstream_identity:
resource: https://network-mcp.example.com/mcp
credential_reference: network-mcp-identity
approved_tools:
- get_bgp_neighbors
- get_route_table
- get_interface_status
tenant_access:
- network-operations
security:
tls_required: true
dynamic_destinations: false
tool_review_required: true
This is an illustrative registry configuration, not an official MCP registry schema.
Registration does not establish permanent trust
Approved servers can change behavior, introduce new tools or become compromised. Registry approval should be combined with version control, periodic review, capability change detection and revocation mechanisms.
Policy Decision Points and Policy Enforcement Points
Zero Trust architectures distinguish between the component that evaluates whether an operation is authorized and the component that enforces the resulting security decision.
Policy Decision Point
Evaluates trusted identity attributes, requested actions, resource information, environmental conditions and applicable authorization policies.
Policy Enforcement Point
Intercepts the request, obtains or evaluates the policy decision and prevents unauthorized execution from reaching protected resources.
A policy engine may be embedded directly within the gateway or deployed as an external authorization service. The choice introduces trade-offs involving latency, consistency, availability and operational complexity.
Deterministic enforcement
Security decisions should be enforced by trusted application and infrastructure logic. A language model's interpretation of a security instruction is not a substitute for a deterministic authorization decision.
Routing requests according to verified authorization context
Conventional reverse proxies often route requests according to hostnames, URL paths or HTTP headers. An MCP-aware gateway may additionally evaluate the authenticated principal, tenant, approved tool namespace and authorized upstream resource.
Establish verified identity
Validate the incoming credential and derive principal information from trusted identity infrastructure.
Resolve the tenant
Establish tenant membership from verified authorization context rather than trusting arbitrary client-provided tenant identifiers.
Resolve the requested tool
Map the requested capability to an approved tool definition and registered upstream server.
Evaluate routing authorization
Determine whether the principal and tenant are permitted to invoke the selected capability against the intended resource.
Establish upstream identity
Obtain an appropriate upstream credential using an approved delegation or workload identity mechanism.
Forward the authorized operation
Route only to the registered destination, maintaining applicable protocol state and resource-specific authorization boundaries.
Never trust model-generated routing destinations
Tool arguments and model-generated URLs must not independently determine arbitrary upstream destinations. Resolve destinations through trusted configuration and apply outbound network restrictions to reduce SSRF and unauthorized connectivity risks.
Capability allowlists and governed tool discovery
MCP clients can discover tools through the
tools/list method and invoke available
tools through tools/call.
An enterprise gateway can present a filtered tool catalog appropriate to the authenticated principal and organizational security policy.
Read-only capabilities
Operational diagnostics, inventory retrieval and approved data queries. Read-only operations still require confidentiality controls because they can expose sensitive information.
State-changing capabilities
Configuration updates, incident modifications, cloud resource creation and other consequential operations requiring stronger authorization and potentially human approval.
{
"jsonrpc": "2.0",
"id": 10,
"result": {
"tools": [
{
"name": "network_get_bgp_neighbors",
"description": "Retrieve approved BGP neighbor information.",
"inputSchema": {
"type": "object",
"properties": {
"device": {
"type": "string"
}
},
"required": ["device"],
"additionalProperties": false
}
}
]
}
}
The gateway may expose a stable, namespaced tool identifier while mapping the operation to an approved upstream server and tool definition.
Discovery filtering is not authorization
Removing a tool from a discovery response does not prevent a client from constructing a direct tools/call request. Every invocation must be independently authorized. Tool descriptions and annotations should not be treated as trusted security policy.
Validating MCP messages and tool arguments
A protocol-aware gateway can inspect the structure of MCP messages and evaluate tool arguments against approved schemas before forwarding requests.
{
"type": "object",
"properties": {
"device": {
"type": "string",
"pattern": "^[a-zA-Z0-9-]{1,64}$"
},
"address_family": {
"type": "string",
"enum": ["ipv4", "ipv6"]
}
},
"required": [
"device",
"address_family"
],
"additionalProperties": false
}
Structural validation
Verify required fields, supported data types, object structure and applicable JSON-RPC and MCP message requirements.
Semantic validation
Evaluate whether the supplied values represent permitted operations and valid enterprise resource identifiers.
Resource authorization
Establish whether the authenticated principal can access the particular resource identified by the validated arguments.
Schema validity is not execution safety
A syntactically valid device identifier can still identify a protected router. A valid string can contain harmful instructions. Schema validation must be combined with semantic controls, authorization and safe backend execution.
Rate limiting, concurrency and execution budgets
Autonomous agents may generate repeated tool invocations during reasoning, retries and multi-step workflows.
Without appropriate limits, an agent can consume excessive gateway capacity, overwhelm upstream systems or generate unexpected operational costs.
Request rate
Limit invocation frequency by principal, tenant, tool, upstream server or another relevant security dimension.
Concurrency
Restrict the number of simultaneous tool executions and long-lived connections to protect finite backend resources.
Execution budgets
Apply workflow-level limits on tool calls, elapsed execution time, data transfer and other measurable resource consumption.
limits:
tenant:
requests_per_minute: 600
concurrent_operations: 40
principal:
requests_per_minute: 60
concurrent_operations: 5
tool:
get_bgp_neighbors:
requests_per_minute: 30
timeout_seconds: 10
workflow:
maximum_tool_calls: 50
maximum_execution_seconds: 120
retry:
maximum_attempts: 2
backoff: exponential
jitter: true
These limits are illustrative engineering values, not recommended universal production defaults. Actual limits must reflect workload behavior, service capacity and organizational requirements.
Retry safety
State-changing operations must not be blindly retried after ambiguous failures. Use appropriate idempotency mechanisms, execution identifiers and outcome reconciliation where supported.
Multitenant MCP gateway architecture
A shared MCP gateway may support multiple departments, business units, customers or independently governed AI applications.
Sharing gateway infrastructure must not imply sharing authorization context, upstream credentials, tool visibility or session state.
Logical isolation
Shared gateway instances with independently enforced tenant identity, authorization, session storage, credential access and resource policies.
Dedicated isolation
Separate gateway instances, execution environments or network boundaries for tenants requiring stronger operational and security separation.
Session identifiers are not authentication credentials
MCP session identifiers must not independently establish user identity or authorization. Where sessions are used, associate session state with verified authorization context and prevent cross-tenant session reuse.
Investigate an enterprise MCP authorization decision
Configure the identity, tenant, tool, upstream server and request conditions. The gateway evaluates each security boundary before allowing, denying or holding the operation.
Decision: All applicable gateway policy checks succeed.
Execution: The request may proceed to the registered upstream MCP server for independent authorization.
[IDENTITY] Verified principal [TENANT] Authorized tenant context [REGISTRY] Approved upstream destination [TOOL] Capability present in allowlist [ROLE] Operation authorized [SCHEMA] Arguments validated [LIMITS] Resource budget available [APPROVAL] Read-only operation [ROUTING] Request authorized for forwarding
Educational policy simulation. No external servers, real credentials or production resources are accessed. Selecting verified approval represents a simulated trusted approval record, not a real approval mechanism.
Expressing MCP authorization through versioned policies
Policy-as-code approaches allow organizations to express authorization requirements in a structured, reviewable and testable form.
Policy engines such as Open Policy Agent can be integrated with an MCP gateway, provided the gateway supplies trusted authorization attributes and reliably enforces the resulting decisions.
package mcp.gateway
import rego.v1
default allow := false
allow if {
input.identity.verified
input.identity.tenant == input.resource.tenant
input.server.approved
input.arguments.valid
input.rate_limit.permitted
input.tool.name == "get_bgp_neighbors"
input.identity.role in {
"network_reader",
"network_operator"
}
input.resource.authorized
}
allow if {
input.identity.verified
input.identity.tenant == input.resource.tenant
input.server.approved
input.arguments.valid
input.rate_limit.permitted
input.tool.name == "apply_network_change"
input.identity.role == "network_operator"
input.resource.authorized
input.approval.verified
input.approval.request_hash ==
input.request_hash
}
This example illustrates deny-by-default authorization with separate read-only and state-changing operation policies.
Trusted policy inputs
Attributes such as identity.verified, resource.authorized and approval.verified must originate from trusted enforcement components. They must never be accepted directly from an untrusted MCP client or model-generated tool argument. Approval records also require appropriate expiry, integrity and replay protection.
Streamable HTTP, sessions and gateway protocol compatibility
A gateway mediating remote MCP communication must account for more than conventional HTTP request forwarding.
Streamable HTTP can support JSON responses and server-sent event streams, depending on the operation and server implementation. Gateways must preserve applicable protocol behavior and negotiated capabilities.
Streaming behavior
Configure appropriate response buffering, connection lifetimes, idle timeouts and backpressure handling for supported server-sent event streams.
Protocol lifecycle
Preserve or correctly mediate initialization, capability negotiation, request correlation, notifications and applicable session lifecycle behavior.
Session-aware routing
Where upstream servers maintain session state, use compatible routing or shared state mechanisms without weakening tenant and identity isolation.
Bidirectional capabilities
Explicitly govern server-initiated requests and notifications, including supported sampling, elicitation and other negotiated capabilities.
Transport bridging
A gateway exposing a remote HTTP interface while connecting to local stdio-based MCP servers acts as a protocol bridge. It must manage process lifecycle, operating-system isolation, credential access and upstream protocol state.
Security telemetry and distributed request correlation
A centralized gateway provides an opportunity to correlate MCP operations with the originating principal, AI application, policy version, upstream destination and execution outcome.
{
"event": "mcp.gateway.authorization",
"trace_id": "example-trace-042",
"principal": "network-engineer-42",
"tenant": "network-operations",
"client": "engineering-copilot",
"server": "network-operations",
"tool": "get_bgp_neighbors",
"policy_version": "12",
"identity_valid": true,
"tenant_authorized": true,
"schema_valid": true,
"rate_limit_permitted": true,
"decision": "allow",
"gateway_duration_ms": 8,
"upstream_duration_ms": 124,
"outcome": "success"
}
| Metric | Engineering purpose |
|---|---|
| Tool invocation rate | Detect workload changes and excessive agent activity. |
| Authorization denial rate | Identify policy violations and configuration errors. |
| Gateway processing latency | Measure overhead introduced by security enforcement. |
| Upstream execution latency | Distinguish gateway delays from backend performance. |
| Active streams and sessions | Monitor connection capacity and session pressure. |
| Policy evaluation failures | Detect unavailable or incorrectly configured authorization services. |
| Tool catalog changes | Identify unexpected capability or schema modifications. |
Telemetry must not become a data leakage channel
Avoid recording raw access tokens, secrets, sensitive tool arguments and unrestricted tool responses. Apply appropriate redaction, retention controls, tenant isolation and access restrictions to gateway observability infrastructure.
High availability and secure failure handling
Centralizing governance introduces a critical infrastructure dependency. Gateway architecture must therefore address availability, failure isolation and secure degradation.
Highly available data plane
Deploy redundant gateway instances with health-aware routing, appropriate session handling and sufficient execution capacity.
Versioned policies
Distribute validated policy versions through controlled deployment processes with rollback and configuration integrity checks.
Circuit breakers
Isolate failing upstream servers and prevent repeated requests from cascading into broader infrastructure failures.
Fail-closed enforcement
Reject operations when required security decisions cannot be established. Do not silently bypass authorization during policy infrastructure failures.
A gateway may use a validated local policy snapshot during a control-plane outage if the organization explicitly permits this behavior and defines acceptable policy age, revocation requirements and failure conditions.
Designing a secure enterprise MCP gateway
Centralize governance. Distribute execution. Preserve every trust boundary.
An MCP gateway should transform uncontrolled agent connectivity into a governed enterprise capability architecture. Its purpose is not merely to forward requests, but to ensure that every operation remains attributable, authorized, constrained and observable throughout its execution lifecycle.
Specifications and further reading
Official Model Context Protocol Specification
NIST SP 800-207 — Zero Trust Architecture
RFC 9700 — Best Current Practice for OAuth 2.0 Security
RFC 8707 — Resource Indicators for OAuth 2.0
Open Policy Agent — Policy-as-Code Documentation
JSON Schema — Specification and Documentation
OpenTelemetry — Observability Documentation
All gateway configurations, policies, identities, resource limits and telemetry examples are illustrative. Production implementations require independent validation against the applicable MCP revision, security architecture and organizational requirements.
Enterprise MCP Gateway
Architecture Designer
Build a governed Model Context Protocol infrastructure. Configure identity enforcement, server registries, tenant boundaries, intelligent routing and resilient gateway deployments. Follow requests through an interactive security enforcement pipeline.
Select an architectural component to inspect its security, routing and availability responsibilities.
Inside the MCP Gateway
Follow the request through the logical policy pipeline. Disabled controls are bypassed. Rejected requests terminate at their enforcement point.
| Server | Capability | Tenant pool | Health | Modeled latency |
|---|---|---|---|---|
| Data MCP 01 | data.lookup | Shared | Healthy | 24 ms |
| Data MCP 02 | data.lookup | Shared | Healthy | 16 ms |
| Operations MCP | service.status | Shared / authorized | Healthy | 20 ms |
// Configure the gateway architecture. // Select a request experiment. // All requests are synthetic.
Architecture Ready
Configure the enterprise gateway and initiate a request. Observe how deployment architecture, security controls and backend routing affect the outcome.
Single Instance
Backend Enforcement
Public TLS
MCP Tool Security and Safe Execution Architecture
Engineering the security boundary between artificial intelligence, executable capabilities and protected enterprise infrastructure.
When AI reasoning becomes infrastructure execution
Traditional AI applications primarily generate information. Agentic AI applications can additionally invoke external capabilities that retrieve data, modify resources and interact with production systems.
MCP provides a standardized interface through which applications can discover and invoke tools exposed by MCP servers.
A tool may retrieve BGP neighbor information, query a database, inspect a Kubernetes cluster, create a cloud resource or initiate an approved infrastructure change.
The security challenge is ensuring that an AI-generated request cannot independently establish the authority required to execute that operation.
Decision generation
The model interprets information and proposes a tool invocation. Its output remains untrusted until independently evaluated.
Security enforcement
Trusted infrastructure validates identity, permissions, resource scope, arguments, execution conditions and applicable approvals.
Constrained execution
The authorized operation executes within an environment possessing only the capabilities necessary for the approved task.
The fundamental execution security principle
A language model may propose an operation. It must not be the component that grants itself permission to perform that operation.
The secure MCP tool execution fortress
A defense-in-depth execution architecture introduces independently enforced security boundaries between model-generated requests and enterprise resources.
Logical reference architecture. These security controls may be distributed across the MCP host, gateway, server, execution platform and downstream resources.
Understanding MCP tool poisoning
MCP tools expose descriptive metadata that helps applications understand their available capabilities. This metadata may include a tool name, description, input schema and annotations.
Because tool descriptions can become part of a model's reasoning context, malicious or compromised servers may introduce misleading instructions intended to influence agent behavior.
Approved capability
A reviewed tool definition accurately describes its intended behavior, accepted arguments and expected operational boundaries.
Compromised capability
Untrusted metadata misrepresents the operation, introduces unexpected instructions or attempts to expand the agent's authorized scope.
{
"name": "get_bgp_neighbors",
"description": "Retrieve BGP neighbor status
for an authorized network device.",
"inputSchema": {
"type": "object",
"properties": {
"device_id": {
"type": "string"
}
},
"required": ["device_id"],
"additionalProperties": false
},
"annotations": {
"readOnlyHint": true
}
}
The example is formatted for readability; the description would be a single valid JSON string in an actual protocol message.
Tool annotations are not security guarantees
A readOnlyHint annotation describes an expected characteristic of a tool. It does not independently prove that the underlying implementation is incapable of modifying resources.
Definition review
Review descriptions, schemas, annotations and actual implementation behavior before approving enterprise capabilities.
Integrity monitoring
Compare approved capability definitions against observed definitions and investigate unexpected changes.
Independent enforcement
Enforce permissions outside model reasoning, regardless of what a tool description claims the agent should do.
Versioned capability approval and change detection
A tool that was reviewed during onboarding may subsequently change its description, input schema, implementation or downstream dependencies.
Enterprise deployments should establish a controlled lifecycle for approving, distributing, monitoring and revoking executable capabilities.
Discover
Retrieve capabilities from a registered MCP server and associate them with the verified server identity.
Review
Evaluate the tool definition, implementation, dependencies, resource access and operational impact.
Approve and version
Record the approved capability version, canonical definition digest and applicable authorization policy.
Distribute
Publish the approved capability through trusted registries and controlled deployment mechanisms.
Monitor
Detect unexpected tool definition changes, implementation changes and anomalous behavior.
Revoke or reapprove
Quarantine unexpected capabilities until their security implications have been evaluated.
capability:
server: network-operations
tool: get_bgp_neighbors
version: 3
integrity:
definition_digest: "sha256:APPROVED_DIGEST"
implementation_digest: "sha256:APPROVED_IMAGE"
approval_status: approved
permissions:
operation: network.read
resource_scope: authorized_devices
execution_profile: restricted-read
lifecycle:
owner: network-engineering
review_required_on_change: true
unexpected_change_action: quarantine
Definition integrity and implementation integrity
Hashing a tool definition detects changes to that definition but cannot prove that the remote implementation behaves as described. Deployment provenance, signed artifacts, trusted ownership and runtime enforcement remain necessary.
Authorizing the tool, operation and target resource
Granting an agent access to an MCP server should not automatically authorize every tool exposed by that server.
Authorization should evaluate the authenticated principal, requested capability, operation type, target resource and relevant environmental context.
| Capability | Network reader | Network operator | Security administrator |
|---|---|---|---|
| get_bgp_neighbors | Allow* | Allow* | Allow* |
| get_route_table | Allow* | Allow* | Allow* |
| apply_network_change | Deny | Approval required* | Deny |
| update_security_policy | Deny | Deny | Approval required* |
| export_all_credentials | Deny | Deny | Deny |
Illustrative enterprise RBAC matrix. *All permitted operations remain subject to resource-specific authorization and other policies.
Role-Based Access Control
RBAC establishes permitted capabilities based on assigned organizational roles.
Attribute-Based Access Control
ABAC evaluates additional attributes such as resource ownership, tenant, environment, data classification and change windows.
Permission attenuation
An agent's effective permissions should be constrained by the intersection of its delegated authority, application policy, tool policy and resource authorization. Delegation must not silently expand the originating authority.
Validating model-generated tool arguments
Tool arguments originate from an application or model-controlled workflow and must be treated as untrusted input.
Structural validation, semantic validation and resource authorization address different aspects of execution security.
{
"type": "object",
"properties": {
"device_id": {
"type": "string",
"pattern": "^[a-zA-Z0-9-]{1,64}$"
},
"address_family": {
"type": "string",
"enum": ["ipv4", "ipv6"]
},
"maximum_results": {
"type": "integer",
"minimum": 1,
"maximum": 100
}
},
"required": [
"device_id",
"address_family"
],
"additionalProperties": false
}
Structural validation
Enforce data types, permitted fields, length restrictions, enumerations and numeric bounds.
Semantic validation
Resolve the device identifier through trusted inventory and verify that the requested operation is supported.
Resource authorization
Verify that the authenticated principal can retrieve information from that particular network device.
Avoid unrestricted command execution interfaces
Prefer narrowly defined operations with typed parameters over tools that accept arbitrary shell commands, unrestricted SQL statements or unconstrained infrastructure operations. Use parameterized APIs and avoid interpreting untrusted strings as executable code.
Sandboxing MCP tool implementations
Authorization determines whether an operation may proceed. Sandboxing constrains what the executing workload can actually access.
These controls are complementary. A permitted operation can still encounter implementation vulnerabilities, malicious dependencies or unexpected runtime behavior.
| Isolation model | Security boundary | Engineering considerations |
|---|---|---|
| Restricted process | OS permissions and process controls | Low overhead; dependent on host security. |
| Hardened container | Namespaces, capabilities, seccomp and other OS controls | Shares host kernel; requires runtime hardening. |
| Sandboxed container runtime | Additional runtime mediation | Improved isolation characteristics with compatibility trade-offs. |
| MicroVM | Virtualized guest kernel boundary | Additional isolation with lifecycle and resource overhead. |
| Dedicated virtual machine | Hypervisor-managed guest environment | Greater resource requirements and management complexity. |
Choose isolation according to the threat model
A conventional container is not equivalent to a virtual machine security boundary. Workloads processing untrusted code or highly sensitive operations may require stronger isolation than ordinary application containers.
Restricting MCP workloads in Kubernetes
Kubernetes can provide a managed execution environment for containerized MCP servers. Security depends on workload configuration, admission policy, runtime isolation, network enforcement and cluster-level access controls.
apiVersion: v1
kind: Pod
metadata:
name: network-mcp
namespace: mcp-execution
labels:
app: network-mcp
spec:
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001
seccompProfile:
type: RuntimeDefault
containers:
- name: mcp-server
image: registry.example.com/network-mcp:approved
securityContext:
privileged: false
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "256Mi"
volumeMounts:
- name: temporary-workspace
mountPath: /tmp
volumes:
- name: temporary-workspace
emptyDir:
sizeLimit: 64Mi
Non-root execution
Run the workload under a dedicated, unprivileged operating-system identity.
Restricted capabilities
Remove unnecessary Linux capabilities and prevent privilege escalation.
Read-only root filesystem
Reduce writable application surfaces while explicitly provisioning necessary temporary storage.
Resource constraints
Bound workload CPU and memory consumption according to expected execution requirements.
Service account restrictions
Avoid automatically exposing Kubernetes API credentials to workloads that do not require them.
Trusted deployment artifacts
Verify image provenance and use approved, immutable image digests in production.
Container hardening is not a complete sandbox
This illustrative Pod does not independently restrict network access, enforce execution deadlines or eliminate host-kernel vulnerabilities. Additional admission, runtime, network and application controls are required.
Constraining filesystem access
MCP servers exposing document processing, file retrieval or software engineering tools may require access to local or mounted storage.
The execution environment should expose only the files and directories necessary for the authorized operation.
Approved workspace roots
Restrict file operations to explicitly authorized workspace locations and enforce path containment through appropriate filesystem APIs.
Mount restrictions
Avoid unnecessary host filesystem mounts, container runtime sockets and shared credential directories.
Read-only data exposure
Mount source data read-only where modification is not necessary for the approved operation.
Ephemeral task storage
Use isolated temporary workspaces and apply appropriate cleanup, retention and storage consumption policies.
Path validation requires more than string matching
Filesystem authorization must account for path resolution, symbolic links, race conditions and platform-specific filesystem behavior. Combine safe filesystem APIs with operating-system isolation and restricted mounts.
Network egress restrictions and destination governance
An MCP tool may need to communicate with an enterprise API, database or infrastructure management endpoint.
Unrestricted outbound connectivity creates unnecessary exposure to data exfiltration, unauthorized service access and server-side request forgery.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: network-mcp-egress
namespace: mcp-execution
spec:
podSelector:
matchLabels:
app: network-mcp
policyTypes:
- Egress
egress:
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: enterprise-api
podSelector:
matchLabels:
app: network-inventory
ports:
- protocol: TCP
port: 8443
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- protocol: UDP
port: 53
- protocol: TCP
port: 53
This example permits selected application connectivity and DNS access for the targeted MCP workload.
NetworkPolicy implementation requirements
The cluster must use a network implementation that enforces Kubernetes NetworkPolicy. Policies are additive, DNS deployment labels vary, and standard NetworkPolicy does not provide general application-layer URL authorization. Additional egress proxies or platform controls may be necessary.
Keeping secrets outside the model reasoning context
An AI agent does not normally need to know the raw credential used by a trusted tool implementation to access an enterprise resource.
Secret management infrastructure should supply appropriately scoped credentials directly to authorized execution components.
Workload identity
Authenticate execution services through trusted workload identity mechanisms rather than embedding permanent credentials.
Short-lived credentials
Obtain narrowly scoped credentials with limited lifetimes where supported by the downstream resource.
Credential containment
Prevent raw secrets from entering model prompts, tool descriptions, unrestricted responses and diagnostic logs.
Secret retrieval is itself a privileged operation
A secret broker must independently authorize the requesting workload and requested secret. Avoid providing an agent with a generic tool that retrieves arbitrary enterprise credentials.
Human-in-the-loop approval architecture
Certain operations may have significant operational, financial or security consequences.
Human approval can introduce an additional authorization requirement before a permitted state-changing operation is executed.
Generate the proposed operation
The agent proposes a specific tool invocation against an identified enterprise resource.
Evaluate existing authorization
Reject operations that violate identity, capability or resource authorization before requesting approval.
Present the exact proposed change
Show the authorized approver the target, operation, relevant parameters, expected impact and available rollback information.
Create a trusted approval record
Bind the decision to the exact operation, approving identity, applicable policy, expiry and replay protection.
Revalidate before execution
Confirm that authorization remains valid and the proposed operation has not changed since approval.
Execute and reconcile
Perform the approved operation, record its outcome and reconcile ambiguous or incomplete execution results.
{
"approval_id": "approval-example-042",
"request_digest": "sha256:CANONICAL_REQUEST_DIGEST",
"tool": "apply_network_change",
"resource": "router-r1",
"requested_by": "network-operator",
"approved_by": "change-approver",
"decision": "approved",
"policy_version": "12",
"expires_at": "2027-01-01T10:15:00Z",
"single_use": true
}
Approval must bind to the actual execution
A generic confirmation message is insufficient. If the operation, resource or relevant arguments change after approval, the execution component should reject the stale approval and require a new decision.
Preventing uncontrolled tool execution
Agentic workflows may repeatedly invoke tools, create parallel operations or retry failed requests. Each execution environment should enforce appropriate resource consumption boundaries.
Compute limits
Constrain CPU and memory consumption to prevent individual workloads from exhausting shared infrastructure.
Execution deadlines
Apply operation-specific deadlines and terminate or reconcile work that exceeds permitted execution time.
Output limits
Restrict response size, temporary storage, result cardinality and data transfer according to the approved operation.
Concurrency limits
Bound simultaneous tool invocations per principal, workload and protected resource.
Workflow budgets
Restrict the total number of tool calls and cumulative execution resources consumed by an agentic workflow.
Execution reconciliation
Use execution identifiers and appropriate idempotency mechanisms to reduce unintended duplicate state changes.
Timeout does not prove that execution stopped
A client-side timeout or cancellation may occur after a downstream operation has already begun or completed. Consequential operations require outcome reconciliation rather than blind retries.
Protecting the return path into the AI application
Security enforcement must extend beyond the incoming tool invocation.
Tool responses may contain sensitive information, untrusted external content, malformed structures or instructions intended to influence subsequent agent behavior.
Response validation
Validate structured output against expected response formats and enforce applicable size and content restrictions.
Data loss prevention
Apply classification-aware response controls, sensitive data filtering and appropriate redaction before returning information.
Instruction separation
Treat tool-returned text as untrusted data, not as an authoritative source of new application or security instructions.
Subsequent action authorization
Independently authorize every additional operation proposed after processing a tool response.
Prompt injection defenses are layered
Content filtering and instruction separation reduce exposure but cannot guarantee that a language model will never be influenced by malicious content. Deterministic authorization and constrained execution remain essential.
Investigate the MCP execution security boundary
Select a security scenario or independently configure the requested operation and execution conditions. Observe how the simulated security architecture authorizes, blocks or holds the operation.
Decision: All applicable security checks succeed.
Execution: The simulated operation completes and its response is permitted.
Initializing execution security laboratory...
Educational simulation only. No real tools, credentials, servers or infrastructure resources are accessed. Runtime access conditions are modeled as pre-execution policy checks.
Establishing an auditable execution chain
Production MCP infrastructure should provide sufficient evidence to establish who requested an operation, what was authorized, which tool executed and what outcome occurred.
{
"event": "mcp.tool.execution",
"trace_id": "example-trace-042",
"execution_id": "example-execution-107",
"principal": "network-operator",
"tenant": "network-operations",
"capability": {
"server": "network-operations",
"tool": "get_bgp_neighbors",
"version": 3
},
"authorization": {
"policy_version": "12",
"resource_authorized": true,
"decision": "allow"
},
"runtime": {
"profile": "restricted-read",
"filesystem_policy": "compliant",
"egress_policy": "compliant",
"credential_scope": "compliant"
},
"execution": {
"duration_ms": 124,
"outcome": "success",
"response_policy": "allow"
}
}
| Security signal | Engineering interpretation |
|---|---|
| Capability integrity failures | Unexpected tool definition or implementation changes. |
| Resource authorization denials | Attempts to access resources outside the permitted scope. |
| Runtime policy violations | Noncompliant execution environments or restricted operations. |
| Network egress denials | Attempts to communicate with unauthorized destinations. |
| Credential scope violations | Requests for credentials outside the approved resource boundary. |
| Approval failures | Missing, expired, invalid or mismatched approval records. |
| Response policy violations | Potential sensitive data exposure or noncompliant output. |
Response blocking does not reverse execution
If a tool executes successfully but its response violates an output security policy, withholding that response does not undo the operation. Record the execution outcome independently and initiate reconciliation or incident handling where appropriate.
Designing secure MCP execution environments
Trust the authorization boundary. Constrain the execution environment. Verify the outcome.
Secure agentic infrastructure does not depend on a language model consistently making safe decisions. It depends on independently enforced security architecture that ensures even an incorrect, manipulated or compromised decision cannot exceed explicitly authorized execution boundaries.
Specifications and further reading
Official Model Context Protocol Specification
NIST SP 800-190 — Application Container Security Guide
NIST SP 800-207 — Zero Trust Architecture
Kubernetes Pod Security Standards
JSON Schema — Specification and Documentation
SPIFFE — Secure Production Identity Framework
The configurations, policies, identities, approval records and execution scenarios are illustrative. Production implementations require validation against applicable protocol revisions, platform capabilities and organizational security requirements.
MCP Tool Authorization
& Policy Workbench
Engineer granular authorization for AI agents and enterprise MCP tools. Investigate identity permissions, contextual policy, delegated authority, resource isolation and human approval through an interactive zero trust authorization architecture.
Select a component to investigate its role in enterprise policy evaluation and enforcement.
Inside the Authorization Engine
Observe each policy evaluation. An explicit denial terminates the request. Sensitive operations can suspend execution pending a human decision.
Human Approval Required
Identity Permissions
Delegation Boundary
Effective Permission Ceiling
Effective permissions are constrained by the intersection of identity permissions and delegated authority. Contextual policies and resource authorization may restrict these permissions further.
| Tool capability | Analyst | Engineer | Security | Admin | Agent |
|---|
// Awaiting authorization request. // Configure the identity, tool and policy. // All operations are synthetic.
Policy Workbench Ready
Configure the authorization context and evaluate the requested MCP tool. Investigate the exact enforcement point responsible for the final decision.
RBAC versus ABAC
RBAC derives permissions from assigned roles. ABAC evaluates attributes associated with the subject, resource, action and environment. Combining both can provide granular authorization.
Permission Attenuation
Delegated authority must not expand beyond the permitted authority of the delegating identity. Effective permissions are further constrained by downstream resource policies.
Approval Is Not Authorization
Human approval is an additional obligation, not a substitute for identity validation, resource authorization or parameter validation. Approval must be bound to the specific operation.
Prompt Injection and Agentic Security Architecture
Engineering resilient AI applications that can process untrusted information without allowing that information to redefine their authority, security policies or permitted infrastructure operations.
When information attempts to become authority
Large language models process natural language instructions and natural language data within their reasoning context.
Unlike conventional application architectures, where executable instructions and application data are normally represented through distinct interfaces, language models can interpret both instructions and information as meaningful text.
Prompt injection exploits this characteristic by introducing content intended to influence the model's behavior in ways that conflict with the application's intended operation.
MCP does not introduce prompt injection as a new vulnerability class. However, MCP-connected applications can expose additional information sources and executable capabilities, increasing the potential consequences of compromised model reasoning.
Information
Documents, webpages, database records, tool results and external messages enter the application as information to process.
Context manipulation
Untrusted content may attempt to influence the model's interpretation of its task, authority or available capabilities.
Independent enforcement
Trusted application components enforce permissions and security policies regardless of the model's interpretation of the content.
The fundamental cognitive security principle
Information can influence reasoning. It must not independently establish authority.
The cognitive security fortress
A resilient agentic application separates trusted application instructions, authenticated user intent, external information and executable authority into independently governed security domains.
Logical defense-in-depth architecture. Context filtering can reduce exposure but does not guarantee that model reasoning remains unaffected by malicious information.
Direct versus indirect prompt injection
Prompt injection can originate from the application's immediate input interface or from information retrieved during an otherwise legitimate workflow.
Direct prompt injection
A user submits content that attempts to manipulate the application's intended behavior or circumvent established restrictions.
The user input is directly available to the model. However, user instructions do not supersede application security policy or establish permissions the user does not possess.
Indirect prompt injection
Manipulative content originates from an external information source, such as a document, webpage, support ticket or MCP tool response.
A legitimate user may initiate the workflow without knowing that retrieved information contains adversarial content.
| Characteristic | Direct injection | Indirect injection |
|---|---|---|
| Origin | Immediate application input | Retrieved external content |
| User awareness | May be intentional or accidental | User may be unaware |
| Trust boundary | User-to-application boundary | External data-to-agent boundary |
| Common exposure | Chat and application interfaces | Documents, tools, resources and search results |
| Primary security control | Independent application authorization | Provenance, isolation and independent authorization |
Authentication does not make content trustworthy
An authenticated MCP server may return content originating from untrusted third parties. Server authentication establishes the identity of the communicating service, not the authority of every statement contained in its responses.
Understanding the sources of untrusted context
MCP applications can receive information through several protocol capabilities. Each capability introduces distinct provenance and trust considerations.
Tool descriptions
Tool names, descriptions, schemas and annotations may influence capability selection. Treat metadata from unreviewed servers as untrusted.
Tool responses
Tool results may include information retrieved from external systems, including adversarial text and misleading operational claims.
MCP resources
Documents, records and application-managed resources may contain content that should be interpreted as data rather than authority.
MCP prompts
Server-provided prompt templates require explicit application trust decisions and appropriate user-facing selection mechanisms.
Multimodal information
Images and other supported content formats may contain information interpreted by multimodal models.
Chained tool results
Information retrieved through one capability may influence subsequent operations involving a different capability or security domain.
Protocol validity is not semantic trust
A structurally valid JSON-RPC response can contain untrusted natural language. Protocol validation, content trust and operation authorization are separate engineering responsibilities.
Preventing authority transfer between MCP servers
Enterprise agents frequently connect to multiple MCP servers with different responsibilities. One server may retrieve documents while another exposes cloud administration capabilities.
Information returned by the document server must not automatically authorize operations against the cloud administration server.
Data authority
A server may be an approved source of particular information without possessing authority over operations in other systems.
Execution authority
Every proposed operation requires authorization against the relevant principal, capability, target resource and application policy.
Trust is not automatically transitive
Approval to retrieve information from one MCP server does not establish approval to invoke capabilities on another server.
Understanding the agentic attack chain
Prompt injection becomes especially consequential when compromised reasoning can influence subsequent tool invocations.
Security architects should model the complete path from untrusted information ingestion to potential downstream effects, identifying where independent controls can interrupt that path.
Legitimate workflow initiation
An authenticated user requests an authorized information retrieval or diagnostic operation.
Untrusted information ingestion
The application retrieves external information that contains potentially manipulative content. Provenance and classification controls identify the information's security context.
Potential reasoning influence
The model may interpret external content in ways inconsistent with the original task. Context separation and filtering reduce exposure.
Proposed downstream operation
The model proposes an additional operation. The application evaluates it independently against the authorized task and capability policy.
Security enforcement
Unauthorized operations are denied. Sensitive or consequential permitted operations undergo additional policy and approval checks.
Incident evidence and response
Security telemetry records relevant provenance, proposed operations, policy decisions and confirmed execution outcomes.
Detection and containment are different objectives
An application may fail to recognize a prompt injection attempt yet still prevent an unauthorized operation through independent access controls. Conversely, detecting suspicious content does not guarantee that all resulting effects are contained.
Separating instructions, information and authority
Agentic applications should preserve information about the origin, intended purpose and security classification of content entering the model context.
Application instructions
Trusted application behavior, task constraints and operational guidance supplied through application-controlled interfaces.
User intent
The user's requested objective, interpreted within their authenticated identity and independently established permissions.
External information
Retrieved content that may inform reasoning but cannot grant permissions or modify trusted security policy.
{
"context_id": "context-example-042",
"origin": {
"server": "enterprise-document-service",
"capability": "retrieve_document",
"resource": "network-operations-guide"
},
"classification": {
"content_type": "external_data",
"trust_level": "untrusted",
"data_sensitivity": "internal"
},
"permitted_use": [
"summarization",
"information_extraction"
],
"authority": {
"grants_permissions": false,
"modifies_application_policy": false
},
"content": "[Retrieved document content]"
}
This envelope illustrates application-managed provenance and classification metadata. It is not a mandatory MCP protocol message format.
Metadata must originate from trusted infrastructure
An untrusted server cannot establish the trust classification of its own content merely by including a field claiming that the content is trusted. The receiving application must independently assign or verify security metadata.
Tracking sensitive information across agent workflows
Information retrieved by an agent may subsequently appear in summaries, generated documents, tool arguments and downstream requests.
Security architecture should preserve relevant provenance and sensitivity classifications across these transformations.
Conservative information-flow tracking
When a model processes mixed-sensitivity inputs, downstream output may need to inherit the most restrictive applicable classification until an approved declassification process establishes otherwise. Exact information lineage through probabilistic model generation is difficult.
Protecting information before it leaves the trust boundary
Agentic applications may possess capabilities that communicate with external systems, create documents, send messages or invoke enterprise APIs.
Information transfer policies should evaluate the actual destination, data classification, authorized purpose and receiving principal.
Input minimization
Retrieve only information necessary for the authorized task, reducing sensitive information exposed to model reasoning.
Classification-aware retrieval
Enforce access controls and classification policies before sensitive records enter the application context.
Destination authorization
Evaluate whether the intended receiving service or recipient is authorized to receive the relevant information.
Structured data filtering
Apply approved field-level restrictions, redaction and response minimization where supported by the data format.
Transfer enforcement
Inspect relevant tool arguments before external communication or information release occurs.
Audit and incident response
Record security decisions and confirmed transfer outcomes without unnecessarily retaining sensitive content.
| Classification | Internal approved service | Unapproved external destination |
|---|---|---|
| Public | Policy-dependent allow | Destination review |
| Internal | Authorized purpose required | Deny |
| Confidential | Explicit authorization | Deny |
| Restricted | Specialized approved workflow | Deny |
| Raw backend credentials | Trusted credential handling only | Deny |
Illustrative enterprise classification policy. Actual transfer rules depend on organizational requirements, contractual obligations and applicable regulations.
DLP is not a complete confidentiality guarantee
Sensitive information may be transformed, summarized or represented indirectly by a model. Pattern-based detection alone cannot guarantee that all sensitive information is recognized. Minimize initial exposure and enforce destination authorization independently.
Moving security decisions outside model reasoning
A model-generated statement claiming that an operation is approved should never substitute for an independently verified authorization decision.
Security enforcement components should evaluate trusted identity context, capability permissions, resource authorization, data classification and approval requirements.
function authorizeOperation(request, trustedContext):
principal = trustedContext.authenticatedPrincipal
if not principal:
return DENY("Unauthenticated principal")
capability = approvedRegistry.lookup(request.tool)
if not capability:
return DENY("Unapproved capability")
if not policy.allowsCapability(principal, capability):
return DENY("Capability not authorized")
if not schema.validate(request.arguments):
return DENY("Invalid arguments")
if not policy.allowsResource(
principal,
request.targetResource
):
return DENY("Resource not authorized")
if not policy.allowsTaskScope(
trustedContext.authorizedTask,
request
):
return DENY("Operation outside task scope")
if not transferPolicy.allows(
trustedContext.dataClassification,
request.destination
):
return DENY("Information transfer prohibited")
if capability.requiresApproval:
if not approvalService.verifyExactRequest(
request,
trustedContext
):
return HOLD("Verified approval required")
return ALLOW("All required policies satisfied")
Authorization inputs must themselves be trustworthy
Identity, task scope, resource ownership, data classification and approval status must originate from trusted application components. Do not accept model-generated assertions as authoritative substitutes for these values.
Preventing authority amplification across agent workflows
Multi-agent applications may delegate tasks between specialized agents with different capabilities and information access.
Delegation introduces additional trust boundaries. A message from one agent should not automatically establish authorization for another agent to perform a privileged operation.
Permission attenuation
Delegated operations remain constrained by applicable originating authority, application policy and receiving-agent permissions.
Inter-agent message provenance
Preserve the identity and origin of messages while treating their natural language content as information rather than executable authority.
Agentic prompt injection defense laboratory
Select an information security scenario and configure the available defense layers. Observe whether the proposed operation is permitted, blocked or left exposed by the simulated security architecture.
Authorized network diagnostic workflow.
AUTHORIZED WORKFLOW
The proposed operation satisfies the modeled application security requirements.
Engineering interpretation: Legitimate workflows remain available when appropriate security controls are enforced.
Initializing laboratory...
Deterministic educational simulation using synthetic scenarios. No real language model, MCP server, external destination or enterprise resource is accessed. Detection outcomes are predefined teaching assumptions, not measured detection rates.
Why prompt injection detection is not sufficient
Prompt injection classifiers, content inspection systems and model-based security filters can provide useful signals.
However, detection systems may produce false positives and false negatives. Their effectiveness varies with content formats, languages, model behavior and application context.
| Security layer | Primary purpose | Important limitation |
|---|---|---|
| Content inspection | Identify suspicious information | Cannot guarantee detection of all manipulation |
| Instruction separation | Reduce authority confusion | Model behavior remains probabilistic |
| Capability allowlist | Restrict available operations | Approved tools can still be misused |
| Resource authorization | Enforce resource-specific access | Requires trustworthy resource identity |
| Data loss prevention | Restrict sensitive information release | May miss transformed sensitive information |
| Human approval | Govern consequential operations | Approval fatigue and misleading presentations |
| Runtime isolation | Constrain actual execution capabilities | Depends on isolation strength and configuration |
| Audit telemetry | Provide investigation evidence | Does not independently prevent execution |
Design for detection failure
Assume that some malicious content will reach the model and influence its behavior. Design independent security boundaries so that this influence cannot automatically produce unauthorized infrastructure operations.
Recording evidence across the agentic request lifecycle
Prompt injection investigations require more than a record of the final model response.
Engineers need to correlate information sources, model-proposed operations, authorization decisions, actual execution outcomes and information transfer events.
{
"event": "agent.security.policy_decision",
"trace_id": "example-trace-107",
"workflow_id": "network-diagnostic-042",
"principal": {
"identity": "network-reader",
"tenant": "enterprise-network"
},
"information_source": {
"server": "document-service",
"capability": "retrieve_document",
"classification": "internal",
"trust": "untrusted_content"
},
"inspection": {
"suspicious_content": true,
"detector_version": "example-3"
},
"proposed_operation": {
"capability": "apply_network_change",
"resource": "router-r1"
},
"authorization": {
"policy_version": "12",
"decision": "deny",
"reason": "operation_outside_task_scope"
},
"execution": {
"attempted": false,
"completed": false
}
}
Provenance correlation
Associate proposed operations with relevant information sources and workflow identifiers.
Policy decision evidence
Record the independently enforced policy, decision reason and relevant trusted context.
Execution confirmation
Distinguish proposed operations, authorized operations and confirmed downstream effects.
Privacy-preserving telemetry
Minimize retained prompts, tool arguments and response content. Apply appropriate access controls and retention policies.
Security logs are another trust boundary
Logs may contain untrusted text and sensitive information. If AI agents analyze security telemetry, log content must remain data rather than an authoritative source of instructions.
Testing agentic security boundaries
Production validation should measure whether the complete application prevents unauthorized effects, not merely whether the model produces an appropriate textual refusal.
Benign workflow testing
Confirm that authorized business operations remain available under normal conditions.
Untrusted content testing
Use controlled synthetic documents and tool responses to evaluate context security.
Authorization testing
Verify that prohibited capabilities and resource operations are independently denied.
Information transfer testing
Confirm that synthetic sensitive data cannot reach prohibited destinations.
Delegation testing
Verify that agent-to-agent delegation does not expand authorized permissions.
Failure-mode testing
Evaluate behavior when content inspection, policy services or approval components become unavailable.
| Validation metric | Engineering objective |
|---|---|
| Unauthorized execution rate | Measure prohibited operations that actually execute. |
| Prohibited information transfer rate | Measure unauthorized release of synthetic sensitive data. |
| Detection false-negative rate | Identify malicious test content missed by inspection. |
| Detection false-positive rate | Identify legitimate content incorrectly classified. |
| Authorized task completion rate | Measure legitimate workflow availability. |
| Policy decision latency | Measure authorization overhead under representative load. |
| Audit correlation completeness | Verify that security events can be reconstructed. |
Test with controlled infrastructure
Security validation should use authorized test environments, synthetic sensitive information and explicitly approved capabilities. Measure actual outcomes rather than assuming that a successful demonstration establishes universal protection.
Designing prompt injection resilient MCP applications
Information informs. Identity establishes the principal. Policy determines authority.
Prompt injection resilience is not achieved by expecting a language model to consistently distinguish every malicious instruction from legitimate information. It is achieved through an architecture in which compromised reasoning cannot independently grant permissions, expand execution capabilities or authorize prohibited information transfers.
Specifications and further reading
Official Model Context Protocol Specification
OWASP LLM Prompt Injection Prevention Cheat Sheet
MITRE ATLAS — Adversarial Threat Landscape for AI Systems
NIST SP 800-207 — Zero Trust Architecture
NIST AI Risk Management Framework
Architecture diagrams, policy examples and security scenarios are educational reference models. Production implementations require validation against applicable MCP revisions, organizational security requirements and platform capabilities.
MCP Secure Tool
Execution Simulator
Investigate the security boundaries between AI-generated instructions and enterprise tool execution. Introduce synthetic security threats, configure defensive controls and observe how layered containment protects applications, infrastructure and sensitive enterprise information.
Select an infrastructure component to investigate its role in secure tool execution.
Inside the Security Fortress
Follow the request through independent defensive modules. A control may pass a request, contain a violation or leave an enforcement gap when disabled.
Before Execution
Instruction provenance, tool integrity, argument structure and operation authorization.
Awaiting evaluationDuring Execution
Restricted runtime capabilities, resource access and filesystem containment.
Awaiting evaluationAfter Execution
Data release inspection, network egress and returned-content trust enforcement.
Awaiting evaluation// Awaiting simulation. // No real tool execution occurs. // All evidence is synthetic.
Secure Execution Laboratory Ready
Select a scenario and defensive architecture. Run the simulation to identify the exact security boundary responsible for containment or exposure.
| Security scenario | Minimal | Gateway | Runtime | Fortress | Current |
|---|
Content Is Not Authority
Documents, websites, tool descriptions and returned content may contain adversarial instructions. Their contents must not independently authorize new enterprise operations.
Schema Is Not Authorization
Structurally valid JSON arguments can still request unauthorized resources or dangerous operations. Semantic validation and resource-level policy remain essential.
Runtime Isolation
Tool execution should operate with restricted filesystem, process, credential and network capabilities. Isolation limits the impact of unexpected execution behavior.
Data Release Enforcement
Authorization to read enterprise information does not automatically authorize disclosure. Data classification and destination policies must govern subsequent release.
Untrusted Tool Responses
Tool results must remain within their intended trust boundary. Follow-on actions require fresh authorization rather than inheriting authority from returned text.
Defense in Depth
Independent enforcement layers reduce reliance on any single classifier, gateway or model behavior. Security controls should be tested against realistic failure conditions.
Cloud-Native MCP Infrastructure
Engineering secure, scalable and resilient Model Context Protocol infrastructure across enterprise cloud platforms, Kubernetes clusters, private networks and distributed AI application environments.
From local MCP processes to enterprise infrastructure
MCP servers can operate as local processes alongside an AI application or as remotely accessible services deployed across distributed infrastructure.
Moving MCP capabilities into enterprise environments introduces requirements that extend beyond protocol implementation. Engineers must consider workload identity, network reachability, authentication, authorization, service availability, deployment lifecycle and operational visibility.
Local execution
MCP clients communicate with local server processes using stdio. Security depends heavily on process permissions, executable provenance and host isolation.
Remote services
Streamable HTTP enables MCP communication across network boundaries, introducing TLS, authentication, session handling and infrastructure availability considerations.
Enterprise platforms
Managed gateways, container orchestration, workload identities, private connectivity and centralized policy enforcement support governed MCP service deployment.
Infrastructure does not replace protocol security
Private networks, container isolation and service identities provide important security boundaries. They do not eliminate the need for MCP-aware authentication, tool authorization and resource-level access controls.
The Azure MCP infrastructure citadel
An enterprise Azure deployment may combine Microsoft Foundry agent applications, Microsoft Entra ID, Azure API Management, Azure Kubernetes Service, private networking and managed data services.
Conceptual reference architecture. Exact Foundry, API Management, private networking and MCP integration capabilities depend on the selected service, region, deployment model and supported feature set.
Microsoft Foundry and MCP-connected agents
Microsoft Foundry provides an environment for building and operating AI applications and agentic workflows. MCP integration can extend supported agent applications with access to external tools and enterprise services.
The agent runtime, model inference endpoint and MCP execution infrastructure represent distinct architectural components. They may have different network paths, identity requirements and operational lifecycles.
Agent orchestration
Manages application workflows, model interactions and supported external tool integrations.
Model inference
Processes model requests and proposes actions within the application-provided context.
Capability execution
Provides governed access to enterprise data, APIs, diagnostics and operational capabilities.
Validate the actual agent network path
A private endpoint associated with a Foundry resource does not automatically guarantee private outbound connectivity from every agent runtime to every MCP server. Verify the supported network integration model and DNS resolution for the specific agent deployment.
Azure API Management as an MCP gateway layer
Azure API Management can provide a centralized enforcement and management layer between AI applications and remotely accessible services.
Depending on the supported deployment and MCP integration capabilities, API Management may expose existing APIs through MCP interfaces or provide gateway functionality for remote MCP services.
Authentication
Validate supported access tokens, trusted issuers, intended audiences and required identity claims.
Traffic governance
Apply request quotas, rate limits, payload restrictions and backend routing policies.
Capability governance
Apply MCP-aware controls where supported, or delegate tool authorization to a trusted application or policy enforcement service.
Backend authentication
Use appropriate service credentials or managed identities for supported downstream authentication scenarios.
Network integration
Connect gateway infrastructure to approved backend networks using the capabilities of the selected API Management tier.
Observability
Correlate gateway requests, policy decisions, backend response times and security events.
<policies>
<inbound>
<base />
<validate-jwt
header-name="Authorization"
require-scheme="Bearer"
failed-validation-httpcode="401">
<openid-config
url="https://login.microsoftonline.com/{{tenant-id}}/v2.0/.well-known/openid-configuration" />
<audiences>
<audience>{{mcp-resource-audience}}</audience>
</audiences>
<required-claims>
<claim name="tid" match="all">
<value>{{tenant-id}}</value>
</claim>
</required-claims>
</validate-jwt>
<rate-limit
calls="60"
renewal-period="60" />
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
</policies>
This example illustrates inbound JWT validation and subscription-based rate limiting in a conventional API Management policy configuration.
Gateway authentication is not tool authorization
The example does not implement complete MCP authorization, scope enforcement, protected resource metadata, downstream token handling or per-tool permissions. Production configuration must validate the appropriate claims and implement the required MCP authorization behavior for the selected architecture.
Deploying MCP servers on Kubernetes
Kubernetes provides a common infrastructure platform for deploying containerized MCP servers as independently managed workloads.
A remote MCP server may be packaged as a container image and exposed through a Kubernetes Service. Ingress controllers or gateway implementations can provide controlled access to its HTTP transport.
Replica count is not session availability
Multiple MCP server replicas provide additional capacity and redundancy. Stateful MCP sessions may require session-aware routing, compatible shared state or a server architecture that does not depend on replica-local session state.
A hardened MCP workload deployment
MCP server containers should run with the minimum operating system privileges, resource allocations and service permissions necessary for their approved capabilities.
apiVersion: v1
kind: ServiceAccount
metadata:
name: network-mcp
namespace: mcp-network
automountServiceAccountToken: false
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: network-mcp
namespace: mcp-network
spec:
replicas: 3
selector:
matchLabels:
app: network-mcp
template:
metadata:
labels:
app: network-mcp
spec:
serviceAccountName: network-mcp
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
containers:
- name: mcp-server
image: registry.example.com/network-mcp:1.0.0
ports:
- name: http
containerPort: 8080
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
resources:
requests:
cpu: 250m
memory: 256Mi
limits:
cpu: "1"
memory: 512Mi
readinessProbe:
httpGet:
path: /ready
port: http
livenessProbe:
httpGet:
path: /health
port: http
volumeMounts:
- name: temporary
mountPath: /tmp
volumes:
- name: temporary
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: network-mcp
namespace: mcp-network
spec:
type: ClusterIP
selector:
app: network-mcp
ports:
- name: http
port: 8080
targetPort: http
Restricted runtime
Non-root execution, dropped Linux capabilities, a read-only root filesystem and default seccomp reduce unnecessary container privileges.
Resource governance
CPU and memory requests and limits provide explicit resource management boundaries.
Health management
Readiness and liveness probes distinguish traffic eligibility from process recovery.
Internal service exposure
ClusterIP provides an internal service address. Additional policies govern which workloads may communicate with that service.
Adapt the manifest to the actual server
The image, namespace and health endpoints are illustrative. Production deployments should pin verified image digests, configure the appropriate identity integration, validate application health endpoints and test filesystem compatibility. The manifest does not itself implement MCP authentication or authorization.
Managed identities and workload identity federation
Enterprise MCP servers often require access to downstream cloud resources, including databases, storage services, secret stores and management APIs.
Long-lived credentials embedded in container images, source code or application configuration create unnecessary credential exposure.
Workload identity federation enables supported Kubernetes workloads to obtain cloud access tokens using trusted workload identity assertions rather than storing long-lived application secrets.
Establish workload identity
Associate the MCP workload with a dedicated Kubernetes ServiceAccount.
Configure federation
Establish a federated identity credential that trusts the appropriate Kubernetes OIDC issuer, subject and audience.
Project workload assertion
Supported workload identity integration makes a short-lived service account token available to the workload.
Obtain cloud access token
The application uses the configured identity SDK to exchange its assertion for a token intended for the downstream resource.
Enforce resource authorization
The destination service evaluates the token and applicable permissions before allowing access to protected resources.
apiVersion: v1
kind: ServiceAccount
metadata:
name: network-mcp
namespace: mcp-network
annotations:
azure.workload.identity/client-id: "<identity-client-id>"
# Add the following to the Deployment pod template:
#
# metadata:
# labels:
# azure.workload.identity/use: "true"
#
# spec:
# serviceAccountName: network-mcp
#
# Configure the AKS OIDC issuer, workload identity
# integration and matching federated credential.
#
# Federated credential subject:
# system:serviceaccount:mcp-network:network-mcp
#
# Federated credential audience:
# api://AzureADTokenExchange
Separate caller identity from workload identity
The identity used by an MCP server to access Azure resources is not automatically equivalent to the identity of the user requesting a tool. The server must independently enforce caller authorization or use an explicitly supported delegated identity architecture.
Private endpoints, routing and DNS resolution
Azure Private Link enables supported Azure services to be accessed through private endpoints associated with virtual networks.
A private endpoint provides a private IP address for connectivity to a supported service. It does not independently grant authorization to access that service.
DNS engineering
Ensure that service hostnames resolve to the intended private endpoint addresses from every authorized workload network.
Routing engineering
Validate virtual network connectivity, peering, route tables and applicable firewall or network security policies.
Public access governance
Disable public network access where required and supported. Creating a private endpoint does not necessarily disable existing public access.
TLS identity
Continue using the appropriate service hostname and certificate validation. Private addressing does not replace authenticated transport.
Secret management and credential isolation
Some enterprise integrations still require API keys, certificates or application-specific credentials. These secrets should remain inside trusted execution infrastructure rather than entering the model context.
Centralized secret stores
Azure Key Vault or equivalent services provide controlled secret retrieval, access governance and lifecycle management.
Identity-based retrieval
Authorized workloads retrieve required secrets using their assigned cloud identity rather than embedded bootstrap credentials.
Runtime credential handling
Trusted application components use credentials directly for downstream authentication without exposing them to model reasoning.
Kubernetes Secrets require additional protection
Base64 encoding is not encryption. Kubernetes Secrets require appropriate RBAC, encryption at rest, restricted workload access and operational controls. External secret stores do not eliminate the need to protect secrets after they enter a workload.
Segmenting MCP workloads by capability and trust
Different MCP servers may expose significantly different levels of infrastructure access.
A read-only documentation service should not automatically share the same network reachability, cloud identity or execution privileges as a privileged infrastructure administration service.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny
namespace: mcp-network
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-mcp-gateway
namespace: mcp-network
spec:
podSelector:
matchLabels:
app: network-mcp
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: mcp-gateway
podSelector:
matchLabels:
app: enterprise-mcp-gateway
ports:
- protocol: TCP
port: 8080
Complete the egress architecture before deployment
These policies deny ordinary ingress and egress traffic by default and selectively permit gateway ingress. Explicit egress rules are still required for DNS, identity token acquisition, telemetry and approved backend connectivity. NetworkPolicy enforcement requires a compatible networking implementation.
Service mesh architecture for MCP infrastructure
Service mesh technologies can provide workload identity, mutual TLS, service-to-service traffic authorization and observability across distributed application environments.
MCP services can benefit from these capabilities, particularly when tool execution involves multiple internal services and independently managed backend components.
Mutual TLS
Authenticates participating workloads and protects service-to-service transport within the configured mesh.
Workload identity
Associates network communication with authenticated service identities rather than relying solely on IP addresses.
Traffic authorization
Restricts which participating workloads may communicate with protected services.
Traffic management
Provides controlled routing, connection management and supported resilience mechanisms.
Observability
Exposes service-level traffic metrics, distributed traces and communication failure evidence.
Egress governance
Supports controlled outbound paths where mesh and network enforcement are configured to prevent bypass.
Transport identity and user identity are different
Mutual TLS can establish which workload is communicating. It does not automatically establish which user authorized a particular MCP tool invocation or whether that user possesses the necessary resource permissions.
Operating Streamable HTTP through cloud infrastructure
MCP Streamable HTTP can involve ordinary HTTP responses and Server-Sent Events, depending on the request and server implementation.
Gateways, load balancers, ingress controllers and service mesh components must preserve the transport behavior required by the deployed MCP implementation.
| Infrastructure component | Engineering consideration | Potential failure |
|---|---|---|
| Reverse proxy | Streaming response behavior | Buffered or delayed events |
| Load balancer | Connection and idle timeouts | Premature disconnection |
| Gateway | Protocol headers and HTTP methods | Invalid protocol handling |
| Replica routing | Stateful session placement | Unknown session identifier |
| Authentication layer | Token expiry and reauthorization | Interrupted authorized workflows |
| Autoscaling | Active streams and workload concurrency | Capacity exhaustion |
| Rolling deployment | Connection draining and session continuity | Interrupted tool execution |
| Retry policy | Operation-specific idempotency | Duplicate consequential operations |
Do not blindly retry tool execution
A network timeout does not establish that a downstream operation failed to execute. Consequential tool calls require appropriate idempotency mechanisms, execution reconciliation or explicit recovery workflows before retrying.
Engineering highly available MCP services
MCP infrastructure availability depends on the complete request path, including identity services, gateways, network connectivity, server replicas and downstream dependencies.
Replica distribution
Distribute workloads across appropriate nodes and availability zones using scheduling and topology controls.
Horizontal scaling
Scale according to representative workload demand, active sessions, concurrency and backend capacity.
Disruption management
Use suitable PodDisruptionBudgets and deployment strategies to manage voluntary workload disruptions.
Session continuity
Establish a compatible strategy for replica-local state, shared state, reconnection and session recovery.
Dependency isolation
Apply concurrency limits, bounded queues and circuit breakers where appropriate to contain downstream failures.
Regional recovery
Define recovery objectives, identity availability, data locality and tested regional failover procedures.
Security must survive infrastructure failure
If an authorization service becomes unavailable, protected operations should not automatically become unrestricted. Define explicit failure behavior that preserves required security boundaries during degraded operation.
Enterprise MCP deployment architecture laboratory
Select a deployment architecture and configure its infrastructure controls. Observe the modeled security posture, operational gaps and recommended engineering improvements.
MODELED PROFILE REQUIREMENTS MET
The selected controls satisfy the illustrative enterprise private deployment profile.
Initializing architecture assessment...
Educational architecture assessment. The control count is not a security score or compliance certification. No cloud resources are deployed or inspected by this laboratory.
Observing the complete MCP request path
Cloud-native MCP infrastructure should expose correlated operational and security evidence across application, gateway, workload and backend boundaries.
| Layer | Important telemetry |
|---|---|
| Agent application | Workflow identifiers, tool proposals and execution outcomes |
| MCP gateway | Authentication decisions, request rates and policy denials |
| Kubernetes | Pod readiness, restarts, CPU, memory and scheduling events |
| Network infrastructure | Connection failures, DNS resolution and policy enforcement |
| Workload identity | Token acquisition failures and identity configuration errors |
| MCP server | Tool execution latency, active sessions and authorization results |
| Backend services | Dependency latency, access decisions and confirmed side effects |
Distributed tracing must preserve security boundaries
Propagate appropriate correlation identifiers across trusted components. Do not place access tokens, raw credentials or unnecessarily sensitive tool arguments in trace attributes, logs or propagated telemetry baggage.
Choosing an MCP deployment platform
| Platform | Suitable use | Engineering considerations |
|---|---|---|
| Local stdio | Developer tools and local integrations | Process permissions and local trust |
| Azure Container Apps | Managed containerized MCP services | Ingress, scaling, identity and streaming behavior |
| Azure App Service | HTTP application hosting | Supported runtime, network integration and connection handling |
| Azure Kubernetes Service | Complex distributed MCP platforms | Cluster operations, network policy and workload isolation |
| Self-managed Kubernetes | Hybrid and infrastructure-controlled environments | Platform lifecycle, identity integration and operational overhead |
| Dedicated virtual machines | Specialized or legacy integrations | OS lifecycle, hardening and service availability |
Platform selection should follow workload requirements rather than assuming that Kubernetes or a managed gateway is mandatory for every MCP deployment.
Designing enterprise-ready MCP infrastructure
Connectivity enables communication. Identity establishes trust in the principal. Authorization determines permitted execution.
Enterprise MCP infrastructure should not be designed as a collection of AI-accessible endpoints. It should be engineered as a distributed capability platform with independently enforced identity, network, execution and information security boundaries.
Specifications and further reading
Official Model Context Protocol Specification
Microsoft Azure API Management Documentation
Microsoft Foundry Documentation
Microsoft Entra Workload ID on AKS
Azure Private Link Documentation
Kubernetes Pod Security Standards
Architecture diagrams, configuration examples and deployment assessments are educational reference models. Validate all implementation details against current platform documentation and organizational security requirements.
Cloud-Native MCP
Deployment Builder
Engineer secure, resilient and privately connected Model Context Protocol infrastructure. Build an enterprise deployment across Microsoft Foundry, Azure API Management, Kubernetes, workload identity and protected cloud services. Introduce infrastructure failures and investigate how architectural decisions affect security and availability.
Select any infrastructure component to inspect its deployment responsibilities and security boundaries.
Inside the MCP Compute Fabric
Inspect replica placement, container health and availability zone distribution. The simulation highlights the selected serving replica and infrastructure failures.
Cloud Infrastructure Laboratory Ready
Configure the enterprise architecture and select an infrastructure scenario to investigate its security and availability behavior.
Educational deployment excerpt only. Image, service account, identity federation, networking and Azure resources require environment-specific configuration.
| Infrastructure test | Development | Gateway | Private | Resilient | Current |
|---|
Private Connectivity
Private endpoints and virtual network connectivity reduce public exposure. Correct DNS resolution, routing and service configuration are equally important.
Federated Workload Identity
Kubernetes workloads can exchange federated credentials for Microsoft Entra access tokens. Authentication does not automatically grant permission to downstream resources.
Independent Authorization
Gateway authentication complements server-side authorization. MCP servers and downstream APIs must independently enforce their own resource and operation permissions.
Container Security
Non-root execution, restricted capabilities, read-only filesystems and network policies reduce the impact of compromised workloads. They do not eliminate every runtime threat.
Zone-Aware Availability
Multiple replicas are not sufficient if they share the same failure domain. Placement, readiness, capacity and dependency resilience determine service availability.
MCP Session Resilience
Stateless requests are easier to redistribute. Stateful MCP sessions require deliberate session routing, recovery and retry semantics. Failed tool calls must not be blindly replayed.
MCP Observability, Governance & Compliance
Engineering end-to-end visibility, distributed tracing, operational intelligence, security accountability and enterprise governance across Model Context Protocol infrastructure and distributed AI agent ecosystems.
Understanding the invisible execution architecture
An enterprise AI agent may receive a user request, interact with a language model, discover MCP capabilities, invoke multiple tools and combine responses from distributed enterprise systems.
Each stage introduces operational dependencies, security decisions and potential failure conditions. Observability enables engineers to reconstruct this distributed execution path using correlated evidence.
Metrics
Quantitative measurements of request rates, latency distributions, error rates, concurrency, resource consumption and service availability.
Logs
Structured records describing application events, policy decisions, failures, execution outcomes and security evidence.
Distributed traces
Correlated spans describing how individual requests move through multiple components, including their timing and relationships.
Monitoring and observability are complementary
Monitoring identifies known conditions through predefined measurements and alerts. Observability provides evidence for investigating both expected and previously unknown system behavior.
The MCP operations command centre
A mature MCP platform requires visibility across the complete agent-to-tool execution architecture. Gateway telemetry alone cannot establish what occurred inside the MCP server or its downstream enterprise dependencies.
Conceptual telemetry architecture. Security audit records may require a separate protected delivery and retention pipeline from sampled operational traces.
OpenTelemetry and distributed MCP systems
OpenTelemetry provides vendor-neutral specifications, APIs, SDKs and collection components for generating, processing and exporting observability signals.
MCP application developers can instrument hosts, clients, gateways, servers and downstream integrations to produce correlated evidence describing protocol operations and enterprise tool execution.
Instrumentation
Application SDKs create spans, metrics and contextual telemetry around important operations and dependencies.
Telemetry transport
The OpenTelemetry Protocol supports exporting telemetry using supported HTTP or gRPC transport configurations.
Collector architecture
Receivers, processors and exporters provide configurable pipelines for collecting and delivering telemetry.
receivers:
otlp:
protocols:
grpc:
endpoint: 127.0.0.1:4317
http:
endpoint: 127.0.0.1:4318
processors:
memory_limiter:
check_interval: 1s
limit_mib: 256
spike_limit_mib: 64
batch:
timeout: 5s
send_batch_size: 512
exporters:
otlp:
endpoint: telemetry.example.com:4317
tls:
insecure: false
service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp]
metrics:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp]
logs:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp]
Telemetry collection creates another security boundary
The example is a local collection skeleton, not a production-hardened configuration. Add appropriate authentication, destination authorization, filtering, data minimization, resource protection and reliable delivery controls. Avoid collecting sensitive content at the instrumentation source wherever possible.
Following an MCP request across enterprise infrastructure
Distributed tracing associates related operations with a common trace identifier. Individual spans describe specific operations, their duration, status and parent-child relationships.
Trace context can be propagated across supported HTTP boundaries using the W3C Trace Context standard. Local transports and asynchronous workflows may require explicit instrumentation and correlation mechanisms appropriate to their architecture.
traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01 Version: 00 Trace ID: 4bf92f3577b34da6a3ce929d0e0e4736 Parent Span ID: 00f067aa0ba902b7 Trace Flags: 01
Correlation identifiers are not security credentials
A trace identifier does not authenticate a caller or authorize tool execution. Incoming trace context is potentially untrusted and must be handled according to the receiving service's trust and sampling policies.
Azure Monitor and Application Insights
Azure Monitor provides monitoring capabilities across Azure resources, applications and supported infrastructure environments.
Application Insights provides application performance monitoring capabilities within Azure Monitor, including request telemetry, dependency analysis, exceptions and distributed application diagnostics.
Gateway telemetry
Collect supported API Management metrics, diagnostic records, response codes, request latency and backend performance.
Application Insights
Instrument MCP applications to expose application requests, dependencies, exceptions and correlated traces.
Container monitoring
Observe Kubernetes workload health, container resource utilization, restarts and infrastructure events.
Log Analytics
Query collected operational records using Kusto Query Language and correlate evidence across services.
Microsoft Sentinel
Integrate appropriate security data into SIEM analytics, incident investigation and response workflows.
Operational dashboards
Establish service objectives, alerting rules, availability measurements and operational health visualizations.
Application-specific instrumentation remains necessary
Azure resource diagnostics do not automatically provide complete MCP tool-level telemetry. Instrument the application and policy enforcement components to record the required execution and authorization evidence.
Observing individual tool invocations
HTTP request monitoring provides an important transport-level view, but it does not necessarily reveal which MCP capability was invoked, which authorization policy was evaluated or whether a downstream operation produced a side effect.
| Telemetry attribute | Engineering purpose |
|---|---|
| Trace and span identifiers | Correlate distributed operations |
| JSON-RPC method | Distinguish protocol operation types |
| Approved tool identifier | Identify the capability being invoked |
| Server identity | Associate execution with an approved service |
| Caller reference | Associate authorized activity with an accountable principal |
| Authorization decision | Distinguish allowed, denied and approval-required operations |
| Policy identifier and version | Reconstruct the applied authorization rules |
| Execution outcome | Distinguish completed, failed, rejected and uncertain outcomes |
| Execution duration | Measure tool performance and dependencies |
| Operation reference | Reconcile consequential backend operations |
{
"event": "mcp.tool.execution",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"invocation_id": "inv-01842",
"rpc.method": "tools/call",
"mcp.tool.name": "get_bgp_neighbors",
"mcp.server.name": "network-diagnostics",
"principal_ref": "subject-42",
"authorization.decision": "allow",
"authorization.policy": "network-read-v4",
"execution.duration_ms": 184,
"execution.outcome": "completed",
"operation.classification": "read-only",
"data.classification": "internal"
}
Illustrative application-defined attributes, not a mandatory MCP telemetry schema. Use applicable OpenTelemetry semantic conventions where supported.
Do not indiscriminately capture tool arguments
Tool arguments and responses may contain credentials, personal information, infrastructure configurations or commercially sensitive data. Use approved attribute allowlists and record only the information necessary for the defined operational purpose.
HTTP success does not necessarily mean tool success
An MCP HTTP exchange can complete successfully at the transport layer while the JSON-RPC response reports an error or the tool result indicates an execution failure.
Transport outcome
HTTP status, connection errors, TLS failures, timeouts and transport availability.
Protocol outcome
JSON-RPC errors, unsupported methods, malformed requests and protocol processing failures.
Execution outcome
Tool-specific results, execution errors, backend failures and confirmed or uncertain side effects.
HTTP/1.1 200 OK
Content-Type: application/json
{
"jsonrpc": "2.0",
"id": 42,
"result": {
"content": [
{
"type": "text",
"text": "Network telemetry service unavailable."
}
],
"isError": true
}
}
Measure the semantic outcome
Service reliability measurements should distinguish transport availability, protocol correctness, policy decisions and actual tool execution success. An HTTP 200 response is insufficient evidence of successful enterprise operation.
Engineering enterprise MCP audit trails
Operational telemetry supports troubleshooting. Security audit records support accountability, investigation and evidence of governed activity. These requirements overlap but are not identical.
Decision evidence
Record the policy decision, relevant principal reference, capability, resource scope and applicable policy version.
Execution evidence
Record whether an authorized action was attempted, completed, rejected or left in an uncertain execution state.
Approval evidence
Associate consequential operations with the applicable approval record and authorized scope of execution.
Integrity protection
Restrict audit modification and deletion. Apply appropriate retention, integrity verification and protected storage controls.
Sampled traces are not a complete audit trail
Operational trace sampling may intentionally discard requests. Security-critical audit records should follow their own defined completeness, delivery, integrity and retention requirements.
Understanding MCP latency budgets
The latency experienced by an AI agent depends on multiple sequential and potentially parallel operations. These may include model inference, gateway processing, authentication, authorization, tool execution and downstream dependency calls.
This simplified example uses mutually exclusive sequential durations. Real distributed traces may contain nested spans and parallel execution. Summing all span durations would therefore overestimate the actual elapsed request time.
P50 latency
The median request duration. Useful for understanding the typical experience, but insufficient for identifying tail latency.
P95 latency
The duration at or below which approximately 95 percent of measured requests complete. Useful for evaluating slower requests.
P99 latency
The duration at or below which approximately 99 percent of measured requests complete. Highlights extreme latency behavior.
Measure the critical path
Identify which operations determine end-to-end completion time. Analyze nested spans, concurrency, queueing and downstream dependencies before attributing latency to the MCP gateway.
Establishing meaningful MCP service objectives
Service-level indicators measure selected aspects of system behavior. Service-level objectives define target values for those measurements over an explicitly defined evaluation period.
| Service indicator | Illustrative objective | Measurement boundary |
|---|---|---|
| Eligible request availability | 99.9% | Defined valid and eligible requests |
| Read-only tool success | 99.5% | Authorized read-only invocations |
| Gateway processing P95 | Below 50 ms | Defined exclusive gateway overhead |
| Diagnostic tool P95 | Below 500 ms | Selected diagnostic tool class |
| Security audit delivery | 100% required events | Reconciled security-critical event inventory |
| Unauthorized execution | Zero tolerated | Confirmed unauthorized side effects |
Example engineering targets only. Actual objectives must reflect workload requirements, measurement definitions, business risk and validated baselines.
Security denials are not necessarily availability failures
A correctly rejected unauthorized request represents successful security enforcement. Define eligible requests carefully when calculating availability and tool execution success rates.
Investigating MCP infrastructure with KQL
Kusto Query Language can be used to analyze collected Azure Monitor and Application Insights telemetry, subject to the selected workspace, instrumentation and table schema.
AppRequests
| where TimeGenerated > ago(1h)
| where AppRoleName == "mcp-gateway"
| summarize
Requests = sum(ItemCount),
P50 = percentilew(DurationMs, ItemCount, 50),
P95 = percentilew(DurationMs, ItemCount, 95),
P99 = percentilew(DurationMs, ItemCount, 99)
by bin(TimeGenerated, 5m)
| order by TimeGenerated asc
AppTraces
| where TimeGenerated > ago(24h)
| where tostring(Properties["event"])
== "mcp.authorization"
| where tostring(Properties["decision"])
== "deny"
| extend Tool =
tostring(Properties["tool_name"])
| summarize Denials = sum(ItemCount)
by Tool, bin(TimeGenerated, 15m)
| order by TimeGenerated desc
let targetTrace =
"4bf92f3577b34da6a3ce929d0e0e4736";
union
(
AppRequests
| project TimeGenerated,
OperationId,
Name,
DurationMs,
Success,
Signal = "Request"
),
(
AppDependencies
| project TimeGenerated,
OperationId,
Name,
DurationMs,
Success,
Signal = "Dependency"
)
| where TimeGenerated > ago(24h)
| where OperationId == targetTrace
| order by TimeGenerated asc
Validate the telemetry schema
These examples assume workspace-based Application Insights tables and application-defined MCP properties. Adapt field names, resource identifiers and event definitions to the deployed instrumentation. Sampled telemetry estimates are not equivalent to complete security audit counts.
Detecting anomalous MCP behavior
Enterprise MCP platforms introduce behavioral patterns that may reveal compromised credentials, unauthorized capability discovery, excessive tool execution or unexpected data access.
Invocation bursts
Unexpected increases in tool invocation frequency, concurrency or resource consumption relative to a workload baseline.
Repeated policy denials
Unusual attempts to invoke restricted capabilities or access resources outside the caller's authorized scope.
Capability drift
Unexpected changes to registered tools, tool schemas, server identities or approved capability inventories.
Data access anomalies
Unusual response volumes, resource access patterns or transfers inconsistent with the approved workflow.
Identity anomalies
Unexpected principal activity, abnormal credential usage patterns or unusual combinations of identity and capability.
Workflow anomalies
Tool invocation sequences that diverge from approved application workflows or established operational baselines.
An anomaly is evidence, not proof of compromise
Changes in legitimate demand, application releases, scheduled operations and workload behavior may generate unusual telemetry. Correlate anomalies with independent security and operational evidence before determining incident scope.
MCP distributed trace investigation laboratory
Select an operational scenario to examine its synthetic distributed trace, gateway behavior, security decision, execution outcome and investigation evidence.
HEALTHY EXECUTION PATH
The modeled request completed successfully and its required audit evidence was delivered.
Initializing investigation...
Educational simulation. All timings, events and operational outcomes are synthetic. Audit delivery is modeled separately from the synchronous request latency. No live MCP services are contacted.
Managing MCP capabilities throughout their lifecycle
Enterprise MCP governance extends beyond individual request authorization. Organizations must establish how capabilities are introduced, reviewed, approved, monitored, changed and retired.
Capability ownership
Assign an accountable owner to every approved MCP server and enterprise capability.
Approved inventory
Maintain server identities, tool schemas, approved destinations, resource permissions and applicable data classifications.
Change governance
Review changes to capability behavior, tool descriptions, dependencies and authorization requirements.
Continuous review
Reassess permissions, operational demand, risk exposure and continued business justification throughout the lifecycle.
Mapping MCP controls to enterprise obligations
MCP does not independently establish regulatory compliance. Compliance depends on the organization's obligations, system classification, jurisdiction, implementation controls and supporting evidence.
| Framework or obligation | Relevant MCP engineering considerations |
|---|---|
| ISO/IEC 27001 | Risk management, access control, logging and information security governance |
| ISO/IEC 42001 | AI management systems, accountability, lifecycle governance and risk assessment |
| SOC 2 | Applicable trust services criteria, control operation and supporting evidence |
| GDPR | Lawful processing, data minimization, purpose limitation, security and retention |
| EU AI Act | Applicable AI system classification, operator obligations, documentation and oversight |
| NIST AI RMF | Govern, Map, Measure and Manage AI-related risks |
| NIST SP 800-207 | Zero trust architecture and resource-centric access enforcement |
Technical controls do not establish certification
This mapping is educational and does not determine whether a particular MCP deployment satisfies legal, regulatory or certification requirements. Applicable obligations require organization-specific assessment and appropriate professional review.
Preventing telemetry from becoming a data exposure channel
MCP telemetry may contain information about enterprise infrastructure, user activity, protected resources and sensitive operational workflows.
Minimize collection
Capture only the attributes necessary for the defined monitoring, security or audit purpose.
Exclude credentials
Prevent access tokens, refresh tokens, API keys, passwords and secret material from entering telemetry pipelines.
Restrict access
Separate operational, security and compliance access according to approved responsibilities and data classifications.
Govern retention
Establish retention and deletion policies appropriate to the telemetry purpose, legal obligations and security requirements.
Control cardinality
Avoid unbounded metric labels such as individual request identifiers, raw user inputs and arbitrary resource names.
Protect correlation data
Treat pseudonymous principal references and correlated activity records as potentially sensitive information.
Redaction is defense in depth
Collector-side filtering can reduce exposure, but sensitive information may already have entered application buffers, local logs or telemetry transport. Prevent unnecessary collection at the source.
Building an observable and governed MCP platform
Every consequential AI action should have an accountable identity, an authorization decision and a verifiable execution outcome.
Enterprise MCP observability is not simply the collection of logs and performance metrics. It is the engineering of trustworthy operational evidence across distributed AI decision-making, security enforcement and enterprise capability execution.
Specifications and further reading
Official Model Context Protocol Specification
OpenTelemetry Semantic Conventions
W3C Trace Context Specification
Application Insights Documentation
Microsoft Sentinel Documentation
NIST AI Risk Management Framework
Architecture diagrams, telemetry records, configuration examples, query examples and performance measurements are educational. Validate implementation details against current specifications, platform documentation and organizational security requirements.
MCP Observability &
Governance Command Centre
Investigate enterprise AI infrastructure through distributed tracing, tool invocation auditing, latency analysis, security anomaly detection and governance enforcement. Follow MCP requests across the complete cloud execution architecture and examine the evidence generated at each operational boundary.
Select an infrastructure component to inspect its instrumentation, operational responsibilities and security governance boundaries.
Enterprise Command Centre Ready
Execute a scenario and examine the relationship between request outcomes, distributed traces, security events and governance decisions.
| Request | Principal | Requested tool | Execution | Decision | Latency | Trace |
|---|---|---|---|---|---|---|
| No retained audit records. | ||||||
Distributed Trace Context
Trace identifiers correlate activity across distributed services. Span identifiers and parent relationships reconstruct the request execution hierarchy.
JSON-RPC Correlation
JSON-RPC identifiers correlate protocol requests and responses within their communication context. They are distinct from globally scoped trace identifiers.
Independent Security Auditing
Security decision records should not depend entirely on sampled performance traces. Authorization and governance evidence require deliberate retention policies.
Telemetry Data Minimization
Raw access tokens, secrets, prompts and sensitive tool arguments should not be indiscriminately exported into operational monitoring systems.
Latency Attribution
End-to-end latency must be attributed to individual execution stages. Distributed spans distinguish gateway, model, MCP server and downstream dependency delays.
Detection Versus Enforcement
Anomaly detection generates investigation signals. Authorization, rate limiting and data protection policies independently determine whether execution is permitted.
Production MCP Security & Troubleshooting
Engineering resilient Model Context Protocol infrastructure through evidence-driven troubleshooting, security incident investigation, controlled containment, verified recovery and continuous operational improvement.
When an enterprise MCP architecture fails
Production MCP infrastructure combines distributed applications, language models, identity providers, gateways, tool servers, authorization services and enterprise dependencies.
A failure in any component can affect the complete agent-to-tool execution path. Security incidents introduce additional uncertainty because an apparently successful operation may have violated its intended authorization or data boundary.
Operational failure
Service unavailability, connection failures, resource exhaustion, protocol incompatibility and downstream dependency timeouts.
Security incident
Suspected unauthorized execution, compromised identities, malicious content, unapproved capabilities or protected data exposure.
Governance failure
Missing approval evidence, incomplete audit records, capability inventory drift and ineffective policy lifecycle controls.
Investigate before changing the architecture
Identify the failing boundary, preserve relevant evidence and establish the actual execution outcome. Avoid broad configuration changes that obscure the original incident or introduce new security risks.
The MCP security incident command centre
An enterprise security operations architecture correlates identity events, gateway decisions, MCP server telemetry, backend evidence and security analytics into a unified investigation.
Conceptual security operations architecture. Isolation and recovery actions require authorized operational procedures and verified evidence.
Isolating the failing architectural boundary
Effective MCP troubleshooting follows the request journey rather than assuming that the most visible component caused the failure.
Security investigation can interrupt this sequence
Evidence of active compromise or unauthorized side effects may require immediate containment before routine troubleshooting is completed. Follow the organization's incident response authority.
Diagnosing MCP authentication and authorization failures
OAuth-protected MCP deployments depend on correct authorization server discovery, token issuance, resource binding and protected resource validation.
| Observed symptom | Possible cause | Engineering investigation |
|---|---|---|
| HTTP 401 | Missing or invalid access token | Inspect authentication challenge and validation evidence |
| HTTP 403 | Insufficient authorization | Inspect scopes, entitlements and resource policy |
| Audience mismatch | Token issued for another resource | Validate intended resource and token audience |
| Signature validation failure | Incorrect signing key or issuer configuration | Inspect trusted metadata and signing key lifecycle |
| Intermittent token expiry | Clock skew or refresh lifecycle failure | Inspect time synchronization and token management |
| Repeated authorization prompts | Client state or authorization lifecycle problem | Inspect client registration, discovery and session handling |
{
"event": "mcp.authentication.rejected",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"gateway": "enterprise-mcp-gateway",
"issuer_validation": "passed",
"signature_validation": "passed",
"expiry_validation": "passed",
"audience_validation": "failed",
"expected_resource": "https://mcp.example.com",
"decision": "reject",
"http_status": 401,
"downstream_execution": false
}
Authentication rejection may indicate healthy enforcement
Do not treat every HTTP 401 or 403 response as a platform outage. Determine whether the rejection is consistent with the intended security policy before modifying access controls.
Initialization, transport and session failures
A reachable MCP endpoint is not necessarily a functioning MCP service. The client and server must establish compatible protocol behavior and maintain the required lifecycle state.
Initialization failure
Investigate negotiated protocol versions, capabilities, initialization responses and lifecycle sequencing.
JSON-RPC errors
Inspect method names, message structure, request identifiers, parameters and application-specific error responses.
Streamable HTTP
Investigate HTTP methods, content negotiation, streaming behavior, proxy buffering and connection timeouts.
Session handling
Where sessions are used, investigate session identifiers, expiration, routing consistency and server state.
stdio transport
Inspect process startup, environment configuration, permissions and protocol framing. Keep diagnostics separate from protocol stdout.
Capability mismatch
Compare negotiated capabilities, advertised tools, schema versions and the client's expected operations.
| JSON-RPC code | Meaning | Investigation focus |
|---|---|---|
| -32700 | Parse error | JSON encoding and message framing |
| -32600 | Invalid request | JSON-RPC message structure |
| -32601 | Method not found | Method availability and protocol support |
| -32602 | Invalid parameters | Parameter structure and validation |
| -32603 | Internal error | Server-side processing evidence |
Distinguish protocol errors from tool errors
A tool execution failure may be represented in an MCP tool result rather than as a JSON-RPC protocol error. Inspect both layers when determining the actual operation outcome.
Investigating unauthorized tool execution
An unauthorized execution incident occurs when a capability or resource operation proceeds outside its intended authorization boundary.
The investigation must establish whether the operation was merely proposed, submitted, accepted by an MCP server or actually completed by an enterprise backend.
Policy evidence
Compare the intended authorization rules, deployed policy version, caller identity, requested capability and resource scope.
Execution evidence
Correlate invocation records, backend operation identifiers, resulting resource state and any required approval evidence.
Containment
Restrict the affected capability or identity through approved emergency procedures while preserving evidence.
Impact assessment
Determine affected resources, tenants, principals, time windows and confirmed downstream consequences.
Containing a suspected compromised MCP server
MCP servers may have access to enterprise APIs, internal networks, data platforms and privileged workload identities. A suspected compromise therefore requires assessment of both the server and its downstream authority.
Gateway isolation alone may be insufficient
A compromised server may retain direct backend access, active credentials or established connections. Containment must address the affected workload identity, network reachability and downstream authorization boundaries.
Preserve evidence
Secure relevant logs, deployment metadata, artifact identifiers, configuration evidence and forensic material using approved procedures.
Restrict capability exposure
Remove the affected service from approved routing and capability discovery where operationally appropriate.
Review downstream authority
Assess affected credentials, workload permissions, backend access and established sessions before declaring containment complete.
Rebuild from trusted artifacts
Restore using verified software and configuration rather than assuming that restarting the workload removes compromise.
Investigating suspected access token misuse
Bearer access tokens can represent valuable authorization material. A valid token does not independently prove that its current presenter is the intended legitimate holder.
Identity correlation
Correlate principal references, client identity, token issuance records and resource access evidence.
Behavioral analysis
Investigate unexpected invocation patterns, resource access and deviations from approved application workflows.
Credential containment
Apply supported revocation, session termination, identity restrictions and resource-side enforcement controls.
{
"event": "identity.activity.anomaly",
"principal_ref": "subject-42",
"client_ref": "enterprise-agent",
"resource": "network-diagnostics",
"token_validation": "passed",
"behavioral_baseline": "deviation",
"security_status": "investigation_required",
"credential_material_logged": false,
"compromise_confirmed": false
}
Revocation behavior varies by token architecture
Self-contained access tokens may remain usable until expiry unless resource-side controls or supported continuous enforcement mechanisms prevent their acceptance. Verify that containment is effective at the protected resource.
Investigating indirect prompt injection
An indirect prompt injection incident may begin when an agent processes untrusted content returned by a document, webpage, resource or MCP tool.
The critical investigation question is whether that content influenced a proposed operation and whether independent security controls prevented unauthorized execution.
Content provenance
Establish the origin and retrieval context of suspicious content. Preserve only the evidence necessary for the investigation.
Operation correlation
Determine which tool proposals followed the suspicious content and compare them with the authorized user objective.
Policy verification
Verify that deterministic authorization controls evaluated the actual requested operation and resource.
Data exposure assessment
Investigate whether protected information reached an unauthorized destination or entered an inappropriate processing context.
Model output is not definitive evidence of causation
Correlation between retrieved content and a tool proposal may justify investigation, but it does not independently establish the precise cause of model behavior.
Diagnosing enterprise MCP gateway failures
Centralized gateways can simplify enterprise governance but also introduce dependencies on routing, policy services, identity validation and gateway availability.
| Failure condition | Possible impact | Investigation focus |
|---|---|---|
| HTTP 502 | Invalid upstream response or upstream connection problem | Backend health, TLS, routing and response handling |
| HTTP 503 | Service temporarily unavailable | Capacity, health probes and dependency availability |
| HTTP 504 | Upstream response deadline exceeded | Timeout budgets and uncertain execution outcomes |
| HTTP 429 | Traffic limit applied | Quota scope, concurrency and workload demand |
| Policy service unavailable | Authorization decision cannot be established | Fail-closed behavior and policy dependency health |
| Streaming interruption | Incomplete response or lost connection | Proxy buffering, idle timeouts and supported resumption |
| Session inconsistency | Request reaches an incompatible session context | State placement, session routing and lifecycle |
High availability must not become a security bypass
A backup gateway must enforce equivalent authorization and security requirements. Failover does not guarantee that an in-flight MCP session or consequential operation can be safely replayed.
Timeouts, retries and uncertain side effects
Distributed systems cannot always determine whether a timed-out operation completed successfully. A lost response does not necessarily mean that the downstream operation failed.
Idempotency
Where supported, design consequential operations with backend-enforced idempotency and stable operation references.
Outcome reconciliation
Verify the authoritative backend state before repeating an operation whose original outcome remains uncertain.
Retry budgets
Use bounded retries, appropriate backoff and workload-specific retry policies to avoid amplifying service failures.
Cancellation semantics
A cancellation request does not necessarily reverse a side effect that has already occurred.
JSON-RPC request IDs are not idempotency keys
Request identifiers correlate protocol requests and responses. They do not automatically provide durable duplicate suppression or exactly-once execution.
Determining the incident blast radius
Blast radius describes the scope of resources, identities, workloads and business processes potentially affected by a failure or security incident.
| Investigation dimension | Evidence required |
|---|---|
| Identity scope | Affected users, clients and workload principals |
| Capability scope | Exposed tools, schemas and authorization boundaries |
| Resource scope | Accessible APIs, data platforms and infrastructure |
| Tenant scope | Potential cross-tenant access or isolation failure |
| Temporal scope | Earliest relevant evidence and last confirmed activity |
| Data exposure | Data classifications and verified destination evidence |
| Business impact | Confirmed service disruption or unauthorized changes |
Potential exposure is not confirmed impact
Separate what an affected identity or workload could access from what evidence demonstrates was actually accessed, modified or transferred.
MCP security incident investigation laboratory
Select a synthetic production incident. Examine the affected architectural boundary, reveal investigation evidence, apply the modeled containment action and validate the recovery conditions.
AUTHENTICATION REJECTION
The modeled gateway rejected an invalid token.
Investigation objective
Recommended containment
Recovery conditions
Historical impact
Initializing incident...
All scenarios, priorities, evidence and recovery outcomes are synthetic. Buttons change the educational simulation only. They do not modify real identities, servers, gateways or enterprise resources.
From incident detection to verified recovery
Enterprise incident response is a coordinated operational capability involving engineering, security, application ownership, governance and business stakeholders.
Preparation
Maintain inventories, emergency access procedures, telemetry, escalation paths and tested response runbooks.
Detection
Identify suspicious activity, service failures and deviations from approved operational behavior.
Investigation
Correlate evidence, determine affected boundaries and distinguish suspected from confirmed consequences.
Containment
Restrict affected capabilities, identities and network paths through authorized incident response procedures.
Eradication and recovery
Remove the underlying cause, restore trusted components and verify the effectiveness of security controls.
Continuous improvement
Document lessons, improve detection, strengthen architecture and validate the resulting corrective actions.
Restoring trust before restoring traffic
Recovery should not simply return a failed component to service. It should establish that the restored architecture satisfies the required identity, authorization, execution and evidence controls.
Recovery requires negative security tests
Demonstrate that approved operations succeed and prohibited operations remain blocked. Successful health probes alone do not establish that authorization boundaries have been restored.
Collecting production troubleshooting evidence
The following examples illustrate basic read-only diagnostic operations for authorized engineering environments. Replace documentation hostnames and resource identifiers with approved targets.
dig mcp.example.com openssl s_client \ -connect mcp.example.com:443 \ -servername mcp.example.com \ -verify_hostname mcp.example.com \ -verify_return_error \ < /dev/null
curl --max-time 10 \ -sS -D - -o /dev/null \ -H 'Accept: text/event-stream' \ https://mcp.example.com/mcp
Depending on the endpoint and its configuration, an unauthenticated GET request may return an authentication challenge, method rejection or another transport-specific response. This test does not establish a complete MCP session.
kubectl get pods -n mcp-platform kubectl get deployments -n mcp-platform kubectl get services -n mcp-platform kubectl get events -n mcp-platform \ --sort-by=.metadata.creationTimestamp kubectl logs -n mcp-platform \ deployment/mcp-gateway \ --since=15m \ --tail=200
let incidentTrace =
"4bf92f3577b34da6a3ce929d0e0e4736";
union
(
AppRequests
| project TimeGenerated,
OperationId,
Name,
Success,
DurationMs,
Signal = "Request"
),
(
AppDependencies
| project TimeGenerated,
OperationId,
Name,
Success,
DurationMs,
Signal = "Dependency"
)
| where TimeGenerated > ago(24h)
| where OperationId == incidentTrace
| order by TimeGenerated asc
Protect diagnostic evidence
Headers, application logs and infrastructure diagnostics may contain sensitive information. Use approved collection procedures, restrict evidence access and avoid exposing credentials or unnecessary production data.
The enterprise MCP engineering checklist
Bringing the complete MCP security architecture together
Secure enterprise MCP infrastructure is not established by a single gateway, identity provider or security policy. It emerges from the coordinated operation of multiple independently enforced controls.
Protocol architecture
Understand hosts, clients, servers, transports, capabilities and message lifecycle behavior.
Threat modeling
Identify attack surfaces, trust boundaries and unintended authority relationships.
Identity architecture
Establish authenticated principals, resource-bound access and controlled delegation.
Gateway engineering
Centralize appropriate governance, routing and policy enforcement.
Tool authorization
Enforce least privilege at the actual capability and resource boundary.
Secure execution
Treat model output as untrusted input and independently authorize operations.
Cloud-native infrastructure
Establish workload isolation, controlled connectivity and resilient deployment.
Observability and governance
Produce trustworthy operational evidence, security accountability and lifecycle controls.
Production security operations
Investigate failures, contain incidents, restore trust and continuously improve.
A secure AI agent is not defined by what it intends to do, but by what the surrounding architecture permits it to execute.
Model Context Protocol provides a standardized foundation for connecting AI applications with external capabilities. Enterprise security depends on independently enforced identity, authorization, workload isolation, trustworthy evidence and resilient operational engineering.
Specifications and further reading
Official Model Context Protocol Specification
RFC 9700 — OAuth 2.0 Security Best Current Practice
NIST SP 800-61 Rev. 3 — Incident Response Recommendations
NIST SP 800-207 — Zero Trust Architecture
All architecture diagrams, incident scenarios, security records and recovery outcomes are educational examples. Validate operational procedures against current specifications, platform documentation and approved organizational incident response policies.
MCP Security Incident
Investigation Simulator
Enter an enterprise AI security operations centre. Investigate production MCP incidents, correlate distributed evidence, identify root causes, contain compromised infrastructure and validate secure service recovery.
Select an infrastructure component to inspect its security responsibilities and trust boundary.
Security Command Centre Ready
Launch a production incident to begin your investigation. Collect evidence, identify the primary failure, apply appropriate response controls and validate secure service recovery.
Evidence Before Assumptions
A security alert identifies a condition requiring investigation. Correlate identity, gateway, workload and application evidence before declaring a definitive root cause.
Containment Versus Remediation
Containment limits ongoing impact. Remediation removes the underlying failure. Neither alone proves that production services can safely return to operation.
Credential Lifecycle Security
Revocation and credential rotation address different risks. Existing access tokens may remain usable until expiry unless resource servers enforce an effective invalidation mechanism.
Independent Authorization
Gateway policy enforcement does not remove the need for MCP server and downstream resource authorization. Each boundary must enforce its own trust requirements.
Preserve Security Evidence
Incident responders should preserve relevant logs, workload metadata and forensic evidence before destructive remediation whenever operational circumstances permit.
Validated Production Recovery
A healthy endpoint is not sufficient evidence of secure recovery. Validate identity, authorization, data protection, service availability and monitoring before closure.
- GPU Storage, NVMe-oF and GPUDirect Storage Explained - November 26, 2026
- MCP Security and Gateway Engineering Explained - November 26, 2026
- AI Agent Identity and Authorization Architecture Explained - November 25, 2026
