Fail-Closed Decision Contract with Signed Receipts

    1

    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

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    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

    FieldValue
    DecisionPASS
    Subject (Hashed)8e3a2b...f12c
    Policy Profileidentity-check
    Policy Version1.0.4
    Checks Satisfieddocument_valid, face_match
    Transaction IDtxn_8892_af81
    Receipt JTI01928374-bbac-71bd
    Expires2024-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

    1. Store the receipt in the application session and call verifyReceipt on the target resource.
    2. Ensure the jti is recorded in your Redis or database guard to prevent replay attacks.
    3. 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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+

    Permissions

    Terminal / Shell
    Listed17 days ago

    What's inside

    Frequently Asked Questions

    This skill addresses the risk of 'fail-open' logic and data leakage by providing a strict decision engine that strips raw PII, enforces tenant isolation, and issues tamper-proof cryptographic receipts for every verification.

    It is a zero-dependency Node.js implementation (v20+) designed to be wrapped as a tool for any LLM or agent framework that supports standard JavaScript execution environments.

    The signed receipts use Ed25519, a modern elliptic curve signature scheme, allowing your downstream services to verify the authenticity and integrity of a decision without re-processing the raw data.

    You receive the core decision engine logic, a policy registry template, the normalization allowlist, and the Ed25519 receipt generation/verification modules.

    Yes, while it includes a built-in memory guard for quick setup, the architecture is designed so you can easily plug in a durable store (like Redis) for distributed session and JTI management.

    This skill focuses on the decision contract and security wrapper; it is intended to ingest and normalize data from your existing LLMs, KYC vendors, or safety models to ensure their output is handled safely.

    New in APIs & Backend