# Writ Documentation — llms-full.txt > Writ — bounded autonomy for agents that spend money. A self-hosted .NET > runtime that runs an agent mission under a cryptographic writ (budget, > scope, deadline, delegation rules), paying over Lightning (L402) and > producing a signed, independently verifiable work record. Writ does not > hold funds — the operator's own wallet makes payments directly. PRIVATE PREVIEW: Writ is in private preview. To request access, write to support@lightningenable.com. This corpus describes the preview behavior, captured directly from the running CLI where possible. This file is the full documentation corpus of https://writ.lightningenable.com, generated from the Markdown sources by docs-site/scripts/generate-llms-full.mjs (do not edit by hand — regenerate with `npm run generate-llms-full` from docs-site/). For a short curated index instead, see https://writ.lightningenable.com/llms.txt. For a structured, machine-readable command manifest, see https://writ.lightningenable.com/.well-known/writ-agent.json. ============================================================================== # For agents Source: https://writ.lightningenable.com/docs/for-agents ============================================================================== # For agents :::note Writ is in private preview. To request access, write to [support@lightningenable.com](mailto:support@lightningenable.com?subject=Writ%20private%20preview). See [Get access](/docs/getting-started/installation). This site serves the Claude Skills and the mission schema. ::: Writ was built for agents to eventually run autonomously — it follows that setting Writ up and operating it should also work with an agent doing the driving, not just a human typing commands. This page is the index for that: what a coding agent (or an autonomous one) should read, in what order, and where the guardrails are. ## Start here: the machine-readable index - **[`/llms.txt`](pathname:///llms.txt)** — a concise, curated index of every documentation page, with a one-line description and an absolute URL for each, following the [llms.txt convention](https://llmstxt.org). Read this first to decide what else to fetch. - **[`/llms-full.txt`](pathname:///llms-full.txt)** — the entire documentation corpus concatenated into one plain-text file, generated from the same source these pages render from on every build. Fetch this when you want the whole thing in one shot instead of paging through individual URLs. - **[`/.well-known/writ-agent.json`](pathname:///.well-known/writ-agent.json)** — a structured JSON manifest: every `writ` command with its arguments, options, and exit codes; the setup checks; the mission manifest schema URL; the list of Claude Skills below; and the verification procedure. This is the file to parse programmatically instead of scraping prose. Its command list is checked against the CLI's own `--help` output on every build of this site. ## Claude Skills Three [Claude Skills](https://support.claude.com/en/articles/12512180-use-skills-in-claude) are published on this site under [`/skills/`](pathname:///skills/README.md), in the same `SKILL.md` format used by [lightning-enable-skills](https://github.com/refined-element/lightning-enable-skills) (and, per the [agentskills.io](https://agentskills.io) standard those follow, loadable unmodified by Claude Code, Claude Desktop, Cursor, and other compatible hosts): | Skill | What it does | |---|---| | [`writ-setup`](pathname:///skills/writ-setup/SKILL.md) | Confirm the `writ` tool is installed, create a persistent operator identity with `writ keys init`, and confirm the setup with a smoke run. | | [`writ-run`](pathname:///skills/writ-run/SKILL.md) | Author a mission manifest from a task description, validate it, plan it with `--dry-run`, run it in `simulated` settlement, read the result, and export a shareable bundle. | | [`writ-verify`](pathname:///skills/writ-verify/SKILL.md) | Verify a work-record bundle received from a counterparty against a pinned public key or head attestation, and interpret every warning `writ verify` can print. | Every skill carries the same hard guardrails, stated up front in its `SKILL.md`: - **Never enable wallet settlement or `--production` without explicit, current-turn human confirmation.** These are the two things that make a run capable of spending real money or refusing to run without a durable key — an agent proposes; a human decides. - **Never print a private key, `WRIT_RECEIPT_KEY` value, or macaroon** — surface only what `writ keys show` and `writ verify` already redact to. - **Stop and hand back to the human on exit code `4`** (approval required) **or `7`** (pending reconciliation) — these are the two outcomes where an agent proceeding on its own is precisely the failure mode Writ's approval gate and reconciliation hold exist to prevent. ## The mission schema, for generation If you're generating a mission manifest programmatically, validate it against [`/schema/mission.schema.json`](pathname:///schema/mission.schema.json) (JSON Schema draft 2020-12) before handing it to `writ validate` — catching a schema violation locally is faster than round-tripping through the CLI. The [manifest reference](/docs/reference/manifest) documents every field the schema declares, with real examples. ## JSON-LD Every page on this site carries `SoftwareApplication`, `HowTo`, and `FAQPage` [schema.org](https://schema.org) structured data in its ``, injected via Docusaurus's `headTags` config. A crawler or agent that reads structured data rather than prose can get the setup steps and the top FAQ answers from that alone. ## The shape of an autonomous session A reasonable order of operations for an agent setting up and running Writ with minimal human intervention: 1. Fetch `/llms.txt`, then `/.well-known/writ-agent.json`, to build a picture of the tool without a human narrating it. 2. Follow `writ-setup`: confirm the `writ` tool is installed, create an operator identity, confirm with a smoke run. 3. Follow `writ-run` to author and run a **`simulated`**-settlement mission — no wallet, no real money, no approval risk. 4. Read the run's `run.json` and `work-record.jsonl`; on success, export a bundle with `writ record export --out`. 5. If a counterparty hands you a bundle instead, follow `writ-verify` to check it against a pinned key. 6. At any point the mission proposes `settlement.mode: wallet` or `--production`, or a run halts at exit `4`/`7`: **stop, explain the situation, and ask a human.** ## Driving the engine with no human in the loop When your agent host calls the engine directly through `writ-mcp` or `writ-api` instead of running a mission, it has to make its own decisions without a person reading prose. The [service, MCP, and HTTP reference](/docs/reference/agent-api) is written for that case: - **Spend under the writ you were given.** A service host serves you the agent role: you run calls, narrow your writ for sub-agents, revoke the writs you delegated (`writ_revoke_delegated`, presenting the parent writ), and read. To read your own receipts and held spends in a workspace other than the host's, pass your writ as `credential` with the `workspace`. Issuing, approving, denying, revoking by id and reconciling are the operator's, and a call to one of those tools returns `operator_only` with the command your operator runs. `writ_status` says your `role` and, if you have no writ yet, how the operator issues one. When a call returns `approval_required`, tell your operator which request is waiting and retry the same call (same idempotency key) after they decide. - **Ask what remains before you spend.** `writ_budget` (or `POST /v1/credentials/budget`) returns `remainingSats`, `perCallMaxSats`, and `maxNextCallSats`, each the tightest value across the whole delegation chain, plus the link that binds. Stop cleanly when `maxNextCallSats` is below the price of the next call, instead of learning it from a refusal. - **Branch on `reasonCode`, not on prose.** Every refused invoke carries a stable `reasonCode` (for example `budget_exhausted`, `price_exceeds_ceiling`, `credential_revoked`, `approval_required`) and a `retry` disposition. On `final`, stop or ask the operator. On `retry_with_change`, try something different: another capability or provider, or a cheaper call. On `retry_later`, retry the same call after a human approves or a transient fault clears. Never retry `payment_outcome_unknown` or `paid_execution_failed`: money may have moved. The full table is in [Refusal reason codes](/docs/reference/agent-api#refusal-reason-codes). - **Retry with the same idempotency key.** Generate a key per unit of work and pass it on the call and on every retry of it (`idempotencyKey` in `writ_invoke`, the `Idempotency-Key` header over HTTP). A retry after a timeout or a lost response then never pays twice: a finished call replays its original outcome and receipt id, and one still in flight answers `in_progress`. See [Idempotent retries](/docs/reference/agent-api#idempotent-retries). ## Human-facing documentation, for context Everything the skills reference is written out in full elsewhere on this site: - [Manifest reference](/docs/reference/manifest) - [Command reference](/docs/reference/commands) - [Service, MCP, and HTTP reference](/docs/reference/agent-api) - [Keys and verification](/docs/guides/keys-and-verification) - [Approvals and budgets](/docs/guides/approvals-and-budgets) - [Settlement](/docs/guides/settlement) - [Security model and preview limitations](/docs/security-and-limitations) - [Troubleshooting](/docs/troubleshooting) ============================================================================== # Your first mission Source: https://writ.lightningenable.com/docs/getting-started/first-mission ============================================================================== # Your first mission This walkthrough runs a real mission end to end in `simulated` settlement mode. No wallet, no API key, no model, no real money. Each step shows the command to run, then the output you should see. **Before you start:** finish [Get access](/docs/getting-started/installation), so that `writ` works in your shell. Then make an empty directory, save the manifest below in it as `mission.yaml`, and run every command on this page from that directory. The walkthrough uses this vendor due-diligence mission because it needs nothing configured; scaffolding your own mission with `writ init` comes at the end. In a source checkout, the same mission is `examples/vendor-dossier/mission.yaml`. ```yaml title="mission.yaml" mission: name: vendor-dossier goal: > Produce a vendor due-diligence dossier on {{target_name}} ({{target_domain}}) from paid data sources: domain registration/DNS posture and regulatory/compliance footprint. vars: - target_domain - target_name budget: total_sats: 200 # cumulative cap, enforced atomically at the credential-chain root per_call_max_sats: 25 # ceiling for any single capability call settlement: mode: simulated # simulated (no real money) | wallet (real Lightning) approvals: {} # empty = fully autonomous within the bounds above capabilities: - id: dns.whois kind: l402-http base_url: https://api.lightningenable.com/l402/proxy/dns-and-whois-afae path: /whois method: GET max_sats_per_call: 5 - id: compliance.search kind: l402-http base_url: https://api.lightningenable.com/l402/proxy/compliance-suite-e352 path: /search method: GET max_sats_per_call: 12 - id: compose.dossier kind: internal # deterministic assembly of the paid outputs, no model workers: - name: infra-researcher scope: [dns.whois] budget_sats: 40 expires_minutes: 30 steps: - type: call capability: dns.whois input: domain: "{{target_domain}}" output: infra.json - name: compliance-researcher scope: [compliance.search] budget_sats: 60 expires_minutes: 30 steps: - type: call capability: compliance.search input: q: "{{target_name}}" output: compliance.json - name: writer scope: [compose.dossier] budget_sats: 0 # internal-only worker: no external spend authority expires_minutes: 20 steps: - type: call capability: compose.dossier input: instruction: | # Vendor Due-Diligence Dossier — {{target_name}} ({{target_domain}}) Compiled autonomously by Writ from paid data sources. Each section below is the response of a capability the mission paid for over L402 under a scoped, delegated credential. include_prior_outputs: true output: dossier.md work_record: signing: dev-ephemeral output_dir: runs/ ``` In `simulated` mode, Writ never contacts the `api.lightningenable.com` URLs: each paid call is answered in-process with fixed sample data. :::tip Reading this page Command blocks contain only the command, so the **Copy** button gives you something you can paste. Output blocks are what the CLI printed on the author's machine. Your run id (`vendor-dossier--