All chapters
  1. Start hereA prompt asks. A guardrail enforces
  2. Foundations · 1Before AI: validations, business rules, access lists, middleware and policy engines
  3. Foundations · 2Guardrail, instruction, evaluation, governance: four words that are not the same
  4. Foundations · 3Trust boundaries: who wrote the text the model is reading
  5. Checks · 4Input checks: type, format, personal data, hostile text and tenancy
  6. Checks · 5Tool-call controls: allowlists, parameter bounds, permissions and approval
  7. Checks · 6Output checks: schema, grounding, leakage, toxicity and policy compliance
  8. Defense · 7Prompt injection: the anatomy of a direct and an indirect attack
  9. Defense · 8Defense in depth: sandbox, network egress, least privilege and isolation
  10. Decisions · 9Policy as code: deterministic rules, policy engines and versions
  11. Decisions · 10Model-based guardrails: when the check is itself a model
  12. Decisions · 11Human in the loop: escalation, abstention and overrides
  13. Systems · 12Guardrails in RAG, MCP, coding agents and multi-agent systems
  14. Systems · 13Testing guardrails: adversarial suites, red teaming, bypass and regression
  15. Reference · 14Frameworks and standards: what each guardrail tool enforces for you
  16. Operations · 15Production: fail open or fail closed, audit and exceptions
  17. Operations · 16Advanced: tool-output laundering, exfiltration paths and policy conflicts
  18. The whole caseThe insurance lab: one hostile roof report, every layer, end to end
  19. ReferenceGlossary
  20. ReferenceAbout this site and its sources
Reference

About this site and its sources

What is synthetic, what was verified and when, the sources, the sister sites, and what is original here.

This page says what this site is, what in it is invented, what was checked and when, where the ideas come from, and which sister sites cover the subjects next to this one.

What this site is#

Guardrails Engineering teaches one idea from the ground up: a prompt asks, a guardrail enforces. It starts from the checks every backend already has (validation, business rules, access lists, middleware, policy engines) and climbs to layered, enforceable controls around an agent built on a probabilistic model: trust labels, input checks, a tool gate, output checks, an egress allowlist, versioned rules, model-based checks that flag, and a person who decides.

It teaches defense. Every attack text on the site is short, synthetic and aimed only at the site's own scripted stand-in, and it is shown only as far as the control that stops it needs. There is no recipe against a real product, no real exploit and no real target.

The author is Sam Muthu. The site is a map to adapt, not a standard: the guard ids, the four places and the page order are one way of dividing the subject, and no standards body defined them.

What is synthetic#

This is an illustrative reconstruction for teaching. It follows the shape of a real project by the author, but the cases, the rules, the fields, the provider, the attack texts and every number are invented. Nothing here reports the quality or the security of a real system or model.

ThingStatus
The insurer, the brokers, the roof-data provider, the underwritersInvented; never named; roles only
The policy fixture UW-GUIDE (2026.2, 2025.4) and its rulesIllustrative; not insurance practice; no real insurer's criteria
Cases UW-G01 to UW-G14, submissions SUB-2001 to SUB-2014Invented for this site
Hosts, emails and identifiers.example domains and the marker 000-00-0000 only
The agentA scripted stand-in in standard-library Python; no model call, no key, no network
Every count on the site (records sent, trials, rates)Produced by the scripted stand-in; shows how a control works, not how often a real model is fooled

The agent here is a scripted stand-in. The obedient variant is fooled every time by construction, so the results on this site show how each control works, not how often a real model is fooled or how good any model is.

How the facts were checked#

Statements about a named product, protocol or standard come from its own documentation, read on 2026-11-17, and each claim is logged with its URL and date in the repository's docs/facts/ folder, one file per page. Where a page did not say something, the site says "the documentation read here does not say". Facts that looked surprising (a moved documentation page, a deprecation, an engine marked experimental) were fetched a second time by a different reader before publishing. No prices, no rankings, no "best".

