Skip to content

Latest commit

 

History

History
633 lines (518 loc) · 30.6 KB

cli.md

File metadata and controls

633 lines (518 loc) · 30.6 KB

Command line

interlock (also python -m interlock) is installed with the package. Each command's --help shows the same text as below. --no-color (before the command) turns off color; color is also off when output isn't a terminal or NO_COLOR is set.

Command Does
doctor check that protection is actually on
report summarize a receipt log: blocks, monitor findings, latency
hook decide one coding-agent tool call (run by the agent)
install-hook put interlock in front of Claude Code, Codex or Cursor
patch gate an agent-authored patch on its own tests
attach check the import seams attach() patches (compatibility contract)
policy check a declarative policy file, or show a built-in pack
learn draft a reviewable policy from observed receipts
trust trust a project's policy overlay
mcp inventory the MCP servers configured on this machine
reviews decide pending reviews; serve their status to agents
drift diff a live surface's tool listing against a recorded corpus
anchor record a receipt log's head outside it, or check it still reaches it
mesh subscribe to community policy packs, or publish a commons
cloud Enroll hosts and run the cloud connector

interlock doctor

Check that interlock protection is actually on.

Runs host-level checks and, when you point it at them, checks your policy, your sidecar and your receipt log:

interlock doctor
interlock doctor --rules myapp.policy:RULES --receipts audit.jsonl --key-file audit.key
interlock doctor --sidecar ~/.interlock/guard.sock --json

Inside your own process, call interlock.posture.attest() (or require()) instead: it sees the installed engine, sink, guards and approver directly.

Exit codes: 0 enforced, 1 degraded (warnings), 2 unprotected (a check failed).

usage: interlock doctor [-h] [--rules MODULE:ATTR] [--policy FILE] [--sidecar PATH]
                        [--receipts FILE] [--key-file FILE] [--json]
  --rules                    load this policy (same spec as interlock-sidecar --rules)
  --policy                   load this declarative policy file (JSON, or YAML with PyYAML)
  --sidecar                  probe the sidecar listening on this socket
  --receipts                 check this receipt log
  --key-file                 the receipt MAC key, to verify the log's chain
  --json                     machine-readable output

interlock report

Summarize a receipt log: what interlock blocked, rewrote and escalated, what monitor mode would have done, how long evaluation took, and whether any receipts were lost.

interlock report audit.jsonl --key-file audit.key
interlock report audit.jsonl --since 24h --monitor     # "would have blocked"
interlock report audit.jsonl --json

The chain is verified first when --key-file is given; the report always says whether it was. Receipts hold argument digests, never values.

Exit codes: 0 ok, 2 the chain is broken, 3 the log could not be read.

usage: interlock report [-h] [--since DURATION] [--monitor] [--top N] [--key-file FILE] [--json]
                        file
  file                       a receipt log written by FileSink
  --since                    only receipts newer than this: 30m, 24h, 7d (default: all)
  --monitor                  show what monitor mode would have blocked or rewritten
  --top                      rows per table
  --key-file                 the MAC key, to verify the chain
  --json                     machine-readable output

interlock hook

Decide one coding-agent tool call (run by the agent, not by you).

The agent passes its hook payload on stdin; the verdict goes back on stdout and the exit code, in that agent's own protocol. interlock install-hook writes the command line; you do not normally run this by hand, except to test:

echo '{"hook_event_name":"PreToolUse","tool_name":"Bash",
       "tool_input":{"command":"git push --force origin main"},
       "session_id":"s","cwd":"/tmp"}' | interlock hook --agent claude-code

Any error - unreadable input, a policy that will not load, a crash - denies the call (fail closed) unless --on-error allow, which lets the call through and says so loudly.

