Check that every write step in a multi-step plan has an undo step, and give the rollback order
For an agent plan made of steps with declared effects (read or write), checks every write in the plan, run or not, has a compensation step that exists, is itself a write, is not its own compensation, and that the dependencies have no cycle; flags writes declared irreversible; and, given which steps have completed, returns the compensations to run in reverse completion order. Does not judge whether a compensation really undoes the effect, nor run anything.
What you get
Finds the write with no undo before step 3 of 6 fails and leaves the system half-done.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/compensation-coverage. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/compensation-coverage \
-H 'content-type: application/json' \
-d '{"steps":[{"id":"reserve","effect":"write","compensation":"release"},{"id":"release","effect":"write","irreversible":false,"compensation":"reserve"},{"id":"charge","effect":"write","dependsOn":["reserve"]}],"completed":["reserve","charge"]}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
steps | array<object>; max 100 items | yes | |
completed | array<string; length 1..200>; max 100 items | no | Step ids completed so far, in completion order. Only used for rollbackOrder and to say an irreversible write has already run; coverage is always checked for the whole plan. |
Example request body
{
"steps": [
{
"id": "reserve",
"effect": "write",
"compensation": "release"
},
{
"id": "release",
"effect": "write",
"irreversible": false,
"compensation": "reserve"
},
{
"id": "charge",
"effect": "write",
"dependsOn": [
"reserve"
]
}
],
"completed": [
"reserve",
"charge"
]
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
uncovered | array<string> | no | Write steps with no usable compensation. |
irreversible | array<string> | no | |
rollbackOrder | array<string> | no | Compensation step ids to run, latest completed first. Present when completed is given. |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the execution-safety-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent