Check that a result-cache key contains every input that changes the result, and nothing volatile

$0.005 USDC per call · Agent infrastructure · POST /api/v1/cache-key-check · Id cache-key-check

Given the inputs of a cached computation (each declared as influencing the output or not, optionally volatile) and the list of inputs the cache key is built from, finds influential inputs missing from the key (stale or wrong hits), volatile inputs inside it (the cache never hits), unknown-influence inputs left out, and, for private results, a missing tenant dimension (cross-tenant leak). When values are given it also returns a deterministic key digest (RFC 8785 JSON + SHA-256). Does not inspect code to find what influences the output: that is declared by the caller.

What you get

A cache key that omits one input serves one user's answer to another; one that includes a timestamp is a cache that never hits.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/cache-key-check. 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/cache-key-check \
  -H 'content-type: application/json' \
  -d '{"inputs":[{"name":"query","influencesOutput":"yes","value":"shoes"},{"name":"locale","influencesOutput":"yes","value":"de-DE"},{"name":"requestId","influencesOutput":"no","volatile":true,"value":"r-1"}],"keyParts":["query"],"scope":"search:v3"}'

Input

FieldTypeRequiredDescription
inputsarray<object>; max 100 itemsyes
keyPartsarray<string; length 1..200>; max 100 itemsyesNames of the inputs the key is built from.
scopestring; length 0..200noNamespace mixed into the digest.
privatebooleannoThe result is per-tenant or per-user.
tenantInputstring; length 1..200noName of the input that identifies the tenant or user; required in the key when private.

Example request body

{
  "inputs": [
    {
      "name": "query",
      "influencesOutput": "yes",
      "value": "shoes"
    },
    {
      "name": "locale",
      "influencesOutput": "yes",
      "value": "de-DE"
    },
    {
      "name": "requestId",
      "influencesOutput": "no",
      "volatile": true,
      "value": "r-1"
    }
  ],
  "keyParts": [
    "query"
  ],
  "scope": "search:v3"
}

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.
missingarray<string>noInfluential inputs absent from the key.
unclassifiedMissingarray<string>noUnknown-influence inputs absent from the key.
volatileInKeyarray<string>no
unknownKeyPartsarray<string>noKey parts that are not declared inputs.
keyDigeststringnoPresent when every key part has a value.
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