Beyond Logging: Sealing the Evidence Behind AI Decisions
From the publisher’s feed, collected in the ZeroLabs newsroom.
When simply logging agentic outputs is not enough, cryptographic evidence envelopes may be one building block of the solution. The underlying technology is highly standardized, and a large number of libraries lower the entry barrier for implementation.The Baseline Requirement: Capturing Context Is as Critical as Recording the DecisionAgentic systems are capable of automating increasingly complex tasks, and when task performance reaches levels that are comparable with those of highly trained employees, it is only natural that decision makers are tempted to also entrust these software systems with increasingly consequential tasks. Having worked as a consultant during the initial AI euphoria, I was able to witness firsthand how some executives jumped at the opportunity to automate first and ask questions later.An agentic system may reach a complex decision such as a loan approval, a payment execution, a contract analysis, etc. in seconds, but months later an auditor may want to understand the decision, how it came to be, and what it was based on.Consider an agent that reviews an invoice for signs of fraud. The final decision might be as simple as { "decision": "approve" }. However, the answer is almost useless by itself without further context about the decision, such as the original document, the decision process, approval flows, and various technical details such as model types, prompts, tool calls, retrieved facts, thought chains, etc. Logging this context is of course good practice and (hopefully) also standard practice for consequential decisions in many organizations. After all, if the decision is about a loan application that is contested, the answer "the AI told us so" is obviously not good enough.From a technical perspective, creating an evidence envelope for an agentic system could involve building an ordinary JSON document containing the right information for the context.Example of an evidence envelope structure:{ "case": { ... }, "input": { ... }, "model": { "provider": "example-provider", "name": "example-model", ... }, "analysis": { "score": 0.15, "decision": "low-risk", ... }, "review": { "approved": true, "reviewer": "finance-manager@example.com", ... }, "action": { "outcome": "payment-approved", "completedAt": "2026-09-28T12:02:01Z" }}In some environments, the requirements may be met at this point. In other environments, an additional requirement is that an actor cannot deny the action (non-repudiation). In this case, cryptographic seals become an essential building block.Tamper-Proof Evidence EnvelopesIf an evidence envelope is expected to provide non-repudiation guarantees, one solution is to protect it using an electronic signature based on public-key cryptography. For JSON-based data structures, ETSI TS 119 182 defines JAdES (JSON Advanced Electronic Signatures) [2], a standardized signature format based on JSON Web Signatures (JWS) that can be used to sign and verify the evidence envelope.Generally, there are two common models for signing JSON documents: attached (payload included) and detached (payload stored separately). A common design is to use the first model, but instead of signing the whole document, a hash of the document is created and signed. This keeps the signed object small and facilitates verification.The signed object could look as follows:{ "payload": "base64url-encoded-hash-bytes", "signatures": [ { "protected": "base64url-encoded-protected-header", "signature": "base64url-encoded-corporate-signature" } ]}Two things should be pointed out. First, even if a remote signing provider is used, the document itself does not have to leave one’s infrastructure as only the hash of the document has to be transmitted. Second, verification can be performed locally and without a third-party provider by rehashing the original content, comparing the resulting hash to the signed hash, and validating the cryptographic signature using the signer’s public certificate.For agentic workflows that require evidence of the decision process that cannot be denied in the future, this means that a hash of a standard JSON payload can be signed by using a third-party TSP’s standardized remote endpoints. This facilitates integration in many standard data science and workflow automation solutions.Integration into Agentic Automation WorkflowsCryptographic seals and the cryptographic suites used to create them are complex topics with plenty of technical depth. However, a high degree of standardization lowers the entry barrier for technical implementations. Many modern remote-signing solutions are based on standardized architectures and protocols defined by the Cloud Signature Consortium [1]. In practice, among other things, this means they provide well-known OAuth2 endpoints for authentication and authorization, together with standardized endpoints for signature creation.A remote-signing flow commonly looks like this:Authenticate to the trust serviceAuthorize the hash for a particular corporate credentialSubmit the hash for signingReceive the signature material returned by the signing serviceStore the JAdES object together with the evidence envelope or a durable reference to it.Example in a popular agentic automation platform (n8n)To demonstrate a potentially valuable combination of an agentic system and remote signing of the decision log, I created a small application that mocks a remote signing provider’s endpoints according to the CSC specifications [1] and built a prototype implementing the use case in n8n.Consider the following use case:A company receives invoices from various sources. Documents are parsed and evaluated by an agentic system to detect potentially fraudulent invoices. Invoices that are likely fraudulent are rejected immediately. Invoices that are deemed non-fraudulent by the agent are sent to a human reviewer and then accepted or rejected.The entire decision process, including the original input, metadata about the agentic system (prompt, model type, reasoning, …), and the final decision, is logged, electronically signed, and archived. Months later, an auditor can review and understand the entire decision context and cryptographically verify that the data has not changed.A generic workflow could look as follows:Example use case of agentic fraud assessment and electronic signature. Source: Image by the author.Such a workflow can readily be implemented as a PoC in n8n:Example of an n8n workflow combining a decision envelope with an electronic signature from a CSC compatible endpoint. Source: Image by the author.After the remote signing endpoint returns the signature, the final envelope can be constructed, for example in a simple JavaScript node in n8n:// Values returned by the signing serviceconst protectedHeader = "";const signatureValue = "";// SHA-256 digest represented as raw bytesconst documentHashBytes = getDocumentHashBytes();// Base64URL-encode the digestconst payload = base64UrlEncode(documentHashBytes);// Construct the JAdES JSON Serialization envelopeconst jadesEnvelope = { payload, signatures: [ { protected: protectedHeader, signature: signatureValue, }, ],};return jadesEnvelope;Real-world signing applications often require paid access to a commercial provider. For evaluating use cases, it is often sufficient to mock the endpoints first. A simple implementation could look as follows (GitHub).Final ThoughtsTamper-proof archiving solutions are common in regulated areas and may rely on specialized software and databases. However, depending on the specific requirements, the entry barrier to creating tamper-proof records may be lower than many businesses realize. In the context of agentic AI, the pattern outlined in this article may be one way to create records that can be used to reliably analyze and understand decisions from automated workflows in the future. Cryptographic seals add integrity guarantees and non-repudiation to the data, which can be valuable in many environments.References[1] Cloud Signature Consortium, Architectures and Protocols for Remote Signature Applications, Version 2.2.0.0.[2] ETSI, TS 119 182–1: Electronic Signatures and Infrastructures (ESI); JAdES Digital Signatures; Part 1: Building Blocks and JAdES Baseline Signatures, V1.2.1.Beyond Logging: Sealing the Evidence Behind AI Decisions was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.