Prompt injection is when content an agent reads (web pages, source files, tool results) carries hidden instructions meant to pull it away from the user’s original request.1 Any agent that reads text it did not write is exposed.

Defenses described in the sources

SettingDefense
Claude Code Auto ModeA server-side probe scans tool results and flags suspicious instructions, and the classifier checks that Claude’s next action still matches the user’s intent; an attack has to pass both.1
Claude Code GitHub ActionsTreat issue text, comments, and changed repository content as untrusted input; grant only the needed permissions and tools; require human review and branch protection before merging.2

Anthropic reports that prompt-injection attack success fell to zero in its evaluations with both the probe and Auto Mode on. The note stresses this is Anthropic’s internal evaluation, not a guarantee for every environment.1

Footnotes

  1. How Claude Code Auto Mode Works 2 3

  2. Claude Code GitHub Actions