How LockStock Works

A cryptographic audit chain for AI agents — real-time verification, zero-TTL credentials, encrypted transcripts

What LockStock Does

LockStock maintains a cryptographic hash chain for every AI agent you deploy. Every action the agent takes — a chat completion, a tool call, a file write — extends the chain by one position. This gives you three things no other system provides simultaneously:

Real-Time Verification

Any third party can verify your agent's identity with a single GET request. The response is one word: current (accept) or anything else (reject). Propagation delay: zero.

Tamper-Evident Audit Trail

Every action produces a hash that depends on every previous action. Skip, reorder, or delete a record — the chain breaks. Mathematical proof, not access control.

Encrypted Transcripts

Every prompt and response is encrypted before leaving your network. The server stores ciphertext it cannot read. Only your Account Key can decrypt — and you hold it, not us.

The Agent Stays Oblivious

This is the most important design decision in the protocol: the agent does not know LockStock exists.

The agent sends a normal API request to the gateway. The gateway stamps the request (advancing the chain), forwards it to the upstream provider, and returns the response. The agent never handles a credential, never calls an auth endpoint, never manages a token lifecycle. The gateway handles everything.

This means adoption does not require modifying your agents. No SDK. No code changes. No credential management logic. Point your agent at the gateway instead of directly at the provider. The audit trail, the verification, and the encryption happen transparently.

Validated in production: A real agent authenticated to a real third-party counterparty service. The gateway stamped the request, attached a cryptographic credential, and the counterparty verified it with one GET call. The agent did not know it happened. Try the verify playground →

How Verification Works

Every stamp produces a state_hash — a SHA-256 hash that depends on the agent's entire action history. This hash is the credential. It has never existed before, it will never be valid again, and it was not issued by anyone. It is a mathematical consequence of the chain advancing.

The Three-Step Exchange

Step 1 — Stamp. The gateway stamps an action. The server advances the chain and returns the new state_hash.

Step 2 — Present. The gateway attaches the credential to the outgoing request: Authorization: D3cipher {agent_id}:{state_hash}. The agent is oblivious.

Step 3 — Verify. The receiving service makes one GET call:

GET https://api.d3cipher.ai/v1/verify/{agent_id}?hash={state_hash}

The response is one word:

StatusMeaningAction
currentCredential matches the chain headAccept
staleAgent has advanced past this hashReject
frozenOperator hit the kill switchReject
revokedAgent permanently decommissionedReject
unknownAgent not registeredReject

if status == "current" — that is the entire integration. Everything else is a rejection. The secure behavior is the default behavior.

What Dies When the Credential Dies

The instant the agent takes its next action, the previous credential becomes stale. There is no TTL, no expiry window, no grace period. The credential is valid for exactly one chain position.

MechanismValid ForCompromise Window
API KeyUntil manually rotatedHours to days
OAuth Token1 hour (typical)Up to 1 hour
JWTMinutes to hoursFull TTL window
Atomic CredentialUntil next actionZero

Freeze an agent on the dashboard. The next verification call — from any counterparty, anywhere — returns frozen. Propagation delay: zero.

Nine Trust Relationships, One Protocol

LockStock is not a point solution for one auth pattern. The same protocol — one hash in, one bit out — covers every trust relationship in an AI agent deployment.

Agent → API Provider

Gateway holds the API key. Agent sends to localhost. Gateway attaches auth and forwards. Agent never sees sk-ant-*.

Agent → Agent (MLS)

MLS sidecar stamps, puts state_hash in BasicCredential. Mutual verification via /v1/verify. No shared secrets between organizations.

Agent → MCP Server

SSE connection presents a chain credential. Middleware verifies on connect. Identity stored for the session. Multi-tenant: one server, N agents.

Agent → Third-Party Service

Gateway stamps Authenticate, attaches D3cipher header. Counterparty calls /v1/verify. The agent never knows.

Agent → Workroom

Every broadcast carries sender_chain_hash. Group membership, intent announcements, sync requests — all chain-linked.

Container → Server

The gateway itself is an agent. It authenticates to the server using its own chain state. Infrastructure auth, same protocol.

Cross-Organization

Org A's agent talks to Org B's agent. Both present chain credentials. Both verify. MLS encrypts the channel. No shared secrets between orgs.

Operator → Kill Switch

Freeze an agent on the dashboard. Next /v1/verify returns frozen. Not "wait for token expiry" — dead now. Revoke is permanent.

Auditor → Chain

Download the chain, recompute every hash offline. No server access needed. No trust needed. The chain is the proof. Non-repudiation: the math proves it.

Encrypted Transcripts

Every prompt and response passing through the gateway is encrypted with AES-256-GCM envelope encryption before leaving your network. The d3cipher server stores only ciphertext. Your Account Key — generated in your browser, never sent to the server — is the only way to decrypt.

This is not "encryption at rest" on someone else's server. The server literally cannot read your data. Even if the server is compromised, the attacker gets encrypted blobs and wrapped keys — neither of which is useful without the Account Key that you hold.

To audit: open the Auditor tab in the dashboard, enter your Account Key, and read the full content of every conversation — decrypted entirely in your browser.

Five Verification Layers

Authentication is one layer of a five-layer verification stack. Each layer answers a different question. They share the chain but not each other's inputs.

Layer 1 — Ordering

Did this happen in this sequence? — SHA-256 hash chain, each hash depends on the previous

Layer 2 — Task Integrity

Were the right types of actions performed? — Mathematical state evolution independent of content

Layer 3 — Content Binding

Was this the exact content at this position? — Deterministic canonicalization + cryptographic seal

Layer 4 — Confidentiality

Can the server read the content? — AES-256-GCM envelope encryption, Account Key held by operator

Layer 5 — Cross-Org E2EE

Can the other organization read it? — MLS (RFC 9420) with per-agent keys

The atomic credential emerges from Layer 1. The state_hash is the chain head after each stamp. Layers 2–5 provide additional guarantees — but the credential itself requires only Layer 1. Each layer is independently verifiable.

Compliance

Because the credential and the audit record are the same atomic operation, the authentication system is the compliance system. There is no separate logging pipeline to keep in sync.

FrameworkRequirementHow LockStock Satisfies It
SOC 2 CC7.2 Monitor system components for anomalies Every agent action is a chain entry. Anomalies break hash linkage. Verified by 6-pass verification kernel.
HIPAA §164.312(b) Audit controls for information systems Immutable audit trail. Envelope encryption ensures the server cannot read PHI.
PCI-DSS 10.5 Secure audit trails against alteration SHA-256 chain — altering any row invalidates all subsequent hashes.

Getting Started

Ready to Secure Your AI Agents?

Deploy a gateway, see your first audit trail in minutes.

Get Started