Start with one rule: no delete lands without a person. Then add a ceiling on how many rows one merge may change, and a list of tables and columns that always wait for you. That is three lines of SQL, and it turns “review everything the agent does” into “review what breaks the rules”.
Why not review every change?
Because it works for ten changes a day and breaks at ten thousand. People asked to approve everything stop reading and start clicking. What scales is approving the rules once, and looking only at the merges that break them. In Chronos those rules are a merge policy: they run inside the merge, on the exact rows it is about to apply, so nothing written a moment before or after can slip past.
Which rule comes first?
max_deletes = 0. A wrong update leaves a row you can see and fix. A wrong delete leaves nothing to look at. Most agents rarely delete, so the queue stays short, and every delete that does come through tells you whether to trust the agent with more.
create merge policy agents with (max_deletes = 0);alter agent bot set (policy = 'agents');What do three lines buy you?
Add a row ceiling and the tables that are never an agent’s call:
create merge policy careful with (max_rows = 500, max_deletes = 0, review_tables = 'payments');alter agent bot set (policy = 'careful');- Run 1updates 12 rows in
leadsmerged, no person needed - Run 2updates 620 rows in
leadsheld: more thanmax_rows = 500 - Run 3deletes 3 rows in
leadsheld:max_deletes = 0 - Run 4updates 1 row in
paymentsheld:paymentsis a review table
A held merge is not lost work. The world stays as the agent left it. You read its diff, then merge it at the version you read, or drop it.
Which rules are there?
Every rule is optional, and a rule left out limits nothing. The ones worth knowing first:
| Rule | A merge waits for a person when |
|---|---|
max_deletes | it deletes more rows than this; 0 means any delete |
max_rows | it changes more rows than this |
review_tables | it changes any table in the list |
review_columns | it changes any column in the list, such as users.email, even in one row |
rows_per_hour, deletes_per_hour | with the agent’s other merges in the last hour, it goes over |
max_age | its world was forked longer ago than this |
check_reads | what the agent read has changed since it read it |
The full list, with defaults, is in Merge policies and reviews.
Can’t an agent split a big job to stay under the limit?
It can try, which is what the hourly rules are for. max_rows and max_deletes judge one merge. rows_per_hour and deletes_per_hour count the agent’s merges into main over a sliding hour, so ten merges of 400 rows meet the same ceiling as one merge of 4,000.
alter merge policy careful set (rows_per_hour = 2000, deletes_per_hour = 0);What about small changes that matter a lot?
Count is the wrong measure for those. One changed email address or one changed account owner is a single row and can be the worst change of the day. Name those columns, and a merge that touches them waits whatever its size:
alter merge policy careful set (review_columns = 'users.email,accounts.owner');For rules about the data itself, such as “every lead list keeps at least one lead”, use a merge check: a query the result of every merge must find nothing in.
What don’t rules catch?
- Wrong values inside the limits. A policy that allows 500 rows allows 500 wrong rows. Keep the diff, and keep undo within reach.
- Anything that is not a merge. A policy governs what reaches
main; an email the agent sent from its own code is sent. - Rules you loosen too early. Raise a limit after the queue has shown you the agent’s deletes and big changes were right, not before.
Questions
What is the first guardrail to put on an AI agent that writes to a database?
No delete lands without a person. A wrong update leaves a row you can see and fix; a wrong delete leaves nothing to look at. In Chronos that is a merge policy with max_deletes = 0.
Do I have to review every change an AI agent makes?
No. Approve rules once, as a merge policy, and review only the merges that break them: too many rows, any delete, or a table or column you named. Everything inside the rules lands on its own.
Can an AI agent get around a row limit by making many small changes?
Not if the policy has hourly limits. rows_per_hour and deletes_per_hour count the agent’s merges over a sliding hour, so many small merges meet the same ceiling as one big one.
