AI Security

Poisoned Repos Can Trick Claude Code Into Opening a Reverse Shell

Researchers show that prompt injection hidden inside a repository's files is enough to turn Anthropic's agentic coding tool against the developer running it.

Alisha Gray· 2 min read
Poisoned Repos Can Trick Claude Code Into Opening a Reverse Shell
Share

Agentic AI coding tools read files. That is their job. But researchers have now demonstrated that this design assumption becomes an attack surface when the files being read contain adversarial instructions — and that Claude Code, Anthropic's terminal-based agent, can be manipulated through that surface into spawning a reverse shell on the developer's own machine.

The attack class is prompt injection. Nothing novel there conceptually. What makes this instance notable is the delivery vector: a repository that appears entirely benign. No malicious binary. No suspicious script. Just text, embedded where Claude Code will eventually read it, instructing the model to execute attacker-controlled commands.

Claude Code operates with meaningful system access by default. It can run shell commands, read and write files, and interact with the local environment — capabilities that make it useful and that make successful prompt injection against it consequential rather than merely embarrassing.

A reverse shell hands an attacker an interactive session on the victim's machine. From there, lateral movement, credential harvesting, and data exfiltration are all on the table. The developer who cloned what looked like a harmless open-source project becomes the entry point.

Anthropomorphic's published usage policy acknowledges that agentic contexts introduce distinct risks around irreversible actions. The gap between that acknowledgment and shipping a tool with shell execution privileges illustrates a tension the industry has not resolved.

This is not an isolated finding. Prompt injection in agentic pipelines has surfaced repeatedly across competing products. The attack geometry is consistent: the model trusts its context window, the context window can be written by an adversary, and the model's granted permissions determine the blast radius.

For developers, the immediate mitigation is scrutiny of what you feed into an agentic session. Untrusted repositories should be treated the way untrusted executables are treated. For vendors shipping agentic tools, the research underscores that permission scoping and confirmation gates for irreversible actions are not optional UX polish — they are security controls.

No CVE has been assigned for this class of behavior. Prompt injection in LLM agents does not map cleanly to the traditional vulnerability taxonomy, which itself reflects how far disclosure norms lag behind the actual threat.

© 2026 Threat Vectr