usage: interlock hook [-h] --agent {claude-code,codex,cursor} [--policy FILE] [--artifact PATH]
                      [--rules MODULE:ATTR] [--sidecar PATH] [--receipts FILE] [--key-file FILE]
                      [--no-receipts] [--no-overlay] [--monitor] [--on-error {deny,allow}]
                      [--reviews {fallback,always,off}] [--review-db FILE]
                      [--patch-gate {off,block,monitor}] [--patch-gates-dir DIR]
                      [--patch-key FILE]
  --agent                    
  --policy                   policy file (default ~/.interlock/policy.json, else the built-in coding-agent pack)
  --artifact                 a manifest-delivered policy artifact, or a directory containing active.json; mutually exclusive with --policy
  --rules                    a Python policy module instead
  --sidecar                  ask this sidecar instead
  --receipts                 receipt log (default ~/.interlock/receipts.jsonl when its key exists)
  --key-file                 receipt MAC key
  --no-receipts              write no receipts
  --no-overlay               ignore project overlays
  --monitor                  record what would happen, never block
  --on-error                 what an internal error does (default deny)
  --reviews                  settle escalations through the review queue: when the agent can't ask (default), always, or never
  --review-db                review queue (default ~/.interlock/reviews.db)
  --patch-gate               also refuse a git commit/push/merge whose diff has not passed `interlock patch gate` (default $INTERLOCK_PATCH_GATE, else off)
  --patch-gates-dir          where patch-gate records live (default ~/.interlock/patch-gates, or $INTERLOCK_PATCH_GATES_DIR)
  --patch-key                patch-gate record key (default ~/.interlock/patch-gates.key, or $INTERLOCK_PATCH_KEY)

interlock install-hook

Put interlock in front of a coding agent's tool calls.

interlock install-hook --for claude-code
interlock install-hook --for all --dry-run       # show the change, write nothing
interlock install-hook --for codex --uninstall

Registers interlock hook --agent <name> in the agent's hook settings (~/.claude/settings.json, ~/.codex/hooks.json, ~/.cursor/hooks.json), keeping every other entry, backing the file up first (.interlock-bak) and replacing any earlier interlock entry. The hook runs this Python and this interlock package, whatever directory the agent runs it from, and denies the call if it cannot start. It also creates ~/.interlock with a default policy that extends the built-in coding-agent pack and a key for the receipt log. Restart running agent sessions afterwards; re-run this if interlock moves.

Run this yourself, outside the agent: the coding-agent pack refuses it from inside one.

Exit codes: 0 done, 1 an agent could not be configured, 64 bad arguments.

usage: interlock install-hook [-h] --for {claude-code,codex,cursor,all} [--settings FILE]
                              [--policy FILE] [--artifact PATH] [--sidecar PATH] [--receipts FILE]
                              [--key-file FILE] [--reviews {fallback,always,off}]
                              [--review-db FILE] [--monitor] [--patch-gate {off,block,monitor}]
                              [--dry-run] [--uninstall]
  --for                      
  --settings                 the agent's settings file (default: its usual path)
  --policy                   pin this policy file in the hook
  --artifact                 pin a distributed policy artifact (or its directory) in the hook; mutually exclusive with --policy
  --sidecar                  decide through this sidecar
  --receipts                 receipt log path
  --key-file                 receipt key path
  --reviews                  settle escalations through the review queue: when the agent can't ask (default), always - Claude Code too - or never
  --review-db                review queue path
  --monitor                  install in monitor mode
  --patch-gate               also refuse a git commit/push/merge whose diff has not passed `interlock patch gate` (see docs/guides/patch-gate.md)
  --dry-run                  print the change only
  --uninstall                remove interlock's hooks

interlock patch

Judge an agent-authored patch on evidence it cannot author.

interlock patch gate                  # judge the working tree vs origin/main
interlock patch gate --base HEAD~1    # judge against an explicit base
interlock patch gate --head HEAD      # judge a commit, e.g. in CI
interlock patch status                # is the current diff covered by a pass?

