Skip to main content
Giving an agent more autonomy is a promise to your organization. Policy as code is how you keep that promise when nobody is watching. This chapter gives you four things to build or demand from a vendor: a risk classification for agent actions, approvals that resist fatigue, execution safeguards, and an audit record anyone can replay.

6.1 Classify actions on two axes

Every control later in this chapter depends on classifying actions well. Two questions do the work:
  • Reversibility. Can the change be undone cleanly, and how fast?
  • Blast radius. How much of your estate can it touch, and which tiers of it?
Classify action classes, not single commands. “Restart a stateless pod” is a class with known properties, and policy refers to the class. Where you can, derive the class by machine: a skill or tool that declares its access type, reversibility, and scope (see Chapter 3) classifies itself, so nobody has to remember that a script is dangerous. Use the matrix as your starting policy: fill each cell with your own action classes before you connect an agent to production.

Write the policy down as code

Policy binds the matrix to your real estate. For each action class it answers: which agent, in which environment, during which change window, under which preconditions, and with which approvers. Keep that policy as versioned configuration that changes through pull requests with named owners. A policy diff is an autonomy decision, so review it like a production change. Here is a generic sketch (not a CloudThinker file format) of one action class:
Read it top to bottom: the agent may roll back only a deploy younger than an hour, during an active SLO breach, with a rollback plan attached. Staging runs without asking. Production waits for a senior SRE. Two rollbacks an hour is the ceiling, and a repeated failure stops the class.

6.2 Design approvals people actually read

Approvals are a human-factors system, and they fail in a known direction: fatigue, then rubber-stamping. Once that happens the gate is theater, and the audit trail records consent that never really happened. A working heuristic: when people accept more than about 95% of a class unchanged, let that class run without asking. When they accept less than about 70%, fix the agent or the policy before you widen anything. Wait for at least 30 decisions on a class before you trust either number, since three approvals out of three proves nothing. High acceptance only means “ready” when people actually read the request. High acceptance with near-zero review time is fatigue, not readiness (Chapter 11, failure mode 7). Four practices make the heuristic usable:
Review approval numbers per action class every few weeks. A class with high acceptance and long approval latency is the clearest candidate to automate: people agree with it, and waiting for them costs you time.

6.3 Execution safety between “approved” and “done”

Hold agent changes to a higher bar than the average human change. Five mechanisms get you there:
  1. Pre-flight checks. Recheck preconditions when the action runs, not when it was planned, because the world moves in between. Scope assertions such as “affects 5 resources or fewer, none tagged critical” fail closed.
  2. Staged rollout with checks between stages. Wide changes go out in slices, with the verification loop from Chapter 1 between slices. Stage the rollback before slice one.
  3. Circuit breakers and rate limits. An agent repeating a failing action, or a fleet above its change-rate ceiling, halts and escalates. Retry with backoff is for network calls, not for production changes.
  4. Rollback as a deliverable. Every consequential action ships with an executable rollback attached at plan time, tested where you can. “We can probably reverse it” is not a rollback plan.
  5. A kill switch. One action that stops all autonomous execution while investigation keeps running. Give it an owner, a drill schedule, and an audit event. Design it before the day you need it.

6.4 An audit record anyone can replay

Design the audit record so three readers can replay any action: the engineer the next morning, the auditor at quarter-end, and the regulator in your worst week. For each consequential action, record: Make the record immutable and exportable, and keep it as long as your own retention policy requires. Done well, agentic operations produce better change evidence than most human processes, as a side effect of doing the work.

6.5 How this maps to CloudThinker

