Question 100
A team uses a PreToolUse hook to guard only tool name Write; a model instead edits files through Bash redirection. What caused the bypass?
Explanation
Correct Answer
The protection was attached only to a tool label, Write, while the filesystem could also be modified through Bash shell redirection. The policy therefore controlled one interface rather than the underlying effect of changing protected files. Secure execution must cover all equivalent write paths, check effective target paths and permissions, and use sandbox or filesystem enforcement where command parsing alone is unreliable. Test both direct edit and shell-based mutation attempts against a protected fixture. Adding a prose reminder to CLAUDE.md may guide behavior but does not remove the alternate executable route.
Incorrect Answers
Read-only tools did not cause the protected file mutation. The bypass happened because the guard watched one named write interface while Bash could achieve an equivalent filesystem effect through redirection. Removing additional read tools would not stop that shell path. The host needs authorization at the actual resource or effect boundary, or comprehensive checks across all write-capable tools with an appropriate sandbox. Tool counts and permissions are different dimensions of the problem.
Changing the model's sampling temperature could alter how often it happens to choose Bash rather than Write, but it cannot close an execution-policy gap. A lower-temperature model can still produce an unauthorized redirection command, and external text can encourage it. Enforcement belongs in the host or sandbox so that equivalent writes are denied regardless of which syntactic tool the model proposes. Determinism in text generation is not proof of resource authorization.
A repository instruction can encourage good behavior but does not eliminate an alternative filesystem mutation path. Bash redirection, edit commands and other write-capable tools may still reach the protected resource while a hook watches only the Write label. The actual enforcement must cover equivalent effects at the command or filesystem boundary. Examples can be useful supplemental training, but a model can ignore them or issue a mistaken shell command, so they cannot repair an incomplete allow/deny policy by themselves.



Claude Certified Architect - Foundations (CCA-F) Practice Tests