I remember the first week I integrated an AI coding assistant into my local development environment. It felt like a force multiplier for my workflow. I could ask it to refactor a messy function or explain a cryptic stack trace from my logs. The productivity gains were immediate. I never stopped to question the trust model of the data the agent consumed. Like many security practitioners, I assumed the agent operated within a sandbox that respected the boundaries of my machine. The discovery of Agentjacking by Tenet Security proves that this assumption is a dangerous oversight in modern software engineering.
Agentjacking is a new class of attack that exploits the way AI coding agents process information from external services. It allows an attacker to execute arbitrary code on a developer's machine by feeding malicious data into tools the agent trusts. In this specific scenario, the researchers used Sentry, a popular error-tracking platform. The exploit does not require a breach of Sentry's servers or the developer's infrastructure. It relies entirely on the architecture of how AI agents interpret structured data through the Model Context Protocol.
At the center of this vulnerability is a fundamental paradox in AI agent design. These agents are designed to be helpful, proactive, and capable of taking action based on technical context. When you ask an AI to fix a bug, it often looks for data sources that provide clues about what went wrong. Sentry is one such source. It gathers error reports from applications and presents them to developers for analysis. To make this easier, many AI agents use the Model Context Protocol to query Sentry and retrieve recent error events.
From a risk perspective, the problem is that the AI agent has no way to verify the source of an error report. It treats every event returned by the Sentry server as a trusted system output. An attacker can exploit this by sending a fake error report directly to a company's Sentry endpoint. This is possible because Sentry uses a Data Source Name, or DSN, which is a public, write-only credential. You can find these DSNs embedded in the source code of millions of websites and client-side applications. Because the DSN is meant to be public so that frontend apps can report errors, anyone with the string can send data to that Sentry project.
When the AI agent queries Sentry via the protocol, it receives the attacker's malicious error report alongside legitimate ones. The agent interprets the instructions inside that fake report as diagnostic steps or resolution guidance. It then executes those instructions with the full privileges of the developer. This is a breakdown of the CIA triad, specifically impacting the integrity of the system and the confidentiality of the developer's data.
To understand the attack chain, we must look at how data moves from the public internet into the private terminal of a developer. The process begins with the attacker locating a target's Sentry DSN. This is not a difficult task. Many organizations inadvertently expose these keys in their production JavaScript bundles or public repositories. Once the attacker has the DSN, they use a standard POST request to send a crafted error event to the Sentry ingest endpoint.
This event is not a simple string. The researchers found that using specific markdown formatting within the message fields and context keys is enough to trick the AI agent. The attacker formats the payload to look exactly like a legitimate Sentry system template. When a developer asks their AI assistant to resolve unresolved Sentry issues, the assistant pulls this malicious event.
The AI agent sees a message that looks like a technical error and a set of instructions to fix it. These instructions might tell the agent to run a script to check environment variables or to update a configuration file. Because the agent believes it is reading a trusted resolution step from a diagnostic tool, it executes the command. Behind the scenes, that command could be exfiltrating Git credentials, private repository URLs, or sensitive environment variables. The attack is stealthy because the developer sees the agent doing exactly what they asked it to do: fix an error.
This attack surface is particularly problematic because it bypasses almost every layer of the modern security stack. An EDR or a firewall looks for malicious signatures or unauthorized connections. In an Agentjacking scenario, every action in the chain is authorized. The Sentry server is authorized to receive data. The AI agent is authorized to query Sentry. The developer has authorized the agent to run code on their machine.
There is no malware to detect in the traditional sense. The malicious intent is buried in the logic of the instruction, not the binary of a file. Assessing the attack surface reveals that the AI agent itself is the weakest link. It acts as a digital Trojan horse, bringing untrusted data from the public internet into a high-privileged environment. Proactively speaking, tools like Web Application Firewalls or Identity and Access Management do nothing to stop this because the attacker never touches the victim's internal infrastructure. They only interact with a public ingest point that is designed to accept data from the world.
When Tenet Security reported these findings to Sentry, the response was telling. Sentry acknowledged the issue but stated it is technically not defensible. This is a common situation in the world of API design and public ingest points. If a service is designed to accept data from any client, it cannot easily distinguish between a real crash and a malicious injection without breaking its primary function. While Sentry has implemented a global content filter to block specific payload strings, this is a reactive measure. Attackers can likely find new ways to format their markdown to bypass such filters.
The researchers tested this attack against over 100 organizations and achieved an 85% success rate. They found at least 2,388 organizations with exposed and injectable DSNs. This suggests that the vulnerability is pervasive across the industry. It is not limited to a single tool or a specific AI model. It is a systemic issue with how we are building autonomous agents that interact with external data sources. We are essentially giving these agents a VIP pass to our most sensitive systems without a bouncer at the door to check IDs.
As a countermeasure, organizations must rethink how they allow AI agents to interact with third-party services. Patching aside, the most effective defense is a shift toward a zero trust model for AI context. Just because data comes from an official API does not mean that data is safe to execute.
Developers should be wary of any AI agent that requests permission to run arbitrary code without manual oversight. If you are using tools like Claude Code or Cursor, you must maintain a high level of healthy paranoia. Review the commands the agent proposes before hitting the enter key. If an agent suggests a resolution for a Sentry error that involves running a shell script you didn't write, stop and verify the error in the Sentry dashboard first.
For organizations, the priority is to audit public-facing code for exposed DSNs. While Sentry DSNs are write-only, they clearly represent a mission-critical risk when AI agents are in the mix. Treating these keys with the same level of care as a private API key is a necessary step. Consequently, security teams should update their threat models to include AI agents as a potential execution vector for external data.
To protect your development environment from Agentjacking and similar injection attacks, consider the following steps:
We are in a period of rapid AI adoption where the speed of development often outpaces the development of security frameworks. Agentjacking is a reminder that every new integration creates a new path for an attacker. The agents we trust to make our lives easier are only as secure as the data we feed them.
Sources: Tenet Security Research Blog, Sentry Official Documentation, Model Context Protocol Specification, NIST AI Risk Management Framework.
Disclaimer: This article is for informational and educational purposes only and does not replace a professional cybersecurity audit or incident response service.



Our end-to-end encrypted email and cloud storage solution provides the most powerful means of secure data exchange, ensuring the safety and privacy of your data.
/ Create a free account