In CloudThinker, Approvals decides every write an agent makes through a connection. Reads always run. Each write passes four checks in order, and the first one with an answer decides, with one exception: under Manual, an Allow Rule doesn’t decide, and the write still goes to a person. CloudThinker turns on Rule enforcement one workspace at a time, and the Approval mode alone decides until it does.
  1. Always blocked. A built-in list of calls that never run, such as stopping CloudTrail logging, closing an AWS account, or deleting the kube-system namespace. No Rule, no person, and no break-glass can override it. You can’t add to this list; to block more, accept a Deny Rule with Never allow break-glass on, which takes effect once enforcement reaches your workspace.
  2. Rules. Each Rule names one kind of write, such as ec2:StopInstances on a staging account, and says Allow, Ask first, or Deny. Agents propose Rules as they work, and a proposed Rule does nothing until a workspace admin accepts it. While the Rules step shows In preview, even an accepted Rule only records what it would have decided, with enforcement still off.
  3. Approval mode. Decides any write no Rule decided. Manual asks a person before every write that no Deny or Ask first Rule decided, including one an Allow Rule covers. Auto has four choices, named by their steps (see the table below). New workspaces start on Auto · Rules + AI · Ask me. Automations default to Auto · Rules + AI · Refuse, since no one may be there to answer.
  4. Approvers. Default approvers or a named group, an optional two-person rule, and break-glass, which is off until an admin turns it on and needs a written reason each time.
AI judgment allows a write that matches what you asked for and stays in its scope. A destructive write, or one with an unclear effect, goes to the last column. To see what AI judgment decided, open Approvals → Activity: its No Rule matched row counts the writes the Approval mode decided, including AI judgment. Each idea in this chapter has a concrete home:

Apply it in your workspace

Anyone in the workspace can view Approvals. To accept Rules or change modes and approvers, you need the workspace Admin role (organization Owners and Admins have it in every workspace).
1

Open Approvals

Open Approvals in the sidebar. If it isn’t there, click More and select Approvals. The page opens on the Overview tab.Success state: you see what needs you and how many calls ran, asked a person, or were refused in the last 7 days.
2

Fill your matrix with Rules

On the Rules tab, review the Rules agents proposed. No proposals yet? Click Find rules. The check-up takes 5 to 10 minutes, uses credits, and proposes Rules from your connections, findings, incidents, alerts, and approval history. Accept the ones that match your matrix from 6.1. If it proposes nothing you want, click Add from template or write a Rule in the form (Rules).Success state: each accepted Rule shows Allow, Ask first, or Deny, and nothing changed before you accepted it.
3

Choose an Approval mode

On the Approval mode tab, set Workspace mode. Auto · Rules + AI · Ask me suits most teams. For a production workspace where only accepted Rules should run writes alone, pick Auto · Rules · Ask me or Manual. Under Run types, click Override to give one run type, such as Automations, its own mode.Success state: the picker shows your choice, and each run type row shows Same as workspace or its override.
4

Set who approves

On the Approvers tab, click Edit on Default approvers and add the people who should answer most asks. Click New group for a team that owns one system, and name that group in each Ask first Rule for its systems; those Rules route asks once enforcement is on. Turn on the two-person rule for production, so nobody approves their own run’s write. Leave break-glass off until you have an emergency procedure for it.Success state: the Who approves card on Overview shows how many default approvers you have and whether the two-person rule is on.
5

Put the policy under review

On the Rules tab, open the More Rule actions menu, click Export active Rules, and commit the YAML file to a repository with named owners. After a pull request merges, open the same menu, click Import policy, and load the merged file. Import shows what would change before you apply it. It merges by default: Rules in the file are added or updated, and Rules missing from the file stay unless you select Remove Rules that are not in the file. Imported Allow Rules wait for review unless you turn on Activate Allow Rules. An accepted Rule decides a write only once CloudThinker turns on Rule enforcement for your workspace; until then set the mode to Manual for the writes that must wait for a person.Success state: the workspace matches the reviewed file in Git.
Git doesn’t lock the workspace. An admin can still accept or edit a Rule in the app, and that change skips your pull request. Keep the workspace Admin role to the few people who own the policy, and export again after any change made in the app so Git stays current.
KEY TAKEAWAYAutonomy is governable when it is written down and enforced. Classify actions by reversibility and blast radius, keep the policy as reviewed code, design approvals against fatigue and measure them, wrap execution in pre-flight checks, staged rollout, circuit breakers, and a ready rollback, and record every action so anyone can replay it.

Next steps

Chapter 7 · Evaluating Agents Like Production Systems

Build a test set from your own incidents and gate every agent change on it.

Set up Approvals

Review proposed Rules, pick an Approval mode, and choose who approves.