Skip to main content

Agentjacking: The Attack That Turns Your AI Coding Agent Against You

Sunday 21 June 2026|Tenet Security / Sentry|
Secure AI BrainEmployee Amplification Systems

Security researchers at Tenet Security disclosed a novel attack called agentjacking, which exploits the Sentry error-tracking MCP server to hijack AI coding agents including Claude Code, Cursor, and OpenAI Codex. By injecting a malicious payload into a project's public Sentry error endpoint, an attacker can cause an AI agent to execute arbitrary code with full developer privileges. Researchers confirmed 2,388 organisations exposed and achieved an 85% exploitation success rate across 100-plus real targets.

Operator Insight

The agentjacking disclosure is a precise illustration of a structural problem that will define enterprise AI security for the next few years. When you give an AI agent access to external tools, including legitimate business tools like error trackers, that agent treats the data returned by those tools as trusted instructions. There is no native scepticism, no verification layer, no firewall between what the tool returns and what the agent decides to do next. Sentry acknowledged the issue is technically not defensible and passed the problem to model vendors. Model vendors have not yet solved it. That gap is open right now, and 2,388 organisations with exposed Sentry DSNs are sitting in it. For any business with developers using Claude Code, Cursor, or Codex, this is an immediate audit item, not a future roadmap consideration. The fix is not complicated: review which MCP servers your agents are connected to, restrict agent access to external data sources during sensitive operations, and treat Sentry errors retrieved by an agent the same way you would treat input from an untrusted user.

30-Second Summary

Security researchers at Tenet Security disclosed a new class of attack called agentjacking, which uses Sentry's public error-tracking endpoint to inject malicious instructions into AI coding agents. When a developer asks their AI agent to fix unresolved Sentry issues, the agent retrieves and executes the attacker's payload with full developer privileges. The attack requires no server compromise, no phishing, and no authentication beyond a public credential embedded in most production websites. Researchers confirmed 2,388 organisations exposed and an 85% success rate in real-world testing.

At a Glance

  • Topic: AI Security
  • Company: Tenet Security (research) / Sentry (affected platform) / Anthropic, Anysphere (Cursor), OpenAI (affected agents)
  • Date: Disclosed June 12, 2026
  • Announcement: Public proof-of-concept demonstrating agentjacking attacks against Claude Code, Cursor, and OpenAI Codex
  • What Changed: Researchers showed that MCP-connected AI agents can be hijacked via untrusted external data sources without any compromise of the agent itself
  • Why It Matters: The attack surface is every AI coding agent connected to an external tool via MCP, which includes the majority of professional developer workflows in 2026
  • Who Should Care: Any business with developers using AI coding agents, any team using Sentry for error tracking, and any organisation deploying agentic AI in production

Key Facts

  • Attack vector: Sentry's event ingestion accepts arbitrary payloads from anyone with a Data Source Name (DSN), a credential typically found in front-end JavaScript bundles and browser source code
  • Exploitation rate: Tenet's researchers tested more than 100 real-world targets and achieved an 85% successful exploitation rate
  • Exposure scale: At least 2,388 organisations have publicly injectable Sentry DSNs, including 71 within the global Tranco top-1 million website list
  • Confirmed affected: A Fortune 500 company with an estimated valuation near $250 billion and a hosting infrastructure provider with $2 billion in assets under management
  • Data at risk: Environment variables, Git credentials, private repository URLs, SSH keys, and developer identities
  • Sentry's response: Sentry was notified on June 3, 2026, introduced a global content filter for one known payload string, and stated the issue is "technically not defensible," deferring broader mitigation to AI model vendors
  • Affected agents: Claude Code (Anthropic), Cursor (Anysphere), Codex (OpenAI)

What Happened

Tenet Security Threat Labs published a proof-of-concept demonstrating that AI coding agents connected to Sentry via MCP can be hijacked by a third party with no prior access to the developer's machine, no compromise of the Sentry platform, and no interaction from the developer beyond asking their agent to triage bugs.

The mechanism relies on two structural features of how these systems work together. First, Sentry's event ingestion endpoint is publicly writable by anyone who holds a valid DSN. DSNs are, by design, embedded in production applications so that errors can be reported from the browser. They are routinely visible in page source code, JavaScript bundles, and public repositories. Second, when a developer asks their AI coding agent to review unresolved Sentry issues, the agent connects to Sentry via MCP and treats the errors returned as trusted information it should act on.

An attacker can post a crafted error event to a target's Sentry account at any time before the developer makes that request. When the agent retrieves the error queue and processes the attacker's injected payload, it executes the embedded instructions with the developer's full system privileges, including access to the filesystem, shell, Git configuration, and any credentials stored in environment variables.

Tenet tested the attack across more than 100 real-world organisations and confirmed an 85% exploitation rate. Researchers identified at least 2,388 organisations with injectable Sentry DSNs, found 71 within the global Tranco top-1 million, and confirmed that a Fortune 500 company near $250 billion in valuation was among those exposed. The exfiltrated data in a real attack would include SSH keys, API tokens, Git credentials, and private repository URLs, obtained without phishing, without prior server access, and without triggering conventional security tooling.

Sentry was notified on June 3, 2026. The company introduced a global content filter for one specific payload string but characterised the underlying issue as "technically not defensible," explaining that the combination of a public write endpoint and an AI agent that processes that data as trusted input cannot be solved at the Sentry layer alone. Sentry deferred the broader fix to AI model vendors, who have not yet shipped a systematic solution.

Why It Matters

It affects the tools developers are already using today. Claude Code, Cursor, and Codex are not niche research tools. They are production developer environments in daily use at companies across every sector. An 85% exploitation rate against a hundred real-world targets means this is a deployable attack, not a theoretical edge case.

