Does a change to the approved thing invalidate the approval under a materiality policy?

$0.005 USDC per call · Agent infrastructure · POST /api/v1/approval-invalidation · Id approval-invalidation

Compares what a human or system approved with what is about to be executed (a quote, order, plan, diff summary: any JSON) under a caller-supplied materiality policy: per-path rules exact / ignore / numeric tolerance (absolute or percent) / no-increase / no-decrease, with the longest matching path winning and a default for unlisted paths. Also covers quote revisions (approved revision number must equal the current one) and expiry (approvedAt + validForSeconds against a caller asOf). pass = approval still covers the action; fail = a material change, a superseded revision or an expired approval (witnesses name the path, approved and current values); unknown = the policy or time evidence needed is missing. Does not decide what is material for you.

What you get

Stops an agent from executing a changed price, quantity or recipient under an approval given for the old one.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/approval-invalidation. 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/approval-invalidation \
  -H 'content-type: application/json' \
  -d '{"approved":{"total":1000,"currency":"USD","items":[{"sku":"A","qty":2}],"note":"v1"},"current":{"total":1004,"currency":"USD","items":[{"sku":"A","qty":2}],"note":"v2"},"policy":{"default":"material","fields":[{"path":"/total","rule":"numeric-tolerance","pct":1},{"path":"/note","rule":"ignore"}]}}'

Input

FieldTypeRequiredDescription
approvedanyyesThe approved snapshot (JSON).
currentanyyesThe version about to be executed (JSON).
policyobjectno
approvedRevisioninteger; 0..1000000000no
currentRevisioninteger; 0..1000000000no
requireSameRevisionbooleannoDefault true when either revision is given (a missing partner gives unknown): an approval for another revision does not cover this one. Send false to ignore the revisions.
approvedAtstring; length 0..40noRFC 3339 instant.
validForSecondsinteger; 0..315360000no
asOfstring; length 0..40noRFC 3339 instant for the expiry check; no clock is read.

Example request body

{
  "approved": {
    "total": 1000,
    "currency": "USD",
    "items": [
      {
        "sku": "A",
        "qty": 2
      }
    ],
    "note": "v1"
  },
  "current": {
    "total": 1004,
    "currency": "USD",
    "items": [
      {
        "sku": "A",
        "qty": 2
      }
    ],
    "note": "v2"
  },
  "policy": {
    "default": "material",
    "fields": [
      {
        "path": "/total",
        "rule": "numeric-tolerance",
        "pct": 1
      },
      {
        "path": "/note",
        "rule": "ignore"
      }
    ]
  }
}

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.
invalidatedbooleanno
materialChangesarray<object>noAt most 100 listed.
materialCountintegerno
immaterialCountintegerno
expiredbooleannoPresent when expiry was evaluated.
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