# My AI reviewer rejected two of my agent's root scripts in two days. Both times it was right.

> Source: <https://dev.to/airbone42/my-ai-reviewer-rejected-two-of-my-agents-root-scripts-in-two-days-both-times-it-was-right-1j0m>
> Published: 2026-11-30 12:38:24+00:00

**Recommendation:** Run a reviewer model outside the agent that rejects any script whose stated reason omits deletes, access or data additions, and derive the reason from the commands themselves.
More in the playbook "Securing agents and AI tools": <https://wpnews.pro/playbooks/agent-security>

My agents don't hold root. When one of them needs to change something on a host, it writes a script and a reason, and both go to a reviewer model outside the agent. The reviewer reads the script, reads the reason, and decides: pass, ask me, or reject.

Last week it rejected two scripts in two days. I want to show you why, because both rejections are the argument for building it this way.

**Rejection 1: "Security updates"**

The agent's reason said: apply security updates to a VM. The script did that, but it also ran a full upgrade, purged packages nobody had mentioned, and rebooted the VM, even when the update step had failed or timed out.

Nothing malicious. The agent just wrote the reason from its intent and the script from its habits. The reviewer compared the two and said no: the reason did not describe what the code does.

The fix was not "be more careful next time". The reason is now generated from the commands themselves (what gets upgraded, which images are pulled, which VM restarts), and the reboot only runs after a successful update. There was also a nastier bug underneath: the guest-exec call returns exit code 0 even when the command inside fails, the real exit code is only in the JSON. A human skimming "security updates" would have approved it.

**Rejection 2: the cleanup nobody mentioned**

The next day a script for a different change was rejected for a smaller reason: it also deleted old backup files. Sensible, but the reason did not say so. The rule the reviewer enforces: anything that deletes, and anything that adds access or data, has to be in the stated reason. The agent resubmitted with the cleanup named and the script passed.

**What I take from this**

A second model with a narrow job ("does the code match the reason, and is the reason enough?") catches things I would have clicked through. I would not have read every one of them closely.

The reviewer is only useful because it is outside the agent. Rules in the agent's own config can be edited by the agent.

It says no with a reason, and the agent can fix it without waking me.

Your turn

I'm writing this up as a playbook: risk tiers, why the guard can't live in the agent, approvals bound to a plan hash, the reviewer prompt and when it may decide alone, bundling approvals per task, plus templates. It is not written yet, and I only write it if enough people want it.

If you run coding agents with real credentials, join the waitlist. The first thing I'll send the list is the reviewer chapter with the actual prompt and a checklist for your own setup, one email, no newsletter:

[https://tobiaszander.de/agent-gates/?ref=devto](https://tobiaszander.de/agent-gates/?ref=devto)

(German version: [https://tobiaszander.de/agent-gates/de/?ref=devto](https://tobiaszander.de/agent-gates/de/?ref=devto))

Free to check your own setup right now: [https://github.com/airbone42/agent-permission-linter](https://github.com/airbone42/agent-permission-linter)
