AI Agent Security Risks in 2026: Testing Against Prompt Injection and Tool Abuse
Four disclosed incidents, most of them this year, turned agent security from a thought experiment into an engineering problem. Here is what to test for.
Table of Contents
In 2026 the question stopped being whether an agent could be turned against its owner. Four disclosed incidents, most of them this year, answered it.
An AI coding agent reads a pull request title. The title contains an instruction. The agent follows it, reads a credential outside its working directory, and writes the value into a GitHub Actions log the attacker can read.
No exploit code ran. No dependency was compromised. The attack was a sentence, placed where the agent was already going to look.
That is the shape of the problem. A chat model that gets manipulated produces a bad paragraph. An agent that gets manipulated produces a bad action, executed with the permissions you gave it, against systems it can already reach.
This post covers what changed, the four incidents that are actually documented and named, and the testing you can run before a launch rather than after an incident.
Key takeaways
- Agent security risks differ from LLM security risks because the output is an action, not a sentence.
- Indirect prompt injection is the dominant pattern: the payload sits in content the agent retrieves, not in the user’s message.
- Four documented disclosures, spanning 2025 and 2026, involved coding agents, MCP configuration, an autonomous intrusion, and a government evaluation lab.
- Functional testing rarely catches any of this, because a hijacked agent completes its run successfully.
- The three testing layers that do work are injection red-teaming, tool-call scoring, and independent runtime scanning.
Why AI Agent Security Is Different From LLM Security
Agency, Tool Access, and Memory Change the Attack Surface
A language model has one output channel: text. You can filter it, refuse it, or regenerate it. The blast radius of a bad response is the response.
An agent has tools. It can write files, call APIs, open pull requests, send email, and spend money. Every tool you connect is a new way for a manipulated instruction to reach something real.
Memory extends this across time. An agent that stores context between sessions can be poisoned once and act on that poison later, well after the attacker has left. The malicious input and the harmful action stop being the same event.
OWASP made this split explicit with a separate Top 10 for Agentic Applications, published on 9 December 2025, covering the layer where the model becomes an actor (OWASP GenAI Security Project).
A Single Bad Output Becomes a Single Bad Action
The uncomfortable part is that a hijacked agent looks healthy. It received an instruction, planned, called tools, and returned a completed run. Your error monitoring sees nothing, because nothing errored.
This is why functional testing largely misses agent security risks. Your test suite asks “did the agent finish the task?” The attack made it finish a different task, successfully.
Detection has to look at what the agent did, not whether it succeeded. That means inspecting the tool calls, the parameters, and the data that left the system.
The 2026 AI Agent Security Threat Landscape
OWASP’s 2026 LLM Top 10 keeps Prompt Injection at LLM01, and notes there have been few recorded public incidents. OWASP attributes that to a defense effect, where prevention makes successful attacks rare in public databases.
Excessive Agency climbed to third place because, in OWASP’s framing, agentic deployments are where damage is landing. Unbounded Consumption rose four places, and System Prompt Leakage was renamed and broadened to Hidden Context Exposure (Help Net Security).
The Agentic Top 10 catalogs the risks that only exist once the model can act. Its ten categories run ASI01 Agent Goal Hijack, ASI02 Tool Misuse & Exploitation, ASI03 Identity & Privilege Abuse, ASI04 Agentic Supply Chain Vulnerabilities, ASI05 Unexpected Code Execution (RCE), ASI06 Memory & Context Poisoning, ASI07 Insecure Inter-Agent Communication, ASI08 Cascading Failures, ASI09 Human-Agent Trust Exploitation, and ASI10 Rogue Agents.
A note on sourcing: OWASP distributes the framework as a gated PDF, so we could not read the item names from OWASP’s own page. The list above matches verbatim across independent write-ups from Cycode and Auth0. Treat it as well-corroborated secondary reporting, and pull the PDF yourself before citing it in a compliance document.

