Part 9 of 13 · 2 min read
Answering guardrail questions in an interview
How do you validate tool calls from a model?
"Strict schema validation on every argument (exact types, ranges, enums, full-match ASCII patterns, no unknown fields, no coercion), then semantic checks against state, then authorisation. In the example's test a keys-only check accepted 13 of 14 hostile argument sets and the strict schema accepted none, at about 2 microseconds a call." Follow-up: "Is that enough?" No: three valid-looking refunds still abused the system and were caught only by semantic checks, so I add grants and caps (module 2).
Are three guardrail layers three times as safe?
"Only if they fail independently. If each misses 20 percent, independent layers miss 0.8 percent, but with shared blind spots the combined miss rate rises toward 20 percent; the example's simulation gave 12.8 percent at correlation 0.9. I count layers that fail for different reasons: schema, policy, sandbox, approval." Follow-up: "How do you measure correlation?" Run the same attack set through each layer and look at overlap in what each missed.
Should a guard fail open or closed?
"For security checks, closed. With a 5 percent error rate in the example's simulation, fail-open let through 5.2 percent of attacks while fail-closed blocked 4.2 percent of good outputs. I choose per risk: an irreversible action fails closed; a low-risk suggestion may fail open with an alert." Follow-up: "How do you reduce the cost?" Make the guard reliable and fast, retry once, and degrade to a human review queue instead of a hard failure.
How do you stop data leaving through the model's output?
"Close the channels: no auto-loading images or links to untrusted hosts, an egress allowlist, and an output guard for secrets and external URLs as a tripwire. A pattern guard catches the plain cases and misses the evasions, which is why the structural controls matter more." Follow-up: "What about a classifier?" It helps with fuzzy cases but is probabilistic and correlated with the model's own blind spots; I would test it like any detector (Level 9 module 4).