The Friendly Fire report published by the AI Now Institute on July 8, 2026 demonstrates that Anthropic's Claude Code and OpenAI's Codex CLI execute malicious code when analyzing third-party repositories in automatic mode. Researchers validated the proof-of-concept on four different models — Sonnet 4.6, Sonnet 5, Opus 4.8, and GPT-5.5 — in out-of-the-box configurations, with no plugins, hooks, or MCP servers. The problem is not a patchable bug: it is the lack of an architectural boundary between data read and instructions to execute inside the agent's context window.
- The PoC demonstrates RCE in Claude Code CLI versions 2.1.116, 2.1.196, 2.1.198, 2.1.199 and in Codex CLI 0.142.4 with the same unchanged payload
- The attack exploits multi-stage prompt injection hidden in README.md and documentation, which reframes execution of malicious scripts as part of the security analysis workflow
- Four models from two vendors execute the payload without detecting its hostile nature, in some cases noting inconsistencies but proceeding anyway
- The AI Now Institute report classifies the issue as a structural property of language as an instruction medium, not a trainable defect
How the Attack Works: The Fake Security Pipeline
The mechanism unfolds in three stages. The first is injection: hidden instructions in documentation files readable by the AI agent during repository scanning. The second is reframing: the agent is induced to interpret script execution as a defensive operation, part of its own security analysis mandate. The third is actual execution via security.sh, an apparently benign script that loads a hidden code_policies binary accompanied by a decoy code_policies.go to evade disassembly checks.
The target configuration is Claude's auto-mode or Codex's auto-review: modes where the agent autonomously approves actions deemed safe. Researchers used the geopy repository as a demonstration, but the vector applies to any third-party code submitted to automatic scanning. No prior compromise of the target system is required: the attacker plants the payload in the repository the defending organization chooses to analyze.
Version Data and Cross-Vendor Convergence
AI Now Institute researchers tested four Claude Code CLI versions — 2.1.116, 2.1.196, 2.1.198, 2.1.199 — and one Codex CLI version, 0.142.4. According to The Hacker News, the same payload worked unchanged across all four models. In some cases models flagged inconsistencies in the code or documentation but completed execution regardless. This cross-vendor convergence with an immutable payload is the core of the architectural claim: this is not a flawed implementation by a single vendor, but a structural invariance in how LLM agents process language and instructions.
Two CVEs document related vulnerabilities in the Claude Code sandbox, attesting to systemic fragility in the isolation perimeter. Per NVD, CVE-2026-39861 records a CVSS 3.1 score of 10.0 CRITICAL for sandbox escape via symlink in versions prior to 2.1.64. CVE-2026-25725 records a CVSS 4.0 score of 7.7 HIGH for injection via settings.json in versions prior to 2.1.2. These vulnerabilities are not identical to the Friendly Fire vector — prompt injection mechanism versus sandbox escape — but they confirm that the security perimeter between agent and host is not solidified.
Expert Take: Language as an Attack Medium
"When the same attack works unchanged across two vendors and four model generations, you are not looking at a software bug. You are looking at a structural property of how these agents work." — Roey Eliyahu, CEO and co-founder of Salt Security
The assessment of Eljan Mahammadli, head of AI provenance at Polygraf AI, converges on the same diagnosis: "An AI coding agent has no reliable way to distinguish the text it reads from instructions it is supposed to follow." According to Mahammadli, quoted by Infosecurity Magazine, "the problem is a property of how these systems handle language and not a defect that can be trained away." The same source reports his observation that "a more capable and more compliant agent can simply be a more effective executor of whatever instruction reaches it": compliance itself, understood as adherence to instructions, becomes attack surface when instructions are forged.
The AI Now Institute report is not the only evidence of similar patterns. Tenet Security has documented Agentjacking: hijacking of AI agents via fake bug reports in Sentry, with an 85% success rate in controlled testing on over 100 executed agents, including Fortune 500 companies. In a specific PoC, a Fortune 100 technology company with a $250 billion market cap was compromised in a test environment. LayerX demonstrated Vibe Hacking: Claude Code induced into offensive behaviors with minimal changes to project files. These independent researches converge on the same architectural pattern: tools built to automate defense inherit the same vulnerabilities as tools that automate offense.
Policy Context: When the Solution Accelerates the Problem
July 8, 2026 coincides with peak government and industry push for AI agent adoption in cybersecurity. The June 2026 Executive Order, Anthropic's Project Glasswing, and the Patch the Planet initiative represent efforts to automate vulnerability scanning and patch management. The Friendly Fire report introduces an operational contradiction: the very tools promoted as defense accelerators become attack vectors when processing untrusted code.
Researchers contacted Anthropic and OpenAI prior to publication. According to The Hacker News, the report explicitly states it falls outside the vendors' formal disclosure policies: the issue does not fit the category of compensable software vulnerability because it is not an implementation defect but a design property. No documentation emerges of specific patches released for this vector. The report does not record in-the-wild exploitation of the Friendly Fire PoC, but the lack of documented mitigation leaves the vector open.
Immediate Actions
- Physically separate the untrusted code analysis environment from the command execution environment: no AI agent with execution capabilities should access credentials, keys, or production resources
- Disable auto-approval for any operation on third-party code, mandating human review before execution of scripts or binaries
- Isolate code analysis sandboxes with enforcement at the operating system level, not just application level, treating every external repository as potentially hostile
- Reevaluate workflows that delegate security classification to the model itself: the decision of what is safe must remain outside the context window that processes suspicious code
The AI Now Institute report's concluding recommendation, cited by The Hacker News, is blunt: "do not hand untrusted code to an agent that can run commands and reach your keys, secrets, or host."
The Weaponized Defense Paradox
The term Friendly Fire is not rhetoric: it describes an incident where one's own weapons strike those who deployed them. Security AI agents are designed to be compliant, interpretive, capable of navigating complex contexts. These same qualities make them vulnerable to instructions disguised as data. The paradox has no immediate solution in the traditional patch cycle: every improvement in language understanding can equate to an improvement in the ability to execute malicious instructions.
Companies accelerating adoption on government impulse must calibrate the risk: defense automation introduces an attack surface that did not exist before automation itself. Architectural separation between reading and execution — not patching a more capable model — is the only documented path to contain the risk.
Information verified against cited sources and current as of publication.
Sources
- https://www.infosecurity-magazine.com/news/anthropic-openai-report-exploit/
- https://thehackernews.com/2026/07/friendly-fire-ai-agents-built-to-catch.html
- https://thehackernews.com/2026/07/ghostapproval-symlink-flaws-could-let.html
- https://www.itpro.com/security/the-agents-you-use-to-beef-up-cybersecurity-could-be-turned-against-you-friendly-fire-attacks-can-manipulate-openai-and-anthropic-models-into-running-malicious-code
- https://ainowinstitute.org/publications/friendly-fire-exploit-brief
- https://www.cybersecuritydive.com/news/anthropics-claude-compromise-mexican-water-utility/819710/
- https://www.anthropic.com/glasswing
- https://nvd.nist.gov/vuln/detail/CVE-2026-39861
- https://nvd.nist.gov/vuln/detail/CVE-2026-25725
- https://tenetsecurity.ai/blog/agentjacking-coding-agents-with-fake-sentry-errors/
- https://layerxsecurity.com/blog/vibe-hacking-claude-code-can-be-turned-into-a-nation-state-level-attack-tool-with-no-coding-at-all/
- https://www.cisa.gov/news-events/news/attack-colonial-pipeline-what-weve-learned-what-weve-done-over-past-two-years