A Multi-Layered Defense Against Poisoned AI Agents

Share

In September 2025, security researchers exposed a supply chain attack hidden within postmark-mcp—an open-source Model Context Protocol (MCP) server designed to enable AI agents to send transactional emails.

For fifteen releases, the package performed flawlessly as a faithful clone of the official integration. Then version 1.0.16 shipped with a single line of modified code.

From that moment on, every email dispatched by an agent carried a silent bcc to an attacker-controlled address (phan@giftshop[.]club). Password resets, invoices, and internal communications were systematically exfiltrated alongside legitimate routing. By the time it was yanked, the package had compromised roughly 1,600 environments.

Standard dependency scanners missed the threat entirely. Why? Because the payload generated perfectly valid, well-formed API traffic. The tool name was send_email. The execution path was send_email.

The Core Realization: The adversary didn't elevate privileges, bypass authentication, or introduce new tools. The agent executed an authorized action—the exploit lived entirely inside a single parameter value on the wire.

The Attack Rides an Allowed Path

The postmark-mcp incident is not an isolated anomaly. It reflects an operational reality across modern agentic infrastructure: attackers trick authorized tools into executing malicious parameters.

Recent exploits highlight this exact attack pattern:

  • EchoLeak (CVE-2025-32711): Disclosed by Aim Security, this zero-click vulnerability in Microsoft 365 Copilot allowed a crafted email to coerce the model into reading sensitive internal files and exfiltrating them to an external endpoint.
  • Slack AI Indirect Injection: PromptArmor demonstrated that hidden instructions embedded in public channels could manipulate Slack AI into leaking private channel messages via rendered links.
  • Database Token Exfiltration: Support workflows integrating Cursor agents with Supabase were manipulated into evaluating untrusted ticket content as executable SQL, leaking integration tokens in the process.

According to OWASP GenAI tracking, prompt injection remains a top failure mode for production agents. Meanwhile, recent benchmark studies reveal that MCP tool-poisoning techniques achieve strikingly high success rates against standard framework implementations.

The Gateway as the Primary Inspection Point

To intercept attacks hidden within parameter values, security controls must operate where arguments are parsed and executed: at the Agent Gateway.

When all agent-to-application tool calls route through a centralized enforcement point, that choke point gains full visibility into four critical vectors:

  1. Identity: Which specific agent is initiating the request?
  2. Context: On whose behalf is the agent acting?
  3. Destination: Which target application and tool are being invoked?
  4. Payload: What exact parameter values are present on the wire?

By separating the Policy Decision Point (PDP) from the Policy Enforcement Point (PEP), organizations apply Zero Trust principles directly to AI workflows. The gateway acts as the PEP, treating runtime argument values as vital inputs for the PDP before traffic ever reaches downstream resources.

Parameter Values as Critical Policy Signals

Parameter evaluation is not a silver bullet or a binary "lie detector." Instead, it provides the missing piece in a multi-layered defense strategy. Every traditional security layer has a structural blind spot that runtime parameter inspection addresses:

Security Layer Focus Structural Blind Spot
Identity & Authentication Verifies cryptographic identity and user delegation. Cannot inspect payload contents on the wire.
Tool Allow-Lists Approves execution of specific functions (e.g., send_email). Completely blind to target argument values.
Behavioral Analytics Tracks baseline request frequency and volume. Sees normal emails and shadow-copied emails as identical traffic.
Intent Analysis Interprets model prompt context and reasoning. Misses malicious parameters injected directly into tool execution fields.
Parameter Inspection Evaluates explicit parameter values passed to inputs at runtime. None. Surfacing hidden threats like unauthorized bcc domains.

In the postmark-mcp attack, traditional identity, allow-list, and behavioral controls all yielded false safety signals. The tool call was authorized, the caller was authenticated, and the request format was standard. Parameter inspection was the only signal capable of stopping the exploit.

Operationalizing Parameter Governance at Scale

The primary barrier to parameter-level enforcement is administrative overhead. An enterprise ecosystem might expose hundreds of tools, each accepting dozens of arguments. Manually writing declarative rules for every parameter quickly becomes unsustainable.

Historically, organizations have relied on two flawed approaches:

  • Coarse, Automated Scanners: Generic API filters scan payloads for broad signatures like PII. However, they miss context-specific threats. An external bcc address is structurally valid email data—not PII—so generic scanners pass it through without alarm.
  • Fine-Grained, Manual Rules: Declarative policies offer high precision but require security teams to hand-craft rules for every schema field, leading to severe maintenance overhead and policy coverage gaps.

A Schema-Driven Path Forward

Achieving parameter-level security without friction requires schema-driven policy workflows:

  • Schema-Driven Auto-Completion: Gateways parse the target tool's OpenAPI or MCP input schema directly. When an administrator crafts a policy, the platform automatically presents parameter options and context-aware operators (e.g., regex matching, domain allow-lists, numeric bounds).
  • Automated Heuristics: Platforms suggest baseline policies based on schema semantics. For instance, fields labeled recipients automatically prompt for domain constraints, while parameters named amount suggest financial threshold limits.
  • Policy Inheritance: Rules are defined once at the resource or application level. Any agent granted access to that resource automatically inherits parameter bounds, eliminating redundant policy creation.
  • Simulation and Shadow Modes: New parameter controls run in non-blocking observation modes to establish baselines and verify traffic patterns without disrupting production workflows.

Conclusion

Future agent compromises will rarely look like traditional perimeter breaches. Instead, they will hide in plain sight as authorized workflows executing legitimate tools with malicious arguments.

Protecting agentic systems requires moving beyond perimeter trust. By positioning an Agent Gateway at the runtime layer to inspect parameter values, security teams can enforce meaningful guardrails before execution occurs.

