Home / Use cases / Agent guardrails
The agent gets the project's mandatory rules before it writes the first line, and the diff is checked for violations before the merge request (MR). Review checks the MR against the same rules.
What happened, how it was measured, and what to do now. Level MUST or SHOULD.
When the agent opens a file, the related rules land in its context in full, not paraphrased.
Changes are checked against mandatory rules. Violations get fixed before the merge request.
The MR is reviewed against the same rules. If new commits arrive, the review is marked outdated.
What happened: a retry loop on gateway timeout caused a double charge (ticket #2214). How it was measured: 14 duplicates in one week in the gateway logs. What to do: put the retry on the payments-retry queue with an idempotency key, and don't change code in legacy/gateway_v1.
Illustrative example.
Add your team's rules in the first days and start counting violations in week one.