Harness security for AI agents · open source · Apache 2.0

Your agent asks. A Lock holds the keys. You sign in lox run.

Your AI agent works on your databases, queues, files, logs and servers (and, inside lea, the web) through a Lock that holds the credentials and masks the data. Reads flow; a connection, a write or anything risky waits for your y in lox run, outside the agent's harness.

1 · Install the family · Linux and macOS · Docker required
brew trust davidgodefroid/tap
brew install davidgodefroid/tap/lockfamily

Source on GitHub

  1. lox add locksql in your project, one source at a time
  2. lox run in a terminal of its own; your agent in another (claude, codex, gemini, … or lea). Quick start

Works with any MCP client (Claude Code, Codex, Cursor, Gemini CLI, …) for every Lock but lockhttp, which guards agents running inside lea. The Locks and the hub run in Docker.

ticket shop / primary · locksql

asked by
your agent, in its harness
class
write · always asked
request, masked
UPDATE orders SET status = ‹p***(4)›
  WHERE id = ‹4***(5)› -- 1 row
the hub holds
this masked screen only: no clear value, no result

approved · you · y · 14:03

signed decision bound to this exact plan; the Lock runs the UPDATE only on it

audit 14:03 agent ◆ shop primary write ✔ you ✓

One ticket, as lox run shows it to you. Answer n, or nothing, and the Lock never runs it.

See it work: a read comes back masked, a write waits for you

Demo, 38 seconds: an agent on the left, lox run on the right, your shell below. Step 1: the agent reads the pending order through locksql; the customer's name and email come back as <redacted>, and lox run logs the read as approved by an auto rule. Step 2: the agent asks for an UPDATE of the order's status; it gets a pending ticket, and lox run shows a question card with the statement, its values masked. Step 3: you press y in lox run, outside the agent; the agent runs the write with the decided ticket and one row changes. Step 4: lox audit lists both exchanges, the read decided by an auto rule and the write by a human.
A masked read, an UPDATE held for you, your y in lox run, then the line in lox audit. Drawn from the captures of one real run, with the agent on the host; with reduced motion it shows the last frame. On a small screen, scroll it sideways.

One Lock per data source, and lea for the agents

01

One write, from the agent's request to your signature

An agent harness is the program that runs a model as an agent and hands it tools. Harness security is the layer around it: every approval is answered outside the harness. For an agent that runs confined, in lea, it holds whatever the model is talked into; an agent on the host runs as you and could still drive Docker (security model).

Here is one UPDATE, line by line, as the audit log records it.

  1. 14:03:01agent

    Asks its Lock client to run UPDATE orders SET status = 'paid' WHERE id = 41277. The client is an MCP server with no credential and no connection; it passes the request over a socket to the Lock.

  2. 14:03:01lock

    In its own container, parses the statement, classes it a write and masks every value: status = ‹p***(4)›. It runs nothing yet and sends the hub a ticket with that masked screen.

  3. 14:03:01hub

    Queues the ticket for lox run. A lea agent has no route to it. The hub never runs a request and never sees a result or a value in clear.

  4. 14:03:02you

    In lox run, your own terminal. Auto mode passes reads by rule, but a write is always asked: the bell rings, you read the masked screen and press y.

  5. 14:03:04hub

    Signs the decision, bound to that exact plan and naming who decided: you, not a rule.

  6. 14:03:04lock

    Checks the signature, runs the UPDATE and returns 1 row updated. On n, no answer or a closed lox run, nothing runs and the agent only learns it was denied.

  7. lateraudit

    lox audit lists the line: who asked, the masked request, who or which rule decided, and the outcome.

Each Lock reaches only the endpoints of its reviewed profile. Decisions can also come from an auto rule, lox approve, Slack, Telegram or a paired phone (the hub).

The request flow, animated: the agent and its Lock client run in the agent harness; the client reaches the lock over a socket; the lock sends a masked ticket to the hub; lox run, in your own terminal outside the harness, decides by an auto rule or asks you; the hub signs the decision and the lock runs the request only on it, then returns masked results to the agent. The agent never talks to the hub, and the hub never sees a query or a result in clear. Four scenarios loop: an auto SELECT, a connection asked once per profile, an UPDATE you approve, a DELETE you deny.
Four requests in a loop: an auto read, the first connection to a profile, an approved write, a denied write. With reduced motion, the whole flow shows at once.

