Validator
0 0 About
Lesson 02 of 7 · Why agents need guardrails

Usually right isn't good enough.

The agent gets it right most of the time. Guardrails are for the time it doesn't, and you won't know which time that is.
Predict first

Same request, twice

You give an the exact same request twice, on the exact same files, and roll back in between.

Will the two builds be byte-for-byte identical?

The idea

Guardrails are for the days it goes wrong

Most of the time the agent does exactly what you asked. aren't there for most of the time. They're there for the build where it confidently writes the wrong property name, edits one file too many, or runs something you didn't approve.

They come in two kinds. Before guardrails stop an action from happening: , , hard rules. After guardrails catch a result that's already happened: the , your check in Desktop, and with git.

The validator is an after guardrail. It can't stop a bad edit. It makes sure a bad edit never goes unnoticed.
Sort it

Before or after?

Does each guardrail stop the action, or catch the result?

The agent must stop and wait after proposing a change
A script checks every file after the build
The agent may only write inside the project folder
You open the report in Desktop, refresh and look
A rule: never touch the frozen export file
Git takes you back to the last good commit
Explore

Blast radius

Every action has a : how much one wrong version of it can damage. Tap an action to see its size.

smallhuge

Tap an action.

Which action deserves a hard rule, not just a check afterwards?

Real story

It ran a script without asking

In the project behind this series, the agent was asked a read-only question about its validator. To answer, it ran a small Python script without asking first. The log said the action was allowed by 's classifier. The script only read files.

Was that a problem?

Recap

Three things to keep