Security model and preview limitations
This page describes what Writ's guardrails are designed to do. Writ's authority-narrowing engine is covered by an adversarial internal test suite and has been through two internal security-review passes. It has not had a formal external security review.
What the guardrails are designed to do
- Writ does not hold funds. Your own wallet makes Lightning payments; the capability providers settle directly with it. Writ issues and verifies spending authority, and records what happened. It never holds funds, but in wallet mode it does instruct your wallet to pay each capability's invoice, and only within the ceiling the credential authorizes.
- Fail-closed by default. An unknown macaroon caveat denies. A missing budget account on a capped credential denies. An unresolvable clock denies. Under
--production, a missing signing key refuses to run rather than falling back to a throwaway one. - No secrets in evidence. Receipts and logs carry hashes and safe identifiers only — never a macaroon, preimage, key, or raw prompt/response body. When a CLI model provider's stderr might echo prompt content back (an argv-echoing parse error, for instance), Writ suppresses that snippet outright rather than risk leaking it into a log.
- Idempotent money path. Paying once executes once; a replayed settlement moves budget once. Reservations are released on every proven no-funds-moved failure path — and deliberately retained, not released, when the outcome is merely unknown (see Settlement).
- Approvals are bound to the exact request. Covered in full in Approvals and budgets.
- Authority on a service host comes from the operator. The service hosts,
writ-mcpand the HTTP API (writ-api), are separate programs from thewritCLI. They serve an agent role and an operator role. The agent role runs calls under a writ it holds, narrows that writ for sub-agents, revokes the writs beneath it, reads its host's workspace, and reads its own records in any workspace where it presents a live writ; issuing writs, approving and denying held spends, revoking by id and reconciling payments are the operator's (writ-mcp --role operator, the operator token, orwrit issue|approvals|revoke|reconcile --service-db). Run the host under its own OS account, with its database,WRIT_ROOT_KEYand launch configuration readable only by that account: see Setting up the host. - SSRF-guarded. Every capability URL, and the LLM
endpoint, is checked — DNS re-resolved at call time — and loopback/private/cloud-metadata targets are denied unless a capability explicitly opts in withallow_localfor local testing (andallow_localis a hard error under wallet settlement /--production). In wallet mode, the connection is pinned to the vetted IP so a DNS rebind can't swap in an internal target after the check. - Model CLIs run with no tool surface. Writ feeds a model the bodies of paid third-party responses, so a prompt injection arriving inside purchased content is an expected input, not a hypothetical one. The
claude-cliprovider runs with--tools "" --strict-mcp-config(no built-in tools, no MCP servers);codexruns with--sandbox read-only, web search off, and a fresh empty temp directory as its workspace — nothing on disk for an injected instruction to read back into the work record. - The manifest is semi-trusted input. A mission file is shareable, and may be agent-authored.
${ENV}reads are opt-in per variable (declared in the manifest's ownenv:block, orWRIT_VAR_-prefixed), and secret-shaped names are refused even when declared — see the manifest reference for the error text. Amodel.api_key_envcan't name a protected Writ/system secret. Atotal_sats: 0mission with a paid capability is refused outright. Every output path is confined to the run directory. Step-output files hold untrusted capability/LLM content — don't open them directly in a browser.
What writ verify shows, and what it doesn't
writ verify offline-checks that every receipt in a work record is validly signed by the claimed key, correctly hash-chained to the receipt before it, and — when a terminal commitment is present — that the exported chain wasn't truncated after the fact. Full walkthrough with real output: Keys and verification.
It verifies: each receipt's signature, every hash-chain link, strict sequence continuity, and the receipt protocol version — plus, when present or supplied, the terminal commitment, a pinned head attestation, the signer identity record, and the rotation and revocation records.
It does not re-derive: authorization (the call was within a delegated credential's scope and budget), payment (a receipt for a paid capability commits to a payment witness), or completion (the step ran and produced a result). The verifier has no access to the credentials, ledger, or wallet; those facts are what the operator's signer attested in each receipt. A clean verify shows that the attestations were signed by that key and that the chain is intact, for exactly the steps recorded in it.
It does not show: that the underlying work was good. Writ does not verify output quality: a signed receipt is the signer's attestation that an authorized, paid, completed action happened, never that its result was correct, unbiased, or useful.
Signer identity is self-asserted
writ verify binds a chain to a self-signed operator identity record, walks signed rotation and revocation records forward from one pinned anchor key, and checks head attestations. The identity itself is asserted by the key that created it: trust it the way you trust the public key you chose to pin. Writ has no hosted signer registry or transparency log. writ record publish-head --relay <wss-url> publishes a head attestation to a Nostr relay you choose, as event kind 38410, and writ record verify-head checks a relay's copy against the local record; wss://agents.lightningenable.com is a public relay that accepts these events. A relay is not a transparency log: it can withhold or lose a later head, so publish to and check more than one relay to detect a withheld head. --post <url> sends the attestation to a URL you choose. See record publish-head.
Preview limitations, stated plainly
Each row states a limit of the preview and how Writ handles it:
| Limitation | Status |
|---|---|
Resuming needs a persistent authority key and signer. writ resume continues a suspended or interrupted run only when the run started with WRIT_ROOT_KEY set and a work_record.signing: env or key-file signer; a run started without them is refused, unchanged. Worker credentials keep their original expiry, so a run whose approval takes longer than the worker's expires_minutes cannot continue. A call that may have paid but was never recorded halts the resume for writ reconcile, and when it is reconciled as paid its output is lost, so the remaining steps need a new run. Free (no-sats) calls are at-least-once across a crash: one killed after it ran but before its result was recorded runs again on resume, and the abandoned first attempt is listed in run.json's AbandonedAttempts. A wrong writ reconcile --resolve not-paid (the payment did go out) makes the resume pay that call a second time: attest only what your wallet shows. run.lock is an operating-system file lock: advisory on Linux and macOS (only processes that take it are kept out) and unreliable on network file systems (NFS, SMB), so keep run directories on a local disk and never run one run from two hosts. If the end of a run's journal is lost and an agent step is asked again and decides differently, that step fails on the idempotency fingerprint and the remaining work needs a new run; nothing is paid twice. | By design (fail closed): see Approvals and budgets. |
A receipt that was never staged keeps the run at exit 6 permanently. When the store refused both a receipt and its staged request, the payment is in the ledger (and in the proof journal when one was written), but the signed receipt cannot be reconstructed, and no command clears the gap. Automation gating on exit 6 must treat it as "work done, evidence incomplete" and must not re-run the mission. | By design (Writ does not invent evidence): see Troubleshooting. |
Staged work records are bound to the host's root key. Run hosts that stage receipts with a persistent WRIT_ROOT_KEY, keep the host database writable only by the host account, and drain the outbox before rotating the key. Records already stuck are handled with writ outbox: re-signed on a service host after a ledger cross-check, or discarded with a recorded reason (a run then exits 11). | Runbook in Troubleshooting. |
Strike can't confirm an ambiguous wallet payment automatically. writ reconcile asks the wallet to look a held payment up by hash first: LND and NWC can usually answer; Strike's API has no such lookup, so a Strike hold needs your explicit --resolve paid|not-paid, and not-paid there also needs --allow-unconfirmed-not-paid, which the audit log records. | Writ retains the hold instead of guessing, and looks the payment up automatically on LND and NWC. The Strike gap is a constraint of Strike's API. |
Aggregate approval thresholds are opt-in. threshold_sats alone is per call: repeated spends just below it are bounded only by the budget caps. Set cumulative_threshold_sats and/or window_threshold_sats + window_seconds to bound the spend made without approval across a run; a service host's WRIT_APPROVAL_CUMULATIVE_SATS, WRIT_APPROVAL_WINDOW_SATS, WRIT_APPROVAL_WINDOW_SECONDS count across every writ and workspace in its database (so one workspace's spend affects, and is visible in aggregate to, every workspace on that host). On a service host the operator decides held spends and issues writs. Approving does not reset the count, a denial does not stick, and a few cases can leave the unapproved spend above the threshold (see the guide). Each paid call under an aggregate threshold runs an aggregate query over the scope's history twice, once inside the reservation's write transaction (about 120 ms each at 50,000 rows in scope, measured on Windows). | Opt-in by design: see Cumulative and windowed thresholds. |
Schema upgrades are forward-only. The database is stamped with a schema version. Opening one from an older Writ applies the known upgrades in order, in one transaction. They are additive, except two steps that rebuild a table, copying every row and index, because SQLite can't alter a CHECK constraint; one written by a newer Writ, or one that is not a Writ database, is refused unchanged with an actionable error. Every upgrade first writes a backup beside the database (<db>.backups/<db-name>.schema-v<from>-<stamp>.bak, in an owner-only directory), and is refused if the backup cannot be written; writ db status and writ db upgrade show and perform it explicitly. There are no down-migrations: to roll back, restore the backup with no Writ process using the database. | By design: every upgrade writes a backup first. |
| Rail-neutral architecture; Lightning-native today. L402 over Lightning is the only implemented settlement rail. | By design, not tracked as a bug. |
Delegation is manifest-declared. Multi-hop delegation narrows real cryptographic authority between workers you declare in the manifest (budget, expiry, and capability scope all narrow in the credential: a worker scoped to one capability carries that exact capability, and a worker scoped to several carries a capability_in caveat listing exactly those capabilities, so its credential alone refuses any capability outside its scope; the orchestrator's own scope check stays as defense in depth) — Writ doesn't discover, contract, or hire arbitrary external agents at runtime. | By design, not tracked as a bug. |
Model cost is priced for the anthropic and claude-cli providers only. openai-compatible and codex record tokens in usage.json but no price, so each call counts toward unpriced_calls and total_cost_usd is a lower bound rather than a silent $0; reported_cost_usd is null when no call reported a price. A priced-table miss on anthropic shows up the same way. An OpenAI-compatible server that omits the usage block contributes no tokens. | By design: Writ has no price table for those providers. |
Run artifacts are private by default (see Run artifacts and export), and an approval is bound to the exact request it was granted for (see Approvals and budgets).
What leaves your machine
Writ sends no telemetry, analytics, or crash reports. There is no account, no sign-in, and no Writ-operated service in the loop. The only network traffic a run produces is what the mission manifest declares:
- Capability calls (
kind: l402-http) go to thebase_urlof each capability, with the request body the step builds. Insimulatedmode, no capability call leaves the process: the example missions in these docs nameapi.lightningenable.comproxy URLs, and Writ contacts them only inwalletmode. Lightning Enable is a separate product of the same company, Refined Element, LLC; each capability's price ceiling is themax_sats_per_callyou declare in the manifest, and the provider's actual invoice must come in at or under it. - Model calls go to the provider you configure: Anthropic's API for
anthropic, your configured endpoint foropenai-compatible, or your locally installed Claude Code or Codex CLI (which bills your own account). A step calls the model when it is anagentstep, or acallto anyinternalcapability other thancompose/compose.*, and the prompt (including the paid data the step feeds it) goes to that provider. A mission whose steps are alll402-httporcomposecalls, such as the first mission, makes no model call and no model probe, and names no model in its outputs. Model call count and list-price cost appear in the run summary,report.html,writ record show, andusage.json; that cost is billed by your provider and is outside the sats budget. - Wallet traffic (
settlement.mode: wallet) goes to your own LND, NWC, or Strike wallet.
Nothing in a run directory is uploaded anywhere unless you run writ record publish-head with --post or --relay, against a URL or relay you choose.
What's explicitly out of scope for v1 (by design)
- No hosted control plane or SaaS: Writ is a self-hosted runtime you run.
- No marketplace or service discovery: a mission calls the capabilities its manifest declares.
- No output-quality verification, as above.
- No custody of funds.
Next steps
- Troubleshooting: the errors you are most likely to meet and how to fix them.
- Keys and verification: the full signer lifecycle.