02

One boundary around the agent, one console per data source

Where agents run

Your agent, or lea

Any MCP client on your machine. Or lea: coding agents (Claude Code, Codex, …) in a container that sees one projects directory and reaches the internet only through a proxy that refuses your private network.

What agents reach: one Lock per data source, its console started by lox run

locksql

SQL databases

lockmq

RabbitMQ brokers

lockfile

Files on S3, SFTP or disk

lockhttp

Outbound HTTP(S)

locklog

Files, journald, Docker, Loki, Elasticsearch (preview)

lockssh

Commands over SSH

Shared core

lockkit

The Go core every Lock is built on:

  • the console, hub-attached only, with its isolated account and socket;
  • policies the AI may tighten and only you loosen;
  • the approval screen, the hub's tickets and the audit log;
  • credentials kept in the console: an ask password typed at the first connection in lox run and sealed to the Lock, or a login read from HashiCorp Vault;
  • personal-data masks, MCP and agent wiring.
  • One hub runs every Lock. lox run starts the hub and each Lock's console with Docker Compose; there is no standalone console.
  • Each Lock is fenced. Every Lock but lockhttp sits on an internal network, behind an egress gateway that reaches only its reviewed profile's endpoints: no internet, cloud metadata or other host port.
  • Agents reach sockets, never the hub. lea's agents find the Locks' sockets in .lockfamily/up.json. An agent on the host does too, through each Lock's launcher (locksql mcp, …).
  • lea is optional, except for lockhttp, whose gate runs beside lea's proxy: it guards only agents running inside lea, not an agent on the host.
Three agents (here Claude Code) work in the lea container. One pushes to github.com through the proxy; its attempts to read ~/.ssh and to reach 192.168.1.10 are blocked. Another asks for a permission, answered from the deck.
lea, running coding agents (here Claude Code): one pushes to GitHub through the proxy; reading ~/.ssh and reaching 192.168.1.10 are blocked.

03

The hub: every Lock's tickets, answered from one place

  • locksql
  • lockmq
  • lockfile
  • lockhttp
  • locklog
  • lockssh

lockhub

queues masked tickets
signs decisions
runs nothing

  • lox run your terminal
  • lox approve
  • Slack, Telegram
  • a paired phone

Every Lock runs attached to lockhub. Its console holds the credentials, checks each request and sends the hub a signed ticket with the masked screen.

lox run decides it. The hub signs the decision, bound to the exact plan, and the Lock runs only on that signed decision. The hub never runs a request, never sees its results and never sees values in clear.

The lox CLI sets each source up (lox add), runs the hub and the Locks and serves the decisions (lox run), and lists what happened (lox audit).

What lox add locksql runs for you, by hand, with locksql · Linux and macOS · Docker and cosign

# 1. In the project: the agent's files (init claude writes Claude Code's;
#    any MCP client can start `locksql mcp`), a database profile (engine,
#    host, TLS, where the password comes from; never the password), then
#    doctor --fix (.locksql/ as lox run reads it)
cd ~/projects            # your project (with lea: lea's projects directory)
locksql init claude
locksql profile add --profile orders
locksql doctor --fix --yes
# 2. Declare the lock: pinned by digest to its latest signed release;
#    the hub's image is pinned with it
lox add locksql orders --profile orders
# 3. In a terminal of its own, outside the agent: review everything,
#    start the hub and the console, then serve the decisions
lox run
  • A database on this machine is host.docker.internal; on Linux it must listen on the Docker bridge, not only on 127.0.0.1.
  • A database behind an SSH host is reached through the profile's built-in ssh bastion ([profiles.NAME.ssh]); one that publishes no port must publish it. A profile's proxy_command is not supported under lox run, which stops before the review on such a lock. Egress, and the ssh example
  • For lea's agents, the lock names your uid (allowed_uids: [1000], id -u, in lockfamily.yaml); lox add adds it when lea is installed.
  • Then ask an agent: “how many orders were placed yesterday?”. lox run asks you once for the connection, then the read runs, masked; a write waits for your y every time.
  • lox doctor checks the setup, the egress allowlist included, and changes nothing. How lox run, lea and host agents fit

