Agent Tool-Invocation Hijacking
Description
Adversary Behavior: Adversaries manipulate the inputs to autonomous AI coding agents to redirect their tool invocations toward adversary-specified actions, including arbitrary command execution, data exfiltration, and unauthorized system modifications.
AI/IDE Mechanism: AI coding agents are granted the ability to invoke tools — including shell commands, file operations, web requests, and API calls — as part of their development workflow. The agent selects and parameterizes tool calls based on its context, which includes tool descriptions, tool return values, and files read during task execution. This context-driven tool selection is susceptible to manipulation.
Execution Path: The adversary crafts malicious content in tool descriptions, tool return values, or files that the agent reads during task execution. This content influences the agent's tool selection and invocation behavior, causing the agent to execute redirected tool invocations with the permissions of the user running the IDE. Sensitive data can be exfiltrated through tool arguments such as encoding data in web request parameters. Testing demonstrated successful exploitation across 19 of 25 agent-LLM pairs in production coding environments.
Security Impact: Redirected tool invocations execute with the full permissions of the hosting user session, enabling arbitrary command execution, data exfiltration, and unauthorized file and system modifications through the agent's legitimate tool-use interface.
Platforms
Detection
Log all agent tool invocations with full argument content and correlate with the originating task context. Flag tool invocations whose arguments contain data derived from recently read files. Monitor for shell executions initiated by the agent process that perform network operations, credential access, or file exfiltration.
Detecting Data Components (5)
Mitigations (1)
Data Sources
References
STIX Metadata
| type | attack-pattern |
| id | attack-pattern--20d8ce23-9aff-4232-b63a-296e2ec07b99 |
| spec_version | 2.1 |
| created | 2026-02-23T00:00:00.000Z |
| modified | 2026-02-23T00:00:00.000Z |
| created_by_ref | identity--f5b5ec62-ffbd-4afd-9ee5-7c648406e189 |
| x_mitre_is_subtechnique | False |
| x_mitre_version | 0.1 |
| x_mitre_status | candidate |