Question 300
An incident-analysis agent is allowed to inspect logs with Bash but must never erase them. A prompt injection inside a retrieved file asks it to run `rm -rf logs/`. Where should the decisive safeguard operate?
Explanation
Correct Answer
Preventive interception can block the side effect regardless of model instructions or injected text. Scope the rule to permitted commands and working directories.
Incorrect Answers
Final output inspection cannot recreate logs deleted by an earlier tool call.
Untrusted document contents cannot reliably enforce tool permission boundaries.
Backups aid recovery but do not prevent unauthorized destruction or loss of current evidence.