MCP is the standard integration layer for AI agents in 2026. The Sentry MCP server is one of hundreds of MCP-connected tools that AI coding agents can be configured to use. The agentjacking technique is not unique to Sentry. Any MCP server that returns data from a source that can be written to by an untrusted party is a potential injection point. Sentry is the first publicly documented instance. It will not be the last.

The fix has been passed between vendors with no resolution. Sentry says it cannot defend this at its layer. AI model vendors have not shipped a systematic solution. That leaves the organisation in the middle, holding an attack surface it did not knowingly create. Operators need to act on their own configuration rather than waiting for vendors to resolve the architectural gap.

Data exfiltration leaves no obvious trace. Because the agent is executing what looks like a normal developer instruction from a trusted tool, there is no obvious anomaly in agent logs. The attacker's code runs in the context of a standard coding session. Traditional endpoint detection and response tools that look for unusual process spawning or network calls may not flag this pattern.

The 2,388 exposed organisations represent the visible surface. Tenet's scan identified organisations with publicly injectable DSNs. Organisations with DSNs exposed through less visible channels, internal tools, or partner systems are not captured in that count.

The David and Goliath View

Agentjacking is not a bug in any one product. It is a consequence of building AI agents that are designed to be helpful by taking external data at face value, and then connecting those agents to real-world systems that were never designed to be trusted data sources. Sentry's error-tracking infrastructure was built to accept anything a browser sends. An AI agent was built to act on anything a connected tool returns. Nobody wrote a policy for what happens when those two systems are wired together.

The security industry is, predictably, behind. Detection and response tools were designed for a world where threats came from compromised credentials, malicious binaries, or network intrusions. An attack that travels through a legitimate MCP server as a well-formatted error event is invisible to most of that tooling. The gap between what AI agents can do and what enterprise security architecture was designed to protect is real, documented, and open.

For operators at 10-to-200-person companies, the practical translation is this: every MCP integration you add to an AI agent is a trust boundary you are implicitly accepting. You should know what those boundaries are, who controls the data on the other side, and what your agent will do if that data contains unexpected instructions. Right now, most teams do not have that inventory. Building it is not a long project. It is an afternoon conversation that pays for itself the first time an attacker looks for your Sentry DSN.

Where This Fits in the AI Stack

Agentjacking sits at the intersection of three layers that are all evolving simultaneously: AI agent runtimes, the MCP protocol that connects them to external tools, and the external tools themselves. The vulnerability is not in any single layer. It emerges from the combination.

The Secure AI Brain offering from David and Goliath addresses exactly this type of structural risk, helping organisations build and govern AI systems with explicit trust boundaries, auditable tool access, and a security architecture that anticipates the novel attack surfaces created when AI agents interact with live business data.

Questions Operators Are Asking

Do we need to use Sentry with our AI coding agents? No. MCP integrations are optional configuration. If your team uses Claude Code, Cursor, or Codex, review which MCP servers are enabled. Disable the Sentry MCP server for any developer whose workflow does not require it, and consider whether other connected tools share the same structural risk.

Is our DSN actually exposed? Check your production JavaScript bundles and any public repositories for strings beginning with https://[hash]@sentry.io/. If you find one, that DSN is writable by anyone on the internet. Rotate it immediately and review the Sentry project settings to restrict what events can be injected.

Has Sentry fixed this? Sentry introduced a content filter for one known payload string. The company has stated this is not a complete fix and that the underlying architecture cannot be fully defended at the Sentry layer. Treat the platform as still vulnerable to novel payloads.

What should we tell our development team right now? Three things: (1) Do not ask your AI coding agent to automatically triage or fix Sentry errors without reviewing the error queue yourself first. (2) Assume your agent treats Sentry errors as trusted instructions. (3) Run your coding agent in a sandboxed environment when handling external data sources where possible.

Will other MCP tools have the same problem? Likely yes. The attack pattern, injecting instructions into a data source that an MCP-connected agent will retrieve and act on, applies to any tool where an external party can write data that the agent will later process. Email inboxes, support ticket systems, public issue trackers, shared project management tools, and customer-submitted form data are all plausible candidates. This is an early documented instance of a problem class, not an isolated product flaw.

Citable Summary

Tenet Security disclosed the agentjacking attack in June 2026, demonstrating that AI coding agents including Claude Code, Cursor, and OpenAI Codex can be hijacked by injecting malicious instructions into a target organisation's Sentry error-tracking endpoint. The attack exploits the combination of Sentry's publicly writable event ingestion and AI agents that treat MCP-returned data as trusted instructions. Researchers confirmed 2,388 organisations exposed, an 85% real-world exploitation rate, and data exfiltration including environment variables, Git credentials, and SSH keys. Sentry introduced a limited content filter and characterised the issue as technically not defensible, deferring a broader fix to AI model vendors.

Why This Matters for Operators

  • Audit which MCP servers your AI coding agents are connected to and remove any you do not actively use or cannot fully trust.

  • Treat data returned by MCP tools as user input, not as system instructions. If your agent framework does not enforce this distinction, raise it with your vendor.

  • Check whether your Sentry DSN is exposed in client-side code, browser bundles, or public repositories. Rotate any DSN that has been publicly visible.

  • Do not ask your AI coding agent to triage or fix Sentry issues in an automated loop without human review of the errors it is processing first.

  • Review your AI tool usage policies to confirm developers understand the risk of running agents with broad filesystem or shell access without process-level sandboxing.

Apply This to Your Business

Want to see what this means for your team?

Tell us a little about your business and we will map the specific opportunity for your sector and team size.

No sales pitch. We will review your details and follow up within 24 hours.