Evaluation and safety · about 20 minutes of study

Guardrails

Guardrails are layered controls that constrain inputs, outputs and actions. They reduce specific risks but need measurable coverage and cannot guarantee every attack is stopped.

Before you start: Review Prompt injection first. Python-like examples use variables, lists and functions.

Guided concept walkthrough

Follow the mechanism

Threat model

Name the protected resources and harms.

1 / 4

A conceptual animation, not a live model trace. Play advances every five seconds and stops at the final stage.

Start with an everyday explanation

A road uses lanes, speed limits, brakes and barriers. Each control addresses a different hazard; painting more lines does not replace brakes.

See a concrete example

A schema checker blocks malformed output; a tenant filter blocks another user record; an approval gate controls an email send. Each protects a different boundary.

A claim to question

A diagram showing zero successful attacks is not proof of complete security.

Try before revealing the answer

Map three failure cases to three distinct controls and explain what each control cannot detect.

Show the worked answer

Schema validation checks shape but not truth. Authorization checks resource access but not answer relevance. Evidence checking can find unsupported claims but does not replace side-effect approval.

Now explain the idea to someone else using your own example. If you cannot explain a stage, revisit it before moving on.

Your explanation and revision notes

Loading local notes…

Read the primary reference

OWASP prompt injection

The explanation and exercises are original teaching material. The linked source provides background; examples and assumed numbers here are not claims about a particular company.