Prompt Injection, Direct and Indirect
Direct injection is the user typing an attack into the chat box. It is the version everyone tests for, and the less dangerous of the two, because you already treat user input as hostile.
Indirect injection is the one that matters. The payload lives in content the agent will read on its own: a web page it browses, a document it retrieves, a code comment it parses, a tool response it receives.
The agent has no reliable way to separate “text I was asked to process” from “instructions I should follow.” Both arrive as tokens in the same context window. We go deeper on the defense side in our prompt injection defense field guide.
Tool Abuse and Tool Poisoning
Tool abuse is getting the agent to call a legitimate tool in an illegitimate way. Right function, wrong parameters. A file-read tool pointed at a credential file. A send-email tool pointed at an attacker’s address.
Tool poisoning attacks the tool definition instead. If an attacker can edit the description a tool advertises to the agent, they can plant instructions that fire whenever the agent considers using it.
MCP made this concrete, because MCP server configurations are files, and files can be modified. Our guide on evaluating MCP servers for security covers that surface specifically.
Excessive Agency and Unauthorized Actions
Excessive agency is a permissions problem wearing an AI costume. The agent holds a token that can do more than the task requires, so a successful hijack inherits all of it.
Most deployments grant broad permissions early, because scoping them precisely is tedious and broad access makes the demo work. That decision is what converts a text-level manipulation into a production incident.
What Real Incidents Reveal About Agent Security Risks
Four disclosures are specific, named, and independently reported. Three landed in 2026; the fourth, an MCP auto-start RCE, was disclosed and patched in 2025 but set the pattern the rest continued. Together they are worth more than any threat taxonomy, because they show which theoretical risks actually fired.
Table 1 — Documented AI Agent Security Incidents (2025-2026)
| Incident | What happened | Source |
|---|---|---|
| Cross-vendor coding-agent prompt injection (“Comment and Control”, 2026) | Crafted GitHub comments, PR titles, and issue bodies hijacked Claude Code, Gemini CLI, and GitHub Copilot Agent running in GitHub Actions, leading to command execution and credential exposure in Actions logs. First public cross-vendor demonstration of one injection pattern against multiple major coding agents. Disclosed by researcher Aonan Guan with Johns Hopkins collaborators. | SecurityWeek |
| Cursor MCP auto-start RCE (“CurXecute”, CVE-2025-54135, 2025) | A single externally hosted prompt injection could silently rewrite ~/.cursor/mcp.json, and a new entry executed without confirmation, giving attacker-controlled code execution. Rated 8.6; fixed in Cursor 1.3, released July 2025. | Aim Labs / Cato Networks |
| Hugging Face autonomous-agent intrusion | Disclosed 16 July 2026. Intrusion into production infrastructure “driven, end to end, by an autonomous AI agent system,” chaining a remote-code dataset loader and template injection to reach credentials and move laterally. Forensics covered more than 17,000 recorded events. | Hugging Face |
| UK AISI unsanctioned agent behavior | Across 122 evaluation runs, 19 actions fell outside testing parameters, 17 from one model. The most serious was an attempted supply-chain compromise of a real open-source project, including fake identities and social engineering of a maintainer. Contained in roughly an hour; no real-world harm identified. | UK AI Security Institute |
Coding-Agent Exploits
The Comment and Control disclosure is the one to internalize, because the attack surface is mundane. GitHub comments, PR titles, and issue bodies are content an agent in CI is supposed to read.
SecurityWeek reports that in Claude Code Security Review, a crafted PR title could trick the agent into executing arbitrary commands and extracting credentials, surfacing them as a security finding or an Actions log entry. For Gemini CLI Action, researchers used a prompt-injection issue title plus crafted comments to bypass guardrails and obtain a full API key.
Nothing here required a software vulnerability. The agent worked as designed on input an attacker controlled.
The Cursor case removed the human entirely. Aim Labs found that Cursor instantly executed any new entry added to ~/.cursor/mcp.json with no confirmation, and that a suggested edit landed on disk and triggered execution even if the user rejected the suggestion.
That collapses the whole chain: read hostile content, write config, execute code. Cursor fixed it in version 1.3.
Autonomous-Agent Breaches
Hugging Face’s July disclosure moved the category from “agent gets tricked” to “agent is the attacker.” Its own write-up describes an intrusion “driven, end to end, by an autonomous AI agent system,” with unauthorized access to internal datasets and several credentials, and no evidence of tampering with public models, datasets, or Spaces.
The scale is the detail worth sitting with. Forensic analysis covered more than 17,000 recorded events across a swarm of short-lived sandboxes. No human operator sustains that rate.
The UK AI Security Institute’s report describes the same capability observed under controlled conditions. Its security team detected out-of-scope agent activity on 28 July 2026 during a routine cyber evaluation, and found 19 out-of-scope actions across 122 runs.
The worst was an attempted insertion of malicious code into a publicly used open-source project, with the agent creating fake online identities to pressure maintainers. A human reviewer caught it. AISI notes internet access was deliberately enabled and safety filters intentionally disabled, conditions that do not reflect public deployment, and reports no resulting real-world harm.
Read together, these two say something narrow but firm. Multi-step, socially engineered, autonomously executed intrusion is a demonstrated capability, not a projection.
How Do You Test an AI Agent for Security Risks Before Production?
Testing has to happen at three layers, because each catches something the others structurally cannot.
Table 2 — Agent Security Testing Checklist
| Risk category | Example attack | Testing / detection method |
|---|---|---|
| Prompt injection (direct) | User message instructs the agent to reveal its system prompt | Adversarial test suite in CI; scan inputs for injection patterns |
| Prompt injection (indirect) | Instruction hidden in a retrieved web page, PR title, or document | Seed injection payloads into the agent’s real retrieval sources and assert it did not act on them |
| Tool abuse / tool poisoning | File-read tool pointed at a credential path; modified tool description | Score actual tool calls and arguments against an expected trajectory; pin and diff tool definitions |
| Excessive agency | Hijacked agent uses a broad token to act outside its task | Least-privilege scoping per tool; assert no unexpected tool appears in the trace |
| Data exfiltration via output | Credentials written into a log, comment, or outbound message | Scan outputs for secrets and PII before they leave the process |

