Agentjacking: the attack that turned 2,388 companies' AI agents against them
A new attack hijacked AI coding agents at 2,388 companies through fake error reports. What agentjacking is, and how to keep your agents safe.
In June 2026 a new class of attack got a name: 'agentjacking'. Researchers documented a campaign that hit 2,388 organizations by hiding malicious instructions inside fake error reports. The mechanism is unsettlingly simple — an attacker files a bogus Sentry error containing markdown with injected commands, an AI coding agent reads that error to 'fix the bug', and executes the attacker's instructions instead. In tests it succeeded 85% of the time.
What makes agentjacking dangerous is that it weaponizes exactly the workflow teams adopted for productivity. The whole point of an autonomous coding agent is that it reads context — issues, logs, error trackers — and acts on it without a human in the loop. The moment that context can be written by an outsider, your error tracker becomes an untrusted input pipeline straight into a system that can edit code, open pull requests, and run commands. Convenience and attack surface turned out to be the same feature.
This is the production face of prompt injection, and it generalizes far beyond Sentry. Any place an agent ingests data it didn't generate — support tickets, emails, web pages it browses, third-party API responses, a teammate's commit message — is a potential injection vector. If you've connected agents to tools through MCP or similar, every connected source is now part of your threat model. The blast radius is whatever permissions you handed the agent.
The mitigation is architectural, not a patch. Put a human review layer between any externally-writable data source and an agent that can take consequential action. Treat agent-readable inputs as untrusted by default and sanitize them. Scope agent permissions to the minimum the task needs, log every tool call, and gate anything irreversible — merging, deploying, deleting, spending — behind explicit approval. The same discipline that makes MCP safe makes agents safe: narrow permissions, a full audit trail, and a human in the loop where it counts.
Agentic workflows are worth keeping — this isn't a reason to rip them out. It's a reason to stop treating an AI agent as a trusted internal user and start treating it as a powerful, gullible one. Map every input your agents can read, ask 'who can write to this?', and add a checkpoint wherever the answer is 'an outsider'. The teams that do this quietly keep their velocity; the ones that don't are one well-crafted error report away from a very bad day.
Key Takeaways
- 'Agentjacking' hit 2,388 orgs: fake Sentry error reports with markdown injection hijacked AI coding agents, 85% success rate
- Any data an agent ingests but didn't generate — tickets, emails, logs, browsed pages — is an injection vector
- Treat agent-readable inputs as untrusted; scope permissions tightly and audit every tool call
- Put human approval between externally-writable sources and any irreversible action (merge, deploy, delete, spend)
Zerguine Abdelbasset
PerceptronDev Team