lox add TYPE INSTANCE and lox import only edit .lockfamily/lockfamily.yaml: the next lox run reviews every change with you

lox run [--manual] [--no-start] [--no-upgrade] [--review] [-v]
        [--pin sha256:DIGEST] [--rotate hub|INSTANCE|all]
                  # review, start the hub and the locks, then serve decisions live:
                  # auto mode (Shift+Tab: manual), a: the audit, q q: quit (fail closed);
                  # 0…9, Tab: a lock's own tab; w: withdraw stuck tickets;
                  # --no-start: serve only; --no-upgrade: keep the pinned images;
                  # --review: everything, line by line; -v: cosign's and docker's output;
                  # --pin: the hub image by digest; --rotate: replace a key first
lox init [--review] [--hub-image REF]
                  # start the project's hub alone (no question for a hub alone); hints at the sources its files name
lox add TYPE      # locksql, lockmq, lockfile, lockhttp, locklog, lockssh: its questions, profile,
                  # declaration, a short review, the console's questions; a failure before the console
                  # starts restores the profile and lockfamily.yaml (the agent's files stay)
lox add TYPE INSTANCE [--version vX.Y.Z | --image REF] [--profile P] [--hub-image REF]
                  # the older form: only declares the lock, pinned by digest, cosign-verified
                  # (an --image or --hub-image is taken as is, verified at the next lox run)
lox add slack --team T… --channel C… --user U…    # tokens asked at the terminal
lox add telegram --chat ID --from ID               # bot token asked at the terminal
lox remove NAME [--purge] # take a lock out after one review; its profile stays unless --purge
lox import [SUB…]        # merge sub-projects' lockfamily.yaml, strictest routing kept
lox down                 # stop the stack; volumes, keys and tickets kept
lox attach INSTANCE      # a console's terminal, for debugging (lox run asks its questions in cards)
lox approve [--once]     # y, n reason, s, q; o (Ctrl-O + Enter, not macOS): clear values;
                  # r on an expired ticket: approve again
lox mobile pair --name phone    # one-time code, confirmed at this terminal
lox mobile list
lox mobile revoke NAME
lox doctor               # hub, locks, keys, egress allowlists, socket, network; changes nothing
lox tickets [--lock NAME] [--error] [--json]
                  # the tickets pending at the hub, without lox run
lox withdraw INSTANCE/ID… | --lock NAME --all-pending|--error
                  # withdraw them; each lock gets the hub's signed denial
                  # (an unverifiable ticket's lock is not told: its TTL ends it)
lox audit [show ID]      # every exchange: masked request, rule or human, outcome
lox audit verify --data DIR --hub-key-file FILE [--lock INSTANCE=PATH] [--anchors FILE]
                  # the hub's audit chain and every decision's signature

The workspace commands take --file to name another lockfamily.yaml. lox up is deprecated: it says to use lox run. The full lox reference

A company bounds every lock, lox included, with one root-owned file its administrator signs and deploys. Managed configuration

<workspace>/.lockfamily/lockfamily.yaml · lea's agents only read it there · a lock's target, production flag and credentials stay in its own profile

version: 1
hub:
  image: ghcr.io/davidgodefroid/lockhub@sha256:…
  facades: [tty, mobile, slack]
  routing:
    orders: [tty, mobile]               # narrows an instance, never widens
  slack:
    team: T0123
    channel: C0123
    users: [U0123]
  mobile:
    origin: https://hub.example.ts.net  # your TLS proxy or tunnel to 127.0.0.1:8444
    seal_clear: true                    # clear values, end to end to the phone
    require_device: [prod-write]        # only a phone's own signature approves these
    push: true                          # Web Push, no payload
locks:
  orders:
    type: locksql
    image: ghcr.io/davidgodefroid/locksql@sha256:…
    profile: orders                     # the profile the console serves
    allowed_uids: [1000]                # id -u of the account that runs lea
    devices: true                       # pins the paired phones
    reveal: true                        # o / Ctrl-O in lox approve

lox run writes .lockfamily/up.json for lea and the launchers. It keeps the hub's data, keys and audit log under $XDG_STATE_HOME/lockfamily/ (default ~/.local/state/lockfamily/), out of the workspace.

