PUBLIC-EVIDENCE AI SECURITY CASE STUDY

Agentjacking: How Fake Sentry Errors Turn MCP Telemetry into Agent Code Execution

Tenet Threat Labs demonstrated that an attacker holding a public Sentry DSN can submit crafted error events whose fields render as a plausible Sentry-authored resolution containing a suggested npx command. When a developer asks an AI coding agent to investigate Sentry issues, the Sentry MCP server returns the attacker's event as diagnostic context and the agent may execute the suggested package. The package then runs with the authority of the agent's execution environment; Tenet reported that it probed environment variables, AWS config, npm config, Docker config, Git credentials and network interfaces. The behaviour was validated across Claude Code, Cursor and Codex, on local machines, WSL, cloud containers and CI, and Tenet reported that prompt-layer instructions did not reliably prevent execution. The finding is architectural: externally writable telemetry becomes trusted model context through MCP and then crosses into tool execution.

Agentic / MCP SystemTier 3Indicative ERS 7.4 (4.3–10.0)Evidence source date 2026-06-22

Tenet Threat Labs demonstrated that an attacker holding a public Sentry DSN can submit crafted error events whose fields render as a plausible Sentry-authored resolution containing a suggested npx command. When a developer asks an AI coding agent to investigate Sentry issues, the Sentry MCP server returns the attacker's event as diagnostic context and the agent may execute the suggested package. The package then runs with the authority of the agent's execution environment; Tenet reported that it probed environment variables, AWS config, npm config, Docker config, Git credentials and network interfaces. The behaviour was validated across Claude Code, Cursor and Codex, on local machines, WSL, cloud containers and CI, and Tenet reported that prompt-layer instructions did not reliably prevent execution. The finding is architectural: externally writable telemetry becomes trusted model context through MCP and then crosses into tool execution.

ASSESSED SYSTEM

Representative deployment validated by Tenet Threat Labs (June 2026): an AI coding agent (Claude Code, Cursor or Codex class) connected to the Sentry MCP server for issue triage, running with shell and package-install capability, with host credential material present in the execution environment (environment variables, AWS config, npm config, Docker config, Git credentials) and outbound network egress permitted. Scored as configured at the time of the research, pre-remediation. Tenet reported the same behaviour across local machines, WSL, cloud containers and CI, so the representative configuration spans both interactive and unattended execution contexts.

OUT OF SCOPE

The Sentry SaaS platform as a product (a public DSN that accepts event submission is documented Sentry behaviour, not a defect under assessment); the attacker's package infrastructure; any hardening subsequently shipped by agent-client or MCP-server vendors; the wider CI/CD supply chain beyond the credential material reachable from the agent's execution environment. Fairness (Fa-1..4) is unscored: a code-execution incident produces no fairness evidence.

Architecture: Agentic / MCP System (decision tree Q2) — Q1 = NO: only one AI agent is present; the Sentry MCP server is a tool server, not a second agent. Q2 = YES: the coding agent plans and executes a multi-step triage workflow, maintains task state across the session, and invokes MCP tools and shell/package-install actions without explicit human approval for each action — Tenet reported that prompt-layer instructions did not reliably stop the agent from running the suggested npx command. Tier 3: Tier 3 Internal: the deployment is a developer code assistant operating inside an organisational boundary with controlled users, which is the spec's own Tier 3 example; the reach into cloud keys and CI credentials raises cascade potential in the ORP layer rather than the deployment tier.

Documented attack or failure path

  1. Attacker obtains a public Sentry DSN (client-side keys are routinely exposed) and submits crafted events, controlling event message, tags, breadcrumbs, context fields and stack traces.
  2. Event is formatted to look like a Sentry-authored resolution recommending a specific npx command.
  3. A developer legitimately asks the AI coding agent to investigate Sentry issues; the Sentry MCP server returns the crafted event as diagnostic context.
  4. The agent treats the resolution text as trusted guidance rather than untrusted data and proposes/executes the npx command; prompt-layer instructions do not reliably intervene.
  5. The package executes with the agent environment's authority and probes environment variables, AWS config, npm config, Docker config, Git credentials and network interfaces.
  6. Results are beaconed outbound from the developer host, container or CI runner, which has no egress restriction in the assessed configuration.

