Guardrails and Safe Deployment Practices
Layered controls (verified features, design guidance on layering)
| Layer | Controls |
|---|---|
| Input | Authentication and rate limits; harmlessness screens; input validation for known injection patterns |
| Prompt | System prompts that state ethical and legal boundaries and tell the model how to refuse |
| Model behaviour | Grounding (allow "I don't know", quotes, citations); structured outputs |
| Action | Permission rules, hooks (PreToolUse deny/ask/defer), least-privilege tools, sandboxing |
| Output | Schema and business-rule validation, content filters, human review for high-risk |
| Environment | Container isolation, network restrictions, credentials outside the boundary |
| Monitoring | Continuous output analysis for signs of successful injection; telemetry and alerts |
Verified specifics from Anthropic's jailbreak-mitigation guide:
- Harmlessness screen: use a lightweight model such as Haiku 5.5 to pre-screen input, with structured outputs constraining the answer to a simple classification. Haiku 5.5 runs safety classifiers that can decline the screening request itself, so treat
stop_reason: "refusal"as a harmful verdict. - Input validation: filter known injection patterns (an LLM can create a generalised screen from examples).
- Prompt engineering: emphasise boundaries and explicit refusal behaviour.
- Continuous monitoring: analyse outputs and iterate on prompts, validation and filtering.
- Chain safeguards: combine strategies; the guide shows a multilayer example for a financial advisor bot.
Sandboxing (verified): Claude Code can run Bash commands in a sandbox that restricts filesystem and network access. A permission gate is not a sandbox.
Safe deployment practices (design guidance)
- Gate on evaluations: no release if the regression or safety suite regresses (D4.1).
- Red-team before launch: adversarial prompts, injection through every data source the agent reads, abuse of every tool.
- Stage the rollout: shadow mode (run, do not act), internal users, canary percentage, then general availability.
- Feature flags and a kill switch: disable the agent or specific tools instantly without a deploy.
- Rollback plan: pinned prompt, tool and model versions; ability to revert quickly (D6.5).
- Limits everywhere: budgets, turn caps, concurrency, rate limits.
- Incident response: who is paged, how to contain, how to communicate, how to learn.
- Least privilege first, widen later.
Exam traps
- A single guardrail (only a system prompt).
- Launching to everyone at once.
- No kill switch or rollback.
- Safety evals run once at launch, never again.
- Treating
refusalfrom a screening model as an error to retry blindly.
References
- Mitigate jailbreaks and prompt injections — checked Oct 16, 2026
- Securely deploying AI agents — checked Oct 16, 2026
Check your understanding
How do you pre-screen user input cheaply?Show answerHide answer
Answer
A Haiku-class model with structured output, treatingrefusalas a harmful verdict.Order a safe rollout.Show answerHide answer
Answer
Shadow mode, internal, canary, general availability, with a kill switch.Why is a permission gate not enough?Show answerHide answer
Answer
It is not a sandbox; add isolation and least privilege.