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).
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.
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.
The wrap proxy and the SQLite transaction engine are related, but the wrap proxy does not itself run the savepoint engine.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 tests AI-generated code with executable checks and guard scans before it is deployed. That remains a separate, live product.
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.
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.
SHA-256 9d42f53331c7934d6e045047e20bc763dd8723b3f714b02274e454cc4aad5244SHA-256 5eb01fb5bf13751888e89b2f1e5ca2ef6d97c465749de37dd1ffb7a8e3924cb8statelock wrap command.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