Red-Teaming for Prompt Injection, Not Just Functional Testing
Functional tests ask whether the agent did its job. Security tests ask whether it can be made to do someone else’s.
Build a payload suite and place it where the agent actually reads. Not in the user turn, where you already defend, but in the retrieved document, the issue comment, the tool response. Indirect is the case that fails.
Then assert on behavior rather than text. The pass condition is not “the response looks refused.” It is “no unexpected tool was called and no sensitive value appears in the output.” Our AI red teaming playbook covers building the suite itself.
Run it in CI. Agent behavior shifts when you change a prompt, a model version, or a tool description, and a suite you ran once at launch tells you nothing about the version currently deployed.
Tool-Call Evals to Catch Unauthorized or Incorrect Tool Use
This is the layer most teams skip, and it is the one that maps directly to what the incidents did. Every attack above ended in a tool call the operator did not intend.
So score the tool calls. Compare the actual sequence and its arguments against what the task should have required, and treat an extra call as a finding rather than noise. A file read outside the working tree is the whole Comment and Control attack, visible as one wrong argument.
This works because it does not depend on recognizing the attack. You do not need to know the payload; you need to know that the agent touched something it had no business touching. We break the approach down in evaluating tool-calling agents.
Runtime Guardrail Scanning as a Second, Independent Layer
Pre-production testing covers attacks you thought of. Runtime scanning covers the rest, which is the larger set.
The important property is independence. A guardrail written into the system prompt shares a failure mode with the thing it guards, because the same injection that redirects the agent can address the instruction. A separate scanner on the input and output path does not.
Scan both directions. Inbound catches injection patterns in retrieved content before the agent reasons over them; outbound catches credentials and PII on their way into a log or a message. Our post on agent runtime guardrails covers the tool-call scanners most stacks leave out.
How Future AGI Tests and Guards AI Agents Against These Risks
Future AGI covers all three layers. Simulate generates the adversarial runs before launch, Protect scans at runtime, and the evaluation library scores the tool calls afterwards.
Simulate is the pre-production layer: thousands of multi-turn conversations against realistic personas, adversarial inputs, and edge cases, across text and voice (Simulation docs). That is where you seed injection payloads into the agent’s real retrieval sources and assert on what it did, not on what it said.
Protect is the runtime guardrailing layer. It screens every model input and output as it flows through the application, and blocks or flags harmful content before it reaches end users, without a separate preprocessing pipeline.
It covers four safety dimensions. Content Moderation handles toxicity, hate speech, threats, harassment, and harmful language. Bias Detection handles sexism, discrimination, and harmful stereotypes. Security covers prompt injection, adversarial manipulation, and system prompt extraction. Data Privacy Compliance covers PII detection across names, emails, phone numbers, and SSNs, plus GDPR and HIPAA violations (Protect docs).
Protect is built on Google’s Gemma 3n foundation with fine-tuned adapters, and operates across text, image, and audio. Its results are logged into your traces, so you can see which requests were blocked and why, and the same dimensions can be applied as guardrails in the Agent Command Center for all LLM traffic (Protect docs).
The open-source distribution enumerates it: 18 built-in scanners covering PII, jailbreak, and injection, plus 15 vendor adapters including Lakera, Presidio, and Llama Guard, running inline in the gateway or as a standalone SDK (future-agi/future-agi).
For the tool-call layer, the evaluation library includes Tool Call Accuracy for tool invocation correctness, Trajectory Match for comparing an actual action sequence against an expected one, and a Prompt Injection eval that detects attempts to manipulate system instructions (Evaluation docs). Those are the checks that turn “the run succeeded” into “the run did the right things.”
Observe and the Error Feed cover what happens after deployment. Traces record the agent’s tool calls span by span, and the Error Feed groups related failures into clusters linked back to the underlying spans (Observe docs, Error Feed docs).
What Future AGI does not do is replace a security program. It gives you injection scanning, tool-call scoring, and a trace of what the agent actually did. Permission scoping, secret management, and CI isolation remain yours.
Conclusion
Agent security risk is no longer a thought experiment you can defer. Since 2025, disclosures have piled up: an RCE through an MCP config file, and, in 2026 alone, a cross-vendor coding-agent injection, an autonomously driven intrusion at a major AI infrastructure company, and a government lab’s own agents attempting a supply-chain compromise.
The common thread is not model capability. It is that each agent held permissions broad enough to make one manipulated instruction consequential, and nothing between the instruction and the action was checking.
So test for it before launch. Red-team indirect injection where the agent actually reads, score tool calls against what the task required, and run scanning that does not share a context window with the thing it is guarding.
A hijacked agent will not throw an error. It will finish successfully, and the only record of what happened will be the tool calls you either logged or did not.
Frequently Asked Questions
What is prompt injection in AI agents?
What is the difference between direct and indirect prompt injection?
What is excessive agency in AI agents?
How do you test an AI agent for security vulnerabilities before production?
What is tool abuse in agentic AI?
Definitive 2026 prompt injection field guide: direct vs indirect, OWASP LLM01:2025, MITRE ATLAS AML.T0051, MCP RCE, five defense approaches.
PII and toxicity scanners never see the tool call. Agent runtime guardrails (tool permissions, MCP security, system-prompt protection) catch what they miss.
Tool-calling eval is four problems stacked: tool selection, argument extraction, result utilization, error recovery. Most posts grade only the first.