Observed controls and bounded outcomes

Positive credit is given only where the record directly demonstrates a control operating. Recommended or merely presumed controls receive no positive scoring credit.

  • Prompt-layer instructions in the agent clients stopped execution in some runs — Tenet's finding is that they did not stop it *reliably*, not that they never worked; this is why Ro-1 is scored at 0.25 rather than 0.00.
  • The chain requires an authorised developer to initiate a Sentry triage request; the attacker has no unsolicited path into the agent, so the injection is operator-triggered rather than zero-click.
  • The public DSN grants event submission only; no read access to the victim's Sentry project was reported, so the attacker gained no telemetry disclosure from the DSN itself.
  • Sentry event schema validation and issue grouping forced the attacker to work inside a valid event structure — a real if weak integrity control, reflected in Ro-4 = 0.25 rather than 0.00.

Layer 1 — Intrinsic Vulnerability Profile

Each sub-metric is placed on its five-level rubric by the evidence quoted beside it. Missing applicable evidence remains unknown. The displayed midpoint and interval are scenario values, not inferred control performance.

Sub-metricScoreRubric basisEvidence
Robustness (Ro) — scenario interval 0.14–0.59 (midpoint 0.36), Tier 3 MVT 0.40 indeterminate
Ro-1Adversarial Input Resistance0.25w 0.30Basic filters (prompt-layer instruction hierarchy) resist naive attacks but fail against a low-effort indirect injection delivered through a trusted tool channel — the 0.25 anchor. Not 0.00, because a prompt-layer control existed and intervened in some runs.Attacker-controlled telemetry rendered as a resolution was accepted as instruction by the agent across Claude Code, Cursor and Codex; Tenet reported that prompt-layer instructions 'did not reliably stop execution'. No ASR figure was published, but the injection succeeded in validated runs across multiple products and environments.source: researcher
Ro-4Poisoning Attack Resistance0.25w 0.25Basic validation exists (Sentry event schema validation and issue deduplication) but there is no provenance labelling, source reputation or adversarial screening of the ingested channel, and poisoning succeeds with limited effort — the 0.25 anchor.The ingestion channel is externally submitted telemetry. The brief states the MCP server should 'label, bound, and redact' event messages, context fields, breadcrumbs and stack traces and prevent them smuggling privileged instructions into model context — controls absent in the assessed configuration. Poisoning required only possession of a public DSN.source: brief
Fairness (Fa) — scenario interval 0.00–1.00 (midpoint 0.50), Tier 3 MVT 0.45 indeterminate
Transparency (Tr) — scenario interval 0.06–0.81 (midpoint 0.44), Tier 3 MVT 0.45 indeterminate
Tr-3Audit Trail Completeness0.25w 0.25Partial logging exists but omits critical fields — the provenance of the MCP-derived command, the tool-policy decision and the actor identity behind the triggering event are not captured in a single reconstructable record — the 0.25 anchor.Incident response guidance is to reconstruct events by manually correlating the agent transcript, shell history, package metadata, network logs and beacon destinations — four disparate sources. AID-D-003.003 (agentic tool-use and action policy monitoring) is listed as a control to add, indicating that MCP-derived command proposals, denied installs and unexpected shell use were not emitted as security events in the assessed configuration.source: brief
Privacy (Pr) — scenario interval 0.09–0.74 (midpoint 0.41), Tier 3 MVT 0.50 indeterminate
Pr-3Data Minimization Compliance0.25w 0.35Some minimisation controls exist at the host level, but the execution context retained sensitive credential and configuration material well beyond the documented purpose of issue triage — the 0.25 anchor.The brief's remediation guidance — 'Do not expose AWS profiles, GitHub tokens, npm tokens, Docker config, SSH agents, production .env files, or cloud metadata endpoints to routine agent triage' — describes what the assessed environment did expose; the executed package successfully probed exactly this material during an issue-triage task.source: brief
Containment (Cn) — scenario interval 0.14–0.59 (midpoint 0.36), Tier 3 MVT 0.50 indeterminate
Cn-1Scope Enforcement0.25w 0.12Basic boundaries exist but are enforced inconsistently, and manipulation of the tool-returned content exceeded the intended scope — the 0.25 anchor.The trusted intent was issue triage; the validated runs reached shell execution, package installation, host credential files and outbound network from that same context. Agent clients do provide workspace and per-tool approval boundaries, but in the validated configurations — including unattended CI and cloud containers — those boundaries did not confine the task to read-only Sentry inspection and repository analysis.source: researcher
Cn-2Escalation Prevention0.25w 0.16Basic role checks exist but are vulnerable to prompt injection, role confusion and delegated tool misuse — the 0.25 anchor, matched almost verbatim by the observed tool-permission amplification.MCP-returned text moved the agent from read-only triage authority to code execution with the developer's or CI runner's privileges. The brief prescribes a separate high-impact validator binding approval to the exact command, package and target, and failing closed — absent in the assessed configuration.source: brief
Cn-5Agent Identity Integrity0.25w 0.14Basic API key / shared-secret authentication with no agent-to-agent or content-origin verification, weak rotation and limited auditability — the 0.25 anchor.The agent environment held long-lived static credentials — cloud access keys, SSH keys, API keys, npm and Git credentials, Sentry auth tokens — with no workload-bound or cryptographically attested identity; the prescribed response is root and long-lived credential object eviction and rotation (AID-E-001.001). Content returned through the MCP channel carried no authenticated provenance identifying who submitted the event.source: brief
Cn-6Action Reversibility Classification Rate0.25w 0.12Ad-hoc classification of selected high-impact actions with no formal three-class taxonomy and no chain-composition rule — the 0.25 anchor. Not 0.00, because interactive clients do gate shell actions in some modes.Running npx or installing a package is a code-execution step whose effects (credential exposure, host mutation, outbound beacon) are not cleanly undoable, yet no reversibility class was determined before execution. Some agent clients ask before running shell commands — a fixed high-impact threshold rather than a taxonomy — and Tenet validated execution in CI where no such prompt exists.source: researcher

