Tamper Detection and Enforcement
Control Zero cryptographically signs every policy bundle and verifies it before loading any rules. Tampering is detected before an untrusted policy can be enforced, and the configured response is applied deterministically. The same tamper detection pipeline protects local audit logs and configuration. This page explains the three protection layers, the four enforcement modes, and recovery from a tamper event.
How the pipeline works
Tamper detection operates at three layers:
1. Policy bundle signing
Every policy bundle published by the backend is cryptographically signed before it leaves the server. The signing key is generated per-org (lazily on first enrollment) and the corresponding public key is distributed to every enrolled machine during the enrollment handshake.
When the SDK pulls a policy bundle, it verifies the signature
against the org's public key before loading any rules. If
verification fails, the SDK treats the bundle as tampered and
follows the org's configured tamper_behavior.
2. Local audit log hash chain
Each audit entry the SDK records locally includes a hash of the
previous entry, forming an append-only chain anchored to a
per-machine genesis seed. The SDK verifies chain continuity; a
mismatch (entries deleted, reordered, or modified) is treated as a
tamper event and handled per the org's configured
tamper_behavior. This chain protects the local record on each
machine. Server-side chain verification on ingest is planned but
not yet implemented -- the hosted audit store today relies on
append-only application semantics and application-layer org scoping,
not a cryptographic chain. Database row-level security policies exist
on these tables as defence in depth, but the runtime connects as a role
that bypasses them, so they are not the enforcing layer today.
3. Bundle content verification
Beyond the outer signature, the SDK also checks an embedded
content fingerprint inside each policy bundle. This fingerprint
covers every rule definition, threshold, and scope in the bundle.
Even if the outer signature were somehow replayed from an older
bundle, the content fingerprint ensures the rules match what the
backend actually published for the current policy_version.
The four tamper_behavior modes
The tamper_behavior setting controls what happens when the SDK
detects a tamper event. It applies org-wide and is returned to
each machine at enrollment time.
| Mode | On tamper event |
|---|---|
warn | Log a warning locally and report the event to the backend. Continue enforcing the last known good policy. |
deny | Reject the tampered bundle and fall back to the last known good policy. Report the event to the backend. |
deny-all | Reject all tool calls until a valid policy bundle is pulled. Report the event to the backend. |
quarantine | Lock down the machine entirely: deny all tool calls and block further policy pulls until an admin intervenes. |
The default mode is warn. Most orgs start here and tighten to
deny or deny-all once they have confirmed their signing
pipeline is stable.