@prefix schema: <https://schema.org/>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.

<https://enforceauth.com/#enforceauth-inc> <http://schema.org/name> "EnforceAuth Inc";
    <http://schema.org/url> "https://enforceauth.com";
    a <http://schema.org/Organization>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#article> <http://schema.org/abstract> "Chain the records. When your log collector receives OPA decision log events, give each record the SHA-256 hash of the record before it. Editing, deleting or inserting a record then breaks the chain at that point. A chain cannot show that its newest records were cut off, so also publish a signed checkpoint of the latest hash at fixed times, to a place the log writer cannot change. An auditor can then recompute the chain and compare it with the checkpoints.";
    <http://schema.org/articleBody> "How to make AI agent audit logs tamper-evident: hash-chained OPA decision logs with external checkpoints\n\nChain the records. When your log collector receives OPA decision log events, give each record the SHA-256 hash of the record before it. Editing, deleting or inserting a record then breaks the chain at that point. A chain cannot show that its newest records were cut off, so also publish a signed checkpoint of the latest hash at fixed times, to a place the log writer cannot change. An auditor can then recompute the chain and compare it with the checkpoints.\n\nWhat \"tamper-evident\" means here\n\nIt means any change is detectable. It does not mean changes are impossible. You get detectability from the hash chain and the checkpoints, and you make changes hard with write-once storage and separate access.\n\nWhere each step runs\n\nStep\n\nWhere\n\nNotes\n\nDecide and log\n\nYour OPA\n\nDecision logs carry decision_id, input, result and the bundle revision. Mask sensitive fields with system.log.mask first. (OPA decision logs)\n\nChain\n\nYour log collector\n\nOPA does not chain logs itself. The collector adds prev_hash and hash to each event in arrival order.\n\nCheckpoint\n\nA separate system\n\nSign the latest hash every few minutes and store it with a different owner or a public timestamp service.\n\nStore\n\nWrite-once storage\n\nKeep records where the writer cannot delete them during the retention period.\n\nVerify\n\nAuditor or scheduled job\n\nRecompute the chain and compare it with the checkpoints.\n\nCertificate Transparency logs use Merkle trees for the same goal at larger scale, with proofs that one log version extends another. (RFC 9162) A simple chain is enough for most decision logs. Move to a Merkle tree when you need proofs for single records without handing over the whole log.\n\nExample: chain and verify\n\nRun in Python 3. Five tests show that edits, deletes and inserts are detected, and that cutting off the newest records is detected only by comparing with a checkpoint.\n\n\"\"\"Hash-chain OPA decision log events so any edit, insert or delete is detectable.\n\nRun in your log collector, after OPA's decision log plugin delivers a batch.\nEach record stores the SHA-256 of the previous record. Keep the latest hash\nsomewhere the log writer cannot change (for example a signed daily checkpoint).\n\"\"\"\nimport hashlib\nimport json\n\nGENESIS = \"0\" * 64\n\n\ndef canonical(event: dict) -> bytes:\n\treturn json.dumps(event, sort_keys=True, separators=(\",\", \":\")).encode()\n\n\ndef chain(events: list[dict], prev: str = GENESIS) -> list[dict]:\n\tout = []\n\tfor e in events:\n\t\th = hashlib.sha256(prev.encode() + canonical(e)).hexdigest()\n\t\tout.append({\"event\": e, \"prev_hash\": prev, \"hash\": h})\n\t\tprev = h\n\treturn out\n\n\ndef verify(records: list[dict], prev: str = GENESIS) -> int | None:\n\t\"\"\"Return the index of the first bad record, or None if the chain holds.\"\"\"\n\tfor i, r in enumerate(records):\n\t\texpected = hashlib.sha256(prev.encode() + canonical(r[\"event\"])).hexdigest()\n\t\tif r[\"prev_hash\"] != prev or r[\"hash\"] != expected:\n\t\t\treturn i\n\t\tprev = r[\"hash\"]\n\treturn None\n\nWhat to hand an auditor\n\nThe records for the period, with prev_hash and hash.\n\nThe signed checkpoints for the same period, and the public key.\n\nThe verifier script.\n\nThe bundle revisions named in the records, linked to the reviewed policy commits.\n\nFor approved high-impact actions: the signed approval tokens (or their IDs and digests), the approval service's public keys for the period, and the approver list in force.\n\nSigned human approval as evidence\n\nWhen an agent's high-impact action needed a person's OK, the decision record has to show that the approval was real. An approval that is just a row in a database, or \"approved: true\" in a request, only proves someone wrote that value. A signed approval proves who approved, what exactly they approved, and when it expires. Anyone holding the public key can check it later.\n\nWhat a signed approval should bind:\n\nClaim\n\nWhy it matters\n\nApprover (sub)\n\nWho approved. Must not be the requester\n\nRequester (req)\n\nThe user the agent acted for\n\nDigest of the exact call (dig): SHA-256 of tool and arguments\n\nAn approval for a $900 refund can't be replayed for $9,000\n\nAudience (aud): the tool\n\nAn approval for one tool can't be used on another\n\nExpiry (exp) and ID (jti)\n\nShort-lived and traceable\n\nIssuer (iss) and signature\n\nOnly your approval service can create one\n\nHow OPA uses it. The agent or gateway passes the approval token with the call. OPA verifies it with io.jwt.decode_verify, which checks the signature, expiry, issuer and audience. (OPA token built-ins) The policy then recomputes the digest of the call and compares it with the approved one. The approval ID, the approver and the digest go into the decision result, so they appear in the decision log. That log is chained and checkpointed as described above.\n\nTested with OPA v1.22.4 (10 opa test cases): a valid approval allows the call and records the evidence. A forged signature, an expired approval, one replayed for a larger amount, one used on another tool, a self-approval and an approver not on the list are each denied with a specific reason. The test signs tokens with a throwaway key.\n\npackage agent.approval\n\nimport rego.v1\n\n# High-impact agent actions need a signed approval from a person other than the requester.\n# The approval service signs a short-lived JWT (ES256) with these claims:\n#   iss: \"approvals.example.com\"   aud: the tool name\n#   sub: approver id               req: requester (the user the agent acts for)\n#   dig: sha256 of {\"tool\", \"args\"} for the exact call   jti: approval id   exp: expiry\n# OPA verifies the signature and every binding, then records the approval in the decision log.\n\nhigh_impact := {\"issue_refund\", \"delete_repository\", \"wire_transfer\"}\n\napprovers := {\"u-bob\", \"u-carol\"}\n\ndefault allow := false\n\nallow if {\n\tnot input.tool in high_impact\n\tcount(deny) == 0\n}\n\nallow if {\n\tinput.tool in high_impact\n\tcount(deny) == 0\n\tapproval_ok\n}\n\ndeny contains \"missing user identity\" if not is_string(object.get(input, \"user\", null))\n\ncall_digest := crypto.sha256(json.marshal({\"tool\": input.tool, \"args\": input.args}))\n\n# io.jwt.decode_verify checks the signature, exp/nbf against \"time\", iss and aud.\nverified := [valid, header, claims] if {\n\t[valid, header, claims] := io.jwt.decode_verify(input.approval_token, {\n\t\t\"cert\": json.marshal(data.approval_keys),\n\t\t\"iss\": \"approvals.example.com\",\n\t\t\"aud\": input.tool,\n\t\t\"time\": time.now_ns(),\n\t})\n}\n\nclaims := verified[2] if verified[0]\n\napproval_ok if {\n\tclaims.dig == call_digest\n\tclaims.req == input.user\n\tclaims.sub != input.user\n\tclaims.sub in approvers\n}\n\n# Why a high-impact call was not allowed, for the decision log and the agent.\napproval_problem := \"no approval token\" if {\n\tinput.tool in high_impact\n\tnot input.approval_token\n} else := \"signature, issuer, audience or expiry check failed\" if {\n\tinput.tool in high_impact\n\tnot claims\n} else := \"approval is for different arguments\" if {\n\tinput.tool in high_impact\n\tclaims.dig != call_digest\n} else := \"approver may not approve their own request\" if {\n\tinput.tool in high_impact\n\tclaims.sub == input.user\n} else := \"approver is not on the approver list\" if {\n\tinput.tool in high_impact\n\tnot claims.sub in approvers\n}\n\n# Evidence fields to keep with the decision (they land in OPA's decision log result).\nevidence := {\n\t\"approval_id\": claims.jti,\n\t\"approver\": claims.sub,\n\t\"call_digest\": call_digest,\n\t\"approval_expires\": claims.exp,\n} if approval_ok\n\ndecision := {\"allow\": allow, \"evidence\": evidence} if approval_ok\n\nelse := {\"allow\": allow, \"problem\": approval_problem} if approval_problem\n\nelse := {\"allow\": allow}\n\nTwo details that decide whether this holds up:\n\nCompute the digest one way. If the approval service and OPA serialize the arguments differently, the digests won't match. The simplest fix is to let OPA compute the digest and return it when approval is needed. The approval service then signs that value. If the digest has to be computed outside OPA, use a canonical JSON form such as RFC 8785.\n\nKeep the signing key away from the agent. If the agent's runtime can reach the approval key, it can approve itself. Keep the key in the approval service, and rotate it with a new kid. Publish old public keys for as long as you keep the logs.\n\nVerified identity for the approver. Where an approval must show that a specific, identity-checked person stood behind it, the approval can carry a verifiable credential presentation. OpenID for Verifiable Presentations 1.0 is a final OpenID Foundation specification for presenting credentials. The W3C Digital Credentials API (a Working Draft) lets a browser request them. Record the verification result and the credential's issuer in the approval, not the raw credential.\n\nWhere EnforceAuth fits\n\nEnforceAuth is the OPA/Rego authorization control plane, in the category we call Authorization Context Intelligence. Your own OPA runtimes make each runtime decision. EnforceAuth does not make that decision. You author, test and ship the Rego and bundles in Writ. Engines send decisions to Writ, and Writ feeds EvidenceIQ, an EnforceAuth capability that keeps a durable, searchable record of authorization decisions. EvidenceIQ records decisions and never makes or changes them. Herald MCP, EnforceAuth’s hosted MCP server, lets you operate EnforceAuth from Claude, Cursor or ChatGPT. Your own OPA makes each runtime decision. Free tier: the first 1 million decisions a month are free, then $89 per additional million. (llms.txt, Pricing)\n\nEnforceAuth deploys in the cloud region you choose, or self-hosted.\n\nHow do I make AI agent audit logs tamper-evident?\n\nHash-chain the decision records so each one includes the hash of the one before, and publish signed checkpoints of the latest hash to a system the log writer cannot change. Edits, deletions and insertions break the chain, and comparing with checkpoints catches records cut from the end.\n\nDoes OPA sign or hash-chain decision logs?\n\nNo. OPA can verify signed policy bundles, and it records the bundle revision in each decision log event, but chaining or signing the log records is done in your log collector.\n\nIs a hash chain enough to prove no records were deleted?\n\nNot on its own. A chain detects changes inside it, but not records removed from the end. Signed checkpoints of the latest hash, stored separately, close that gap.\n\nWhat is the difference between tamper-evident and tamper-proof logs?\n\nTamper-evident logs make any change detectable. Tamper-proof would mean changes are impossible. In practice you combine tamper-evident records with write-once storage and separate access.\n\nHow do I prove a human approved an AI agent's action?\n\nUse a signed approval, not a flag. The approval service signs a short-lived token that names the approver, the requester, the tool, and a SHA-256 digest of the exact arguments. The policy engine verifies the signature and recomputes the digest before allowing the call, and the approval ID and digest go into the decision log.\n\nCan an approval for one AI agent action be reused for another?\n\nNot if the approval is bound to the call. Put a digest of the tool and arguments, the tool as audience, and a short expiry in the signed approval. A different amount, tool or time then fails the check.\n\nWhere should the approval signing key live?\n\nIn the approval service only, never where the agent runs. If the agent can reach the key, it can approve its own actions. Rotate keys with a new key ID, and keep old public keys for as long as you keep the logs.";
    <http://schema.org/author> <https://enforceauth.com/#enforceauth-inc>;
    <http://schema.org/dateModified> "2026-11-04";
    <http://schema.org/datePublished> "2026-11-04";
    <http://schema.org/description> "Chain the records. When your log collector receives OPA decision log events, give each record the SHA-256 hash of the record before it. Editing, deleting or";
    <http://schema.org/encoding> _:b24_b0, _:b24_b1, _:b24_b2, _:b24_b3;
    <http://schema.org/hasPart> <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#faq>, <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#section-1>, <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#section-2>, <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#section-3>, <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#section-4>, <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#section-5>, <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#section-6>;
    <http://schema.org/headline> "How to make AI agent audit logs tamper-evident: hash-chained OPA decision logs with external checkpoints";
    <http://schema.org/inLanguage> "en";
    <http://schema.org/isPartOf> <https://enforceauth.com/guides/index.jsonld#catalog>;
    <http://schema.org/license> "https://enforceauth.com/terms";
    <http://schema.org/mainEntityOfPage> <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents>;
    <http://schema.org/name> "How to make AI agent audit logs tamper-evident: hash-chained OPA decision logs with external checkpoints";
    <http://schema.org/publisher> <https://enforceauth.com/#enforceauth-inc>;
    <http://schema.org/url> "https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents";
    a <http://schema.org/TechArticle>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#faq> <http://schema.org/mainEntity> <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#question-1>, <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#question-2>, <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#question-3>, <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#question-4>, <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#question-5>, <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#question-6>, <https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#question-7>;
    a <http://schema.org/FAQPage>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#question-1> <http://schema.org/acceptedAnswer> _:b24_b4;
    <http://schema.org/name> "How do I make AI agent audit logs tamper-evident?";
    a <http://schema.org/Question>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#question-2> <http://schema.org/acceptedAnswer> _:b24_b5;
    <http://schema.org/name> "Does OPA sign or hash-chain decision logs?";
    a <http://schema.org/Question>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#question-3> <http://schema.org/acceptedAnswer> _:b24_b6;
    <http://schema.org/name> "Is a hash chain enough to prove no records were deleted?";
    a <http://schema.org/Question>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#question-4> <http://schema.org/acceptedAnswer> _:b24_b7;
    <http://schema.org/name> "What is the difference between tamper-evident and tamper-proof logs?";
    a <http://schema.org/Question>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#question-5> <http://schema.org/acceptedAnswer> _:b24_b8;
    <http://schema.org/name> "How do I prove a human approved an AI agent's action?";
    a <http://schema.org/Question>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#question-6> <http://schema.org/acceptedAnswer> _:b24_b9;
    <http://schema.org/name> "Can an approval for one AI agent action be reused for another?";
    a <http://schema.org/Question>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#question-7> <http://schema.org/acceptedAnswer> _:b24_b10;
    <http://schema.org/name> "Where should the approval signing key live?";
    a <http://schema.org/Question>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#section-1> <http://schema.org/name> "What \"tamper-evident\" means here";
    <http://schema.org/text> "It means any change is detectable. It does not mean changes are impossible. You get detectability from the hash chain and the checkpoints, and you make changes hard with write-once storage and separate access.";
    a <http://schema.org/WebPageElement>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#section-2> <http://schema.org/name> "Where each step runs";
    <http://schema.org/text> "Step\n\nWhere\n\nNotes\n\nDecide and log\n\nYour OPA\n\nDecision logs carry decision_id, input, result and the bundle revision. Mask sensitive fields with system.log.mask first. (OPA decision logs)\n\nChain\n\nYour log collector\n\nOPA does not chain logs itself. The collector adds prev_hash and hash to each event in arrival order.\n\nCheckpoint\n\nA separate system\n\nSign the latest hash every few minutes and store it with a different owner or a public timestamp service.\n\nStore\n\nWrite-once storage\n\nKeep records where the writer cannot delete them during the retention period.\n\nVerify\n\nAuditor or scheduled job\n\nRecompute the chain and compare it with the checkpoints.\n\nCertificate Transparency logs use Merkle trees for the same goal at larger scale, with proofs that one log version extends another. (RFC 9162) A simple chain is enough for most decision logs. Move to a Merkle tree when you need proofs for single records without handing over the whole log.";
    a <http://schema.org/WebPageElement>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#section-3> <http://schema.org/name> "Example: chain and verify";
    <http://schema.org/text> "Run in Python 3. Five tests show that edits, deletes and inserts are detected, and that cutting off the newest records is detected only by comparing with a checkpoint.\n\n\"\"\"Hash-chain OPA decision log events so any edit, insert or delete is detectable.\n\nRun in your log collector, after OPA's decision log plugin delivers a batch.\nEach record stores the SHA-256 of the previous record. Keep the latest hash\nsomewhere the log writer cannot change (for example a signed daily checkpoint).\n\"\"\"\nimport hashlib\nimport json\n\nGENESIS = \"0\" * 64\n\n\ndef canonical(event: dict) -> bytes:\n\treturn json.dumps(event, sort_keys=True, separators=(\",\", \":\")).encode()\n\n\ndef chain(events: list[dict], prev: str = GENESIS) -> list[dict]:\n\tout = []\n\tfor e in events:\n\t\th = hashlib.sha256(prev.encode() + canonical(e)).hexdigest()\n\t\tout.append({\"event\": e, \"prev_hash\": prev, \"hash\": h})\n\t\tprev = h\n\treturn out\n\n\ndef verify(records: list[dict], prev: str = GENESIS) -> int | None:\n\t\"\"\"Return the index of the first bad record, or None if the chain holds.\"\"\"\n\tfor i, r in enumerate(records):\n\t\texpected = hashlib.sha256(prev.encode() + canonical(r[\"event\"])).hexdigest()\n\t\tif r[\"prev_hash\"] != prev or r[\"hash\"] != expected:\n\t\t\treturn i\n\t\tprev = r[\"hash\"]\n\treturn None";
    a <http://schema.org/WebPageElement>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#section-4> <http://schema.org/name> "What to hand an auditor";
    <http://schema.org/text> "The records for the period, with prev_hash and hash.\n\nThe signed checkpoints for the same period, and the public key.\n\nThe verifier script.\n\nThe bundle revisions named in the records, linked to the reviewed policy commits.\n\nFor approved high-impact actions: the signed approval tokens (or their IDs and digests), the approval service's public keys for the period, and the approver list in force.";
    a <http://schema.org/WebPageElement>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#section-5> <http://schema.org/name> "Signed human approval as evidence";
    <http://schema.org/text> "When an agent's high-impact action needed a person's OK, the decision record has to show that the approval was real. An approval that is just a row in a database, or \"approved: true\" in a request, only proves someone wrote that value. A signed approval proves who approved, what exactly they approved, and when it expires. Anyone holding the public key can check it later.\n\nWhat a signed approval should bind:\n\nClaim\n\nWhy it matters\n\nApprover (sub)\n\nWho approved. Must not be the requester\n\nRequester (req)\n\nThe user the agent acted for\n\nDigest of the exact call (dig): SHA-256 of tool and arguments\n\nAn approval for a $900 refund can't be replayed for $9,000\n\nAudience (aud): the tool\n\nAn approval for one tool can't be used on another\n\nExpiry (exp) and ID (jti)\n\nShort-lived and traceable\n\nIssuer (iss) and signature\n\nOnly your approval service can create one\n\nHow OPA uses it. The agent or gateway passes the approval token with the call. OPA verifies it with io.jwt.decode_verify, which checks the signature, expiry, issuer and audience. (OPA token built-ins) The policy then recomputes the digest of the call and compares it with the approved one. The approval ID, the approver and the digest go into the decision result, so they appear in the decision log. That log is chained and checkpointed as described above.\n\nTested with OPA v1.22.4 (10 opa test cases): a valid approval allows the call and records the evidence. A forged signature, an expired approval, one replayed for a larger amount, one used on another tool, a self-approval and an approver not on the list are each denied with a specific reason. The test signs tokens with a throwaway key.\n\npackage agent.approval\n\nimport rego.v1\n\n# High-impact agent actions need a signed approval from a person other than the requester.\n# The approval service signs a short-lived JWT (ES256) with these claims:\n#   iss: \"approvals.example.com\"   aud: the tool name\n#   sub: approver id               req: requester (the user the agent acts for)\n#   dig: sha256 of {\"tool\", \"args\"} for the exact call   jti: approval id   exp: expiry\n# OPA verifies the signature and every binding, then records the approval in the decision log.\n\nhigh_impact := {\"issue_refund\", \"delete_repository\", \"wire_transfer\"}\n\napprovers := {\"u-bob\", \"u-carol\"}\n\ndefault allow := false\n\nallow if {\n\tnot input.tool in high_impact\n\tcount(deny) == 0\n}\n\nallow if {\n\tinput.tool in high_impact\n\tcount(deny) == 0\n\tapproval_ok\n}\n\ndeny contains \"missing user identity\" if not is_string(object.get(input, \"user\", null))\n\ncall_digest := crypto.sha256(json.marshal({\"tool\": input.tool, \"args\": input.args}))\n\n# io.jwt.decode_verify checks the signature, exp/nbf against \"time\", iss and aud.\nverified := [valid, header, claims] if {\n\t[valid, header, claims] := io.jwt.decode_verify(input.approval_token, {\n\t\t\"cert\": json.marshal(data.approval_keys),\n\t\t\"iss\": \"approvals.example.com\",\n\t\t\"aud\": input.tool,\n\t\t\"time\": time.now_ns(),\n\t})\n}\n\nclaims := verified[2] if verified[0]\n\napproval_ok if {\n\tclaims.dig == call_digest\n\tclaims.req == input.user\n\tclaims.sub != input.user\n\tclaims.sub in approvers\n}\n\n# Why a high-impact call was not allowed, for the decision log and the agent.\napproval_problem := \"no approval token\" if {\n\tinput.tool in high_impact\n\tnot input.approval_token\n} else := \"signature, issuer, audience or expiry check failed\" if {\n\tinput.tool in high_impact\n\tnot claims\n} else := \"approval is for different arguments\" if {\n\tinput.tool in high_impact\n\tclaims.dig != call_digest\n} else := \"approver may not approve their own request\" if {\n\tinput.tool in high_impact\n\tclaims.sub == input.user\n} else := \"approver is not on the approver list\" if {\n\tinput.tool in high_impact\n\tnot claims.sub in approvers\n}\n\n# Evidence fields to keep with the decision (they land in OPA's decision log result).\nevidence := {\n\t\"approval_id\": claims.jti,\n\t\"approver\": claims.sub,\n\t\"call_digest\": call_digest,\n\t\"approval_expires\": claims.exp,\n} if approval_ok\n\ndecision := {\"allow\": allow, \"evidence\": evidence} if approval_ok\n\nelse := {\"allow\": allow, \"problem\": approval_problem} if approval_problem\n\nelse := {\"allow\": allow}\n\nTwo details that decide whether this holds up:\n\nCompute the digest one way. If the approval service and OPA serialize the arguments differently, the digests won't match. The simplest fix is to let OPA compute the digest and return it when approval is needed. The approval service then signs that value. If the digest has to be computed outside OPA, use a canonical JSON form such as RFC 8785.\n\nKeep the signing key away from the agent. If the agent's runtime can reach the approval key, it can approve itself. Keep the key in the approval service, and rotate it with a new kid. Publish old public keys for as long as you keep the logs.\n\nVerified identity for the approver. Where an approval must show that a specific, identity-checked person stood behind it, the approval can carry a verifiable credential presentation. OpenID for Verifiable Presentations 1.0 is a final OpenID Foundation specification for presenting credentials. The W3C Digital Credentials API (a Working Draft) lets a browser request them. Record the verification result and the credential's issuer in the approval, not the raw credential.";
    a <http://schema.org/WebPageElement>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents#section-6> <http://schema.org/name> "Where EnforceAuth fits";
    <http://schema.org/text> "EnforceAuth is the OPA/Rego authorization control plane, in the category we call Authorization Context Intelligence. Your own OPA runtimes make each runtime decision. EnforceAuth does not make that decision. You author, test and ship the Rego and bundles in Writ. Engines send decisions to Writ, and Writ feeds EvidenceIQ, an EnforceAuth capability that keeps a durable, searchable record of authorization decisions. EvidenceIQ records decisions and never makes or changes them. Herald MCP, EnforceAuth’s hosted MCP server, lets you operate EnforceAuth from Claude, Cursor or ChatGPT. Your own OPA makes each runtime decision. Free tier: the first 1 million decisions a month are free, then $89 per additional million. (llms.txt, Pricing)\n\nEnforceAuth deploys in the cloud region you choose, or self-hosted.";
    a <http://schema.org/WebPageElement>.
