5. Integrity Envelope
Every AIR carries an integrity envelope computed by the signing component before submission to the Evidence Custodian. The cryptographic primitives are fixed: SHA-256 for hashing, ECDSA with the P-256 curve for signatures.
5.1 Hash Chain Construction
For the first record in a chain (sequence_number = 0): prev_chain_hash is 32 zero bytes. For all subsequent records: prev_chain_hash is the chain_hash of the immediately preceding record.
// For every record:
content_hash = SHA-256(canonical_payload)
chain_hash = SHA-256(content_hash ∥ prev_chain_hash ∥ action_timestamp_ms ∥ agent_id)
signature = ECDSA-P256.sign(chain_hash, private_key)
The four-input construction binds identity and temporal ordering into the chain at the cryptographic level: a receipt proves who, when, and what without requiring payload access. Both agent_id and action_timestamp_ms are mandatory fields supplied by the upstream agent platform at capture time.
The concatenation inputs are encoded as follows: content_hash and prev_chain_hash are raw 32-byte SHA-256 digest bytes. action_timestamp_ms is an unsigned 64-bit integer in big-endian (network) byte order (8 bytes). agent_id is a length-prefixed UTF-8 string: a 4-byte big-endian unsigned 32-bit integer containing the byte length of the UTF-8 encoding, followed by the UTF-8 encoded bytes (no null terminator). The total input to SHA-256 is exactly 76 + len(agent_id) bytes. This encoding is deterministic: two conforming implementations given the same field values MUST produce the same chain_hash.
Canonical form follows the JSON Canonicalization Scheme (RFC 8785). All fields except the integrity envelope are included in the canonical payload.
5.1.1 Concurrency and Serialisation
The hash chain construction requires sequential production of records within a single Evidence Chain. Because each record's chain_hash depends on the preceding record's chain_hash via prev_chain_hash, a conforming implementation cannot produce record N+1 until record N has been finalised and signed. This dependency provides a total ordering guarantee that is cryptographically enforced rather than administratively asserted.
Evidence Chains are scoped per agent_id. Agents with distinct agent_id values operate independent chains with no cross-chain ordering dependency. Concurrent agent deployments do not contend with each other.
Within a single agent_id, implementations must serialise record production. Two conforming patterns exist: (a) the Issuer's capture pipeline maintains a per-agent_id serialisation point (queue or mutex) and produces fully signed, sequenced records before submission to the Evidence Custodian; or (b) the Evidence Custodian assigns sequence numbers at admission time and returns chain_hash to the Issuer for use in the next record. Pattern (a) requires Issuer-side state but minimises round trips. Pattern (b) centralises ordering but introduces a synchronous dependency on the Evidence Custodian for each record.
If an agent produces multiple Material Actions concurrently, the capture pipeline queues them and serialises into the chain in arrival order. Records may share the same action_timestamp_ms; the sequence_number provides the authoritative total ordering.
5.2 Identity Binding Levels
| Level | Requirements |
| Level 1 | agent_id and operator_id present. Signing key pre-registered. Signature verifies. |
| Level 2 | Level 1 plus auth_context present with valid scopes and non-expired token claims at action_timestamp_ms. |
| Level 3 | Level 2 plus at least one resolvable Verifiable Credential in delegation_chain, verified by the Issuer at capture time. |