The gate asks three questions and refuses to guess:

  1. does every test file the patch touches contain an assertion at all;
  2. does the suite fail with the patch's own tests at the pre-patch revision (a test that passes before the change does not test the change);
  3. does the same suite pass with the patch applied.

A pass is signed and stored under ~/.interlock/patch-gates/. With the hook adapter's --patch-gate block (or INTERLOCK_PATCH_GATE=block) a git commit, git push or git merge is refused until a passing record covers the exact diff being landed. Run the gate outside the agent: the agent can edit a test, but it cannot edit the pre-patch revision it is replayed against.

Exit codes: 0 the gate passed, 1 it failed, 64 bad arguments.

usage: interlock patch [-h] ACTION ...
usage: interlock patch gate [-h] [--repo DIR] [--base REF] [--head REF] [--test-cmd CMD]
                            [--timeout SEC] [--rescan CMD] [--allow-untested] [--keep DIR]
                            [--gates-dir DIR] [--key FILE] [--json] [--no-record]
usage: interlock patch status [-h] [--repo DIR] [--base REF] [--head REF] [--gates-dir DIR]
                              [--key FILE] [--json]

interlock attach

Check that the import seams interlock attaches to still exist.

interlock attach --check
interlock attach --check --json

attach() monkey-patches another library's class, which is the most fragile thing in interlock: a client update that renames the class or moves the method turns a guard into a no-op. This command runs the same structural contract check on the installed packages without installing any hook, so a dependency upgrade can be verified in CI before it reaches an agent.

Only attachable surfaces are imported (MCP today); the model SDKs are listed as adapter-guarded and not imported. Exit codes: 0 every installed attachable surface is compatible, 1 at least one is not (or failed to import), 64 the command line was wrong.

usage: interlock attach [-h] [--check] [--json]
  --check                    exit non-zero when an installed attachable surface is incompatible
  --json                     machine-readable output

interlock policy

Check a declarative policy file before you rely on it.

interlock policy check policy.json
interlock policy check ~/.interlock/policy.json --overlay .interlock/policy.json
interlock policy show builtin:coding-agent        # print a built-in pack
interlock policy verify --artifact policy.json    # a distributed artifact
interlock policy doctor                           # the native evaluator

check loads the file the way the guard will: it lists the rules, the locked ones, any rule quarantined as invalid (with why), and each overlay's status. verify loads an artifact the way a host will and reports its epoch, sha256 and which backend decides which part. doctor reports whether the optional native accelerator is importable and which ABI it implements.

Exit codes: 0 valid / available, 1 an invalid artifact or a file with quarantined rules, 2 does not load / unavailable, 64 bad action.

usage: interlock policy [-h] ACTION ...
usage: interlock policy check [-h] [--overlay FILE] [--json] file
usage: interlock policy show [-h] name
usage: interlock policy verify [-h] --artifact PATH [--json]
usage: interlock policy doctor [-h] [--json]

interlock learn

Draft a reviewable policy from a receipt log: the actions your guard actually allowed, and an escalation for everything else.

interlock learn --receipts audit.jsonl --out baseline.json
interlock learn --receipts audit.jsonl --out baseline.json --name acme-baseline

Reads a receipt log written by FileSink, keeps the actions observed with an ALLOW verdict (matched case-insensitively), and writes a declarative policy whose single rule escalates any action outside that envelope. The draft is deterministic - two runs over the same log are byte-identical - so a diff between two drafts is worth reviewing.

It is never auto-enforced: this command only writes the file you name. It installs nothing, enables nothing, locks nothing and emits no block rule. Review it with interlock policy check and install it on purpose.

Exit codes: 0 wrote the policy, 3 the log could not be read, held no ALLOW-observed receipt, or the output could not be written (no file is written in those cases); 64 the command line was wrong.

usage: interlock learn [-h] [--receipts FILE] [--out FILE] [--name NAME]
  --receipts                 a receipt log written by FileSink (required)
  --out                      where to write the draft policy (required)
  --name                     the policy 'name' field (default: learned-behavioural-baseline)