A lockfamily.yaml at the workspace's root (the older layout) is still read, with a warning, until .lockfamily/ exists.

Who may answer which risk class: the hub enforces it, whatever a facade does

Risk classTerminal, lea's deckPhoneSlack, Telegram
read, read-pii, writeyesyesyes, never a production ticket
prod-write, policy-loosenyesyesno
unlock, grantyesnono
clear valueson demand: o / Ctrl-O (reveal: true)sealed to it (seal_clear)never

A chat facade never answers a production ticket, whatever its risk class. Chat facades show masked screens only, every agent-supplied string escaped: a chat account is only as safe as the devices signed in to it.

04

Install, add your sources, keep lox run open

1 · Install the family: lox, lea, the Locks' launchers, cosign
brew trust davidgodefroid/tap
brew install davidgodefroid/tap/lockfamily

Homebrew asks you to trust a third-party tap once. Without Homebrew: curl -fsSL https://lockfamily.dev/install.sh | sh installs the same tools into ~/.local/bin, each verified with cosign (what it does). The script itself is signed: check it with cosign before you run it.

Linux and macOS · Docker

# 2. In your project (with lea: lea's projects directory), one source at a time
cd ~/projects
lox add locksql          # or lockmq, lockfile, lockhttp, locklog, lockssh
# 3. In a terminal of its own, outside the agent: approvals live here
lox run
# 4. Your agent, in another terminal: claude, codex, gemini, … or lea
  • lox add TYPE sets one source up and creates .lockfamily/lockfamily.yaml if needed: its questions, the launcher's profile add, init claude and doctor, a short review, then the console's own questions. A failure, an n or Ctrl-C before the console starts restores the profile and lockfamily.yaml (the agent's files and the doctor's repairs stay).
  • lox init starts the hub alone first, if you prefer. For a hub alone it asks nothing, and it lists the data sources the project's files name (.env*, compose*.yaml, config/: hints only, never a secret).
  • Where to run them: for lea, in its projects directory, the only place lea reads .lockfamily/up.json. For an agent on the host, in the project or any parent: each Lock's launcher looks up from the working directory.
  • A Lock added while lea runs reaches it at lea's next start: lea stop, then lea. lockfile is Linux only.

lox add · by hand

Linux and macOS (Windows through WSL2) · Docker · MariaDB, MySQL, PostgreSQL, SQLite

brew trust davidgodefroid/tap                 # once: Homebrew asks you to trust a third-party tap
brew install davidgodefroid/tap/lockfamily   # or locksql alone, with lox and cosign: brew install davidgodefroid/tap/locksql davidgodefroid/tap/lox cosign
cd ~/projects                                 # your project (with lea: lea's projects directory)
lox add locksql                             # its questions, then the review; lea stop, then lea, if lea runs
lox run                                       # in a terminal of its own, outside the agent

Then ask your agent: “how many orders were placed yesterday?”. lox run asks once for the connection; reads then run masked, and each write waits for your y. locksql on GitHub

Linux and macOS · Docker · RabbitMQ 3.13 and 4.x

brew trust davidgodefroid/tap                 # once: Homebrew asks you to trust a third-party tap
brew install davidgodefroid/tap/lockfamily   # or lockmq alone, with lox and cosign: brew install davidgodefroid/tap/lockmq davidgodefroid/tap/lox cosign
cd ~/projects                                 # your project (with lea: lea's projects directory)
lox add lockmq                              # its questions, then the review; lea stop, then lea, if lea runs
lox run                                       # in a terminal of its own, outside the agent

Then ask your agent: “which queues have no consumer?”. Catalogue calls answer at once; message reads wait for your approval in lox run. lockmq on GitHub

Linux only (Docker, a kernel with Landlock; seccomp sandboxes the plugins)

brew trust davidgodefroid/tap                 # once: Homebrew asks you to trust a third-party tap
brew install davidgodefroid/tap/lockfamily   # or lockfile alone, with lox and cosign: brew install davidgodefroid/tap/lockfile davidgodefroid/tap/lox cosign
cd ~/projects                                 # your project (with lea: lea's projects directory)
lox add lockfile                            # its questions, then the review; lea stop, then lea, if lea runs
lox run                                       # in a terminal of its own, outside the agent