<https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents> a <http://schema.org/WebPage>.
_:b24_b0 <http://schema.org/contentUrl> "https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents.jsonld";
    <http://schema.org/encodingFormat> "application/ld+json";
    a <http://schema.org/MediaObject>.
_:b24_b1 <http://schema.org/contentUrl> "https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents.ttl";
    <http://schema.org/encodingFormat> "text/turtle";
    a <http://schema.org/MediaObject>.
_:b24_b10 <http://schema.org/text> "In the approval service only, never where the agent runs. If the agent can reach the key, it can approve its own actions. Rotate keys with a new key ID, and keep old public keys for as long as you keep the logs.";
    a <http://schema.org/Answer>.
_:b24_b2 <http://schema.org/contentUrl> "https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents.md";
    <http://schema.org/encodingFormat> "text/markdown";
    a <http://schema.org/MediaObject>.
_:b24_b3 <http://schema.org/contentUrl> "https://enforceauth.com/guides/tamper-evident-decision-logs-for-ai-agents.pdf";
    <http://schema.org/encodingFormat> "application/pdf";
    a <http://schema.org/MediaObject>.
_:b24_b4 <http://schema.org/text> "Hash-chain the decision records so each one includes the hash of the one before, and publish signed checkpoints of the latest hash to a system the log writer cannot change. Edits, deletions and insertions break the chain, and comparing with checkpoints catches records cut from the end.";
    a <http://schema.org/Answer>.
_:b24_b5 <http://schema.org/text> "No. OPA can verify signed policy bundles, and it records the bundle revision in each decision log event, but chaining or signing the log records is done in your log collector.";
    a <http://schema.org/Answer>.
_:b24_b6 <http://schema.org/text> "Not on its own. A chain detects changes inside it, but not records removed from the end. Signed checkpoints of the latest hash, stored separately, close that gap.";
    a <http://schema.org/Answer>.
_:b24_b7 <http://schema.org/text> "Tamper-evident logs make any change detectable. Tamper-proof would mean changes are impossible. In practice you combine tamper-evident records with write-once storage and separate access.";
    a <http://schema.org/Answer>.
_:b24_b8 <http://schema.org/text> "Use a signed approval, not a flag. The approval service signs a short-lived token that names the approver, the requester, the tool, and a SHA-256 digest of the exact arguments. The policy engine verifies the signature and recomputes the digest before allowing the call, and the approval ID and digest go into the decision log.";
    a <http://schema.org/Answer>.
_:b24_b9 <http://schema.org/text> "Not if the approval is bound to the call. Put a digest of the tool and arguments, the tool as audience, and a short expiry in the signed approval. A different amount, tool or time then fails the check.";
    a <http://schema.org/Answer>.