interlock trust

Trust (or stop trusting) a project's policy overlay.

interlock trust add                 # the overlay found from this directory
interlock trust add path/to/.interlock/policy.json
interlock trust list                # ok / CHANGED / MISSING
interlock trust remove [PATH]

An overlay (.interlock/policy.json in a repository) is ignored until trusted, and trust is tied to the file's exact content: edit it and it is ignored again until you re-trust it. add shows what the overlay adds before recording it. Run this yourself, outside the agent - the coding-agent pack refuses it from inside one.

usage: interlock trust [-h] [--store FILE] ACTION ...
  --store                    trust file (default ~/.interlock/trusted.json)
usage: interlock trust add [-h] [--yes] [path]
usage: interlock trust list [-h]
usage: interlock trust remove [-h] [path]

interlock mcp

Inventory the MCP servers configured on this machine.

interlock mcp scan                       # every server, with risk notes
interlock mcp scan --json
interlock mcp scan --emit-policy mcp.json  # a rule blocking unlisted servers
interlock mcp where github               # every config that defines it

Reads Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, Gemini CLI and Codex configs (user scope, plus the project around --cwd). Never starts a server and never touches the network. Environment and header values are not read into the report - only their names.

Exit codes: 0 no risks found, 1 at least one risk note, 2 nothing matched (where).

usage: interlock mcp [-h] ACTION ...
usage: interlock mcp scan [-h] [--json] [--cwd CWD] [--emit-policy FILE]
usage: interlock mcp where [-h] [--cwd CWD] name

interlock reviews

Decide pending reviews, and serve their status to agents.

interlock reviews list                   # pending first; --status, --all
interlock reviews show r-1a2b3c4d
interlock reviews approve r-1a2b3c4d     # --as NAME (default: your login)
interlock reviews reject r-1a2b3c4d --reason "use the staging table"
interlock reviews revoke r-1a2b3c4d
interlock reviews wait r-1a2b3c4d --timeout 120
interlock reviews mcp                    # read-only MCP server (stdio)

A review is filed when a call escalates and is settled through the queue (see interlock.reviews). After an approval the agent retries the identical call, which runs once. Run approve/reject/revoke yourself, outside the agent: the coding-agent policy refuses them from inside one.

For the agent, add the MCP server to its config, e.g. for Claude Code:

{"mcpServers": {"interlock-reviews": {"command": "interlock", "args": ["reviews", "mcp"]}}}

Exit codes: 0 done, 1 the review can't be changed (wrong state, self-approval, unknown id), 64 bad arguments.

usage: interlock reviews [-h] [--db FILE] [--key FILE] [--head FILE] [--json] ACTION ...
  --db                       review queue (default ~/.interlock/reviews.db)
  --key                      HMAC key that signs rows and the high-water mark (default: next to --db, reviews.key)
  --head                     rollback high-water mark (default: <key>.head). Point it at storage your database backups do not restore
  --json                     machine-readable output
usage: interlock reviews list [-h] [--status {pending,approved,rejected,revoked,expired,executed}]
                              [--limit LIMIT]
usage: interlock reviews show [-h] id
usage: interlock reviews approve [-h] [--as NAME] id
usage: interlock reviews reject [-h] [--as NAME] [--reason REASON] id
usage: interlock reviews revoke [-h] [--as NAME] id
usage: interlock reviews wait [-h] [--timeout TIMEOUT] id
usage: interlock reviews mcp [-h]

interlock drift

Diff a live surface's tool listing against a recorded corpus.

interlock drift --corpus corpus.json --live "my-mcp-server --list-tools"
interlock drift --corpus corpus.json --live "..." --surface demo
interlock drift --corpus corpus.json --live "..." --json

