F2 · Layered guardrails

Family: Oversight and operations

Defence in depth: several stacked checks, on input, on tools and on output.

Principle

Several checks stack up: relevance and safety classifiers (jailbreak, injection), personal-data filters, moderation, tool risk rating, rules, output validation. They apply to the input, to tool calls, to tool responses and to the output. None is perfect; stacking them is what lowers the risk.

The problem it solves

An agent can receive an off-topic or booby-trapped request, expose personal data or call a dangerous tool.

When to use it

  • Any agent exposed to users or to outside content: this is the minimum baseline.
  • Alongside the security-by-design patterns (G), which constrain the architecture instead of detecting.

When to avoid it

  • As the only defence when the agent combines private data, untrusted content and an outbound channel: detectors are probabilistic. Constrain the architecture (G4, G6).
  • In place of authentication and access control: guardrails add to them, they do not replace them.

Common pitfalls

The anti-patterns that misuse this pattern, best established first. Each sheet describes the symptoms, the public incidents and the remedies.

Security and permissions

Oversight, operations and governance

  • AP84 · One-way harness — Rules that are never checked, or alerts that never change the rules: the harness does not learn.

All anti-patterns

Synonyms by vendor

  • Guardrails (OpenAI, Microsoft)
  • Multimodal Guardrails (CSIRO Data61)

Neighbouring patterns

Sources

Content reviewed on 2026-10-02

Pattern catalogue