Prompt injection
Hidden hostile instructions that try to hijack the . See what it is, how it works, how it is used and what to watch for, with pictures and examples.
What it is
injection is a trick where an attacker hides instructions inside text the reads, such as a file, a web page or the result of a tool. The attacker hopes will treat that text as an order and do something you never asked for, like running a command or sending away. can both read outside content and act on your computer, so it guards against this with several layers. In auto mode, a server-side check also scans tool results for suspicious content, and the that reviews actions never sees the tool results, so hidden text cannot fool it directly.
How it works
-
Attacker hides orders in content
-
Claude reads that file or page
-
Safeguards check risky actions
-
You review before approving
How to use it
-
system — in Manual mode, sensitive actions such as editing files or running commands wait for your approval.
-
curlandwgetcommands that fetch from the web are not auto-approved by default; add them to
permissions.denyto block them completely. -
WebFetch summaries — for most fetches a separate reads the page, and Claude gets that answer instead of the raw page.
-
/feedbackreport suspicious behavior with it, and run scripts that touch outside web services inside a .
Watch out
No system is fully immune, so read suggested commands and changes to important files before you approve them, and do not pipe untrusted content straight into Claude. A claude -p run shows no workspace trust dialog, so be extra careful with you do not know. detection is a different, narrower safeguard: it asks before running a Bash command Claude Code cannot fully analyze.
Related terms
Original and official docs
This page explains the term in plain words. The original is the authority: if they differ, follow the original.
Loading…
Choose a pending booking to cancel. Each cancellation requires confirmation.
Your :