The corpus records each covered surface's tool-listing fingerprint and schema shapes (see interlock/drift.py). --live runs a command and reads its standard output as the live tool listing: one tool name per line, or one JSON object per line when you also record schema shapes. --live is a shell string, so a command with arguments or quoted paths works as written.

Every added tool, removed tool and changed schema shape is reported with a severity, and any finding is drift. Nothing is written back and nothing is filed - the corpus is only ever read - so the diff is a report you act on.

Exit codes: 0 no drift, 1 drift found, 64 the command line was wrong, 3 the corpus could not be read or the live command failed.

usage: interlock drift [-h] [--corpus FILE] [--live CMD] [--surface NAME] [--json]
  --corpus                   the recorded corpus to diff against
  --live                     a shell command whose stdout is the live tool listing
  --surface                  which corpus surface the live command describes (default: the corpus's only surface)
  --json                     machine-readable output

interlock anchor

Record a receipt log's head outside it, and verify the log still reaches it.

interlock anchor audit.jsonl --key-file audit.key            # verify, then record
interlock anchor audit.jsonl --key-file audit.key --check    # is it still there?
interlock anchor audit.jsonl --key-file audit.key --out /mnt/worm/audit.anchor --json

A hash chain catches edits, deletions and reordering inside a log, but a log with its last receipts removed is still a valid, shorter chain. The anchor closes that: it records the last mac and the receipt count in a small signed file outside the log, on storage the log's writer cannot reach (a WORM volume, another host, a committed git repository).

record verifies the chain first, then refuses to move backwards - the log must still contain the receipt the existing anchor names at the same position, and must not be shorter than the anchored count. So a rolled-back log cannot bless itself by re-anchoring. --check is the same comparison without writing, and accepts a log that has grown since the anchor.

Exit codes: 0 the log reaches its anchor, 2 the chain or the anchor is broken, 3 a file could not be read, 64 bad arguments.

usage: interlock anchor [-h] --key-file FILE [--out FILE] [--check] [--json] file
  file                       a receipt log written by FileSink
  --key-file                 the MAC key that signed the log (and this anchor)
  --out                      where to keep the anchor (default: <log>.anchor). Put it on storage the log's writer cannot reach
  --check                    verify against the recorded anchor instead of writing a new one
  --json                     machine-readable output

interlock mesh

Subscribe to the interlock mesh, or publish a commons for it.

For a node (the deployment running an agent):

interlock mesh init --root root.json --mirror https://commons.example.org [--ring stable]
interlock mesh sync                       # fetch and verify; the cache only changes if all of it verifies
interlock mesh status [--json]            # subscriptions, freshness, what shadow rules would have done
interlock mesh resolve mesh:coding-agent@stable   # print the pack as this node would install it
interlock mesh grant block --pack coding-agent --status stable   # let this pack's stable blocks block
interlock mesh grant block --rule no-curl-pipe-sh                # or one rule (add --pack to keep it to one pack)
interlock mesh grant --list               # the grants in force; `grant revoke ...` takes one back

Then in your policy file: {"version": 1, "extends": "mesh:coding-agent@stable", "rules": [...]}

Reporting is off until the operator enables it, one layer at a time, and an enable never reaches back before its own date:

interlock mesh report init                # this node's reporting key
interlock mesh report build --receipts ~/.interlock/receipts.jsonl --out report.json   # local only
interlock mesh report enable [--digests] [--fingerprints] [--sample RULE --i-warrant-samples]   # the one consent point
interlock mesh report status              # what may leave, since when, and a preview
interlock mesh report submit report.json --consensus URL --aggregator URL --aggregator URL

INTERLOCK_MESH_NO_REPORT=1 refuses every upload, whatever is enabled. A node that shares redacted samples gives the data warranty (CONTRIBUTING.md): the samples were lawfully obtained and hold no personal data and no third party's confidential data. Without it, a report carries no samples.

For a maintainer (the people who run a commons):

interlock mesh keys init --out keys/      # one Ed25519 key per role; raise counts/thresholds for a real root
interlock mesh publish --source commons/ --out site/ --keys keys/   # needs no root key while the root is current
interlock mesh verify site/               # walk the site exactly as a subscriber would
interlock mesh consensus forget --state consensus.json --sample DIGEST   # erase a sample (GOVERNANCE.md)

A new root is signed in a ceremony, each root keyholder on their own machine (docs/guides/mesh-root-ceremony.md):

interlock mesh root draft --site site/ --keys keys/ --out root-2.json   # root keys from keys/root-keys.json
interlock mesh root sign root-2.json --key root.json                    # writes root-2.json.sig.<keyid>
interlock mesh root sign root-2.json --external-signer ./token-sign     # stdin: the bytes, stdout: hex signature
interlock mesh root assemble root-2.json --sig root-2.json.sig.* --site site/

A node never auto-enforces a new community rule: every rule it has not seen before spends a monitor window in shadow mode, and a rule's status and the node's ring cap how strong its verdict may be. No community rule blocks until the operator grants it: without a grant a block is capped to an escalate, and on a node with no approver installed that escalation is only recorded as a shadow finding. See docs/guides/mesh.md.

Exit codes: 0 ok, 1 the mesh is stale or a shadow summary shows findings (status), 2 verification or publishing failed, a grant could not be changed, or a report was not sent, 3 a file could not be read, 64 the command line was wrong.

usage: interlock mesh [-h] ACTION ...
usage: interlock mesh init [-h] --root FILE [--mirror URL] [--ring {canary,early,stable}]
                           [--monitor-days DAYS] [--dir DIR]
usage: interlock mesh sync [-h] [--dir DIR] [--json]
usage: interlock mesh status [-h] [--dir DIR] [--json]
usage: interlock mesh resolve [-h] [--dir DIR] spec
usage: interlock mesh grant [-h] [--list] [--dir DIR] ACTION ...
usage: interlock mesh keys [-h] ACTION ...
usage: interlock mesh root [-h] ACTION ...
usage: interlock mesh publish [-h] --source DIR --out DIR --keys DIR [--timestamp-days DAYS]
                              [--no-validate] [--json]
usage: interlock mesh verify [-h] [--root FILE] [--json] DIR
usage: interlock mesh report [-h] ACTION ...
usage: interlock mesh serve [-h] --role {consensus,aggregator,mirror,dap-leader,dap-helper}
                            [--bind HOST:PORT] [--state FILE] [--token TOKEN] [--task FILE]
                            [--keys FILE] [--peer-token TOKEN] [--collector-token TOKEN]
                            [--known-catalog ID] [--min-orgs N] [--dir DIR] [--require-credential]
                            [--issuer HEX_PUBLIC] [--revoked FILE] [--min-batch N]
usage: interlock mesh dap [-h] ACTION ...
usage: interlock mesh log [-h] [--root FILE] [--json] DIR_OR_URL
usage: interlock mesh gossip [-h] --peer URL [--dir DIR] [--token TOKEN]
usage: interlock mesh credential [-h] ACTION ...
usage: interlock mesh harness [-h] --policy FILE --benign FILE [--samples FILE] [--poisons FILE]
                              [--stress] [--max-fp-rate RATE] [--max-p95-us US]
                              [--max-induced-rate RATE] [--max-stress-p95-us US]
                              [--min-recall RATE] [--json]
usage: interlock mesh forge [-h] --state FILE --benign FILE --out DIR [--samples FILE]
                            [--max-fp-rate RATE] [--min-recall RATE]
usage: interlock mesh consensus [-h] ACTION ...

interlock cloud

Enroll this host with an interlock cloud plane, and run the connector.

interlock cloud enroll --url https://cloud.example --token TOKEN
interlock cloud run --once
interlock cloud status --json
interlock cloud leave --yes
IL_CLOUD_ADMIN_COOKIE=... IL_CLOUD_ADMIN_CSRF=...       interlock cloud keys rotate --host host_...

The connector is outbound-only: it polls the plane for reviews, grants and policy manifests, and the plane cannot dial this host. policy shows the artifact the host has installed and verified; the plane distributes it, so --policy FILE is refused with the local interlock policy command named as the way to check a file.

enroll consumes a single-use enrollment token, writes an Ed25519 host seed and cloud.json under the connector home ($IL_CLOUD_HOME, default ~/.interlock) with mode 0600, and prints the host id and agent key id - never the agent key. run reconciles reviews from the local queue, uploads the masked review batch, long-polls for grants, verifies and applies them, acknowledges, heartbeats and ships receipts; --once does one cycle and exits non-zero when the sync failed. status reports connectivity, spool depth, queue lag, revocation and the grant counters (grants_applied, grants_refused, grants_acked, last_grant_refusal) without printing credentials. leave removes cloud.json and the seed and prints what it left on disk.

The uploaded review body is allow-listed on both sides: the masked preview, the argument digest, the mask counts and metadata - never the raw event or arguments. The connector sets share_usernames: true in cloud.json when the org wants the plain requester name; otherwise it sends a host-keyed HMAC label.

A decision on the plane is a signed Ed25519 grant, and the host releases the call only after verifying it - binding, org, host, signature, per-host seq/prev chain, expiry and an unseen grant id. A refused grant leaves the review pending and is reported on the next acknowledgement. A released remote approval appears on the receipt as approval="cloud:<grant_id>".

The plane needs two pieces of C3 material, both read at use time and never written to the database or a log: IL_CLOUD_APPROVAL_KEY_FILE, a hex 32-byte Ed25519 approval seed in a 0600 file (enrolling hosts pin its public half), and IL_CLOUD_PREVIEW_KEK, a hex or base64 key used to encrypt masked previews per org. Operators review and decide in the hosted, mobile-first UI at /reviews; every preview read is an audited disclosure and a decision needs a step-up no older than 300 seconds.

keys rotate|revoke calls the admin API and needs an operator session, taken from IL_CLOUD_ADMIN_COOKIE and IL_CLOUD_ADMIN_CSRF - never from argv, which is visible in ps and shell history. The CLI never prompts for a password; without a session it prints how to rotate or revoke from the web UI instead.

Receipts leave the host without ever touching a verdict: the connector tails the host receipt log from a durable byte offset, batches only complete lines, and advances the offset only after the plane answers 2xx, so uploads are at-least-once and the plane deduplicates by mac. enroll writes receipt_log as receipts.jsonl beside the connector home - the file the hook writes when its key exists - and removing that field from cloud.json stops receipt upload for the host. status reports that offset, its line number, the pending bytes and the last framing error; status --reset-offset LINE --yes is operator recovery only, for a log that was rotated under the connector. A receipt whose prev does not continue the plane's head is a fork: the plane freezes receipt ingest for that host and audits the break, while grants, reviews and heartbeats keep working until an admin unfreezes it with a step-up and a reason.

Exit codes: 0 done, 1 failure, 2 missing or unsafe configuration, 64 the command line was wrong. The agent key is never asked for on the command line and is printed only by an explicit rotate that hands it back once.

usage: interlock cloud [-h] ACTION ...
usage: interlock cloud enroll [-h] [--url URL] [--token TOKEN] [--name NAME] [--home DIR]
usage: interlock cloud run [-h] [--once] [--url URL] [--home DIR] [--verbose]
usage: interlock cloud status [-h] [--json] [--reset-offset LINE] [--yes] [--home DIR]
usage: interlock cloud leave [-h] [--yes] [--home DIR]
usage: interlock cloud policy [-h] [--policy FILE] [--json] [--home DIR]
usage: interlock cloud keys [-h] [--host HOST] [--key KEY] [--url URL] [--json] [--home DIR]
                            [rotate|revoke]
usage: interlock cloud admin [-h] COMMAND ...