Evidence integrity and signatures

Integrity answers whether the admitted payload matches its canonical representation. A signature can additionally bind that payload to a key-custody boundary. Neither property proves the observation is semantically true.

Evidence trust boundary from producer through adapter and engine to retention

Figure 1. Trust checks are layered at admission; source correctness and response authority stay outside the evaluator.

Three different trust questions

QuestionMechanismResidual risk
Was the payload changed?Canonical JSON and SHA-256 evidence hash.A malicious producer can hash false data.
Did an authorized key approve it?Signature verification and key identity.A compromised key or verifier may approve false data.
Is the observation relevant and correct?Contract binding, source governance and independent review.Semantic correctness cannot be inferred from cryptography alone.

Canonical evidence payload

The provenance layer serializes a stable evidence payload before hashing or signing. Stable canonicalization avoids different byte representations for the same logical fields.

canonical payload
  → SHA-256 digest
  → compare supplied integrity hash
  → verify optional signature
  → record verification metadata
  → evaluate only under enabled engine requirements

MappingEvidenceAdapter computes the expected integrity hash and records whether the supplied hash matches. AssuranceEngine(require_integrity=True) turns an unverified hash into UNKNOWN.

Verification boundaries

ClassUseBoundary
HMACKeyringDeterministic local or test signing and verification.Secret material exists in the local process.
ProcessSignatureVerifierOne-shot JSON-lines verification by a separately owned process.The library receives only a boolean; this is not itself an HSM.
HTTPSignatureVerifierRemote KMS-compatible verification over HTTPS.Key custody and provider audit storage remain external.
QuorumSignatureVerifierRequire a conservative threshold of providers.Any explicit negative result wins.
FailoverSignatureVerifierTolerate selected provider errors without accepting explicit invalidity.Policy must define strict versus degraded operation.

Enable the full policy deliberately

adapter = MappingEvidenceAdapter(
    keyring=verifier,
    require_signature=True,
)
engine = AssuranceEngine(
    require_integrity=True,
    require_signature=True,
    require_provenance=True,
)

Adapter verification metadata and engine strictness are separate. Configuring a verifier without requiring its result does not create a high-assurance policy.

Threats and controls

ThreatControlStill required
Payload alterationCanonical digest and integrity comparison.Protected digest source or signature.
Unknown signing keyKey id lookup and active-key policy.Rotation and revocation governance.
Verifier outageFail closed; retain diagnostics.Availability design and escalation.
Stale positive providerExplicit negative precedence in failover/quorum.Fresh revocation and provider-status evidence.
Signed but false observationNone at the cryptographic layer.Source validation, independence and semantic review.