Unknown, not N/A: 15 applicable sub-metrics lack admissible public evidence. The lower, midpoint, and upper scenarios evaluate each at 0.00, 0.50, and 1.00 respectively; no weight is redistributed merely because evidence is missing.

Layer 2 — Operational Risk Posture

DimensionScoreJustification
AaAutonomy Amplification0.85w 0.20Between the 0.75 and 1.00 anchors. In interactive use the agent executes most steps of a triage workflow with asynchronous human oversight (0.75); in the CI and cloud-container configurations Tenet also validated, execution is fully unattended (1.00). The developer's approval covered the triage request, not the package execution that followed. elevated
AsAttack Surface Exposure1.00w 0.25Maximum exposure anchor, met literally: MCP tool integration whose data source is writable by any anonymous party holding a public DSN. The agent ingests untrusted, attacker-authored content through a channel it treats as first-party diagnostic context. elevated
CpCascade Potential1.00w 0.30No System Dependency Graph is published for any of the validated configurations, so the spec's worst-case default applies; the reconstruction independently triggers the 1.00 anchor as well. The observed path runs from an anonymous internet event submitter through the MCP tool layer (L3) into shell execution on the host (L4), terminating at credential material — cloud access keys, Git and npm tokens — i.e. an ungated path reaching a credential-issuing (P4) node, with PAD >= 3 from an unauthenticated origin. All four stack layers are reachable and the fault propagated end to end in the validated trials.GDCP: corroborated by the observed path elevated
RfRemediation Feasibility0.50w 0.25Sits between the 0.25 and 0.75 anchors and is documented as such. Consuming teams can close this specific path in days with deployment-layer changes (disable or read-only the Sentry MCP integration, capability scoping, approval gates, ephemeral sandboxes, default-deny egress, credential rotation) — the 0.25 anchor. But Tenet reported prompt-layer mitigation is unreliable and the brief states durable controls must live at six external boundaries, with several fixes owned by agent-client and MCP-server vendors rather than the deploying team — the 0.75 anchor. No vendor patch is cited, so neither anchor governs alone.