References

In September 2025, security researchers exposed a supply chain attack hidden within postmark-mcp—an open-source Model Context Protocol (MCP) server designed to enable AI agents to send transactional emails.

For fifteen releases, the package performed flawlessly as a faithful clone of the official integration. Then version 1.0.16 shipped with a single line of modified code.

From that moment on, every email dispatched by an agent carried a silent bcc to an attacker-controlled address (phan@giftshop[.]club). Password resets, invoices, and internal communications were systematically exfiltrated alongside legitimate routing. By the time it was yanked, the package had compromised roughly 1,600 environments.

Standard dependency scanners missed the threat entirely. Why? Because the payload generated perfectly valid, well-formed API traffic. The tool name was send_email. The execution path was send_email.

The Core Realization: The adversary didn't elevate privileges, bypass authentication, or introduce new tools. The agent executed an authorized action—the exploit lived entirely inside a single parameter value on the wire.

The Attack Rides an Allowed Path

The postmark-mcp incident is not an isolated anomaly. It reflects an operational reality across modern agentic infrastructure: attackers trick authorized tools into executing malicious parameters.

Recent exploits highlight this exact attack pattern:

  • EchoLeak (CVE-2025-32711): Disclosed by Aim Security, this zero-click vulnerability in Microsoft 365 Copilot allowed a crafted email to coerce the model into reading sensitive internal files and exfiltrating them to an external endpoint.
  • Slack AI Indirect Injection: PromptArmor demonstrated that hidden instructions embedded in public channels could manipulate Slack AI into leaking private channel messages via rendered links.
  • Database Token Exfiltration: Support workflows integrating Cursor agents with Supabase were manipulated into evaluating untrusted ticket content as executable SQL, leaking integration tokens in the process.

According to OWASP GenAI tracking, prompt injection remains a top failure mode for production agents. Meanwhile, recent benchmark studies reveal that MCP tool-poisoning techniques achieve strikingly high success rates against standard framework implementations.

The Gateway as the Primary Inspection Point

To intercept attacks hidden within parameter values, security controls must operate where arguments are parsed and executed: at the Agent Gateway.

When all agent-to-application tool calls route through a centralized enforcement point, that choke point gains full visibility into four critical vectors:

  1. Identity: Which specific agent is initiating the request?
  2. Context: On whose behalf is the agent acting?
  3. Destination: Which target application and tool are being invoked?
  4. Payload: What exact parameter values are present on the wire?

By separating the Policy Decision Point (PDP) from the Policy Enforcement Point (PEP), organizations apply Zero Trust principles directly to AI workflows. The gateway acts as the PEP, treating runtime argument values as vital inputs for the PDP before traffic ever reaches downstream resources.

Parameter Values as Critical Policy Signals

Parameter evaluation is not a silver bullet or a binary "lie detector." Instead, it provides the missing piece in a multi-layered defense strategy. Every traditional security layer has a structural blind spot that runtime parameter inspection addresses:

Security Layer Focus Structural Blind Spot
Identity & Authentication Verifies cryptographic identity and user delegation. Cannot inspect payload contents on the wire.
Tool Allow-Lists Approves execution of specific functions (e.g., send_email). Completely blind to target argument values.
Behavioral Analytics Tracks baseline request frequency and volume. Sees normal emails and shadow-copied emails as identical traffic.
Intent Analysis Interprets model prompt context and reasoning. Misses malicious parameters injected directly into tool execution fields.
Parameter Inspection Evaluates explicit parameter values passed to inputs at runtime. None. Surfacing hidden threats like unauthorized bcc domains.

In the postmark-mcp attack, traditional identity, allow-list, and behavioral controls all yielded false safety signals. The tool call was authorized, the caller was authenticated, and the request format was standard. Parameter inspection was the only signal capable of stopping the exploit.

Operationalizing Parameter Governance at Scale

The primary barrier to parameter-level enforcement is administrative overhead. An enterprise ecosystem might expose hundreds of tools, each accepting dozens of arguments. Manually writing declarative rules for every parameter quickly becomes unsustainable.

Historically, organizations have relied on two flawed approaches:

  • Coarse, Automated Scanners: Generic API filters scan payloads for broad signatures like PII. However, they miss context-specific threats. An external bcc address is structurally valid email data—not PII—so generic scanners pass it through without alarm.
  • Fine-Grained, Manual Rules: Declarative policies offer high precision but require security teams to hand-craft rules for every schema field, leading to severe maintenance overhead and policy coverage gaps.

A Schema-Driven Path Forward

Achieving parameter-level security without friction requires schema-driven policy workflows:

  • Schema-Driven Auto-Completion: Gateways parse the target tool's OpenAPI or MCP input schema directly. When an administrator crafts a policy, the platform automatically presents parameter options and context-aware operators (e.g., regex matching, domain allow-lists, numeric bounds).
  • Automated Heuristics: Platforms suggest baseline policies based on schema semantics. For instance, fields labeled recipients automatically prompt for domain constraints, while parameters named amount suggest financial threshold limits.
  • Policy Inheritance: Rules are defined once at the resource or application level. Any agent granted access to that resource automatically inherits parameter bounds, eliminating redundant policy creation.
  • Simulation and Shadow Modes: New parameter controls run in non-blocking observation modes to establish baselines and verify traffic patterns without disrupting production workflows.

Conclusion

Future agent compromises will rarely look like traditional perimeter breaches. Instead, they will hide in plain sight as authorized workflows executing legitimate tools with malicious arguments.

Protecting agentic systems requires moving beyond perimeter trust. By positioning an Agent Gateway at the runtime layer to inspect parameter values, security teams can enforce meaningful guardrails before execution occurs.

References