The Python code shown on the pages comes from the example in the repository (examples/uw-guardrails/), and every output shown was pasted from a real run. Code in Java, Rego, YAML or a framework's configuration is labelled "documented shape; not run here", and its shape comes from the documentation read that day.

Diagram: Where each kind of statement on this site comes from

Read left to right. Statements about tools and standards come from their own documentation, read on one date and logged. Results come from runs of the example code, pasted as they printed. Designs are this site's own and are called designs. Every number from the example is synthetic.

  1. Tools and standards
    1. Their own documentation: Each claim logged with its URL and date in the fact files.
  2. Results
    1. Runs of the example: Standard-library Python with a scripted stand-in; no model call.
  3. Designs
    1. This site's arrangement: The four places, the five-step anatomy, the trust label read by the tool gate.
  4. Labelled as
    1. Synthetic, illustrative: No result reports the quality or security of a real system or model.

Sources#

Primary sources read for this site, grouped. Vendor documentation changes often; the date read is 2026-11-17 for all of them.

SourceUsed on
OWASP Top 10 for LLM Applications and LLM01 Prompt InjectionPrompt injection, Frameworks
NIST AI Risk Management FrameworkFrameworks
Open Policy Agent documentationBefore AI, Policy as code, Frameworks
Guardrails AI repositoryFrameworks, Input checks
NeMo Guardrails documentationFrameworks, Tool controls, Input checks
Promptfoo documentationFrameworks, Testing
A provider's moderation guideFrameworks, Output checks
A provider's guide on mitigating jailbreaks and prompt injectionFrameworks, Prompt injection
A coding agent's sandboxing documentationDefense in depth
Spring Security architecture, Jakarta Bean Validation, PostgreSQL row securityBefore AI, Input checks

What is original here, and what is not#

Ideas with an author are attributed where they are used. The confused deputy is Norm Hardy's, from a 1988 paper. Defense in depth, least privilege, allowlists, taint checking, policy decision points and idempotency keys are long-standing engineering ideas with no single owner on this site. The split of prompt injection into direct and indirect follows the OWASP list and provider documentation.

What this site adds is the arrangement: the four places plus the network edge as a frame for every check; the five-step anatomy of an injection (placement, delivery, adoption, action, payoff) with the rule that wording only acts at adoption; the trust label read by the tool gate; the policy gate as one comparison that stops several different attacks; and the blast radius computed from holdings with the agent assumed fooled. These are designs for teaching. Where the site proposes a design, it calls it a design.

No prose, example or figure was copied from any source. The diagrams are original.

Sister sites#

This site is one of a series of guides on engineering with AI agents. Each owns one subject and links the others where the subjects meet.

SiteOwns
Prompt EngineeringHow instructions are written, composed and versioned
Context EngineeringWhat the model can see now: selection, retrieval, budget
Memory EngineeringDurable information and saved state
Agent CommunicationMessages between agents; A2A and MCP
Observability EngineeringLogs, metrics, traces, audit events and replay as evidence
Tools EngineeringCallable capabilities: schema, execution, MCP tools
Structured Output EngineeringTyped contracts: shape, validation, repair, evolution
Agent OrchestrationThe control plane: what runs next, under which condition
Agent ReliabilityAcceptable outcomes despite failures, retries and load
Eval EngineeringMeasurement: graders, golden sets, judges, release gates
Harness EngineeringThe runtime around a model call
Diff to DeployShipping a change with coding agents: hooks, review, CI
What this is not. This site is not a governance guide. Governance (who is accountable, which controls must exist, who may grant an exception) is the organization's own system; this site describes only the part of it that a guardrail depends on.

Run it yourself#

The example needs Python 3 and nothing else: no model, no key, no network. From the repository root, python3 examples/uw-guardrails/run_guards.py --all prints every case under the warning-only profile and with every guard, and python3 -m unittest inside that folder runs its tests. The labs on the pages run in the browser on data generated from the same code, and store nothing.