{"spec_version":"2","spec_versions":["1","2"],"spec_url":"/docs/canonicalization-v2","spec_urls":{"1":"/docs/canonicalization","2":"/docs/canonicalization-v2"},"verifier_url":"/verifier.js","verifier_versioned_url":"/verifier/v2.js","verifier_sha256":"51061dd8cadacdf95486127adad9693977089258f8a2bc1a196d62fa53fe034b","verifier_pin_note":"The path pins the rule version; this sha-256 pins the bytes. Record the hash, re-download later, and compare. The file only changes when the rule or the code changes.","algorithm":{"digest":"sha-256","encoding":"utf-8, lowercase hex","serialization":"sorted keys, no whitespace, arrays in stored order","field_count":24,"chain_rule":"prev_hash equals the previous record's hash; 64 zeros at seq 1","commit_rule":"sha256(salt + \":\" + field + \":\" + stableStringify(value)), lowercase hex. The salt is 32 random bytes per field (records written before that change carry one salt for all four), and is not part of the record hash: a holder of the record sees the commitment, not the value."},"fields":["client_id","project_id","seq","decision_id","decided_at","agent_id","agent_name","action_tool","action_amount_usd","action_data_classes","action_target","risk_score","decision","decision_source","matched_rule_id","matched_rule_name","policy_id","policy_version","explanation","record_type","correction_of","handoff_from","training_excluded","prev_hash"],"defaults":{"action_data_classes":[],"record_type":"authorization","training_excluded":false},"genesis":"0000000000000000000000000000000000000000000000000000000000000000","vectors":[{"name":"genesis-allow","note":"The permanent demo record. First record of its chain, so prev_hash is 64 zeros.","expected_hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","record":{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":1,"decision_id":"dec_demo_permanent","decided_at":"2026-11-23T19:00:33.315Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":180,"action_data_classes":[],"action_target":"order/4417","risk_score":null,"decision":"allow","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"The refund is under the automated ceiling and touches no restricted data class.","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":false,"prev_hash":"0000000000000000000000000000000000000000000000000000000000000000","hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","preimage":"{\"action_amount_usd\":180,\"action_data_classes\":[],\"action_target\":\"order/4417\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-23T19:00:33.315Z\",\"decision\":\"allow\",\"decision_id\":\"dec_demo_permanent\",\"decision_source\":\"policy\",\"explanation\":\"The refund is under the automated ceiling and touches no restricted data class.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"project_id\":null,\"record_type\":\"authorization\",\"risk_score\":null,\"seq\":1,\"training_excluded\":false}"}},{"name":"nulls-and-defaults","note":"Null amount and risk, a non-empty data class list, training excluded, a project set.","expected_hash":"9125dd44bb577197013a28bcbe8658bc0d434aebf14d707d85d283251b04a199","record":{"client_id":"6b048d50f944cb895b485f90","project_id":"6b048d51fa85c086cf641ff2","seq":1,"decision_id":"dec_deny_health","decided_at":"2026-11-24T08:14:02.000Z","agent_id":"crm-sync-01","agent_name":"CRM sync","action_tool":"customer.export","action_amount_usd":null,"action_data_classes":["health"],"action_target":"segment/all","risk_score":88,"decision":"deny","decision_source":"policy","matched_rule_id":"no-health-export","matched_rule_name":"Never export health data","policy_id":"6b048d51fa85c086cf641ff1","policy_version":3,"explanation":"Health data may not leave the client boundary.","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":true,"prev_hash":"0000000000000000000000000000000000000000000000000000000000000000","hash":"9125dd44bb577197013a28bcbe8658bc0d434aebf14d707d85d283251b04a199","preimage":"{\"action_amount_usd\":null,\"action_data_classes\":[\"health\"],\"action_target\":\"segment/all\",\"action_tool\":\"customer.export\",\"agent_id\":\"crm-sync-01\",\"agent_name\":\"CRM sync\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-24T08:14:02.000Z\",\"decision\":\"deny\",\"decision_id\":\"dec_deny_health\",\"decision_source\":\"policy\",\"explanation\":\"Health data may not leave the client boundary.\",\"handoff_from\":null,\"matched_rule_id\":\"no-health-export\",\"matched_rule_name\":\"Never export health data\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":3,\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"project_id\":\"6b048d51fa85c086cf641ff2\",\"record_type\":\"authorization\",\"risk_score\":88,\"seq\":1,\"training_excluded\":true}"}},{"name":"unicode-escaped","note":"Quotes, backslashes and a non-ASCII currency sign in a hashed field.","expected_hash":"6ae4f9bbbba1a01934510a1178eb34115541ba481de5c7be5c74cfb064ce29a9","record":{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":1,"decision_id":"dec_unicode_4417","decided_at":"2026-11-24T09:02:11.000Z","agent_id":"triage-bot-04","agent_name":"Support triage","action_tool":"refund.create","action_amount_usd":12000,"action_data_classes":["payment"],"action_target":"order/4417","risk_score":null,"decision":"deny","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":3,"explanation":"Denied: \"health\" export of ₪12,000 was blocked by rule 3. Path C:\\exports\\raw","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":false,"prev_hash":"0000000000000000000000000000000000000000000000000000000000000000","hash":"6ae4f9bbbba1a01934510a1178eb34115541ba481de5c7be5c74cfb064ce29a9","preimage":"{\"action_amount_usd\":12000,\"action_data_classes\":[\"payment\"],\"action_target\":\"order/4417\",\"action_tool\":\"refund.create\",\"agent_id\":\"triage-bot-04\",\"agent_name\":\"Support triage\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-24T09:02:11.000Z\",\"decision\":\"deny\",\"decision_id\":\"dec_unicode_4417\",\"decision_source\":\"policy\",\"explanation\":\"Denied: \\\"health\\\" export of ₪12,000 was blocked by rule 3. Path C:\\\\exports\\\\raw\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":3,\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"project_id\":null,\"record_type\":\"authorization\",\"risk_score\":null,\"seq\":1,\"training_excluded\":false}"}},{"name":"correction-chained","note":"A correction that points at the record it corrects and chains onto its hash.","expected_hash":"50cdeda00d3bcf74b8df44819c1a3ec6bfeda5523caa15709780329204cdbf74","record":{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":2,"decision_id":"dec_correction_4417","decided_at":"2026-11-24T09:30:00.000Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":180,"action_data_classes":[],"action_target":"order/4417","risk_score":null,"decision":"deny","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"Correction: the action was outside the matched rule's scope, so the decision is recorded as deny.","record_type":"correction","correction_of":"dec_demo_permanent","handoff_from":null,"training_excluded":false,"prev_hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","hash":"50cdeda00d3bcf74b8df44819c1a3ec6bfeda5523caa15709780329204cdbf74","preimage":"{\"action_amount_usd\":180,\"action_data_classes\":[],\"action_target\":\"order/4417\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":\"dec_demo_permanent\",\"decided_at\":\"2026-11-24T09:30:00.000Z\",\"decision\":\"deny\",\"decision_id\":\"dec_correction_4417\",\"decision_source\":\"policy\",\"explanation\":\"Correction: the action was outside the matched rule's scope, so the decision is recorded as deny.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948\",\"project_id\":null,\"record_type\":\"correction\",\"risk_score\":null,\"seq\":2,\"training_excluded\":false}"}}],"negative":[{"name":"tampered-amount","note":"The demo record with action_amount_usd changed from 180 to 181 while keeping its stored hash.","must_reject":true,"record":{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":1,"decision_id":"dec_demo_permanent","decided_at":"2026-11-23T19:00:33.315Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":181,"action_data_classes":[],"action_target":"order/4417","risk_score":null,"decision":"allow","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"The refund is under the automated ceiling and touches no restricted data class.","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":false,"prev_hash":"0000000000000000000000000000000000000000000000000000000000000000","hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","preimage":"{\"action_amount_usd\":181,\"action_data_classes\":[],\"action_target\":\"order/4417\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-23T19:00:33.315Z\",\"decision\":\"allow\",\"decision_id\":\"dec_demo_permanent\",\"decision_source\":\"policy\",\"explanation\":\"The refund is under the automated ceiling and touches no restricted data class.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"project_id\":null,\"record_type\":\"authorization\",\"risk_score\":null,\"seq\":1,\"training_excluded\":false}"}}],"chain":{"name":"demo-chain-2","note":"The correction follows the demo record, its prev_hash equals that record's hash, sequence is contiguous.","must_verify":true,"records":[{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":1,"decision_id":"dec_demo_permanent","decided_at":"2026-11-23T19:00:33.315Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":180,"action_data_classes":[],"action_target":"order/4417","risk_score":null,"decision":"allow","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"The refund is under the automated ceiling and touches no restricted data class.","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":false,"prev_hash":"0000000000000000000000000000000000000000000000000000000000000000","hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","preimage":"{\"action_amount_usd\":180,\"action_data_classes\":[],\"action_target\":\"order/4417\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-23T19:00:33.315Z\",\"decision\":\"allow\",\"decision_id\":\"dec_demo_permanent\",\"decision_source\":\"policy\",\"explanation\":\"The refund is under the automated ceiling and touches no restricted data class.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"project_id\":null,\"record_type\":\"authorization\",\"risk_score\":null,\"seq\":1,\"training_excluded\":false}"},{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":2,"decision_id":"dec_correction_4417","decided_at":"2026-11-24T09:30:00.000Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":180,"action_data_classes":[],"action_target":"order/4417","risk_score":null,"decision":"deny","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"Correction: the action was outside the matched rule's scope, so the decision is recorded as deny.","record_type":"correction","correction_of":"dec_demo_permanent","handoff_from":null,"training_excluded":false,"prev_hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","hash":"50cdeda00d3bcf74b8df44819c1a3ec6bfeda5523caa15709780329204cdbf74","preimage":"{\"action_amount_usd\":180,\"action_data_classes\":[],\"action_target\":\"order/4417\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":\"dec_demo_permanent\",\"decided_at\":\"2026-11-24T09:30:00.000Z\",\"decision\":\"deny\",\"decision_id\":\"dec_correction_4417\",\"decision_source\":\"policy\",\"explanation\":\"Correction: the action was outside the matched rule's scope, so the decision is recorded as deny.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948\",\"project_id\":null,\"record_type\":\"correction\",\"risk_score\":null,\"seq\":2,\"training_excluded\":false}"}]},"v1":{"spec_version":"1","spec_url":"/docs/canonicalization","status":"frozen","note":"v1 hashed the action values in cleartext. Records written under it stay verifiable here; new records use v2.","fields":["client_id","project_id","seq","decision_id","decided_at","agent_id","agent_name","action_tool","action_amount_usd","action_data_classes","action_target","risk_score","decision","decision_source","matched_rule_id","matched_rule_name","policy_id","policy_version","explanation","record_type","correction_of","handoff_from","training_excluded","prev_hash"],"defaults":{"action_data_classes":[],"record_type":"authorization","training_excluded":false},"genesis":"0000000000000000000000000000000000000000000000000000000000000000","vectors":[{"name":"genesis-allow","note":"The permanent demo record. First record of its chain, so prev_hash is 64 zeros.","expected_hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","record":{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":1,"decision_id":"dec_demo_permanent","decided_at":"2026-11-23T19:00:33.315Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":180,"action_data_classes":[],"action_target":"order/4417","risk_score":null,"decision":"allow","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"The refund is under the automated ceiling and touches no restricted data class.","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":false,"prev_hash":"0000000000000000000000000000000000000000000000000000000000000000","hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","preimage":"{\"action_amount_usd\":180,\"action_data_classes\":[],\"action_target\":\"order/4417\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-23T19:00:33.315Z\",\"decision\":\"allow\",\"decision_id\":\"dec_demo_permanent\",\"decision_source\":\"policy\",\"explanation\":\"The refund is under the automated ceiling and touches no restricted data class.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"project_id\":null,\"record_type\":\"authorization\",\"risk_score\":null,\"seq\":1,\"training_excluded\":false}"}},{"name":"nulls-and-defaults","note":"Null amount and risk, a non-empty data class list, training excluded, a project set.","expected_hash":"9125dd44bb577197013a28bcbe8658bc0d434aebf14d707d85d283251b04a199","record":{"client_id":"6b048d50f944cb895b485f90","project_id":"6b048d51fa85c086cf641ff2","seq":1,"decision_id":"dec_deny_health","decided_at":"2026-11-24T08:14:02.000Z","agent_id":"crm-sync-01","agent_name":"CRM sync","action_tool":"customer.export","action_amount_usd":null,"action_data_classes":["health"],"action_target":"segment/all","risk_score":88,"decision":"deny","decision_source":"policy","matched_rule_id":"no-health-export","matched_rule_name":"Never export health data","policy_id":"6b048d51fa85c086cf641ff1","policy_version":3,"explanation":"Health data may not leave the client boundary.","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":true,"prev_hash":"0000000000000000000000000000000000000000000000000000000000000000","hash":"9125dd44bb577197013a28bcbe8658bc0d434aebf14d707d85d283251b04a199","preimage":"{\"action_amount_usd\":null,\"action_data_classes\":[\"health\"],\"action_target\":\"segment/all\",\"action_tool\":\"customer.export\",\"agent_id\":\"crm-sync-01\",\"agent_name\":\"CRM sync\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-24T08:14:02.000Z\",\"decision\":\"deny\",\"decision_id\":\"dec_deny_health\",\"decision_source\":\"policy\",\"explanation\":\"Health data may not leave the client boundary.\",\"handoff_from\":null,\"matched_rule_id\":\"no-health-export\",\"matched_rule_name\":\"Never export health data\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":3,\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"project_id\":\"6b048d51fa85c086cf641ff2\",\"record_type\":\"authorization\",\"risk_score\":88,\"seq\":1,\"training_excluded\":true}"}},{"name":"unicode-escaped","note":"Quotes, backslashes and a non-ASCII currency sign in a hashed field.","expected_hash":"6ae4f9bbbba1a01934510a1178eb34115541ba481de5c7be5c74cfb064ce29a9","record":{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":1,"decision_id":"dec_unicode_4417","decided_at":"2026-11-24T09:02:11.000Z","agent_id":"triage-bot-04","agent_name":"Support triage","action_tool":"refund.create","action_amount_usd":12000,"action_data_classes":["payment"],"action_target":"order/4417","risk_score":null,"decision":"deny","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":3,"explanation":"Denied: \"health\" export of ₪12,000 was blocked by rule 3. Path C:\\exports\\raw","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":false,"prev_hash":"0000000000000000000000000000000000000000000000000000000000000000","hash":"6ae4f9bbbba1a01934510a1178eb34115541ba481de5c7be5c74cfb064ce29a9","preimage":"{\"action_amount_usd\":12000,\"action_data_classes\":[\"payment\"],\"action_target\":\"order/4417\",\"action_tool\":\"refund.create\",\"agent_id\":\"triage-bot-04\",\"agent_name\":\"Support triage\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-24T09:02:11.000Z\",\"decision\":\"deny\",\"decision_id\":\"dec_unicode_4417\",\"decision_source\":\"policy\",\"explanation\":\"Denied: \\\"health\\\" export of ₪12,000 was blocked by rule 3. Path C:\\\\exports\\\\raw\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":3,\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"project_id\":null,\"record_type\":\"authorization\",\"risk_score\":null,\"seq\":1,\"training_excluded\":false}"}},{"name":"correction-chained","note":"A correction that points at the record it corrects and chains onto its hash.","expected_hash":"50cdeda00d3bcf74b8df44819c1a3ec6bfeda5523caa15709780329204cdbf74","record":{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":2,"decision_id":"dec_correction_4417","decided_at":"2026-11-24T09:30:00.000Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":180,"action_data_classes":[],"action_target":"order/4417","risk_score":null,"decision":"deny","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"Correction: the action was outside the matched rule's scope, so the decision is recorded as deny.","record_type":"correction","correction_of":"dec_demo_permanent","handoff_from":null,"training_excluded":false,"prev_hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","hash":"50cdeda00d3bcf74b8df44819c1a3ec6bfeda5523caa15709780329204cdbf74","preimage":"{\"action_amount_usd\":180,\"action_data_classes\":[],\"action_target\":\"order/4417\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":\"dec_demo_permanent\",\"decided_at\":\"2026-11-24T09:30:00.000Z\",\"decision\":\"deny\",\"decision_id\":\"dec_correction_4417\",\"decision_source\":\"policy\",\"explanation\":\"Correction: the action was outside the matched rule's scope, so the decision is recorded as deny.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948\",\"project_id\":null,\"record_type\":\"correction\",\"risk_score\":null,\"seq\":2,\"training_excluded\":false}"}}],"negative":[{"name":"tampered-amount","note":"The demo record with action_amount_usd changed from 180 to 181 while keeping its stored hash.","must_reject":true,"record":{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":1,"decision_id":"dec_demo_permanent","decided_at":"2026-11-23T19:00:33.315Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":181,"action_data_classes":[],"action_target":"order/4417","risk_score":null,"decision":"allow","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"The refund is under the automated ceiling and touches no restricted data class.","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":false,"prev_hash":"0000000000000000000000000000000000000000000000000000000000000000","hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","preimage":"{\"action_amount_usd\":181,\"action_data_classes\":[],\"action_target\":\"order/4417\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-23T19:00:33.315Z\",\"decision\":\"allow\",\"decision_id\":\"dec_demo_permanent\",\"decision_source\":\"policy\",\"explanation\":\"The refund is under the automated ceiling and touches no restricted data class.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"project_id\":null,\"record_type\":\"authorization\",\"risk_score\":null,\"seq\":1,\"training_excluded\":false}"}}],"chain":{"name":"demo-chain-2","note":"The correction follows the demo record, its prev_hash equals that record's hash, sequence is contiguous.","must_verify":true,"records":[{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":1,"decision_id":"dec_demo_permanent","decided_at":"2026-11-23T19:00:33.315Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":180,"action_data_classes":[],"action_target":"order/4417","risk_score":null,"decision":"allow","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"The refund is under the automated ceiling and touches no restricted data class.","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":false,"prev_hash":"0000000000000000000000000000000000000000000000000000000000000000","hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","preimage":"{\"action_amount_usd\":180,\"action_data_classes\":[],\"action_target\":\"order/4417\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-23T19:00:33.315Z\",\"decision\":\"allow\",\"decision_id\":\"dec_demo_permanent\",\"decision_source\":\"policy\",\"explanation\":\"The refund is under the automated ceiling and touches no restricted data class.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"project_id\":null,\"record_type\":\"authorization\",\"risk_score\":null,\"seq\":1,\"training_excluded\":false}"},{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":2,"decision_id":"dec_correction_4417","decided_at":"2026-11-24T09:30:00.000Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":180,"action_data_classes":[],"action_target":"order/4417","risk_score":null,"decision":"deny","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"Correction: the action was outside the matched rule's scope, so the decision is recorded as deny.","record_type":"correction","correction_of":"dec_demo_permanent","handoff_from":null,"training_excluded":false,"prev_hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","hash":"50cdeda00d3bcf74b8df44819c1a3ec6bfeda5523caa15709780329204cdbf74","preimage":"{\"action_amount_usd\":180,\"action_data_classes\":[],\"action_target\":\"order/4417\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":\"dec_demo_permanent\",\"decided_at\":\"2026-11-24T09:30:00.000Z\",\"decision\":\"deny\",\"decision_id\":\"dec_correction_4417\",\"decision_source\":\"policy\",\"explanation\":\"Correction: the action was outside the matched rule's scope, so the decision is recorded as deny.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948\",\"project_id\":null,\"record_type\":\"correction\",\"risk_score\":null,\"seq\":2,\"training_excluded\":false}"}]}},"v2":{"spec_version":"2","spec_url":"/docs/canonicalization-v2","status":"current","note":"The four sensitive action values are replaced by salted commitments. The hash is recomputable from the public record; the values are not disclosed until the salt is released with them.","fields":["client_id","project_id","seq","decision_id","decided_at","agent_id","agent_name","action_tool","action_amount_usd_commit","action_data_classes_commit","action_target_commit","risk_score_commit","decision","decision_source","matched_rule_id","matched_rule_name","policy_id","policy_version","explanation","record_type","correction_of","handoff_from","training_excluded","prev_hash"],"commit_fields":["action_amount_usd","action_data_classes","action_target","risk_score"],"commit_rule":"sha256(salt + \":\" + field + \":\" + stableStringify(value)), lowercase hex. The salt is 32 random bytes per field (records written before that change carry one salt for all four), and is not part of the record hash: a holder of the record sees the commitment, not the value.","defaults":{"action_data_classes":[],"record_type":"authorization","training_excluded":false},"genesis":"0000000000000000000000000000000000000000000000000000000000000000","vectors":[{"name":"v2-genesis-allow","note":"The live v2 demo record. Cleartext and salt are published here, so the commitments and the record hash both check from this file.","expected_hash":"4fae5603ba18b3f8bc8eaa88f05e9b59ceb79c4a3d2852e639561412967ff4f4","record":{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":2,"decision_id":"dec_demo_v2","decided_at":"2026-11-24T18:05:00.000Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":240,"action_data_classes":[],"action_target":"order/9001","risk_score":null,"decision":"allow","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"The refund is under the automated ceiling and touches no restricted data class.","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":false,"prev_hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","hash_version":2,"action_amount_usd_commit":"7b412531a132790bc6bfa5d74a061b8dd0540fea57c53021817d75d5c376c8ce","action_data_classes_commit":"eb2b759eb6be53130ceba9080310eda03b975022e9c4bbfe8dcc976fca95565d","action_target_commit":"18d4660f9e10905f36a6d2eba8757b2250337298a6885ed75ca0c4b3c86e72c7","risk_score_commit":"414436afbf18b3d5dff72e4e710c68dd263ab4e6301a303e58b45cbd53f55120","commit_salt":"9f2c41d7a8b3e650c14d92fa77b03e5188c6ad4f2e91b7d3c50a68f417e2bd09","hash":"4fae5603ba18b3f8bc8eaa88f05e9b59ceb79c4a3d2852e639561412967ff4f4","preimage":"{\"action_amount_usd_commit\":\"7b412531a132790bc6bfa5d74a061b8dd0540fea57c53021817d75d5c376c8ce\",\"action_data_classes_commit\":\"eb2b759eb6be53130ceba9080310eda03b975022e9c4bbfe8dcc976fca95565d\",\"action_target_commit\":\"18d4660f9e10905f36a6d2eba8757b2250337298a6885ed75ca0c4b3c86e72c7\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-24T18:05:00.000Z\",\"decision\":\"allow\",\"decision_id\":\"dec_demo_v2\",\"decision_source\":\"policy\",\"explanation\":\"The refund is under the automated ceiling and touches no restricted data class.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948\",\"project_id\":null,\"record_type\":\"authorization\",\"risk_score_commit\":\"414436afbf18b3d5dff72e4e710c68dd263ab4e6301a303e58b45cbd53f55120\",\"seq\":2,\"training_excluded\":false}"}},{"name":"v2-nulls-and-defaults","note":"A null amount, an empty defaulted data class list and a non-null risk score, each committed.","expected_hash":"c270dcc1ee0fef8f5a62f01a41a202a1eaec29dfec1296a76d54743580827ce9","record":{"client_id":"6b048d50f944cb895b485f90","project_id":"6b048d51fa85c086cf641ff2","seq":1,"decision_id":"dec_v2_deny_health","decided_at":"2026-11-24T08:14:02.000Z","agent_id":"crm-sync-01","agent_name":"CRM sync","action_tool":"customer.export","action_amount_usd":null,"action_data_classes":["health"],"action_target":"segment/all","risk_score":88,"decision":"deny","decision_source":"policy","matched_rule_id":"no-health-export","matched_rule_name":"Never export health data","policy_id":"6b048d51fa85c086cf641ff1","policy_version":3,"explanation":"Health data may not leave the client boundary.","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":true,"prev_hash":"0000000000000000000000000000000000000000000000000000000000000000","hash_version":2,"action_amount_usd_commit":"4ada7c116af1c7f8f2828682afe570aad3a33a977321584ab91f3c6d9b2fbac5","action_data_classes_commit":"d834f1b11c7e717acdf6d9a413a46e4e2199405977e28ffacc5c544afe0c9fcd","action_target_commit":"c05e75887f255ab2273362ad63420753ec72a465bd1a187024bfee75c11ad649","risk_score_commit":"be0654854920f9b72a374782add62c0eb2d18b61d834e4e396d39fd7be1b7a23","commit_salt":"3b7e05c9d1f4a2b86e0d5c93f18a47b2d6e904c1f37a85b2d6e0c418f95a7b23","hash":"c270dcc1ee0fef8f5a62f01a41a202a1eaec29dfec1296a76d54743580827ce9","preimage":"{\"action_amount_usd_commit\":\"4ada7c116af1c7f8f2828682afe570aad3a33a977321584ab91f3c6d9b2fbac5\",\"action_data_classes_commit\":\"d834f1b11c7e717acdf6d9a413a46e4e2199405977e28ffacc5c544afe0c9fcd\",\"action_target_commit\":\"c05e75887f255ab2273362ad63420753ec72a465bd1a187024bfee75c11ad649\",\"action_tool\":\"customer.export\",\"agent_id\":\"crm-sync-01\",\"agent_name\":\"CRM sync\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-24T08:14:02.000Z\",\"decision\":\"deny\",\"decision_id\":\"dec_v2_deny_health\",\"decision_source\":\"policy\",\"explanation\":\"Health data may not leave the client boundary.\",\"handoff_from\":null,\"matched_rule_id\":\"no-health-export\",\"matched_rule_name\":\"Never export health data\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":3,\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"project_id\":\"6b048d51fa85c086cf641ff2\",\"record_type\":\"authorization\",\"risk_score_commit\":\"be0654854920f9b72a374782add62c0eb2d18b61d834e4e396d39fd7be1b7a23\",\"seq\":1,\"training_excluded\":true}"}},{"name":"v2-unicode-escaped","note":"Quotes, backslashes and a non-ASCII currency sign, hashed through a commitment.","expected_hash":"cc9e17e477c94e9a18e80871c7577888e61640de99b862f5df16aa19348455bc","record":{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":1,"decision_id":"dec_v2_unicode_4417","decided_at":"2026-11-24T09:02:11.000Z","agent_id":"triage-bot-04","agent_name":"Support triage","action_tool":"refund.create","action_amount_usd":12000,"action_data_classes":["payment"],"action_target":"order/4417","risk_score":null,"decision":"deny","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":3,"explanation":"Denied: \"health\" export of ₪12,000 was blocked by rule 3. Path C:\\exports\\raw","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":true,"prev_hash":"0000000000000000000000000000000000000000000000000000000000000000","hash_version":2,"action_amount_usd_commit":"da421a0c67f8652e1e42da45212d183feb2b4056471dc3cdab9b7f9bc20ef77f","action_data_classes_commit":"cf5ef490b2ff2b24167b1a0feed0db929e0d0221dffeb3e3ca7c57f8bd7cbd7b","action_target_commit":"861c8e021fea6b610aa065313c29deb83eae72f64460fe4f039cf25393752624","risk_score_commit":"ff592dc0d979d2d3ac6846ecbf505bdcf10bf2b1fdaa46a30a358055af47dd11","commit_salt":"3c7be0a91d45f8620b5edc7341a9f80e62d4b7c93f0518ae47d6c29b80f31e5a","hash":"cc9e17e477c94e9a18e80871c7577888e61640de99b862f5df16aa19348455bc","preimage":"{\"action_amount_usd_commit\":\"da421a0c67f8652e1e42da45212d183feb2b4056471dc3cdab9b7f9bc20ef77f\",\"action_data_classes_commit\":\"cf5ef490b2ff2b24167b1a0feed0db929e0d0221dffeb3e3ca7c57f8bd7cbd7b\",\"action_target_commit\":\"861c8e021fea6b610aa065313c29deb83eae72f64460fe4f039cf25393752624\",\"action_tool\":\"refund.create\",\"agent_id\":\"triage-bot-04\",\"agent_name\":\"Support triage\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-24T09:02:11.000Z\",\"decision\":\"deny\",\"decision_id\":\"dec_v2_unicode_4417\",\"decision_source\":\"policy\",\"explanation\":\"Denied: \\\"health\\\" export of ₪12,000 was blocked by rule 3. Path C:\\\\exports\\\\raw\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":3,\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"project_id\":null,\"record_type\":\"authorization\",\"risk_score_commit\":\"ff592dc0d979d2d3ac6846ecbf505bdcf10bf2b1fdaa46a30a358055af47dd11\",\"seq\":1,\"training_excluded\":true}"}},{"name":"v2-correction-chained","note":"A correction that points at the v2 demo record and chains onto its hash.","expected_hash":"a2b3103560e1fd63ce00ff71545d4b959e1d4076e725b258efb1093207ebafef","record":{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":3,"decision_id":"dec_demo_v2_correction","decided_at":"2026-11-24T18:20:00.000Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":240,"action_data_classes":[],"action_target":"order/9001","risk_score":null,"decision":"deny","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"Correction: the action was outside the matched rule's scope, so the decision is recorded as deny.","record_type":"correction","correction_of":"dec_demo_v2","handoff_from":null,"training_excluded":false,"prev_hash":"4fae5603ba18b3f8bc8eaa88f05e9b59ceb79c4a3d2852e639561412967ff4f4","hash_version":2,"action_amount_usd_commit":"29c117eb9ced47aaf022a61af1c53adaa7d843088e0a8a95ec80e32981ed257a","action_data_classes_commit":"a94ba09e22a9cc134d39ab16a1e28a66f66fb63da80902081a99c91e58cc7616","action_target_commit":"451eb2908294bd0d8c0f025291f219055d17d7e013436b639366cbfcad98cdd3","risk_score_commit":"7be2b6dff727fe9b2f90b3a473ef1f322484673dc3cb26c8b0f3debb1ce70c8e","commit_salt":"d84a1f60c92b73e5a0148fd6b2c97e35041fac8b7d26e9c03f5a1b84d709e26c","hash":"a2b3103560e1fd63ce00ff71545d4b959e1d4076e725b258efb1093207ebafef","preimage":"{\"action_amount_usd_commit\":\"29c117eb9ced47aaf022a61af1c53adaa7d843088e0a8a95ec80e32981ed257a\",\"action_data_classes_commit\":\"a94ba09e22a9cc134d39ab16a1e28a66f66fb63da80902081a99c91e58cc7616\",\"action_target_commit\":\"451eb2908294bd0d8c0f025291f219055d17d7e013436b639366cbfcad98cdd3\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":\"dec_demo_v2\",\"decided_at\":\"2026-11-24T18:20:00.000Z\",\"decision\":\"deny\",\"decision_id\":\"dec_demo_v2_correction\",\"decision_source\":\"policy\",\"explanation\":\"Correction: the action was outside the matched rule's scope, so the decision is recorded as deny.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"4fae5603ba18b3f8bc8eaa88f05e9b59ceb79c4a3d2852e639561412967ff4f4\",\"project_id\":null,\"record_type\":\"correction\",\"risk_score_commit\":\"7be2b6dff727fe9b2f90b3a473ef1f322484673dc3cb26c8b0f3debb1ce70c8e\",\"seq\":3,\"training_excluded\":false}"}}],"negative":[{"name":"v2-tampered-commit","note":"The v2 demo record with its amount commitment replaced by another record's commitment. Must be rejected.","must_reject":true,"record":{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":2,"decision_id":"dec_demo_v2","decided_at":"2026-11-24T18:05:00.000Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":240,"action_data_classes":[],"action_target":"order/9001","risk_score":null,"decision":"allow","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"The refund is under the automated ceiling and touches no restricted data class.","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":false,"prev_hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","hash_version":2,"action_amount_usd_commit":"4ada7c116af1c7f8f2828682afe570aad3a33a977321584ab91f3c6d9b2fbac5","action_data_classes_commit":"eb2b759eb6be53130ceba9080310eda03b975022e9c4bbfe8dcc976fca95565d","action_target_commit":"18d4660f9e10905f36a6d2eba8757b2250337298a6885ed75ca0c4b3c86e72c7","risk_score_commit":"414436afbf18b3d5dff72e4e710c68dd263ab4e6301a303e58b45cbd53f55120","commit_salt":"9f2c41d7a8b3e650c14d92fa77b03e5188c6ad4f2e91b7d3c50a68f417e2bd09","hash":"4fae5603ba18b3f8bc8eaa88f05e9b59ceb79c4a3d2852e639561412967ff4f4","preimage":"{\"action_amount_usd_commit\":\"4ada7c116af1c7f8f2828682afe570aad3a33a977321584ab91f3c6d9b2fbac5\",\"action_data_classes_commit\":\"eb2b759eb6be53130ceba9080310eda03b975022e9c4bbfe8dcc976fca95565d\",\"action_target_commit\":\"18d4660f9e10905f36a6d2eba8757b2250337298a6885ed75ca0c4b3c86e72c7\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-24T18:05:00.000Z\",\"decision\":\"allow\",\"decision_id\":\"dec_demo_v2\",\"decision_source\":\"policy\",\"explanation\":\"The refund is under the automated ceiling and touches no restricted data class.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948\",\"project_id\":null,\"record_type\":\"authorization\",\"risk_score_commit\":\"414436afbf18b3d5dff72e4e710c68dd263ab4e6301a303e58b45cbd53f55120\",\"seq\":2,\"training_excluded\":false}"}}],"disclosures":[{"name":"v2-disclosure-mismatch","note":"A disclosed value that does not hash to the published commitment: verifyCommitment must reject it.","must_reject":true,"commitment":{"salt":"9f2c41d7a8b3e650c14d92fa77b03e5188c6ad4f2e91b7d3c50a68f417e2bd09","field":"action_amount_usd","value":4200,"commit":"7b412531a132790bc6bfa5d74a061b8dd0540fea57c53021817d75d5c376c8ce"}}],"chain":{"name":"v2-demo-chain-2","note":"The v2 demo record and its correction: contiguous sequence, each prev_hash matching.","must_verify":true,"records":[{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":2,"decision_id":"dec_demo_v2","decided_at":"2026-11-24T18:05:00.000Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":240,"action_data_classes":[],"action_target":"order/9001","risk_score":null,"decision":"allow","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"The refund is under the automated ceiling and touches no restricted data class.","record_type":"authorization","correction_of":null,"handoff_from":null,"training_excluded":false,"prev_hash":"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948","hash_version":2,"action_amount_usd_commit":"7b412531a132790bc6bfa5d74a061b8dd0540fea57c53021817d75d5c376c8ce","action_data_classes_commit":"eb2b759eb6be53130ceba9080310eda03b975022e9c4bbfe8dcc976fca95565d","action_target_commit":"18d4660f9e10905f36a6d2eba8757b2250337298a6885ed75ca0c4b3c86e72c7","risk_score_commit":"414436afbf18b3d5dff72e4e710c68dd263ab4e6301a303e58b45cbd53f55120","commit_salt":"9f2c41d7a8b3e650c14d92fa77b03e5188c6ad4f2e91b7d3c50a68f417e2bd09","hash":"4fae5603ba18b3f8bc8eaa88f05e9b59ceb79c4a3d2852e639561412967ff4f4","preimage":"{\"action_amount_usd_commit\":\"7b412531a132790bc6bfa5d74a061b8dd0540fea57c53021817d75d5c376c8ce\",\"action_data_classes_commit\":\"eb2b759eb6be53130ceba9080310eda03b975022e9c4bbfe8dcc976fca95565d\",\"action_target_commit\":\"18d4660f9e10905f36a6d2eba8757b2250337298a6885ed75ca0c4b3c86e72c7\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":null,\"decided_at\":\"2026-11-24T18:05:00.000Z\",\"decision\":\"allow\",\"decision_id\":\"dec_demo_v2\",\"decision_source\":\"policy\",\"explanation\":\"The refund is under the automated ceiling and touches no restricted data class.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948\",\"project_id\":null,\"record_type\":\"authorization\",\"risk_score_commit\":\"414436afbf18b3d5dff72e4e710c68dd263ab4e6301a303e58b45cbd53f55120\",\"seq\":2,\"training_excluded\":false}"},{"client_id":"6b048d50f944cb895b485f90","project_id":null,"seq":3,"decision_id":"dec_demo_v2_correction","decided_at":"2026-11-24T18:20:00.000Z","agent_id":"demo-agent-01","agent_name":"Demo agent","action_tool":"refund.create","action_amount_usd":240,"action_data_classes":[],"action_target":"order/9001","risk_score":null,"decision":"deny","decision_source":"policy","matched_rule_id":"spend-under-250","matched_rule_name":"Refunds up to 250 USD","policy_id":"6b048d51fa85c086cf641ff1","policy_version":1,"explanation":"Correction: the action was outside the matched rule's scope, so the decision is recorded as deny.","record_type":"correction","correction_of":"dec_demo_v2","handoff_from":null,"training_excluded":false,"prev_hash":"4fae5603ba18b3f8bc8eaa88f05e9b59ceb79c4a3d2852e639561412967ff4f4","hash_version":2,"action_amount_usd_commit":"29c117eb9ced47aaf022a61af1c53adaa7d843088e0a8a95ec80e32981ed257a","action_data_classes_commit":"a94ba09e22a9cc134d39ab16a1e28a66f66fb63da80902081a99c91e58cc7616","action_target_commit":"451eb2908294bd0d8c0f025291f219055d17d7e013436b639366cbfcad98cdd3","risk_score_commit":"7be2b6dff727fe9b2f90b3a473ef1f322484673dc3cb26c8b0f3debb1ce70c8e","commit_salt":"d84a1f60c92b73e5a0148fd6b2c97e35041fac8b7d26e9c03f5a1b84d709e26c","hash":"a2b3103560e1fd63ce00ff71545d4b959e1d4076e725b258efb1093207ebafef","preimage":"{\"action_amount_usd_commit\":\"29c117eb9ced47aaf022a61af1c53adaa7d843088e0a8a95ec80e32981ed257a\",\"action_data_classes_commit\":\"a94ba09e22a9cc134d39ab16a1e28a66f66fb63da80902081a99c91e58cc7616\",\"action_target_commit\":\"451eb2908294bd0d8c0f025291f219055d17d7e013436b639366cbfcad98cdd3\",\"action_tool\":\"refund.create\",\"agent_id\":\"demo-agent-01\",\"agent_name\":\"Demo agent\",\"client_id\":\"6b048d50f944cb895b485f90\",\"correction_of\":\"dec_demo_v2\",\"decided_at\":\"2026-11-24T18:20:00.000Z\",\"decision\":\"deny\",\"decision_id\":\"dec_demo_v2_correction\",\"decision_source\":\"policy\",\"explanation\":\"Correction: the action was outside the matched rule's scope, so the decision is recorded as deny.\",\"handoff_from\":null,\"matched_rule_id\":\"spend-under-250\",\"matched_rule_name\":\"Refunds up to 250 USD\",\"policy_id\":\"6b048d51fa85c086cf641ff1\",\"policy_version\":1,\"prev_hash\":\"4fae5603ba18b3f8bc8eaa88f05e9b59ceb79c4a3d2852e639561412967ff4f4\",\"project_id\":null,\"record_type\":\"correction\",\"risk_score_commit\":\"7be2b6dff727fe9b2f90b3a473ef1f322484673dc3cb26c8b0f3debb1ce70c8e\",\"seq\":3,\"training_excluded\":false}"}]},"head":{"name":"v2-demo-head","note":"The correction is the head of the demo chain. A verifier must accept this head and reject one sequence later.","head":{"seq":3,"hash":"a2b3103560e1fd63ce00ff71545d4b959e1d4076e725b258efb1093207ebafef"},"must_reject":{"seq":4,"hash":"a2b3103560e1fd63ce00ff71545d4b959e1d4076e725b258efb1093207ebafef"},"live":"/api/v1/heads"}},"handoff":{"format":"aprve.handoff.v1","decision_id_rule":{"without_nonce":"dec_34e667234dcc","with_nonce":"dec_1b397d82fba8","input_without_nonce":"client_id:seq:decided_at","input_with_nonce":"client_id:seq:decided_at:nonce","digest":"sha-256, first 12 hex, prefixed dec_","meaning":"A decision_id that differs from the no-nonce form means a caller nonce took part, so the timestamp is the caller's assertion and timing is bound."},"authorization":{"record":{"client_id":"cl_demo0001","project_id":null,"seq":10,"decision_id":"dec_1b397d82fba8","decided_at":"2026-11-24T10:00:00.000Z","agent_id":"agt_planner","agent_name":"Planner","action_tool":"agent.handoff","action_amount_usd_commit":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","action_data_classes_commit":"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","action_target_commit":"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc","risk_score_commit":"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd","decision":"allow","decision_source":"policy","matched_rule_id":null,"matched_rule_name":"Agent hand-off","policy_id":"pol_demo","policy_version":1,"explanation":"Hand-off granted for 2 tools until 2026-12-01T00:00:00.000Z. The counterparty and the scope are committed, not published.","record_type":"handoff","correction_of":null,"handoff_from":null,"training_excluded":false,"prev_hash":"0000000000000000000000000000000000000000000000000000000000000000"},"hash":"4b9392283a1924ff457022e1c67b24efbe565387afb20139a007c8e4fb80021e"},"action":{"record":{"client_id":"cl_demo0001","project_id":null,"seq":11,"decision_id":"dec_action00001","decided_at":"2026-11-24T10:04:12.000Z","agent_id":"agt_executor","agent_name":"Executor","action_tool":"refund.create","action_amount_usd_commit":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","action_data_classes_commit":"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","action_target_commit":"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc","risk_score_commit":"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd","decision":"allow","decision_source":"policy","matched_rule_id":null,"matched_rule_name":"Refunds under 500 USD","policy_id":"pol_demo","policy_version":1,"explanation":"Hand-off granted for 2 tools until 2026-12-01T00:00:00.000Z. The counterparty and the scope are committed, not published.","record_type":"authorization","correction_of":null,"handoff_from":"dec_1b397d82fba8","training_excluded":false,"prev_hash":"4b9392283a1924ff457022e1c67b24efbe565387afb20139a007c8e4fb80021e"},"hash":"d8cad9cdfe7a5781c4cae57b0b2b5c5f71cfee7db6817981a68fa46c7654efae"},"revocation":{"record":{"client_id":"cl_demo0001","project_id":null,"seq":12,"decision_id":"dec_revoke00001","decided_at":"2026-11-24T12:00:00.000Z","agent_id":"agt_planner","agent_name":"Planner","action_tool":"agent.handoff.revoke","action_amount_usd_commit":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","action_data_classes_commit":"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","action_target_commit":"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc","risk_score_commit":"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd","decision":"deny","decision_source":"policy","matched_rule_id":null,"matched_rule_name":"Agent hand-off revocation","policy_id":"pol_demo","policy_version":1,"explanation":"Authority granted at seq 10 ended at seq 11: counterparty rotated.","record_type":"revocation","correction_of":"dec_1b397d82fba8","handoff_from":null,"training_excluded":false,"prev_hash":"d8cad9cdfe7a5781c4cae57b0b2b5c5f71cfee7db6817981a68fa46c7654efae"},"hash":"984fa87f396f3596e109220c13c9dfeff01030750676288d2d51fdefccd37698"},"timing":[{"name":"timing-order-ok","records":{"authorization_hash":"4b9392283a1924ff457022e1c67b24efbe565387afb20139a007c8e4fb80021e","action_hash":"d8cad9cdfe7a5781c4cae57b0b2b5c5f71cfee7db6817981a68fa46c7654efae"},"expected":{"order_ok":true,"rejected":false},"actual":{"order_ok":true},"note":"The action record is later in the chain, names the hand-off decision_id in handoff_from, and carries a later decided_at. All three checks are on hashed fields."},{"name":"timing-order-rejected","records":{"authorization_hash":"4b9392283a1924ff457022e1c67b24efbe565387afb20139a007c8e4fb80021e","action_hash":"a943d6bf8cdb678c80fbf9931ffdc5d8a07399281429c6e71c07b1edb06019a1"},"expected":{"order_ok":false,"rejected":true},"actual":{"order_ok":false},"note":"The referenced action claims a timestamp before the authorization it cites. A verifier must reject the pair rather than report order."}],"revocation_vector":{"hash":"984fa87f396f3596e109220c13c9dfeff01030750676288d2d51fdefccd37698","shape":{"record_type":"revocation","decision":"deny","action_tool":"agent.handoff.revoke","correction_of":"the decision_id of the revoked hand-off","explanation":"states the sequence at which authority ended"},"check":"A revocation is valid when its hash recomputes, correction_of names the earlier decision_id, and its seq is greater than that record's seq."}},"conformance":["Same 24 fields, same defaults for absent values.","Same serialization: keys sorted ascending, no whitespace, arrays in stored order.","Same digest: SHA-256 over UTF-8 bytes, lowercase hex, 64 characters.","Same chain rule: prev_hash equals the previous record's hash; 64 zeros at seq 1.","Every positive vector reproduces its published hash exactly.","The tampered vector is rejected and its recomputation differs from the stored hash.","Same 24 v2 fields, with the four commitments in place of the four action values.","Same serialization and digest as v1.","A commitment equals sha256(salt + ':' + field + ':' + stableStringify(value)).","Every v2 positive vector reproduces its published hash exactly.","The tampered commitment is rejected, and a wrong disclosed value fails verifyCommitment.","verifyHead accepts the published head and rejects one that does not match the records."],"how_to":["Fetch /verifier.js (one ESM file, no dependencies) or implement the rule yourself.","Hash each record in v1.vectors and v2.vectors and compare to expected_hash, byte for byte.","Confirm every record in negative is rejected, in both versions.","Confirm each v2 disclosure is rejected: a wrong value must not match its commitment.","Confirm each chain verifies with zero failures, and that verifyHead accepts head and rejects must_reject.","Reproduce handoff.authorization.hash and handoff.action.hash, then confirm timing[0] reads order_ok: true and timing[1] reads order_ok: false.","Reproduce handoff.revocation.hash and confirm its correction_of names the revoked decision_id at a lower seq.","Run it in CI: any change to the rule breaks these constants loudly."],"public":true,"authentication":"none"}