Check that every write step in a multi-step plan has an undo step, and give the rollback order

$0.005 USDC per call · Agent infrastructure · POST /api/v1/compensation-coverage · Id compensation-coverage

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

FieldTypeRequiredDescription
stepsarray<object>; max 100 itemsyes
completedarray<string; length 1..200>; max 100 itemsnoStep 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.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: 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.
uncoveredarray<string>noWrite steps with no usable compensation.
irreversiblearray<string>no
rollbackOrderarray<string>noCompensation step ids to run, latest completed first. Present when completed is given.
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways 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