Free for open source projects and schools. AI Council costs nothing for OSS maintainers and educational institutions. Apply →

Home / Use cases / Agent guardrails

AI agents follow your team's rules, and you can verify it

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 happens when the agent doesn't know the rules

  • More review commentsAI-assisted PRs get about 1.7 times more review comments than human-written ones.CodeRabbit, December 2025. Source
  • Copy-paste instead of reuseThe share of copy-pasted code in changes grew from 8.3% to 12.3%, while refactoring fell from 25% to under 10%.GitClear, 2025. Source
  • Agent PRs wait longerA PR from an AI agent waits 17.6 hours for review to start, vs. 3.4 hours for a regular PR.LinearB, 2026, 75th percentile. Source

A rule works at both ends

  1. The rule is written as a case

    What happened, how it was measured, and what to do now. Level MUST or SHOULD.

  2. Delivered before the edit

    When the agent opens a file, the related rules land in its context in full, not paraphrased.

  3. Diff check

    Changes are checked against mandatory rules. Violations get fixed before the merge request.

  4. MR review

    The MR is reviewed against the same rules. If new commits arrive, the review is marked outdated.

What a rule looks like

MUST: retry payments only through the queue

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.

What the engineering leader sees

  • Agent work funnelHow often agents gather context, check the rules and edit code.
  • Branch statusPassed, Blocked with a list of problems, or outdated.
  • Agent sessionsWhich rules and knowledge the agent got in each session.

What you see in the product

See rule checks on your own code

Add your team's rules in the first days and start counting violations in week one.

Made on
Tilda