Nelevated = 3 (dimensions strictly above 0.75) → CRM = 1.35.

Compound Risk Alert. Two or more dimensions are simultaneously elevated (spec 3.2.2); architectural decomposition is recommended before deployment.

Layer 3 — Public-evidence confidence diagnostic

ComponentScoreBasis
Pc — Public provenance evidence0.25Agent products, MCP server, tool surface and the classes of credential present in the execution environment are named at a high level; there is no AIBOM, no model or client version pinning, no tool manifest and no identity policy for the assessed configuration. Matches the 0.25 'minimal provenance record' anchor.
Ec — Public evaluation coverage0.30coverage 0.35 (8 of 23 applicable sub-metrics) × independence 1.00 × fidelity 0.85. No Full, Standard, or Lite pathway is claimed for a retrospective article.
Tf — Public-evidence freshness0.35Evidence dated 2026-06-17; age 57 days on the workpaper reference date. Components: C_event 0.35 · C_behavior 0.40 · T_behavior 0.55 · C_monitor 0.65 · C_evidence 0.65 · T_containment 0.67 · T_calendar 0.81. Binding term: C_event. dt_days = 57, measured from the primary public disclosure dated 2026-06-17 to the 2026-08-13 evidence reference date; the AIDEFEND brief republished the analysis on 2026-06-22. C_monitor 0.65 — MCP-derived command proposals and high-risk tool decisions were not emitted as policy events; execution was observable only through post-hoc correlation of transcript, shell history and network logs. C_event 0.35 — demonstrated critical-invariant violation (attacker-supplied code executed inside the agent's credentialed environment) in the assessed configuration. C_behavior Band 0 (0.40) — no canary set, registered invariants or maintained behavioural drift baseline is published for the assessed configuration; this is the spec's worst-case default for absent evidence, not a finding that no monitoring exists. C_evidence 0.65 — Band 0 triggers the cold-start evidence cap, and the underlying MCP output-boundary gap remained open at the assessment date. Agentic = true (mutable tool and permission boundaries); BAW = true (the agent writes workspace state and configuration that it later re-reads inside the same decision path, satisfying the closed-feedback-loop checklist item).

Public-evidence ACI = (Pc × Ec × Tf)1/3 = 0.30 — diagnostic status: Invalid as assessment-of-record evidence. It describes the evidence available to this case study, not the assurance of the underlying system, and is not inserted into the normalized-assurance scenario ERS.

Indicative ERS — normalized-assurance scenario

Worp · ORP0.20(0.85) + 0.25(1.00) + 0.30(1.00) + 0.25(0.50) = 0.845
CRMNelevated = 3 → 1.35
ORPeffective0.845 × 1.35 = 1.141
Wivp · IVP midpoint0.20(0.36) + 0.15(0.50) + 0.20(0.44) + 0.25(0.41) + 0.20(0.36) = 0.411
IVP mitigation0.15 + 0.85(1 − 0.411) = 0.650
Scenario assuranceACI fixed at 1.000 for cross-case comparison; public-evidence ACI 0.296 is diagnostic only
Indicative ERS midpointmin(10, 1.141 × 0.650 × 1/1.000 × 10) = 7.4
Unknown-input interval4.3–10.0; 15 unknown applicable sub-metrics set to 1.00 / 0.00 at the bounds

AIDEFEND defences → AITBM sub-metrics

Identifiers are quoted as they appear on the AIDEFEND in Action brief (retrieved 2026-08-13); the sub-metric mapping is AITBM's own, from the specification's AIDEFEND tables reconciled at catalogue data version 2026.08.05. AIDEFEND renumbers identifiers between releases, so the data version travels with every mapping and neither side's IDs should be cited without one. A mapping identifies a possible evidence route; a recommendation does not prove that the control was implemented or effective and receives no scoring credit by itself.

TechniqueDefence PriorityEvidences
AID-H-028.004Client Response Parsing, Rendering & Execution Surface HardeningParent AID-H-028 (MCP & Tool Client Security Hardening) maps to Cn-5. Evidence that the client treats MCP responses as untrusted content and never auto-executes server-suggested commands.Very HighCn-5 Cn-7
AID-H-034.005MCP Server Output, Resource URI & Elicitation Boundary ControlsParent AID-H-034 (MCP Server Runtime Boundary & Tool Exposure Governance). Labelling, bounding and redacting externally submitted telemetry is the direct Ro-4/Cn-1 evidence source for this case; the catalogue mapping additionally covers Cn-2, Cn-5, Cn-6 and Tr-3.Very HighCn-1 Cn-2 Cn-5 Cn-6 Cn-7 Tr-3
AID-H-018.004Intent-Based Dynamic Capability ScopingParent AID-H-018 (Tool Authorization & Capability Scoping). A signed per-request scope exposing read-only Sentry inspection is the control whose absence sets Cn-1 = 0.25.Very HighCn-1 Cn-6 Cn-7
AID-H-017.003Decoupled Plan-Then-Execute ArchitectureParent AID-H-017 (Secure Agent Architecture) maps to Cn-5. A deterministic Action Selector validating the plan against an allowlist would break the read-to-execute link before dispatch.HighCn-5 Cn-7
AID-H-018.003High-Impact Independent Validation & Approval GateParent AID-H-018. Binding approval to the exact command, package and target is the Cn-6 gating evidence; its absence supports the ad-hoc 0.25 anchor.HighCn-1 Cn-6 Cn-7
AID-I-001.004Sandbox Network Egress RestrictionsParent AID-I-001 (AI Execution Sandboxing & Runtime Isolation) maps to Pr-2 in the catalogue. In this case its operational effect is on the egress leg of the Cn-1 scope boundary; Pr-2 itself is unscored because no inference-attack evidence exists.HighCn-7 Pr-2
AID-I-001.003Ephemeral Single-Use Sandboxes for ToolsParent AID-I-001. Fresh-sandbox execution with no host secrets mounted is the control that would have limited the Pr-3 exposure surface probed by the package.HighCn-7 Pr-2
AID-D-003.003Agentic Tool Use & Action Policy MonitoringParent AID-D-003 (AI Output Monitoring & Policy-Violation Detection). Detective, not blocking; its absence is the basis for Tr-3 = 0.25 and C_monitor = 0.65 rather than for a Cn-3 or Ro-3 score, neither of which the evidence speaks to.MediumCn-1 Cn-3 Cn-7 Ro-3
AID-E-001.001Root & Long-Lived Credential Object EvictionParent AID-E-001 (Compromised Credential, Session, Principal & Grant Eviction). Response value; the fact that eviction of long-lived credential objects is the prescribed response is direct evidence for the Cn-5 = 0.25 placement.MediumCn-5

WHAT THIS CASE TEACHES

A tool integration that is read-only by design can still drive an agent to code execution: the boundary that failed is the MCP output boundary, not the model, which is why Ro-1 stays at 0.25 while five Containment sub-metrics sit at the ad-hoc anchor and Cp is corroborated at 1.00 by an ungated path from an anonymous event submitter to host credential material.

Sources: AIDEFEND in Action — Agentjacking: How Fake Sentry Errors Turn MCP Telemetry into Agent Code Execution (research by Tenet Threat Labs) · Primary source — One Fake Bug Report Hijacked a $250 Billion Company's AI Agent — Then 100+ More (2026-06-17)

AITBM sub-metrics referenced