Top MCP Security Risks Enterprises Should Understand
Understand critical MCP security risks. Learn how Model Context Protocol alters enterprise attack surfaces and how runtime gateways block unauthorized tool execution.
Maulik Shyani
October 9, 2026
17 min read
Enterprise platform engineering and security teams face a fundamental operational shift. What began as the controlled rollout of conversational chatbots and code completion assistants has transformed into an interconnected fabric of autonomous systems. Powering this shift across Microsoft Copilot Studio, Azure AI Foundry, Cursor, Windsurf, Claude Desktop, and custom internal agent frameworks is theModel Context Protocol (MCP)—an open standard designed to standardize how Large Language Models connect to databases, SaaS APIs, local operating system environments, and development pipelines.
Often described as the "USB-C for artificial intelligence," MCP provides a universal specification that lets models dynamically discover tools, read enterprise resources, and execute system commands without requiring bespoke API code for every backend service.
Yet, as adoption surges across cloud platforms and developer workstations, security teams face a stark operational reality: MCP was engineered for functional interoperability and developer velocity, not enterprise security.
When an AI agent connects to an MCP server, the protocol does not merely deliver reference data. It exposes active execution capabilities directly to probabilistic models. The model reads the server's advertised tools, interprets natural language capability descriptions, and autonomously decides which commands to run, which parameters to construct, and which endpoints to call.
Hundreds of internet-facing and locally hosted MCP servers operate today with severe misconfigurations. When non-deterministic reasoning engines interface directly with sensitive enterprise tools, the traditional perimeter dissolves. A hidden prompt injection within an untrusted document, an unvetted open-source plugin, or an insecure local configuration can be transformed into arbitrary code execution, production data destruction, or credential theft in seconds.
According to Gartner, 33% of enterprise software applications will incorporate agentic AI by 2028, up from less than 1% in 2024—and over 40% of agentic AI deployments risk operational cancellation or emergency freezes due to a lack of governance, visibility, and execution controls. Recent empirical vulnerability research paints an even starker picture: remote code execution flaws (such as CVE-2025-6514 with a CVSS score of 9.6) and supply chain poisonings demonstrate that traditional endpoint and network controls fail to detect or intercept model-directed attacks.
For security leaders, managing MCP security risks is no longer an optional platform hygiene task. It is a prerequisite for maintaining organizational resilience in an agentic AI landscape.
Autonomous System Architecture & Challenges
Modern agentic deployments diverge fundamentally from classical microservice and service-oriented architectures. A standard microservice executes a pre-compiled, deterministic call graph (A→B→C). In contrast, an autonomous agentic system treats execution paths as an emergent runtime property dictated by probabilistic model inference.
Agents, Tools, and Orchestrators
At the foundational tier, an orchestrator (such as LangGraph, CrewAI, AutoGen, or managed runtimes likeAmazon Bedrock AgentCore andMicrosoft Azure AI Foundry) coordinates model context, memory buffers, dynamic prompts, and tool interfaces.
Within this architecture, an MCP server functions as the tool provider. The protocol structures interaction across three foundational primitives:
Tools: Executable functions that AI models can invoke dynamically, ranging from SQL queries and file operations to internal microservice calls.
Resources: Contextual data sources, such as live file contents, database tables, or API responses, that an agent can read into its working memory.
Prompts: Pre-packaged prompt templates and behavioral guidelines served to standard clients.
During startup or discovery, the client initiates a handshake over JSON-RPC 2.0. The MCP server returns its complete manifest—exposing tool names, input parameter JSON schemas, and natural language descriptions explaining what each tool does. The model evaluates this manifest, determines its plan of action, and emits a structured tool call. The client receives this completion and dispatches it to the MCP server for execution.
Multi-Agent Workflows and Chaining
Enterprise automations rarely execute within single-turn boundaries. They link multiple models into collaborative, hierarchical topologies:
Supervisor / Routing Agent: Ingests an ambiguous directive (e.g., "Investigate customer billing disputes across regional accounts and issue ledger adjustments"), decomposes it into sub-goals, and delegates work to specialized worker agents.
Analysis Agent: Queries internal transactional databases via text-to-SQL or parses unstructured contracts.
Execution Agent: Calls external microservices or SaaS APIs to mutate enterprise state.
This operational structure introduces asynchronous execution chaining. Execution flows branch and cascade dynamically. If an execution agent encounters a schema error, an API timeout, or a rate limit, the supervisor agent may autonomously reformulate its plan, selecting alternate tools or retrying with broader queries—execution sequences that no software engineer explicitly coded into a deterministic script.
Tool Invocation Mechanics (APIs, DBs, SaaS)
Autonomous agents interface with critical enterprise resources across three primary vectors:
Direct REST and gRPC Endpoints: Calling internal microservices using long-lived bearer tokens or static API keys.
Direct Database Drivers: Querying data lakes and transactional SQL databases via text-to-SQL connectors without query-level safety boundaries.
Model Context Protocol (MCP) Implementations: Standardized client-server interfaces that expose developer environments, local command lines, and SaaS platforms directly to models.
Identity Propagation Gaps Across Services
In microservice architectures, user identity propagates down the call chain using cryptographically signed tokens containing explicit user claims. In agentic workflows, this custody chain shatters at the orchestrator boundary:
Ambient Privilege Inheritance: Endpoint agents inherit the privileges of the active human user. Downstream systems record normal employee activity, masking background agent tasks and preventing teams from identifying whether an action was taken by a human or an automated model.
Static Machine Accounts: Cloud-hosted agents execute using over-privileged, shared service principals to eliminate integration friction.
Loss of Non-Repudiation: When a downstream database records an unauthorized state mutation from a shared service principal, security teams cannot determine which user prompt, agent step, or model inference triggered it.
Token Issuance and Validation (JWT/JWKS)
While microservices validate JSON Web Tokens (RFC 7519) using JSON Web Key Sets (JWKS) (RFC 7517), autonomous agents rarely incorporate dynamic token down-scoping.
OAuth 2.0 Token Exchange (RFC 8693) is seldom implemented in custom agent frameworks. Once an agent receives an administrative credential, it retains that broad authority indefinitely, leaving systems vulnerable if the agent's context window is compromised.
Runtime Execution vs. Orchestration Logic
Orchestration frameworks manage application state, prompt templates, and retry loops. They do not function as network-level security boundaries. If an enterprise relies solely on system prompts (e.g., "Never delete production records") or application-level callbacks, an indirect prompt injection attack can bypass them entirely.
True enterprise governance requires decoupling business orchestration from network-level policy enforcement. Most enterprises control models—but not execution paths.
Autonomous System Risks (Core Section)
Because MCP acts as an operational bridge between unstructured language processing and executable systems, unmanaged MCP servers create liabilities across five core enterprise risk categories:
Action Risk
Action risk encompasses unauthorized, unintended, or maliciously coerced state changes across enterprise environments:
Unauthorized API Execution (OWASP LLM06 Excessive Agency): An agent executes state-altering operations (e.g., modifying access control lists, reconfiguring DNS routing, or deleting production storage buckets) due to adversarial prompt injection or model hallucination.
Tool Misuse & Semantic Drift: An agent equipped with broad system tools (e.g., shell execution or dynamic SQL drivers) executes destructive actions to satisfy an ambiguous prompt.
Privilege Escalation: By passing untrusted inputs into chained tools, an attacker tricks an agent into calling privileged internal endpoints that lack parameter-level authorization.
Data Risk
Sensitive Data Leakage (OWASP LLM02): Agents processing unstructured text inadvertently pull PII, PHI, or internal credentials into external API payloads or outbound model context windows.
RAG Over-Exposure (OWASP LLM08): Retrieval-Augmented Generation systems index vast document stores without mapping vector embeddings back to source Access Control Lists (ACLs). An unprivileged user querying an agent can extract restricted executive compensation data because the agent's retrieval tool operates with unrestricted permissions.
Cross-Tenant Contamination: In multi-tenant environments, shared vector caches and agent memory buffers allow one tenant's agent chain to inspect or mutate another tenant's confidential records.
Financial Risk
Runaway API Execution Costs: Unbounded reasoning loops can trigger thousands of model completions per minute, burning through monthly inference budgets in hours.
Uncontrolled Financial Transactions: Autonomous procurement, billing, or refund agents operating without hard, deterministic caps execute duplicate or fraudulent disbursements.
Downstream API Abuse & Rate-Limit Exhaustion: Unchecked bursts of tool calls flood internal microservices and third-party SaaS platforms, triggering rate limits and degrading dependent systems.
Operational Risk
Cascading Failures: When a dependent tool times out, an agent may misinterpret the failure and trigger recursive retries or erratic fallback actions, sparking a self-inflicted denial-of-service (DoS) storm.
State Machine Corruption: Non-deterministic parameters write malformed schemas or inconsistent states into ERP and CRM systems, disrupting downstream operational workflows.
Compliance Risk
Audit Gaps: Ephemeral script connections execute without centralized logging. When auditors request records of why an automated transaction occurred, the enterprise cannot produce an immutable audit trail.
Regulatory Violations: Unchecked agent actions violate standards such as theNIST AI Risk Management Framework (AI RMF 1.0), the EU AI Act (Article 12 logging and Article 14 human oversight), SOC 2 Type II controls, and GDPR Article 22 mandates regarding automated processing.
Table 1: Autonomous System Risks vs. Business Impact
Unaudited agent decisions acting across segregated data boundaries.
Inability to satisfy regulatory discovery; legal non-repudiation failure.
EU AI Act (High-Risk AI Systems transparency & logging), NIST AI RMF.
Interoperability & Lock-In Risks
As organizations attempt to govern multi-cloud deployments, adopting proprietary point solutions creates architectural lock-in and persistent security blind spots.
The Traps of Early Agent Adoption
Proprietary Connectors and Vendor SDKs: Cloud hyperscalers package agent runtimes inside proprietary abstractions. These services isolate execution logic, preventing cross-cloud orchestration and obscuring the underlying network calls from enterprise security platforms.
Embedded Policy Logic in Orchestrators: Writing authorization policies directly into prompts or custom Python code binds governance rules to specific models. If an enterprise changes LLM providers or migrates to open-weight models, prompt-based safety guardrails often fail to generalize, forcing teams to rewrite their security logic from scratch.
Non-Standard Token Formats: Cloud-specific identities—such as AWS AgentCore Identity, Azure Entra Agent ID, and GCP Vertex AI SPIFFE identities—are not natively interoperable. Bridging these environments requires complex, custom translation layers. To maintain developer velocity, platform teams frequently fall back to broad, static API tokens, opening severe security holes.
Closed Telemetry Systems: Cloud providers direct agent metrics into isolated dashboards (e.g., Azure Monitor, AWS CloudWatch, Google Cloud Logging). These proprietary silos lack cross-cloud request tracking, leaving SecOps teams unable to trace an agent run as it moves across multi-cloud boundaries.
Architectural Solutions for Enterprise Portability
Protocol Standardization (HTTP/gRPC, JWT): Decouple agent-to-tool and agent-to-agent interactions using open Layer 7 standards and standard JWT structures.
Adapter-Based Architecture: Abstract model providers and orchestrators behind neutral ingress and egress adapters to decouple application logic from underlying infrastructure.
Externalized Policy Bundles (Open Policy Agent / OPA): Abstract security policies away from application code into declarative, mathematically verifiable rules written in Rego. These bundles are versioned in Git, verified in CI pipelines, and compiled to WebAssembly (Wasm) for microsecond runtime evaluation.
Neutral Telemetry (OpenTelemetry): Standardize traces, metrics, and logs on the OpenTelemetry standard. Emitting normalized Generative AI semantic conventions allows enterprise SIEM and observability platforms to analyze agent actions across any hosting environment.
Runtime Control Architecture (Aegis-Aligned)
Discovering connected MCP servers provides baseline visibility, but maintaining a static list cannot prevent a hijacked model from executing a destructive shell command or exfiltrating data in transit.
To protect critical infrastructure, enterprises must implement an inline Runtime Control Architecture that intercepts, inspects, authorizes, and audits every MCP tool invocation across both network and stdio transports.
Core Architecture Components
Gateway / Proxy (Envoy Proxy Pattern): The data plane uses an inline proxy modeled on Envoy. Operating at Layers 4 and 7, it intercepts outbound HTTP/gRPC requests, WebSocket streams, and local OS-level stdio execution pipes linking AI clients to MCP servers.
External Authorization (ext_authz): The proxy's ext_authz filter pauses outgoing tool calls. It serializes the call context (client identity, destination MCP tool, raw parameters, and task attributes) and dispatches an evaluation check to an external authorization engine before allowing the command to execute.
Policy Engine (OPA Bundles): The authorization service evaluates the payload against compiled Open Policy Agent bundles. It validates caller identity, verifies parameter boundaries (e.g., verifying action == "query" and blocking action == "drop"), and ensures execution matches organizational security baselines in microseconds.
Dynamic Token Exchange Engine: When an action is approved, the runtime proxy uses an RFC 8693 token exchange service. It trades the agent's ambient credential for an ephemeral, down-scoped token valid only for that specific target system, preventing credential harvesting by compromised tools.
Observability (OpenTelemetry): An inline OpenTelemetry collector captures every interaction. The pipeline records prompt hashes, agent identifiers, OPA evaluation decisions, latencies, and tool response payloads, redacting sensitive parameters before sending traces to the enterprise SIEM.
Enterprises can implement this architecture usingAegis Security. Aegis provides a purpose-built runtime control plane that links continuous MCP server discovery to inline proxy enforcement, ensuring that all tool execution paths—across both cloud networks and local developer workstations—are strictly governed under zero-trust policies.
Autonomous System with Runtime Gateway
Governance & Control Model: The Eight Enterprise MCP Risk Vectors
Traditional cybersecurity models assume that verified authentication equals trusted operational behavior. In an MCP ecosystem, this assumption collapses. An MCP server may be fully authenticated and operational, yet perform destructive actions due to adversarial input or flawed reasoning.
The 8 Critical MCP Attack Surfaces
Lack of MCP Visibility: Security teams lack an accurate inventory of connected local and remote MCP servers, creating widespread unmonitored shadow AI.
Uncontrolled Remote Server Ingestion: Unvetted cloud MCP servers connected to SaaS platforms bypass centralized security reviews and data perimeter policies.
Shadow Local stdio Servers: Developers launch local MCP subprocesses via CLI or desktop assistants that execute with full workstation user rights, invisible to network firewalls.
Destructive Tool Invocations: Non-deterministic reasoning causes agents to execute destructive state changes (DELETE, DROP, UPDATE) under the guise of routine task execution.
Persistent Ambient Authentication: Agents inherit broad user session tokens or static API keys that persist long after the human user logs out.
Supply Chain Compromise & Rug Pulls: Open-source MCP servers dynamically mutate tool schemas or parameter requirements post-installation without administrative re-evaluation.
Exfiltration via Unvetted Tools: Malicious or poorly configured MCP servers silently route contextual prompts and internal data payloads to external webhooks.
Corporate IP Leakage via Personal Licenses: Developers configure MCP servers with personal consumer AI accounts, routing proprietary source code into unvetted, non-compliant LLM ecosystems.
The Five Control Pillars
Identity (Who is acting): Establishing the cryptographic identity of the calling agent (via SPIFFE IDs, x509 certificates, or signed JWT claims). Downstream systems verify both the human sponsor and the specific agent instance.
Policy (What is allowed): Defining permissible actions using declarative policy-as-code. Policies enforce parameter schemas, payload sizes, allowed tools, and rate limits outside the LLM context window.
Observability (What happened): Emitting normalized OpenTelemetry spans containing full causal metadata—prompt hashes, tool inputs, execution latency, and response status.
Auditability (Can it be proven): Generating cryptographically signed, immutable audit records linking the originating user session to the final database mutation.
Human Approval (When required): Providing dynamic step-up authorization. High-risk transactions (e.g., executing shell scripts, dropping database tables, or modifying production configurations) pause execution and notify a human reviewer via Slack, Teams, or an internal portal.
Core Governance Concepts
Zero Trust for Agents: Treat every agent tool invocation as an untrusted network event. Never grant ambient network access based solely on internal network location.
Least Agency vs. Least Privilege: While least privilege restricts what systems an agent can touch, least agency restricts how much autonomy the agent possesses. It bounds the agent's execution envelope, ensuring it cannot chain open-ended tool calls without human checkpoints.
Dynamic Privilege Attenuation: As an agent progresses through a multi-step task, its permissions should actively narrow. Once data retrieval finishes, read privileges are revoked before update operations proceed.
Runtime Enforcement: Intercept and evaluate execution payloads in transit at the data plane layer rather than relying on model guardrails.
Continuous Monitoring: Analyze real-time telemetry to detect semantic drift, parameter anomalies, and policy violation attempts as they happen.
Real-world vulnerability research demonstrates why model-level prompt filters and unmonitored MCP connections expose organizations to systemic risk. In these environments, the vulnerability is not model capability—it is unconstrained execution inside trusted systems.
The Supabase Cursor Agent Token Leak
The Failure: Security researchers documented a severe prompt injection vulnerability involving an AI coding agent running with elevated service-role privileges. When processing untrusted user-submitted support tickets containing obfuscated prompt injection instructions, the agent executed internal diagnostic MCP tools that pulled environment configuration variables and integration secrets, encoding them into subsequent outbound API responses.
Why Traditional Controls Failed: The agent operated with legitimate backend service credentials. The database connection was authenticated, and the API requests were technically well-formed. Traditional WAFs and API gateways saw only valid internal queries, failing to detect that the model was exfiltrating authentication tokens under the direction of an injected prompt.
The Lesson: Agents processing untrusted external inputs must never possess standing access to tools that expose environment secrets or raw database schemas. Runtime policies must inspect and block payloads that attempt to read .env files or sensitive system configurations.
WhatsApp Message Exfiltration via Invariant Labs Poisoning Exploit
The Failure: Security researchers at Invariant Labs demonstrated how an unvetted third-party MCP server installed alongside a legitimate messaging integration could hijack model behavior. The malicious MCP server advertised a benign capability but embedded hidden instructions within its tool description. When the agent parsed the tool metadata, it silently read the user's complete WhatsApp conversation history and exfiltrated the messages to an external tracking endpoint.
Why Traditional Controls Failed: The attack required zero user error and no direct prompt injection into the chat window. The exploit was delivered entirely through the MCP server's advertised metadata, which entered the model context during initial discovery.
The Lesson: Tool metadata must be treated as untrusted user input. An inline session proxy must intercept tool advertisements, stripping unverified natural language instructions before they reach the model.
Remote Code Execution via Insecure MCP Client Transport (CVE-2025-6514)
The Failure: Security researchers uncovered CVE-2025-6514, a critical vulnerability (CVSS 9.6) in the widely deployed mcp-remote project. The vulnerability allowed an untrusted or compromised MCP server to trigger arbitrary OS command execution on client machines whenever an AI client connected to it over an insecure transport or via man-in-the-middle conditions.
Why Traditional Controls Failed: The AI assistant initiated the connection as an intended, authorized client action. Traditional endpoint tools (EDR) saw an authorized developer process launching subprocesses, failing to recognize that the command originated from an adversarial server payload.
The Lesson: MCP connections must require mutual TLS (mTLS) and cryptographic server attestation. Clients must execute tools within sandboxed, containerized microVMs to prevent arbitrary host command execution.
Risk Propagation in Agent Workflow
Business & Operational Value: Enabling Scale Through Control
A persistent misconception among engineering leaders is that implementing rigorous security controls around developer tools slows engineering velocity. In production, the reality is the exact opposite: uncontrolled automation cannot scale.
According to enterprise studies from Gartner and McKinsey, over 40% of enterprise agentic AI initiatives risk cancellation or stall in pilot phases due to governance, visibility, and execution concerns. Furthermore, research indicates that roughly 88% of AI agent pilots never reach production because teams cannot prove to risk committees that agents will remain within policy boundaries.
Deploying a dedicated MCP security framework provides clear business value:
Radically Reduced Blast Radius: Constraining agents with zero-trust access controls ensures that an individual compromised prompt cannot lead to lateral system compromise.
Continuous Compliance Readiness: Emitting standardized OpenTelemetry traces transforms audit preparation into an automated process, simplifying compliance with NIST AI RMF, SOC 2, and the EU AI Act.
Accelerated High-Impact Automation: When security teams know that an inline gateway will intercept unauthorized actions, they can safely move from read-only copilots to autonomous, state-mutating agents.
Long-Term Architectural Portability: Externalized policies into declarative OPA bundles and standardizing telemetry on OpenTelemetry protects the enterprise from vendor lock-in, enabling teams to switch models and cloud platforms without rewriting governance layers.
Table 2: Control Mechanisms vs. Risk Mitigation
Control Mechanism
Implementation Layer
Primary Risks Mitigated
Latency Overhead
Engineering Complexity
Inline Envoy Proxy Interception
Network Data Plane (Layer 7)
Action Risk, Operational Runaway
Low (< 2ms)
Moderate
Externalized OPA Policy Bundles
Policy Engine (ext_authz)
Action Risk, Compliance Violations
Low (< 5ms)
Moderate
Dynamic Token Exchange (RFC 8693)
Identity / IAM Infrastructure
Privilege Escalation, Cross-Tenant Leaks
Medium (~10-25ms)
High
OpenTelemetry Semantic Tracing
Observability Plane (Out-of-band)
Compliance Risk, Forensic Blind Spots
Zero (Async Egress)
Low
Asynchronous HITL Step-Up Auth
Distributed Event Queue / Messaging
Financial Risk, Unintended Data Mutations
Asynchronous (User Dependent)
Moderate
Schema Validation & Parameter Sanitization
Runtime Proxy Filter
Tool Misuse, Injection Attacks
Ultra-Low (< 1ms)
Low
Technical Terms to Explain
Policy-as-Code: Managing authorization, compliance, and operational rules as version-controlled, declarative code. Using domain-specific languages (such as Rego for OPA), policies are tested in CI pipelines and pushed dynamically to enforcement points without requiring application restarts.
ext_authz (External Authorization): A standard network filter protocol used by proxies like Envoy. When a connection reaches the proxy, ext_authz pauses the request and dispatches payload metadata to an external policy engine. The proxy holds the request until the policy service returns an allow or deny decision.
OPA Bundles: Compressed, cryptographically signed archives containing compiled Rego policies and data JSON files. Open Policy Agent engines running as sidecars or microservices continuously poll control servers for bundle updates, activating new policies in milliseconds.
JWT & JWKS: JSON Web Tokens (RFC 7519) carry cryptographically signed identity assertions. JSON Web Key Sets (RFC 7517) provide the public keys needed to verify those signatures, enabling key rotation without distributed secret distribution.
Token Exchange (RFC 8693): A standardized OAuth 2.0 framework allowing a service to exchange an ambient credential for a down-scoped, short-lived security token valid only for a specific downstream tool or API.
OpenTelemetry (OTel): A vendor-neutral CNCF observability framework providing standard APIs, SDKs, and tooling to generate and export traces, metrics, and logs. Standardizing on Generative AI semantic conventions enables cross-platform tracking of model reasoning and tool execution.
Agent Identity: Cryptographic attribution assigned to an autonomous software agent (via SPIFFE IDs, x509 certificates, or signed claims), distinct from the human user who prompted it.
Runtime Enforcement: The deterministic interception, inspection, and authorization of data plane traffic in transit before payloads reach target infrastructure.
Shadow Mode (Dry-Run): An operational deployment pattern where a newly introduced policy evaluates production agent traffic in real time, logging whether it would have allowed or blocked each call without actually dropping packets.
Secure Control Plane Architecture
Engineering Implementation: Architecting an MCP Security Enforcement Layer
To protect enterprise systems against MCP vulnerabilities across both cloud services and developer workstations, platform engineering teams must deploy a four-stage security pipeline:
Stage 1: MCP Server Discovery & Registry Whitelisting
Enterprises cannot secure unmonitored connections. Security teams must implement automated discovery across two vectors:
Endpoint Configuration Auditing: Deploy endpoint sensors to inspect local developer configuration manifests (such as claude_desktop_config.json, Cursor configuration files, and Windsurf manifests). Flag unvetted third-party GitHub MCP servers and disable unauthorized local installations.
Transport Process Monitoring: Monitor developer machines for subprocess execution matching MCP patterns (node build/index.js, python -m mcp_server) communicating over stdio pipes or local loopback ports.
Stage 2: Tool-List Pre-Filtering at the Session Proxy
Never expose raw MCP tool lists directly to models. Deploy an inline session proxy between the agent client and the MCP server. When the server advertises its available capabilities, the proxy intercepts the response:
Evaluates the active user role, project context, and task definition.
Strips unauthorized or high-risk tools from the schema list.
Sanitizes natural language tool descriptions to prevent tool poisoning.
Transmits the rewritten, minimal tool list to the model.
When an agent issues a tool invocation, the runtime proxy halts the connection and serializes the call context (client identity, destination tool, parsed SQL statement or shell command, and parameters). The payload is evaluated against declarative OPA Rego policy bundles:
package mcp.security
import future.keywords.in
default allow = false
default require_approval = false
# Allow read-only database analysis via MCP SQL tool
allow {
input.identity.role == "data_analyst_agent"
input.tool.name == "sqlite_query"
# Deterministic SQL parsing: Ensure only SELECT operations are permitted
input.parsed_operation.type == "SELECT"
not input.parsed_operation.contains_mutations
# Restrict execution limits
input.tool.parameters.row_limit <= 500
}
# Require human approval for state mutations
require_approval {
input.identity.role == "data_analyst_agent"
input.tool.name == "sqlite_query"
input.parsed_operation.type in ["UPDATE", "INSERT"]
}
# Block all administrative or destructive operations outright
allow = false {
input.parsed_operation.type in ["DROP", "DELETE", "ALTER", "TRUNCATE"]
}
Stage 4: Credential Vaulting and Inline Injection
Eliminate static API keys and database passwords stored in local JSON configuration files. All credentials terminate at the runtime proxy. The agent connects to the MCP proxy using short-lived developer session credentials. When an action is approved, the proxy retrieves the true backend credential from a centralized vault (such as HashiCorp Vault or AWS Secrets Manager), injects it into the outbound request, and executes the call safely.
Secure Your MCP Tool Execution Paths with Aegis Security
The Model Context Protocol has transformed AI agents from passive conversational interfaces into active, autonomous software workers. But connecting reasoning models directly to production systems without deterministic execution boundaries creates unmanageable enterprise risk. Model-level guardrails, static roles, and unmonitored stdio transports leave your infrastructure exposed to tool poisoning, code injection, and data exfiltration.
Aegis Security provides the purpose-built runtime control plane required to govern MCP deployments safely. By intercepting tool calls across both network and stdio transports, filtering tool advertisements before they enter the model context, evaluating execution payloads against version-controlled OPA policy bundles, and injecting credentials dynamically, Aegis delivers true zero-trust security for autonomous agents across AWS, Azure, SaaS, and developer endpoints—without requiring teams to rewrite their application code.
Ready to secure your Model Context Protocol deployments and eliminate unmonitored tool execution risks?Book a Demo with Aegis Security to see our runtime enforcement architecture in action.
Frequently Asked Questions (FAQs)
What are the primary MCP security risks enterprises face today?
The primary risks include lack of visibility over shadow MCP servers, uncontrolled access to remote SaaS systems, unapproved local stdio subprocesses running with full workstation rights, destructive actions executed via unvalidated parameters, persistent ambient credentials, supply chain poisoning (such as "rug pull" updates), data exfiltration through untrusted tools, and the exposure of enterprise IP via personal consumer AI accounts.
How does tool poisoning differ from standard prompt injection?
Standard prompt injection occurs when malicious instructions are embedded within user prompts or ingested documents (e.g., PDFs or emails). Tool poisoning occurs when the MCP server itself embeds adversarial instructions inside its advertised natural language tool descriptions. Because these descriptions enter the model's context window during capability discovery, the model interprets the instructions as legitimate operational guidelines, executing attacks without requiring external user input.
Why are local stdio MCP servers invisible to traditional network security tools?
In local developer setups (such as Cursor or Claude Desktop), MCP servers launch as direct OS subprocesses that communicate with the agent client over standard input and standard output (stdio) pipes. Because data travels through OS-level inter-process communication rather than the network stack, it never generates network packets, leaving firewalls, proxies, and network intrusion detection systems completely blind.
What is a "confused deputy" attack in an MCP deployment?
A confused deputy attack occurs when an MCP server receives an authentication token from an AI client without verifying whether the token was specifically intended for that server, and then forwards it to downstream APIs. If an attacker directs an agent to invoke a rogue or secondary MCP server, that server can reuse the victim's token to perform unauthorized actions against enterprise resources under the guise of legitimate activity.
How does an inline proxy stop MCP supply chain attacks like dynamic tool mutations?
An inline session proxy maintains a versioned, cryptographically pinned registry of approved tool schemas and descriptions. If a third-party MCP server modifies its advertised capabilities or changes a tool description after an update, the proxy detects the divergence, blocks the server's registration, and triggers an administrative review gate before the new tool can be exposed to AI models.