MCP Security Best Practices: Infrastructure-Layer Governance for Enterprise AI
TL;DR: MCP’s specification leaves security out, so application teams end up building inconsistent authentication, authorization, and data protection one implementation at a time. The fix is to move enforcement into a gateway: a single control point that authenticates every client with OAuth 2.1 with PKCE (Proof Key for Code Exchange), authorizes every request against a hierarchical policy, filters sensitive data out of every context exchange, and logs every operation for audit. This guide covers the risks a gateway has to stop (prompt injection, tool poisoning, confused deputy, supply chain tampering), the controls that stop them, and the five signals that tell you whether your MCP governance is actually working in production.
The MCP security challenge: why application-layer governance fails
The Model Context Protocol’s design philosophy prioritizes simplicity and flexibility, deliberately omitting security mechanisms from the core specification. This decision places the entire burden of security implementation on application developers and operators. In practice, this approach creates several critical vulnerabilities that become apparent as organizations scale their MCP deployments.
Application-layer security implementation suffers from fundamental inconsistency. When each development team implements their own authentication and authorization logic for MCP connections, the result is a patchwork of security controls with varying levels of rigor and completeness. One team might implement complete OAuth 2.0 flows with proper token validation, while another relies on simple API keys stored in environment variables. This inconsistency makes it impossible to establish organization-wide security baselines or conduct meaningful security audits.
This pattern, where security responsibilities are pushed to application developers who then implement inconsistent, often inadequate controls, is what we call the import-and-hope pattern. Organizations import MCP capabilities into their applications and hope that developers will implement security correctly. They hope configurations won’t drift over time and that no critical vulnerabilities will emerge from the fragmented security landscape. This hope-based approach to security governance inevitably fails at scale.
The fundamental problem is clear: governance belongs in the infrastructure layer. When security controls are scattered across application implementations, they cannot provide the consistent, auditable, and scalable protection that enterprise deployments require. The distributed nature of MCP implementations compounds this problem. In a typical enterprise deployment, MCP servers might be developed by different teams, using different programming languages and frameworks, and deployed across various environments. Each implementation becomes a potential security weak point. A single poorly secured MCP server can expose sensitive data or provide unauthorized access to critical systems, regardless of how well other components are secured.
What specifically goes wrong: the named MCP attack surface
Application-layer governance fails against a specific, now well-documented set of attacks that every MCP deployment should assume an attacker will try. The same risks recur across industry guidance, including the Open Worldwide Application Security Project’s (OWASP) Gen AI Security Project and the Cloud Security Alliance:
- Tool poisoning and tool shadowing. A malicious or compromised MCP server registers a tool with a legitimate-looking name and description, then returns instructions or data designed to manipulate the calling AI model. Tool shadowing is the related case where a second, malicious tool definition overrides or impersonates a trusted one inside the same client.
- Rug pull attacks. A tool behaves safely during evaluation and review, then changes behavior after approval, exploiting the fact that many organizations approve a tool once and rarely re-verify it.
- The confused deputy problem. An MCP proxy or gateway using a static client ID with dynamic client registration can be tricked into granting an attacker’s client the same trust as a legitimate one, because the server cannot distinguish between them.
- Prompt injection through tool outputs. Content returned by a tool, a document, a database row, an API response, can contain instructions that the AI model interprets as commands rather than data, a risk that is invisible to controls that only check the request, not the response.
- Excessive permissions and token passthrough. An MCP server that accepts a client’s access token and forwards it unchanged to a downstream API inherits every scope on that token, not just the scopes the MCP operation actually needs.
- Supply chain tampering. An MCP server package, binary, or dependency is altered after publication, a risk application-layer deployments rarely check for because no single team owns verification across every server in use.
Each of these is an infrastructure-layer problem with an infrastructure-layer fix, covered in the sections below: gateway-based enforcement stops tool poisoning and shadowing, strict authentication defeats the confused deputy problem, policy-driven data filtering catches prompt injection in tool outputs, scoped per-server tokens contain passthrough, and centralized audit logging with server inventory addresses supply chain tampering. See also the dedicated MCP audit logging guide for the forensic detail behind signal 5 below, plus the MCP supply chain guide for the full server-vetting and software bill of materials (SBOM) treatment.
The context leakage problem
MCP’s core function, exchanging context between AI systems and data sources, creates unique data protection challenges. Context often contains sensitive information: customer data, proprietary business logic, personally identifiable information (PII), or confidential documents. Traditional security controls focus on protecting data at rest and in transit, but MCP introduces a new concern: context in use.
When an AI system requests context from multiple sources to answer a query, that context flows through the MCP connection and into the AI model’s processing pipeline. Without proper controls, sensitive data from one context source might inadvertently influence responses that should be restricted to users without appropriate access. This context leakage can occur even when individual MCP servers implement access controls correctly, because the AI system itself becomes a mixing point for data from multiple security domains.
Scale and operational complexity
As organizations deploy more MCP-enabled applications, the operational burden of application-layer security becomes unsustainable. Consider an enterprise with fifty different AI applications, each connecting to an average of ten MCP servers. This creates five hundred individual security relationships that must be configured, monitored, and maintained. Each connection requires credential management, access policy definition, audit logging configuration, and ongoing security updates.
Application developers, focused primarily on delivering AI functionality, often lack the specialized security expertise required to implement these controls correctly. Security teams, meanwhile, struggle to maintain visibility into the sprawling landscape of MCP connections. The result is security debt that accumulates faster than it can be addressed, creating an ever-expanding attack surface.
The compliance gap
Regulatory frameworks and audit standards like GDPR and HIPAA, along with the SOC 2 attestation standard, require organizations to demonstrate consistent security controls across their data processing systems. Application-layer MCP security makes compliance demonstration nearly impossible. How can an organization prove that all MCP connections properly enforce data residency requirements? How can auditors verify that access controls are consistently applied across dozens of independently developed MCP servers?
This compliance gap is a practical barrier to production deployment. Organizations that cannot demonstrate adequate security controls for their MCP implementations face regulatory risk, potential fines, and restrictions on how they can deploy AI capabilities. The solution requires moving security enforcement from the application layer to the infrastructure layer, where it can be consistently applied, centrally managed, and systematically audited.
MCP security through gateway-based enforcement
Infrastructure-layer security for MCP begins with establishing a centralized control point: the API gateway. By routing all MCP traffic through a gateway layer, organizations can enforce security policies consistently across all connections, regardless of how individual applications or MCP servers are implemented. This architectural pattern moves MCP security from a distributed application problem into a manageable infrastructure concern.
The gateway acts as a policy enforcement point that sits between AI applications (MCP clients) and context providers (MCP servers). Every MCP request passes through this gateway, where it undergoes authentication, authorization, data filtering, and logging before reaching its destination. This centralized enforcement ensures that security policies apply uniformly, eliminating the inconsistency inherent in application-layer approaches.
The difference in enforcement consistency is stark, and easier to see as a direct comparison:
| Enforcement point | Policy application rate | What causes the gap |
|---|---|---|
| Infrastructure layer (gateway) | 100% of MCP connections | No gap. Every connection passes through one control point |
| Application layer (per-team implementation) | 85-90% of MCP connections | Configuration drift, developer oversight, inconsistent deployment across teams |
That 10-15 percentage point gap is not a rounding error. On an enterprise running hundreds of MCP connections, it is the exact set of connections where a security incident is most likely to originate, because no one applied the policy consistently in the first place.
Gateway architecture for MCP
An effective MCP security gateway implements several key capabilities. First, it must understand the MCP protocol itself, parsing requests to extract relevant security context: which client is making the request, which server and resource are being accessed, what operations are being performed, and what data is being exchanged. This protocol awareness enables fine-grained policy enforcement that goes beyond simple network-level controls.
The gateway maintains a registry of all MCP servers in the environment, along with their security requirements and capabilities. When a client attempts to connect to an MCP server, the gateway validates that the connection is permitted, that the client has appropriate credentials, and that the requested operations comply with organizational policies. This registry-based approach stores every MCP security configuration in one central registry, eliminating the configuration drift that plagues distributed systems.
Modern gateway implementations use service mesh technology to provide transparent MCP security without requiring changes to existing applications. The gateway can be deployed as a sidecar proxy alongside each MCP client and server, intercepting MCP traffic at the network layer. This transparent interception means that security policies can be applied to existing MCP implementations without code changes, dramatically reducing the friction of security adoption.
Dynamic policy enforcement
Gateway-based enforcement enables dynamic security policies that adapt to changing conditions. Rather than hardcoding security rules into individual applications, policies are defined centrally and evaluated at runtime based on current context. For example, a policy might restrict access to sensitive MCP resources during off-hours, require additional authentication for requests originating from untrusted networks, or automatically rate-limit clients that exhibit suspicious behavior.
These dynamic policies can incorporate signals from multiple sources: identity providers, threat intelligence feeds, compliance databases, and runtime behavior analysis. When a security event occurs, such as a compromised credential being detected, the gateway can immediately enforce updated policies across all MCP connections, providing organization-wide protection in seconds rather than the days or weeks required to update individual applications.
Observability and audit
The gateway’s position as a central control point makes it an ideal location for comprehensive observability. Every MCP request generates structured logs that capture security-relevant details: authenticated identity, requested resources, operations performed, data volumes exchanged, and policy decisions made. These logs provide the audit trail required for compliance demonstration and security investigation. See the MCP audit logging guide for the full forensic log schema and retention guidance.
Beyond simple logging, the gateway can aggregate metrics that reveal security patterns across the entire MCP deployment. Unusual access patterns, failed authentication attempts, policy violations, and performance anomalies become visible at the infrastructure level, enabling security teams to detect and respond to threats before they impact production systems. This observability moves MCP security from a reactive, incident-driven process into a proactive, data-driven discipline.
Authentication and authorization at the gateway
Effective MCP security requires strong authentication to verify client identity and authorization to control resource access. Gateway-based enforcement provides a natural point to implement these controls consistently across all MCP connections, integrating with enterprise identity systems and centralized policy engines.
Identity-aware MCP connections
Authentication at the gateway begins with establishing strong client identity. Rather than relying on simple API keys or shared secrets, gateway-based authentication integrates with enterprise identity providers using standard protocols. The current baseline for remote MCP connections is OAuth 2.1 with PKCE (Proof Key for Code Exchange), which closes a specific gap in OAuth 2.0: it stops an attacker who intercepts an authorization code from exchanging it for a token, because the exchange also requires a secret the client generated itself. Four mechanisms matter most for MCP specifically:
- OAuth 2.1 with PKCE as the default for every remote MCP server, replacing static credentials or long-lived personal access tokens.
- Token audience validation on every request: the gateway rejects any token whose audience claim does not explicitly name the MCP server being called, which stops a token issued for one server from being replayed against another.
- No token passthrough: the gateway never accepts a client’s access token and forwards it unchanged to a downstream API. It issues a dedicated, scoped token per MCP server instead, so a compromised downstream credential cannot be traced back to over-broad client permissions.
- Per-client consent with exact redirect URI validation for any MCP proxy using dynamic client registration, which is the specific control that defeats the confused deputy problem named above.
Each MCP client obtains credentials from the identity provider and presents them to the gateway with each request.
This identity-aware approach enables several critical security capabilities. First, it provides accountability: every MCP request can be attributed to a specific user, service account, or application. This attribution is essential for audit logging, security investigation, and compliance demonstration. Second, it enables fine-grained access control based on identity attributes: a user’s role, group membership, department, or clearance level can all inform authorization decisions.
The gateway validates credentials on every request, checking that tokens are current, properly signed, and issued by trusted identity providers. Expired or revoked credentials are rejected immediately, preventing unauthorized access even if credentials are compromised. This continuous validation provides much stronger security than application-layer approaches that might cache credentials or skip validation checks for performance reasons.
Fine-grained authorization policies
Authentication establishes who is making a request. Authorization determines what they are allowed to do. Gateway-based authorization for MCP implements policies that control access at multiple levels of granularity. At the coarsest level, policies might specify which clients can connect to which MCP servers. More fine-grained policies control access to specific resources, tools, or prompts within an MCP server.
Authorization policies draw on the rich context available at the gateway: client identity, requested resource, operation type, time of day, network location, and historical behavior. A policy might allow a data science team to access analytical MCP resources during business hours from corporate networks, while restricting access to production data resources to specific service accounts with additional authentication requirements.
Attribute-based access control
Attribute-Based Access Control (ABAC) provides the flexibility required for complex MCP security scenarios. Rather than maintaining static access control lists, ABAC policies evaluate attributes of the request, the client, the resource, and the environment to make authorization decisions dynamically. This approach scales naturally as the number of MCP resources and clients grows.
For example, an ABAC policy might grant access to customer data MCP resources only when the client identity has the “customer-support” role, the request originates from an approved network, the requested customer record matches the client’s assigned region, and no active security incidents affect the client’s account. This multi-factor authorization provides defense in depth, ensuring that compromising a single credential or control does not grant unrestricted access.
Service-to-service authentication
Many MCP connections occur between services rather than human users. Service-to-service authentication requires different approaches than user authentication, typically using workload identity, service accounts, or certificate-based authentication. The gateway must support these patterns while maintaining the same level of security rigor.
Workload identity systems, such as SPIFFE/SPIRE, provide cryptographically verifiable identities for services based on their runtime environment and deployment context. The gateway can validate these identities and make authorization decisions based on service attributes: which team owns the service, what environment it runs in, what data classification it is approved to access. This approach provides strong authentication without requiring services to manage long-lived credentials or secrets.
Token management and rotation
The gateway can implement sophisticated token management strategies that balance security and operational simplicity. Short-lived access tokens minimize the window of vulnerability if credentials are compromised, while refresh tokens enable long-running MCP connections without requiring frequent re-authentication. The gateway handles token refresh transparently, presenting a simple interface to MCP clients while enforcing security best practices behind the scenes.
Automatic credential rotation further strengthens security by regularly updating the cryptographic material used for authentication. The gateway coordinates rotation across all MCP connections, ensuring that new credentials are distributed and validated before old credentials expire. This automation eliminates the operational burden and error-prone manual processes that often lead to security incidents in production systems.
Global policy with local context: scalable MCP governance
Enterprise MCP deployments span multiple teams, environments, and geographic regions, each with distinct security requirements. Effective governance requires balancing global security standards with local flexibility, enabling teams to move quickly while maintaining organization-wide compliance. Governance should live in the infrastructure layer, and gateway-based enforcement provides the infrastructure to implement this balance through hierarchical policy management. The management plane sets the global baseline once, and each data plane enforces it locally, so a regional team can add stricter rules without weakening the organization-wide baseline. For the organizational side of this model, including tenant boundaries and approval tiers, see MCP for enterprise.
Hierarchical policy architecture
A scalable MCP governance model implements policies at multiple levels of the organizational hierarchy. Global policies, defined by central security teams, establish baseline security requirements that apply to all MCP connections: minimum authentication strength, required audit logging, prohibited operations, and compliance controls. These global policies ensure consistent security posture across the organization.
Divisional or team-level policies layer additional requirements on top of global policies, addressing specific security needs without requiring changes to the global baseline. A healthcare division might add policies enforcing HIPAA compliance for MCP connections accessing patient data. A financial services team might implement additional authentication requirements for connections to trading systems. These local policies inherit and extend global policies rather than replacing them, ensuring that baseline security is never compromised.
Project or application-level policies provide the finest-grained control, enabling teams to implement specific security requirements for individual MCP deployments. These policies might define which specific users can access particular MCP resources, implement custom data filtering rules, or establish rate limits for specific use cases. The hierarchical model ensures that these application-specific policies cannot weaken the security guarantees provided by higher-level policies.
Policy composition and inheritance
The gateway’s policy engine evaluates all applicable policies when making authorization decisions, combining global, divisional, and application-level rules into a single effective policy. This composition happens transparently, without requiring policy authors to understand the complete policy hierarchy. Teams can focus on their specific requirements, confident that global security standards are automatically enforced.
Policy inheritance follows clear precedence rules that prevent conflicts and ensure predictable behavior. More specific policies override general policies, but only in ways that strengthen security, never weaken it. A local policy can add additional authentication requirements or restrict access further, but cannot remove global restrictions or bypass mandatory controls. This “security ratchet” ensures that governance becomes progressively stronger as policies are layered, never weaker.
Context-aware policy evaluation
Effective MCP governance requires policies that adapt to local context while maintaining global standards. The gateway evaluates policies using rich contextual information: the requesting client’s identity and attributes, the target MCP server and resource, the operation being performed, the current time and network location, and historical behavior patterns. This context enables policies to make nuanced decisions that balance security and usability.
For example, a global policy might require multi-factor authentication for all MCP connections to production systems. A divisional policy could relax this requirement for connections originating from secure development environments during business hours, while maintaining strict enforcement for remote access or off-hours requests. This context-aware approach provides strong security without imposing unnecessary friction on legitimate workflows.
Distributed policy enforcement
In large-scale deployments, MCP connections may span multiple data centers, cloud regions, or geographic locations. The gateway architecture must support distributed policy enforcement while maintaining consistent security decisions across all locations. This requires careful design to balance local autonomy with global consistency.
Policy distribution mechanisms ensure that all gateway instances have current policy definitions, typically using a combination of centralized policy repositories and local caching. When policies change, updates propagate to all enforcement points within seconds, ensuring that security decisions reflect current requirements. This rapid propagation enables organizations to respond quickly to security incidents or compliance changes, updating policies across thousands of MCP connections simultaneously.
Audit and compliance reporting
Hierarchical policy management generates rich audit data that demonstrates compliance at multiple organizational levels. Global security teams can verify that baseline security requirements are enforced across all MCP connections. Divisional compliance officers can demonstrate that their specific regulatory requirements are met. Application teams can prove that their deployments comply with all applicable policies.
The gateway aggregates policy decisions and generates compliance reports that map to specific regulatory frameworks or security standards. These reports provide the evidence required for audits, certifications, and regulatory filings, transforming compliance from a manual, error-prone process into an automated capability built into the infrastructure. This automation dramatically reduces the operational burden of compliance while improving accuracy and completeness.
Data protection and PII filtering for context exchange
MCP’s fundamental purpose, exchanging context between AI systems and data sources, creates unique data protection challenges. Context often contains sensitive information that must be protected according to regulatory requirements, contractual obligations, or organizational policies. Gateway-based data protection provides systematic controls that prevent unauthorized data exposure while preserving the utility of context for AI applications.
Understanding context data flows
Effective data protection begins with understanding how data flows through MCP connections. When an AI application requests context, the MCP server retrieves relevant information from its data sources and returns it through the protocol. This context might include database records, document contents, API responses, or computed results. Each piece of context potentially contains sensitive data that requires protection.
The gateway’s position in the data flow enables it to inspect and filter context before it reaches the AI application. This inspection happens transparently, without requiring changes to MCP clients or servers. The gateway can identify sensitive data patterns, apply filtering rules, and transform context to remove or redact information that should not be exposed to the requesting client.
Pattern-based data detection
Data protection policies leverage pattern matching to identify sensitive information in context. Regular expressions and pattern libraries detect common sensitive data types: social security numbers, credit card numbers, email addresses, phone numbers, IP addresses, and other personally identifiable information. When the gateway detects these patterns in MCP responses, it can apply appropriate protection measures based on policy.
Advanced detection goes beyond simple pattern matching to understand semantic content. Natural language processing techniques identify sensitive topics, confidential business information, or regulated data types based on context and meaning rather than just format. This semantic detection catches sensitive information that might not match predefined patterns, providing more comprehensive protection.
Dynamic data redaction and masking
When sensitive data is detected, the gateway can apply various protection techniques based on policy requirements and use case needs. Complete redaction removes sensitive information entirely, replacing it with a placeholder or removing it from the response. This approach provides maximum protection but may reduce the utility of context for AI applications.
Data masking preserves the structure and format of sensitive information while obscuring the actual values. For example, a credit card number might be masked to show only the last four digits, or an email address might be replaced with a hash that preserves uniqueness without revealing the actual address. Masking enables AI applications to reason about data relationships and patterns without exposing sensitive values.
Tokenization replaces sensitive data with random tokens that can be mapped back to original values through a secure tokenization service. This approach enables AI applications to work with consistent identifiers across multiple contexts while preventing exposure of actual sensitive data. The gateway manages token generation and mapping, ensuring that tokens are used consistently and that original values remain protected.
Context-aware data protection
Data protection policies must consider the context of each request to make appropriate protection decisions. The same piece of information might require different protection levels depending on who is requesting it, why they need it, and how it will be used. The gateway evaluates multiple factors when applying data protection: client identity and authorization level, the purpose of the request, the sensitivity classification of the data, and applicable regulatory requirements.
For example, customer service representatives might receive full access to customer contact information through MCP connections, while marketing applications receive only aggregated or anonymized data. A data science team might access detailed transaction records for model training, but with all personally identifiable information removed. These context-aware protections ensure that data exposure is limited to what is necessary for each specific use case.
Compliance-driven data handling
Regulatory frameworks impose specific requirements for handling sensitive data. GDPR requires minimizing personal data processing and implementing appropriate technical measures to protect it. HIPAA mandates specific safeguards for protected health information. PCI DSS restricts how payment card data can be stored and transmitted. The gateway implements these compliance requirements through policy-driven data protection.
Compliance policies can enforce data residency requirements, ensuring that context containing regulated data never leaves approved geographic regions. They can implement retention limits, automatically purging sensitive data from logs and caches after specified periods. They can enforce encryption requirements, ensuring that sensitive context is always protected in transit and at rest. These automated compliance controls reduce the burden on development teams while ensuring consistent adherence to regulatory requirements.
Data loss prevention integration
The gateway can integrate with enterprise Data Loss Prevention (DLP) systems to leverage existing data classification and protection policies. When DLP systems have already classified data sources and defined protection requirements, the gateway applies these same policies to MCP context exchanges. This integration ensures consistent data protection across all enterprise systems, not just MCP connections.
DLP integration also enables the gateway to learn from organizational data protection patterns. As security teams refine DLP policies based on incidents and audits, those improvements automatically apply to MCP data protection. This continuous improvement ensures that MCP security evolves with the organization’s overall security posture.
The five golden signals of MCP governance
Effective MCP governance requires continuous monitoring and measurement. Drawing inspiration from site reliability engineering practices and adapting the framework from the Golden Signals of AI Governance, we can identify five critical signals that indicate the health and security of MCP deployments. These golden signals provide the observability foundation for detecting issues, measuring compliance, and continuously improving security posture.
Note: This represents an MCP-specific adaptation of the original Golden Signals framework, tailored to the unique characteristics of Model Context Protocol deployments while maintaining alignment with broader AI governance principles.
The five signals at a glance:
| Signal | What it measures | Healthy range | Warning sign |
|---|---|---|---|
| 1. Policy violation rate | Frequency of operations that violate governance policy | Low and stable, occasional edge cases only | Sudden spike (misconfiguration or attack) or steady drift (policy no longer matches real usage) |
| 2. Model routing compliance | Whether requests route to approved models per policy | High adherence to defined routing rules | Low compliance, or repeated attempts to reach more capable but non-compliant models |
| 3. Latency distribution | End-to-end MCP operation response time | Low and stable for the operation mix in scope, with p50 and p99 tracked against your own baseline | Rising latency, especially concentrated in one policy type or MCP server |
| 4. Token cost by service, team, and model | Financial impact of MCP operations, broken down by owner | Cost aligned with business value delivered per team | Sudden spikes (runaway process) or gradual creep (scope creep, no cost awareness) |
| 5. Audit log completeness | Whether every MCP operation generates a retained, sufficiently detailed audit record | Complete, with every operation logged | Any gap. Treat every gap as an immediate investigation, one that jumps the normal backlog |
Signal 1: policy violation rate
The policy violation rate measures the frequency of attempted operations that violate defined governance policies. This metric provides immediate visibility into how well MCP deployments align with organizational security and compliance requirements. A healthy MCP deployment typically maintains a low policy violation rate, with violations representing only occasional misconfigurations or legitimate edge cases requiring policy refinement.
Sudden spikes in policy violation rate indicate serious problems. A widespread increase might signal a misconfigured application attempting unauthorized operations, a policy change that is too restrictive for legitimate use cases, or an actual attack attempt. Gradual increases might indicate policy drift, where applications evolve in ways that conflict with governance requirements, or inadequate training on policy expectations.
Monitoring policy violations by type, source, and target provides deeper insights. Which policies are most frequently violated? Are violations concentrated among specific applications or teams? Do certain MCP resources generate more violations than others? This granular monitoring enables targeted remediation, whether through policy refinement, application fixes, or additional training, rather than broad troubleshooting.
Signal 2: model routing compliance
Model routing compliance tracks whether MCP connections are directing requests to approved AI models and services according to defined routing policies. Organizations often establish policies that specify which models should be used for different types of requests based on cost, performance, data sensitivity, or compliance requirements. This signal measures adherence to those routing policies.
High model routing compliance indicates that governance policies are effectively guiding AI model selection. Low compliance might indicate that routing policies are too restrictive, poorly communicated, or not aligned with actual use case requirements. It could also reveal applications attempting to bypass routing controls to access more capable (but more expensive or less compliant) models.
Analyzing routing compliance patterns reveals optimization opportunities. Are certain teams consistently routing to more expensive models when cheaper alternatives would suffice? Are high-security workloads being processed by models that lack appropriate compliance certifications? This visibility enables both cost optimization and risk reduction through better model selection governance.
Signal 3: latency distribution
Latency distribution measures the end-to-end response time for MCP operations, from initial request through policy evaluation, context retrieval, and response delivery. This operational metric directly impacts user experience and system performance. While security and governance are paramount, controls that add excessive latency can drive teams to seek workarounds or bypass controls entirely.
Healthy MCP governance maintains latency distributions with p50 (median) below 100 milliseconds and p99 (99th percentile) below 500 milliseconds for most operations. Latency spikes might indicate policy complexity issues, resource constraints in the gateway infrastructure, problems with MCP servers, or issues with external systems that policies depend on (identity providers, policy engines, data classification services).
Monitoring latency by operation type, policy complexity, and MCP server helps identify optimization opportunities. Simple operations (retrieving cached context) should execute in single-digit milliseconds. Complex operations (evaluating multiple contextual factors and retrieving fresh data) might take longer but should still remain within acceptable bounds. Identifying slow operations enables targeted optimization efforts.
Signal 4: token cost by service, team, and model
Token cost tracking measures the financial impact of MCP operations, broken down by service, team, and AI model. As organizations scale their AI deployments, token costs can become significant. This signal provides visibility into cost drivers and enables cost optimization through better resource allocation and model selection.
Monitoring token costs by team reveals which parts of the organization are driving AI spending and whether costs align with business value delivered. Tracking costs by model shows whether expensive, high-capability models are being used appropriately or whether cheaper alternatives could serve many use cases. Service-level cost tracking identifies which MCP-enabled applications are most cost-intensive.
Cost anomalies often indicate problems beyond just budget concerns. Sudden cost spikes might reveal runaway processes, inefficient context retrieval patterns, or inappropriate model selection. Gradual cost increases might indicate scope creep or lack of cost awareness among development teams. This financial signal thus serves double duty as both a cost management tool and an operational health indicator.
Signal 5: audit log completeness
Audit log completeness measures whether comprehensive audit trails are being generated and retained for all MCP operations. Complete audit logs are essential for compliance demonstration, security investigations, and operational troubleshooting. This signal tracks not just whether logs are being generated, but whether they contain sufficient detail and are being properly retained.
High audit log completeness indicates that the organization can demonstrate compliance and investigate incidents effectively. Gaps in audit logs represent blind spots where security events might go undetected or where compliance cannot be proven. This metric should approach 100% for production MCP deployments, with any gaps triggering immediate investigation.
Monitoring log completeness by operation type and MCP server identifies potential logging gaps. Are certain operations not being logged? Are specific MCP servers failing to generate required audit events? Is log retention working correctly across all storage systems? This visibility ensures that audit capabilities remain comprehensive as MCP deployments evolve.
Implementing golden signal monitoring
Effective monitoring requires collecting these signals continuously, storing them in a time-series database, and visualizing them through dashboards that enable rapid problem detection. Alerting rules trigger notifications when signals deviate from expected ranges, enabling proactive response to security and operational issues. Over time, historical signal data reveals trends and patterns that inform strategic improvements to MCP governance.
From prototype to production: enterprise compliance for MCP
Moving MCP implementations from experimental prototypes to production systems requires addressing enterprise compliance requirements systematically. This transition requires technical security controls. It also requires organizational processes, documentation, and governance structures that demonstrate security and compliance to auditors and regulators.
The production readiness gap
Most MCP implementations begin as prototypes or proofs of concept, where security is often minimal or absent. Developers focus on demonstrating functionality and value, deferring security concerns for later. This approach works for experimentation, but it creates a significant gap when organizations attempt to move these implementations to production. The FINOS AI Governance Framework calls this “Tier 3”, the tier where promising technologies stall because they lack the production-grade security and compliance controls enterprise deployment requires.
The production readiness gap encompasses multiple dimensions. Technical security controls must be implemented and validated. Operational processes for credential management, incident response, and change management must be established. Documentation must be created to support audits and compliance assessments. Risk assessments must be conducted and accepted by appropriate stakeholders. Bridging this gap requires systematic effort across multiple organizational functions.
Establishing security baselines
Production MCP deployments require clearly defined security baselines that specify minimum requirements for all implementations. These baselines address authentication mechanisms, authorization policies, data protection controls, audit logging, encryption, and monitoring. The gateway-based enforcement model makes implementing these baselines straightforward: configure the gateway to enforce baseline requirements, and all MCP connections automatically comply.
Security baselines should be documented in a security control framework that maps to recognized standards like the FINOS AI Governance Framework, NIST Cybersecurity Framework, ISO 27001, or SOC 2 trust service criteria. This mapping demonstrates to auditors that MCP security controls address standard security requirements, simplifying compliance assessments. The framework should specify not just what controls are required but how they are implemented, tested, and monitored.
Risk assessment and acceptance
Production deployment requires formal risk assessment that identifies potential security threats to MCP implementations and evaluates their likelihood and impact. This assessment should consider various threat scenarios: unauthorized access to sensitive data, credential compromise, denial of service attacks, data exfiltration, and compliance violations. For each identified risk, the assessment documents existing controls, residual risk, and risk acceptance decisions.
Risk acceptance involves senior stakeholders who understand the business value of MCP implementations and can make informed decisions about acceptable risk levels. Some risks may be accepted as-is if they are low probability or low impact. Others may require additional controls or compensating measures before production deployment. The risk assessment process ensures that security decisions are made deliberately and documented clearly.
Audit logging and forensics
Compliance frameworks universally require comprehensive audit logging that captures security-relevant events and enables forensic investigation. The gateway’s centralized position makes it ideal for generating complete audit logs of all MCP activity. These logs must capture sufficient detail to answer key forensic questions: Who accessed what data? When did access occur? What operations were performed? Were access controls properly enforced?
Audit logs must be protected from tampering and retained according to compliance requirements. This typically involves writing logs to immutable storage, implementing cryptographic integrity protection, and establishing retention policies that balance compliance requirements with storage costs. Log analysis tools enable security teams to search logs, identify patterns, and investigate incidents efficiently.
Change management and version control
Production MCP deployments require rigorous change management processes that ensure security controls remain effective as systems evolve. Changes to MCP servers, clients, gateway configurations, or security policies must be reviewed, tested, and approved before deployment. Version control systems track all changes, enabling rollback if problems occur and providing audit trails of system evolution.
Automated testing validates that changes do not introduce security regressions. Security tests verify that authentication still works correctly, authorization policies are enforced as expected, and data protection controls function properly. Performance tests ensure that changes do not introduce unacceptable latency or resource consumption. This automated validation enables rapid, safe evolution of MCP deployments.
Continuous compliance monitoring
Compliance is not a one-time achievement but an ongoing process. Production MCP deployments require continuous monitoring that verifies compliance controls remain effective over time. The gateway’s golden signals provide real-time visibility into security posture. Automated compliance checks periodically verify that configurations match approved baselines, policies are correctly enforced, and audit logs are being generated and retained properly.
Compliance dashboards provide executives and auditors with current views of MCP security posture. These dashboards show compliance status across multiple frameworks, highlight any violations or exceptions, and track remediation of identified issues. This continuous visibility transforms compliance from a periodic audit exercise into an ongoing operational capability.
Incident response planning
Production deployments require documented incident response plans that specify how security incidents involving MCP connections will be detected, investigated, contained, and remediated. These plans should address various incident scenarios: compromised credentials, unauthorized data access, policy violations, and denial of service attacks. Each scenario includes specific response procedures, escalation paths, and communication protocols.
Regular incident response exercises test these plans and train teams in their execution. Tabletop exercises walk through incident scenarios, identifying gaps in procedures or capabilities. Technical drills test actual response capabilities, verifying that teams can execute response procedures under pressure. These exercises ensure that when real incidents occur, response is swift and effective.
Documentation and knowledge transfer
Production MCP deployments require comprehensive documentation that enables operations teams to manage systems effectively and supports compliance assessments. This documentation includes architecture diagrams showing how MCP components interact, security control descriptions explaining how requirements are met, operational runbooks detailing routine procedures, and troubleshooting guides for common issues.
Knowledge transfer ensures that multiple team members understand MCP security architecture and operations. This redundancy prevents single points of failure where only one person understands critical systems. Training programs bring new team members up to speed quickly, maintaining operational capability as teams evolve. Documentation and training together ensure that MCP security remains effective regardless of personnel changes.
An MCP gateway applies these practices in one place, with an approved server catalog, tool profiles, and secrets kept out of client config. See how to govern MCP server traffic with an MCP gateway.
How Tetrate Agent Router Enterprise implements this pattern
Everything above describes the pattern any MCP gateway should implement. Tetrate Agent Router Enterprise is one production implementation of it, and the specific mechanisms matter more here than a feature list would:
- Curated tool catalog with per-profile authentication and filtering. Every MCP Gateway connection runs against an approved server catalog, scoped per profile, so security can audit exactly what an agent reached and when, alongside which tool and model it called.
- Step-up authorization, built with Ory. Routine agent actions proceed without friction. Higher-risk actions trigger human approval through the customer’s own identity system, the same escalation pattern described in the authorization section above.
- Compliance posture a security team can verify directly. Tetrate has SOC 2 Type II, ISO 27001, and GDPR compliance. The stack includes TLS 1.3 in transit, AES-256 at rest, multi-factor login, role-based access, immutable audit logs, and CVE-protected builds in the customer’s VPC or on-premises. The full audit report is available under NDA, so a reviewer can read the findings directly rather than take the claim on faith.
- Customer-controlled data capture. For every MCP connection, the customer chooses whether the gateway stores the full request, only counts and cost, or nothing at all, with the setting changeable at any time. This is a setting the customer configures, distinct from the compliance controls above that Tetrate operates and a customer can only verify through the audit report.
- Outbound-only connectivity. Each data plane opens one outbound HTTPS connection to the management plane. Nothing connects in, so a security team opens no inbound firewall rules to adopt gateway-based MCP governance.
Agent Router Enterprise runs gateways in any cloud, region, on-premises site, or edge location, and manages all of the gateways from one management plane, so the data plane keeps carrying MCP traffic even if the management plane is unreachable.
Infrastructure-layer governance secures enterprise MCP
Securing the Model Context Protocol requires a fundamental shift from application-layer security to infrastructure-layer governance. The core principle is that governance belongs in the gateway: enforcement in one place, applied to every connection. The challenges of MCP security, inconsistent implementation, context leakage, operational complexity, and compliance gaps, cannot be adequately addressed through application-level controls alone. Gateway-based enforcement provides the architectural foundation for enterprise-grade MCP security that scales across organizations.
By treating governance as an infrastructure-layer concern, organizations can confidently deploy MCP-enabled AI applications at scale, with security and compliance requirements systematically addressed. The centralization provides the foundation for safe innovation by ensuring that security guardrails are always in place without limiting flexibility. This architectural approach, moving security enforcement from scattered application implementations to centralized infrastructure, is the sustainable path to enterprise-grade MCP governance. For a broader view of runtime policy enforcement across models and tools, see AI risk management and governance.
Start a fast-track evaluation of Tetrate Agent Router Enterprise’s MCP Gateway: a dedicated managed instance with admin controls, spun up in minutes with no procurement step. Request a demo.
Frequently asked questions
What is MCP security?
MCP security is the set of controls that protect Model Context Protocol connections between AI applications and the data sources or tools they access. MCP security in practice means authentication, authorization, data protection, and audit logging implemented either by each application individually or, more reliably, by a gateway that enforces them consistently across every connection.
Is the Model Context Protocol secure by default?
No. MCP’s specification deliberately omits security mechanisms to keep the protocol simple and flexible, which means security is something an organization has to add, either inside each application or, as this guide covers, at a centralized gateway.
What are the most common MCP security risks?
The same risks recur across industry guidance, including OWASP’s Gen AI Security Project, the Cloud Security Alliance, and MCP’s own security documentation. The recurring risks are tool poisoning, tool shadowing, rug pull attacks where a previously approved tool changes behavior after review, the confused deputy problem in proxy authentication, prompt injection carried in tool outputs rather than the original request, excessive permissions from token passthrough, and supply chain tampering in MCP server packages. Each is detailed in the risk section above.
How do you secure an MCP server in production?
Route every MCP connection through a gateway that authenticates clients with OAuth 2.1 with PKCE, authorizes requests against a hierarchical policy, filters sensitive data out of context exchanges, and logs every operation. Combine this with the organizational controls production deployment requires: a documented security baseline mapped to a recognized framework, a completed risk assessment, change management for gateway and policy updates, and an incident response plan specific to MCP connections.
Learn more about Tetrate Agent Router Enterprise — enterprise AI agent routing with smart routing, policy, cost controls, and audit across every gateway.