The agent accepts the stored row when all three checks hold:
- The decoded policy bytes rehash to
policy_hash. policy_hashequals SHA-256 of the canonicalbody.policy.validate_policy_gate(request_hash)returnsY = 1and 12 bearings for that samerequest_hash.
The agent then matches the action to the policy. Default is deny. The executable must be listed. The endpoint must be listed as both an upstream endpoint and a downstream endpoint. The region must be mutable. Immutable region text in the signed prompt must still match the document. The replacement length must be within max_patch_bytes.
A passing action writes exhibit_summary, marks the nonce SPENT, and stamps accept. A rule failure marks the nonce SPENT, leaves the document unchanged, and stamps reject. A policy or prompt mismatch stamps reject and leaves the nonce RESERVED. A second submit of a SPENT nonce stamps reject and does not apply the patch again.
There is no HMAC. Each scripted reply is a fixed proposal in the case list. cargo run --bin serve sends the submitted policy and prompt to the xAI Chat Completions API, then runs the same checks on the returned proposal. request_hash covers the policy and the prompt. The model reply stays outside that hash.