StateLock logoStateLock In development

Check the tool call against a contract
before it is forwarded or committed.

StateLock is a runtime guardrail, in development, for AI agents that use MCP tools. In the current prototype, a wrap proxy sits between the agent and an upstream tool server and can block a listed tool call whose arguments fail the contract, before that call is forwarded. A separate SQLite transaction engine can try a mutation in a savepoint and roll it back if a post-condition fails. This version does not include a human approval step. A beta demo is now available: unsigned desktop apps for Windows and Apple silicon Macs, plus an interactive guided tour in your browser that plays back the built-in sample database (it cannot connect to your own agent or data).

StateLock v0.2.1 — demo
Soundtrack

Music plays only inside this player, synced to the video. The Mixkit tracks are not offered as standalone downloads. 1000 Handz tracks are licensed under CC BY 4.0 and are credited below the video. StateLock is in development; this film demonstrates the current beta demo, using example data.



Design preview · example journal data
StateLock design preview with example data
Design preview of the StateLock journal report with example data from a test database. The final app may look different.
Why it matters

Stop a bad call, or roll a trial mutation back.

A tool call can update a database or an API as soon as it runs. Checking only a log after the fact can leave a bad change already applied. StateLock is being built so a contract can stop a listed call before it is forwarded, or roll a trial mutation back if a post-condition fails. Those are two paths in the current prototype, not one automatic pipeline.

How it works

Two paths in the current prototype.

The wrap proxy and the SQLite transaction engine are related, but the wrap proxy does not itself run the savepoint engine.

01

The wrap proxy

The proxy intercepts an agent’s tool call before it reaches the upstream server. For a tool listed in the contract, it checks required arguments, ranges, patterns, and rejects NaN or Infinity. If that check fails, the call is blocked and the agent receives a structured problem report (RFC 9457). If the check passes, the original call is forwarded. In a single wrap session, a duplicate idempotency key can also be blocked. There is no human approval step, and approval is not bound to a signed set of exact arguments.

02

The SQLite transaction engine

When a mutation is run through this engine, it is tried inside a SQLite savepoint. The engine can cap how many records one call may change and assert conditions on the uncommitted state, such as no negative stock. If a check fails, the savepoint is rolled back, prior state is preserved, and the attempt is recorded. If every check passes, the change is committed. This path is not applied automatically to every call the wrap proxy forwards.

Features

What the prototype already covers.

This is an early prototype, now available as a beta demo. The items below describe capabilities that exist in the current code, not a finished product.

Where enforcement happens

Contract checks run in the wrap proxy, on the tool-call message, before a listed call is forwarded. Savepoint trial, post-conditions, commit, and rollback run in the SQLite transaction engine when that engine is used.

What it blocks, and what it only logs

A failed preflight check on a listed tool is blocked; it is not only logged, and it does not reach the upstream server. A failed savepoint check is rolled back and recorded in the journal. The wrap proxy in this version does not implement a log-only mode.

When a contract fails

The wrap proxy returns a structured problem report to the agent and does not forward the call. The SQLite engine rolls the trial back, preserves prior state, journals the attempt, and returns a problem report the agent can use on its next try.

Coverage and bypass limits

A tool with no contract entry is allowed through the wrap proxy. Only tool-call messages are checked. An idempotency key is optional and remembered only in that wrap session. If an agent talks to the upstream server directly, StateLock is not in the path. The wrap proxy does not itself run the savepoint engine.

Journal and replay protection

Committed and rolled-back engine attempts are recorded in an append-only journal, including before-and-after state tags. In a wrap session, a duplicate idempotency key can be blocked. That list is not kept after the session ends.

Known Windows limitation

In v0.2.1 the wrap proxy does not run on Windows, because of an asyncio stdin issue on the default Windows event loop. A fix is written and tested on Windows but is not in a release yet. The demo app does not include the wrap proxy, so it is not affected.

Now and next

Built in this prototype, and planned next.

Built now

Wrap-proxy preflight on listed tool calls; short-circuit block with a problem report; in-session idempotency-key replay block; a tested SQLite savepoint engine with blast-radius and post-condition checks; commit or rollback; and an append-only journal. PostgreSQL savepoint and REST dry-run adapters exist as prototype code and are not the tested core path.

Planned, not in this version

A human approval step bound to the exact action and arguments; default-deny for tools with no contract entry; automatic savepoint trial inside the wrap proxy; persistent idempotency across sessions; a working log-only audit mode; Windows support for the wrap proxy; and a public release.

SICurator: before code ships

SICurator tests AI-generated code with executable checks and guard scans before it is deployed. That remains a separate, live product.

StateLock: while agents run

StateLock is being built to control live tool execution. In this prototype, that means contract checks on listed calls and savepoint rollback when the transaction engine is used — not a general guarantee that every change is tried and committed through one path.

Status Beta demo · v0.2.1

Try the StateLock demo.Demo

The demo app runs a guided tour on a built-in sample inventory database: a valid change that commits, an overdraw that rolls back, out-of-range and malformed calls that are blocked, a replayed call, and an unlisted tool that gets through. You can also send your own calls. The browser demo plays back the same tour as the real engine ran it.

Windows (x64)

StateLock-0.2.1-demo-windows-x64-setup.exe
12.9 MB · unsigned · Windows 10 or 11, installs for your user only

Download for Windows SHA-256 9d42f53331c7934d6e045047e20bc763dd8723b3f714b02274e454cc4aad5244

macOS (Apple silicon)

StateLock-0.2.1-demo-macos-arm64.dmg
13.2 MB · unsigned · macOS 12 or later, M1 or newer

Download for macOS SHA-256 5eb01fb5bf13751888e89b2f1e5ca2ef6d97c465749de37dd1ffb7a8e3924cb8

The installers are not code-signed

  • Windows: SmartScreen may say “Windows protected your PC”. Choose More info, then Run anyway. If Smart App Control is on, Windows blocks unsigned apps and offers no override, so use the browser demo instead. We do not recommend turning Smart App Control off.
  • macOS: Gatekeeper may say the app cannot be opened because Apple cannot check it. Open System Settings › Privacy & Security and choose Open Anyway, or right-click the app and choose Open.
  • Check the SHA-256 above against your download. There is no Intel Mac or Linux build of the demo.

What this demo does not do yet

  • There is no human approval step.
  • Tools that are not listed in the contract are let through unchecked.
  • The demo runs the proxy checks and the SQLite engine in one process on a sample database. It does not connect to your agent, your MCP servers, or your data, and it does not include the statelock wrap command.
  • PostgreSQL and REST adapters are not part of the demo.

Proprietary software of TimTec LLC, d/b/a Zero Form. Provided as-is under the demo EULA. The source code is not published. Want to go further? hello@zeroform.dev