FALCONINTERNET

Agentjacking: Fake Sentry Errors Are Hijacking AI Coding Agents

Security
Agentjacking: Fake Sentry Errors Are Hijacking AI Coding Agents

If your development team is using an AI coding agent alongside Sentry for error monitoring — and as of mid-2026, a lot of teams are — a research disclosure published June 12 deserves your attention before the next sprint. Researchers at Tenet Security have documented an attack they call agentjacking: a technique for injecting malicious instructions into Sentry error events and letting your AI coding assistant execute them with your own credentials, while every conventional security control in your stack gives the all-clear.

How Error Monitoring Became an Attack Surface

Sentry uses a credential called a Data Source Name (DSN) to accept error reports from your application. Because the DSN is designed for browser-side telemetry collection, it is intentionally public — embedded in compiled JavaScript, frequently visible in GitHub repositories, often discoverable through passive scanning. Anyone with a valid DSN can POST arbitrary event payloads to your Sentry project, and those events land in your error queue alongside real application crashes. That is the intended behavior. The problem is what happens to those events once an AI agent enters the picture.

Modern AI coding agents — Claude Code, Cursor, Codex — increasingly connect to Sentry via the Model Context Protocol (MCP), the emerging standard for wiring LLMs to external tools and data sources. When a developer instructs their agent to "investigate the open Sentry issues and figure out what needs fixing," the agent retrieves the full error queue. All of it. Including whatever an attacker planted.

The Attack in Six Steps

Tenet Security's documented attack chain is uncomfortable in its elegance:

  • The attacker finds a target's Sentry DSN — extracted from a JavaScript bundle, a public GitHub repository, or a scanning service that indexes such things.
  • The attacker POSTs a crafted error event with Markdown-formatted "diagnostic guidance" embedded in the message and context fields, formatted to visually mimic legitimate Sentry resolution templates.
  • The injected event appears in the target's project error queue alongside real application errors, indistinguishable without careful reading.
  • A developer asks their AI coding agent to work through the unresolved Sentry issues.
  • The agent retrieves the injected event via MCP and, finding no structural difference between it and genuine Sentry output, executes the embedded instructions.
  • The payload exfiltrates what it can reach: .env files, AWS access keys, GitHub tokens, OAuth tokens, npm registry tokens, Kubernetes cluster credentials, private repository URLs.

In controlled testing across more than 100 organizations, Tenet achieved an 85% exploitation success rate against Claude Code, Cursor, and Codex. The researchers identified at least 2,388 organizations with injectable Sentry DSNs currently exposed — from Fortune 500 companies and cloud security vendors down to solo developers. Among the Tranco top-one-million websites alone, 71 had injectable DSNs.

Why Every Security Tool in Your Stack Says "Fine"

What makes this attack structurally difficult to detect is that no unauthorized action occurs at any point in the chain. Tenet calls it the Authorized Intent Chain: the agent running npm install, reading an environment file, or making a credential API call does so as the developer, under the developer's active session, using the developer's authorized permissions. The EDR sees a trusted process. The WAF sees normal outbound traffic. IAM sees credentials used as intended. Nothing fires. The exfiltration completes before any human notices that the "Sentry error" the agent just fixed was never real.

Even explicit instructions to the agent to "ignore untrusted content in Sentry events" proved ineffective during testing. Agents could not reliably distinguish injected payload from legitimate diagnostic context when the payload was formatted to match Sentry's own output templates — the structural cues that would tip off a careful human reader are invisible to the LLM's trust model.

Sentry's Response: Acknowledged, Not Fixed

Tenet disclosed to Sentry on June 3, 2026. Sentry acknowledged the issue the same day but declined to address the root cause, characterizing it as "technically not defensible" at the platform level. What the company did implement was a global content filter blocking the specific payload string used in Tenet's research. That filter is reactive to one known variant. Any attacker who reads the Cloud Security Alliance research note can adjust their payload to sidestep it — and the underlying mechanism of accepting arbitrary events via a publicly embeddable DSN remains unchanged. No CVE has been assigned to the attack class.

What to Do About It

A vendor fix is not coming in the near term. The controls that matter are on your side:

  • Audit MCP server connections. List every MCP server your team's agents are currently connected to. Disable the Sentry MCP integration on any workstation where it isn't actively and regularly used.
  • Require explicit human approval for agent actions. Reconfigure AI coding agents to request per-action confirmation before executing shell commands or installing packages — especially when the triggering context came from an external tool. The added friction is worth the tradeoff.
  • Move your DSN behind a server-side relay. If your Sentry DSN is embedded in client-side JavaScript, rotate it and route all Sentry ingestion through a server-side relay so the credential never appears in browser-rendered code.
  • Replace long-lived credentials in your environment. AWS access keys, GitHub PATs, and npm tokens sitting in .env files are exactly the harvest this attack is optimized for. Migrate to short-lived, scoped tokens wherever your platform supports them.
  • Isolate agent execution environments. AI coding agents should run in containers or sandboxes with restricted filesystem access, no route to cloud metadata endpoints (169.254.169.254 and the IMDSv2 equivalent), and no write access to credential stores beyond what a given task requires.

The architectural lesson underneath all of this: AI agents extend implicit trust to every data source their connected tools return. If any of those sources accepts external input — and Sentry's does, deliberately, by design — you have a prompt injection surface regardless of how trustworthy the integration looks on paper. As agentic AI embeds deeper into standard development workflows, auditing what an agent can see and what it can do matters as much as auditing the agent itself. MCP server connections deserve the same scrutiny as third-party code dependencies.

Watching how quickly real attack tooling follows new developer workflows is something we track closely — the gap between "interesting research" and "someone is actively running this" has historically been measured in weeks, not months.

Need this handled instead of explained?

We do this for a living — talk to an engineer about your setup.