Approval is a record, not a prompt
The agent can request an approval. It cannot grant one. The approval is bound to a hash of the exact payload; edit the draft and the approval becomes invalid.
One inbound email, ten checkpoints, eight ways to break it. A working model of the control plane between an AI action and your CRM.
Initializing deterministic control plane…
Most AI demos stop at the happy path. The hard part starts when a tool times out after it already changed something. This lab models the control plane we put around every external action: one durable run, one approval record, one verified outcome.
The agent can request an approval. It cannot grant one. The approval is bound to a hash of the exact payload; edit the draft and the approval becomes invalid.
Every outbound action carries a stable key. A retry after a crash finds the existing send and skips it instead of emailing the client twice.
A 200 from a send API only proves the API accepted the request. The run is not complete until the mailbox, calendar, or CRM reads the record back.
Durable run ledger · outbox · payload-bound approvals · append-only audit · per-run cost budget
| Failure | A naive agent | This control plane |
|---|---|---|
| Worker killed after send | Resends on retry | Checkpoint + idempotency key suppress the second send |
| Duplicate inbound webhook | Creates a second lead | Source-id dedupe accepts one run |
| CRM returns 500 | Marks the job done | Retry with backoff; exception if it stays down |
| Human rejects approval | Sends anyway or stalls silently | No external action; draft retained |
| Model invents an amount | Trusts the model | Deterministic numeric reconciliation blocks |
| Provider 200, mailbox empty | Trusts the status code | Read-back verification fails; no CRM sync |
| Prompt injection | Follows the email | Policy gate outside the prompt; human approval |
| Runaway token spend | Finds out on the invoice | Per-run budget cap; pause before send |
npm testWe scope the pilot around one inbox, one CRM, and the actions that must never happen twice.
This page is a reference implementation, not a client deployment. The connectors and model are simulated; the control-plane invariants are covered by the test suite in the repository.