Plugins are installed into the console's home (lockfile plugin install format.is-pdf@1.0.0) and applied with :review in the console. Then ask your agent about a file by its exact key. lockfile on GitHub

With lea · Docker · pre-release

brew trust davidgodefroid/tap                 # once: Homebrew asks you to trust a third-party tap
brew install davidgodefroid/tap/lockfamily   # or lockhttp alone, with lea, lox and cosign: brew install davidgodefroid/tap/lockhttp davidgodefroid/tap/lea davidgodefroid/tap/lox cosign
cd ~/projects                                 # lea's projects directory
echo LEA_LOCKHTTP=1 >> ~/.config/lea/lea.conf  # opt-in: lea's gate asks the hub
lea stop --all                                # if lea runs: the gate starts with lea
lox add lockhttp                              # its policy
lox run                                       # in a terminal of its own, outside lea
lea                                           # in another terminal

Reads of trusted hosts go through; a post, an upload or an unknown host waits for your y in lox run (or a paired phone). A new endpoint is asked once per session.

With TLS decryption (LEA_LOCKHTTP_MITM=1), or plain HTTP to an internal host, a policy inject entry has the gate add an API's header for one exact host from its own secrets file, so the agent never holds the credential. lockhttp on GitHub

A Linux host with the logs · Docker 19.03 or later · lockhub v0.10.0 or later · early release

brew trust davidgodefroid/tap                 # once: Homebrew asks you to trust a third-party tap
brew install davidgodefroid/tap/lockfamily   # or locklog alone, with lox and cosign: brew install davidgodefroid/tap/locklog davidgodefroid/tap/lox cosign
cd ~/projects/shop                            # the project whose logs the agent investigates
lox add locklog                               # its questions, then the review; lea stop, then lea, if lea runs
lox run                                       # in a terminal of its own, outside the agent

Then ask your agent: “when did the 502s start?”. Counts, patterns and traces come back free and masked; a scan or an unmask waits for you in lox run. On the host, locklog is a trial for non-production data; for production, run the agent in lea or a container of its own. locklog on GitHub

Linux and macOS · Docker · lockhub v0.12.0 or later · pre-release

brew trust davidgodefroid/tap                 # once: Homebrew asks you to trust a third-party tap
brew install davidgodefroid/tap/lockfamily   # or lockssh alone, with lox and cosign: brew install davidgodefroid/tap/lockssh davidgodefroid/tap/lox cosign
cd ~/projects                                 # your project (with lea: lea's projects directory)
lox add lockssh                               # host, login, key file, allow rules; lea stop, then lea, if lea runs
lox run                                       # in a terminal of its own, outside the agent

A command an allow rule matches (systemctl status *, df -h) runs at once. Anything else is refused or, with exec = true, becomes a ticket you decide. Output comes back masked; the key stays in the console's account.

Its console runs hub-attached only: current lockssh releases need lox v0.12.0 or later (v0.11.0 was the first that knew lockssh). lockssh on GitHub

Linux, macOS, or Windows with WSL2 · Docker · an account or API key for your agents' provider (Claude Code, Codex, …)

brew trust davidgodefroid/tap                 # once: Homebrew asks you to trust a third-party tap
brew install davidgodefroid/tap/lockfamily   # or lea alone, with lox and cosign: brew install davidgodefroid/tap/lea davidgodefroid/tap/lox cosign
cd ~/projects                                 # lea's projects directory
lea                                           # the first run sets lea up
lox add locksql                               # per source; lea stop, then lea, brings it in
lox run                                       # in another terminal, outside lea: approvals live here

lea runs coding agents: Claude Code by default, Codex and other providers too. Or use lea's own installer: curl -fsSL https://leadeck.dev/install.sh | sh installs lea only; lox add and lox run also need lox and cosign (v2.5.0 or later). In the first agent, sign in to its provider once (/login in Claude Code); press n for another agent.

lea shows no approval: when the projects directory declares Locks and no lox run serves them, lea says to run it, and the agents' requests wait. lea on GitHub

Known limits

Each project documents what the agent can see and its residual risks in its security model: locksql, lockmq, lockfile, lockhttp, locklog, lockssh, lea.