Layered guardrails & HITL
allowedtripwirepending
- Defense in depth: input, action and output guardrails.
- Input tripwire blocks a prompt injection pre-inference.
- A high-risk tool call pauses for HITL approval.
- Approved; the output guardrail checks PII and releases.
Notes & references
Use when
Untrusted input or irreversible side effects.
Avoid
Approval fatigue, and combining the lethal trifecta in one agent.
if input_check(message).blocked: # check 1
return "Sorry, I can't help with that."
for call in agent.run(message):
if call.tool.is_risky: # check 2
if not await ask_human(call):
continue
run(call)
return output_check(reply) # check 3
- A practical guide to building agentsOpenAI
- The lethal trifecta for AI agentsSimon Willison
- Designing AI agents to resist prompt injectionOpenAI
- Agents Rule of TwoMeta
- GuardrailsOpenAI
- Human-in-the-loopOpenAI
- How we built Claude Code auto modeAnthropic
- Defeating Prompt Injections by DesignDebenedetti et al.