Coco
Integrate and operate

Monitor to Enforce

Roll Coco out without blocking anything first, then switch to Enforce and handle what escalates.

Roll Coco out without blocking anything, then switch to Enforce and handle what escalates.

Start in Monitor, read what Coco would have done on real traffic, then enforce.


Run in Monitor

New projects start in Monitor. Every call runs, and the receipt records the verdict and the fact the call ran.

Activate a contract and run the agent:

coco contracts activate payment.transfer --live
coco run "Pay Sunrise Capital 25,000 for invoice 89"
coco ledger --limit 2

The ledger reads ESCALATE run: what Enforce would have decided, on a call that went ahead. To filter, use coco ledger --verdict DENY. For data, use --json. On a connected project, open the Audit Logs.

Good to know: To tell the agent what Enforce would have done, set tell_agent: true in coco.yaml. It adds one line to the tool result, such as Coco would deny this in Enforce: <reason>.

Read what it would have stopped

Before you promote the project, look for:

  • Calls Coco would stop that should run: Fix the contract or its bindings.
  • Calls Coco would allow that shouldn't run: Add a rule.

After any change, replay your boundary cases:

coco eval cases

Test one contract at a time

Monitor applies to the whole project. Once a project enforces, use the testing status to add or change one contract without enforcing it:

coco contracts activate <id> --testing     # recorded, never enforced
coco contracts activate <id> --live        # when the record looks right

A contract in testing runs in shadow whatever the project's mode.

Keep in mind: The dashboard has no testing status yet.

Switch to Enforce

On a local project, set mode: enforce in coco.yaml.

DENY now stops the call and tells the model why. ESCALATE pauses:

waiting on a person: ESC-001 Needs approval by Level 2 manager, under the policy: ...
  coco escalations approve ESC-001 --by <name>, then run again

Keep in mind: On a connected project, the gate holds the mode. Every hosted project runs in Monitor today, because the dashboard can't change the mode yet, so mode: enforce in coco.yaml has no effect there.

Decide escalations

ProjectWhere a person decides
Localcoco escalations, then coco escalations approve ID --by EMAIL or reject ID --by EMAIL --reason R.
ConnectedThe dashboard's Escalations page. The agent picks up the decision the next time it asks.

A rejection needs a reason, and the agent tells the user why when your application resumes the run. The approver sees the contract's obligations, such as which role has to sign.

Finish the paused call

coco run keeps no thread between runs, so running the prompt again opens a new escalation. To finish the paused call, your application keeps the thread open and resumes it once the person decides. See Pause for a person and resume, or the complete script in Wait for a person inside the run.

An agent with no way to pause gets DENY.

Good to know: A call with the same session id and call id as an open or decided escalation gets the escalation's answer first, before any rule runs. That's how a retry picks up an approval through the gate or CocoEnforcer.

Check the record

Walk the chain:

coco verify

You'll see Chain intact: N receipts., or the first receipt where the chain breaks, with exit code 1.


On this page