Back to AI/ML Overview
🛡️ Knowledge Site · Guardrails for Agentic Software · Enforceable Controls

Guardrails EngineeringA prompt asks. A guardrail enforces.

An agent reads text written by strangers and can call tools that change things. An instruction in a prompt is a request the model usually follows. A is a condition that code enforces whether the model follows it or not. This site starts from the validations, permissions and business rules of ordinary backend systems and climbs, one idea at a time, to layered controls around a probabilistic agent, asking one question at each step: what stops the harm when the model is wrong?

🎯The problem

A roof-assessment description carries a hidden request to export applicant records. A sentence in the prompt that says “never export data” is a hope, not a control. What actually stops it is code the model cannot argue with: a tool that is not allowed, a parameter outside its bounds, a policy check, an approval, and an audit record that shows the attempt.

🔑The question every page asks
What stops the harm when the model is wrong? Each chapter places one control at one boundary of the same synthetic insurance workflow and shows what it catches, what it misses and what it costs.

🗺️What is inside

From backend rules to

Validations, access control and policy engines before AI; against instructions, and governance; the trust boundaries an agent crosses.

Input, tool and output checks

Type, format, personal data and tenancy at the door; allow-lists, parameter bounds and approvals on ; schema, grounding and leakage checks on output.

Injection and defense in depth

Direct and indirect injection, sandboxing, network egress, least privilege, policy as code, and model-based with their error rates.

People, tests and production

Escalation and override, adversarial suites and red teaming, fail-open against fail-closed, auditability and exception handling.

🖱️How to read it

  • New to : read in order. Each chapter starts in plain English with one tiny example.
  • Experienced: jump to tool controls, defense in depth, policy as code or the insurance lab. The rigorous part sits in folded blocks.
  • Seventeen interactive labs, among them a placement explorer and a red-team lab, each with a plain table next to it.
  • Attack text is synthetic and aimed at the site’s own scripted stand-in. Results show how a control works, not how good any model is.