Approval policy for a coding agent

A coding agent runs commands, ships code and touches databases. Most of its work is reading and editing files, which stays local; the steps that reach production or cannot be taken back are the ones a person should see.

Signs you in or up first. You see every rule in your workspace before any is added.

Or change it in the policy generator first: names, limits and how long a request waits. Two-person approval needs Team or above; the other rules need Pro. On Free every request waits for one person instead.

What it decides

Each kind of action the agent takes, the names it sends for it, what happens, and why.

  • Look things upread.*Runs on its own and is recorded.Looking things up changes nothing, so it runs on its own and is still recorded.
  • Run commands on a servershell.*Waits for a person to approve.A command on a server can do anything the server can. A person reads it first.
  • Deploy to productiondeploy.*Waits for a person to approve.A deploy reaches customers. A person approves each one, from the inbox, Slack or a phone.
  • Change a database or run a migrationdatabase.*Waits until two different people approve. One no stops it.A migration or a write to production data can lose data for good. Two different people approve; one no stops it.
  • Delete datadelete.*Waits until two different people approve. One no stops it.Deleted data rarely comes back. Two different people approve.
  • Grant or remove accessaccess.*Never. The request is refused at once.Granting or removing access is never the agent's call. The request is refused at once, so a person does it themselves.

The rules

These are the 6 rules the button adds, for every agent or the one agent key you pick. Every “never” and “ask” goes in before any “allow”, and rules you already have stay. When rules disagree the most cautious wins.

[
  {
    "action": "read.*",
    "effect": "allow"
  },
  {
    "action": "shell.*",
    "effect": "ask"
  },
  {
    "action": "deploy.*",
    "effect": "ask"
  },
  {
    "action": "database.*",
    "approvals": 2,
    "effect": "ask"
  },
  {
    "action": "delete.*",
    "approvals": 2,
    "effect": "ask"
  },
  {
    "action": "access.*",
    "effect": "deny"
  }
]

The agent’s side

The agent asks before each action under one of these names, such as shell.run, with the amount and currency where money moves, and acts only when the answer says allowed: true. An amount it leaves out never gets past a limit. The requests docs show the call, and the playground lets you try one without signing up.