- Home
- Skills
- APIs & Backend
- Fail-Closed Decision Contract with Signed Receipts
Fail-Closed Decision Contract with Signed Receipts
Control layer around any verification engine or vendor: strict result allowlist (no scores, media or unknown fields), consent-bound sessions scoped to app/tenant/subject, PASS only when every required check passed under the right policy, one-use Ed25519 receipts, metadata-only audit
$39
Works with the AI Agents you already use
Fail-Closed Decision Contract with Signed Receipts
Example session with this skill installed
Register a policy for 'identity-check' requiring 'document_valid' and 'face_match'. Normalize a vendor result where both passed, and generate a decision for subject 'user_123'.
- Read your context and instructions
- Compiled the fail-closed decision contract
The decision process has been executed for the subject user_123. The engine result was normalized to remove raw scores, and the policy contract was applied to reach a terminal state.
Decision Contract Result
| Field | Value |
|---|---|
| Decision | PASS |
| Subject (Hashed) | 8e3a2b...f12c |
| Policy Profile | identity-check |
| Policy Version | 1.0.4 |
| Checks Satisfied | document_valid, face_match |
| Transaction ID | txn_8892_af81 |
| Receipt JTI | 01928374-bbac-71bd |
| Expires | 2024-05-20T10:05:00Z |
{
"decision": "PASS",
"reasonCodes": ["ALL_CHECKS_PASSED"],
"engineName": "vendor-kyc-adapter",
"engineVersion": "2.1.0",
"completedAt": "2024-05-20T10:00:00Z",
"receipt": "eyJhbGciOiJFZERTQSIsImtpZCI6InB1Yi0yMDI0In0.eyJpc3MiOiJhdXRoLXN2YyIsInN1YiI6ImhtYWMtMTIzNCIsImFwcElkIjoibXktYXBwIiwidGVuYW50SWQiOiJ0LTk5IiwianRpIjoiMDE5MjgzNzQtYmJhYy03MWJkIn0.signature_bytes"
}
Next steps
- Store the
receiptin the application session and callverifyReceipton the target resource. - Ensure the
jtiis recorded in your Redis or database guard to prevent replay attacks. - Export the HMAC-hashed audit record to your long-term compliance log store.
Connects securely to your tools. The creator never sees your data.
About this skill
Services that wrap a verification engine (document checks, face match, fraud rules, a vendor KYC API) grow the same bugs: raw engine output lands in the database and logs, a missing check is treated as nothing wrong, a result from one request is accepted for another, and the verified flag handed to the application is a boolean nobody can audit. This skill is the contract around the engine.
Policy registry (policy.mjs): versioned policies per profile naming the required checks, the consent version and the assurance profile; the union of known check names feeds the result validator.
Engine-result allowlist (engine-result.mjs): exactly the keys providerTransactionId, engine {name, version, policyVersion}, completedAt, checks [{name, status, code}]; unknown checks, duplicates, scores, media, document numbers and free text are refused before storage or logging.
Session state machine (session.mjs): pure transitions CREATED -> CONSENTED -> PROCESSING -> PASSED/FAILED/REVIEW, DECLINED and EXPIRED terminal; consent bound to the digest of the exact notice shown; only the hash of the processor transaction kept; sessions found only through their exact (app, tenant, subject), 404 otherwise.
Decision (decision.mjs): PASS only when every required check is present with PASS under the session's policy version and transaction; any FAIL is FAIL; a missing, UNAVAILABLE or REVIEW check or a policy/transaction mismatch is REVIEW with reason codes.
Receipts (receipt.mjs): Ed25519 JWTs minted only from a PASSED session with accepted consent, bound to issuer, audience, tenant, subject, session, policy and key id, 30 to 600 s, accepted exactly once through a required replay guard; key-pair generator included.
Audit (audit.mjs): records hold identifiers, states, decisions and codes only, the subject as an HMAC digest; unknown fields and free text refused.
9 tests, a demo that walks one session end to end, reference/contract.md with the schema, rules and rotation notes. Node 20+, no packages, no network. Engineering guidance, not legal advice.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.
Requires a durable store for JTI consumption in production. Does not perform actual document/media analysis; acts as the contract layer for engine results. Node 20+ required.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 17 days ago
- Software
Node.js 20+