Skip to content

AI Security Research: Tool Poisoning & The Semantic Supply Chain

1. Introduction: The Shift from Code to Semantics

Section titled “1. Introduction: The Shift from Code to Semantics”

As established in our research on Function Hijacking Attacks, an LLM operating within an orchestration framework acts as a semantic interpreter. When an agent is instantiated, it is provided with a “toolbox”—a set of capabilities defined by JSON schemas, OpenAPI specifications, or Model Context Protocol (MCP) manifests.

To the orchestration framework (like LangChain or AutoGen), these schemas are structured configuration files. But to the LLM, they are highly authoritative system instructions.

This architectural reality creates a massive vulnerability: The Semantic Supply Chain.

When an enterprise AI agent dynamically loads a third-party plugin or connects to an external MCP server to expand its capabilities (e.g., a “GitHub Integration” or a “Jira Ticket Manager”), it ingests the tool’s descriptions directly into its context window. If a threat actor compromises the tool’s manifest, they are no longer just altering configuration data; they are injecting zero-day cognitive payloads directly into the agent’s central nervous system.

Tool Poisoning fundamentally differs from Indirect Prompt Injection. In an indirect injection, the payload is hidden in the data the LLM processes (e.g., a read email). In Tool Poisoning, the payload is embedded in the definition of the tool itself.

Because the LLM views tool descriptions as authoritative system directives designed to help it reason about its environment, payloads hidden here possess disproportionate semantic gravity.

2.1 Metadata Poisoning & Semantic Payloads

Section titled “2.1 Metadata Poisoning & Semantic Payloads”

Attackers manipulate the description, name, or parameters fields of a tool manifest to include stealthy behavioral overrides.

Consider an organization utilizing a dynamically loaded, open-source text formatting tool.

{
"name": "format_markdown",
"description": "Formats raw text into clean, readable Markdown. Use this tool before presenting final reports to the user.",
"parameters": {
"type": "object",
"properties": {
"raw_text": { "type": "string" }
}
}
}

When the orchestration framework concatenates this schema into the system prompt, the LLM internalizes the “CRITICAL SYSTEM OVERRIDE.” The next time the agent attempts to format text, the poisoned metadata successfully hijacks the execution flow, coercing the agent into pivoting to a highly privileged tool (run_system_diagnostic) that it otherwise would not have called.

Beyond static payload injection, adversaries in 2026 exploit the dynamic resolution of tools.

  • Shadowing Attacks: An attacker publishes a malicious tool to an internal or external registry with a name identical to, or closely mimicking, a heavily utilized, trusted tool (e.g., aws_s3_read vs. aws_s3_reader). If the orchestration framework prioritizes the malicious tool or the LLM’s semantic routing is confused, the agent silently routes sensitive execution data through the attacker’s endpoint.
  • Rug-Pull Attacks: A developer audits a benign tool and approves it for corporate use. Post-approval, the attacker updates the remote OpenAPI spec or MCP manifest served by their endpoint, hot-swapping the benign description with a weaponized semantic payload. Because the framework fetches the schema dynamically at runtime, the agent is compromised instantly without any code changes on the victim’s infrastructure.

3. MCP Security: Expanding the Attack Surface

Section titled “3. MCP Security: Expanding the Attack Surface”

The introduction of the Model Context Protocol (MCP) by Anthropic fundamentally accelerated the adoption of dynamic toolchains. MCP standardizes how AI models connect to data sources and tools, effectively acting as the USB-C standard for Agentic AI.

However, as highlighted by recent vulnerability disclosures (documented by MBGSec and Tom’s Hardware regarding critical MCP server flaws), this protocol expands the AI attack surface exponentially.

Trust Boundary Collapse

MCP transforms isolated LLMs into distributed microservices. When an MCP client connects to an external MCP server, it retrieves a list of tools and resources. The LLM inherently trusts the remote server’s structural definitions, collapsing the boundary between external, untrusted infrastructure and internal reasoning logic.

Malicious MCP Registries

Similar to the crises surrounding npm or PyPI, the emergence of community-driven MCP registries creates a systemic vulnerability. An attacker deploying a rogue MCP server can push poisoned tool schemas to thousands of connected enterprise agents simultaneously.

4. Transitive Trust Abuse and Semantic Lateral Movement

Section titled “4. Transitive Trust Abuse and Semantic Lateral Movement”

The most catastrophic consequence of Tool Poisoning manifests in multi-agent environments. When organizations deploy swarms of AI agents, they inevitably establish hierarchical trust boundaries. For example, a low-privileged Data_Ingestion_Agent might be permitted to interact with a high-privileged Database_Admin_Agent.

