A plain-English rulebook for AI coding agents, in three lists
A dev.to template sorts what a coding agent may do into allowed, needs approval and never, then says to enforce it with tools, not trust.
The short version
- Every rule goes on one of three lists: allowed, needs a person, or never.
- Test each action by asking what it would cost if the agent did it a hundred times by mistake.
- Never list includes force-pushing to shared branches, piping network scripts into a shell, and editing tests to pass.
- Enforcement should sit outside the model: hooks, network allowlists, scoped credentials and branch protection.
- The template comes from Sandscale, a vendor whose product is described at the end of the post.
Why it matters
Many teams give coding agents access first and write rules only after an accident. This template gives a team something concrete to argue over before one happens. Its main point is that a rule only counts if something other than the agent enforces it.
Rules first, not after the accident
As dev.to reported, in a post originally published on the Sandscale blog, most teams let coding agents into their projects before anyone writes down what the agents may do. A coding agent is an AI tool that reads and edits a project's files and can run commands. The author's examples of what goes wrong are a force-push (overwriting shared version history), a curl | sh command (downloading a script and running it blindly), and a database migration run against the wrong database.
The post's argument is that writing the policy in plain English first is easier than writing it in a hurry afterwards. It offers a deliberately short template to copy, trim and argue about. The author says the arguing is most of the value.
Three lists and one test
Every rule lands on one of three lists. Allowed covers things the agent may do without asking, because they are cheap to undo or stay inside its sandbox (an isolated workspace). Needs a person covers things that leave the sandbox or are hard to undo, and a named human approves or denies them first. Never covers things refused even with approval, because one mistake costs more than any convenience is worth.
To sort an action, the post asks one question: what would it cost if the agent did this a hundred times by mistake? Cheap and local means list one. Expensive or external means list two. Unrecoverable means list three.
The sample policy fills the lists in. Allowed includes reading files, editing its working copy, running the project's own tests, and opening a draft pull request (a proposed code change). Needs a person includes adding a dependency, changing CI configuration (the automated checks that run on code), running any database migration, and sending anything outside the company. Never includes reading secrets files, touching production data, and changing the policy itself.
Why the lines sit where they do
The post explains a few of its choices. New dependencies need a person because agents install packages that merely sound right, and fake lookalike packages are a known risk. A human glancing at the package name and page is a cheap check.
Changing CI files and Git hooks needs a person because those files run later with more access than the agent has now. An agent that edits them could raise its own privileges indirectly.
Disabling tests is on the never list. The post calls it the most common way an agent appears to succeed at a task it actually failed, and it is easy to miss unless someone looks. Self-approval is also banned. An approval system where the requester can approve, the author says, is "a log, not a control."
Make something other than the agent enforce it
A written policy that nothing enforces depends on the agent reading and obeying it. The post warns that agents can be talked out of instructions through prompt injection, where text hidden in content the agent reads tries to steer it. So the lists should be enforced outside the model.
- Hooks: Claude Code can run a check before a tool call that allows it, blocks it, or asks a person. The never list maps to blocks, and the needs-a-person list maps to asks.
- Network limits: an allowlist of approved hosts, set on the sandbox, not left to the agent's judgment.
- Credentials: if the agent should not have more than read-only access, do not hand it anything more.
- Branch protection: the Git host itself blocks pushes to shared branches and merges.
The template also asks for records of every run: who started it, which agent and model, each command and its result, and each approval and who gave it. Exceptions should be written, granted per project by its owner, and carry an end date.
Read it with the author's interest in mind
The post closes by describing how the rules map to Sandscale, the company behind the blog. It says Claude Code runs under your policy there, human approvals are on every plan, sandboxes start with the network off, and actions go into a tamper-evident audit log. Project-level policies come with the Team and Enterprise plans.
That does not make the template less useful, since the lists work with any tooling. But it is a vendor's post, and this summary has not tested any of its product claims. The author's own closing advice is to keep the written version whatever you enforce it with, so that after the next surprise the first question is which list the action belonged on.
What to watch
- Whether teams adopt hook-based blocking for their never lists, or keep relying on instructions the agent is merely asked to follow.
- How the companion incident story about a coding agent leaking a key shapes what teams put on their never lists.
Try it
Pick three things your coding agent can do today and ask the hundred-times question about each. Then check whether anything besides the agent's own good behavior stops the risky ones.
Sources and links
Liked it? Say why
Add a line for other readers.
No account needed. We never show your email. Comments with links, ads or abuse are held and not shown. Your comment shows after a quick check.
Listen to the AI Wire headlines
Listen to the AI WireListen to our daily AI shows every morning: on your commute, in the shower, wherever you are
Listen to the daily showsWritten by the SI Agent News Desk from the reporting above.Written with AI from the source above. Every number is checked against the source. Spot a mistake? Corrections.
