Fail-Closed Policy Gates & Verifiable Agent Provenance
Agents running local or networked tools fail in predictable ways: they mistake superficial text checks for real completion, mutate stale files, or swap payload arguments after human approval. Safety cannot rely on polite system prompts — it has to live in the boundary proxy.
1. The Completion Signal Problem
In iterative agent loops, models reliably exhibit reward-hacking around exit criteria: reporting "tests look good" without running them, emitting stub code to satisfy syntax checks, or writing past stale file contexts. Exit criteria are falsifiable by design: no step counts as complete unless an external deterministic check produces a matching artefact hash or exit code.
2. Cryptographic Tool Boundaries (Inside Scarlet Sentinel)
To give IT teams and developers hard guarantees around Model Context Protocol (MCP) tools, our reverse proxy gate applies five deterministic invariants before any upstream tool runs:
- RFC 6962 Domain-Separated Merkle Pinning: Every allowed tool schema is pinned into a Merkle tree. A call whose tool definition has drifted, or that cannot present a valid inclusion proof, fails closed before the tool runs.
- WYSIWYS Consent Binding: Human or policy approval signs a constant-time HMAC over the canonicalised JSON arguments, tenant ID, and tool leaf hash — stopping post-approval argument substitution.
- Per-Tenant Monotonic Nonces: Persisted monotonic counters reject replayed approvals and cross-tenant request reuse.
- Operator-Blind PII Sealing: Personal fields are sealed with a worker-held key and randomised nonces, ensuring ciphertext commitments bind without leaking plaintext equality even if the proxy logs are inspected.
- Double-Entry Write-Ahead Log (WAL): Every allow/deny decision chains sequentially on disk, so a deleted or altered record is detectable offline without trusting the proxy.
3. Optimistic Hash-Locked File Edits
At the developer-tool layer (Crimson Codex), the same anti-guessing rule applies to file edits: an agent must present the content hash of the span it actually read before a patch is allowed to commit. If another process or human modified the file underneath, the edit refuses loudly with both hashes rather than blindly clobbering bytes.
Explore the interactive 12-stage cryptographic self-test matrix on the product page.
Explore Scarlet Sentinel