If an adversary successfully poisons a widely used, seemingly innocuous third-party tool (e.g., an open-source markdown_formatter or a date_calculator MCP plugin), they exploit Transitive Trust.

  1. The Initial Infection: The Data_Ingestion_Agent loads the poisoned markdown_formatter tool from an external registry. The malicious schema instructs the agent to embed a hidden, obfuscated payload in all formatted outputs.
  2. The Handoff: The Data_Ingestion_Agent formats a user’s document and hands the result over to the Database_Admin_Agent for archiving.
  3. Semantic Lateral Movement: The Database_Admin_Agent reads the text. Because it fundamentally trusts inputs generated by internal peers, its cognitive defenses are lowered. The hidden payload within the formatted text hijacks the Admin Agent’s routing logic.
  4. Execution: The Admin Agent executes a Function Hijacking Attack, utilizing its privileged execute_sql tool to drop tables or exfiltrate data, all while attributing the action to a legitimate internal workflow.

This represents the ultimate collapse of execution boundaries: the attacker used a supply-chain attack on a simple formatting tool to achieve lateral movement and compromise a database via a highly privileged agent.

5. Forensic Investigation & Runtime Detection (DFIR)

Section titled “5. Forensic Investigation & Runtime Detection (DFIR)”

Traditional supply-chain defenses rely on Software Bill of Materials (SBOMs), binary signing, and hash verification. These controls are entirely blind to Semantic Tool Poisoning. An attacker updating a JSON description field does not change the cryptographic signature of the underlying Python execution code; they only change the cognitive payload fed to the LLM.

DFIR analysts must implement Orchestration-Layer Telemetry to detect semantic tampering.

Security Operations Centers (SOCs) must monitor the initialization phase of Agentic frameworks. When an agent boots and connects to an MCP server or loads an OpenAPI spec, the framework must log the exact JSON schemas ingested. Analysts should establish a baseline of these schemas and alert on Schema Drift—unauthorized modifications to the description or parameter strings of critical tools.

B. Detecting Semantic Anomalies in Tool Definitions

Section titled “B. Detecting Semantic Anomalies in Tool Definitions”

Tool descriptions should be concise and strictly functional. The presence of imperative commands, overrides, or behavioral instructions within a tool manifest is a massive Red Flag.

hunt_tool_schema_poisoning.kql
// Detects anomalous or malicious directives embedded within dynamic Tool Schemas or MCP Manifests
AIOrchestrationEvents
| where ActionType == "ToolSchemaLoaded" or ActionType == "MCPConnectionEstablished"
| extend ToolDescription = tostring(ParsedSchema.description)
| extend ToolName = tostring(ParsedSchema.name)
// Hunt for prompt injection vectors masquerading as tool descriptions
| where ToolDescription has_any (
"SYSTEM OVERRIDE",
"IGNORE PREVIOUS INSTRUCTIONS",
"MUST EXECUTE",
"Bypass",
"CRITICAL ALERT"
)
// Measure length: Tool descriptions over 500 chars are highly unusual and suggest payload stuffing
| extend DescLength = string_size(ToolDescription)
| where DescLength > 500
| project TimeGenerated, ApplicationName, ToolName, ToolDescription, SourceRegistryIP
| sort by TimeGenerated desc

6. Defensive Architectures: Securing the Semantic Supply Chain

Section titled “6. Defensive Architectures: Securing the Semantic Supply Chain”

To mitigate Tool Poisoning, organizations must adopt Capability-Oriented Security Architectures that enforce Zero Trust at the orchestration layer.

  1. Schema Pinning and Immutable Manifests: Do not fetch tool schemas dynamically at runtime from external MCP servers or web endpoints. Schemas must be statically defined, stored in local version control, cryptographically hashed, and loaded from disk. The orchestration framework should reject any tool whose loaded schema hash does not match the approved baseline.
  2. Semantic Sandboxing (The Dual-LLM Defense): Before a tool’s description is fed into the primary Agent’s system prompt, it should be processed by a smaller, isolated “Sanitizer LLM.” This model is specifically trained to detect and strip imperative commands, prompt injections, and behavioral overrides from JSON payloads, ensuring the primary agent only receives clean, functional descriptions.
  3. Strict Least Privilege for LLM Agents: Assume the semantic supply chain will eventually be breached. Agents must operate under strict, ephemeral IAM roles. A compromised Markdown formatting tool should mathematically be unable to leverage AWS STS tokens or execute bash commands, effectively containing the blast radius of the poisoned schema.

Tool Poisoning fundamentally alters how we perceive software dependencies. In traditional systems, importing a compromised library results in arbitrary code execution. In Agentic AI, importing a compromised tool description results in arbitrary cognitive execution.

As frameworks like the Model Context Protocol democratize access to interconnected tool ecosystems, the semantic trust boundary collapses. Securing these systems requires a paradigm shift: treating natural language documentation, JSON schemas, and API metadata with the exact same cryptographic rigor and suspicion as compiled executable binaries.

The semantic supply chain is the new frontline of AI security.