Manifest reference
A Writ mission manifest is one YAML (or JSON) file. This page documents every field in mission.schema.json, the schema writ validate and writ run both parse against. additionalProperties: false applies at every object level shown here, so an unrecognized field is a validation error.
A mission file is shareable and may be agent-authored. ${NAME} environment-variable interpolation is opt-in per variable, secret-shaped names are refused even when declared, and every output path is confined to the run directory. See Security model and preview limitations before running a manifest you didn't author.
Top level
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
mission | object | yes | — | See mission below. |
env | array of string | no | — | Env vars this manifest may read via ${NAME}. See env. |
model | object | no | — | Model provider config for agent steps and model-backed internal capabilities. See model. |
budget | object | yes | — | See budget. |
settlement | object | no | { mode: simulated } | See settlement. |
approvals | object | no | — | Human-in-the-loop gate. See approvals. |
capabilities | array (min 1) | yes | — | See capabilities. |
workers | array (min 1) | yes | — | See workers. |
work_record | object | no | { signing: dev-ephemeral } | See work_record. |
mission
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
name | string | yes | — | Pattern ^[a-z0-9][a-z0-9-]*$. Slug used in run ids and output paths. |
goal | string | yes | — | What the mission should accomplish. May reference {{vars}}. |
schedule | string | no | "manual" | 'manual' or a cron expression — only manual is executed in v1. |
vars | array of string | no | — | Pattern per item ^[A-Za-z_][A-Za-z0-9_]*$. Names supplied at run time via --var name=value and referenced as {{name}}. A referenced-but-unsupplied var is a hard error (writ run refuses to start). |
Example:
mission:
name: vendor-dossier
goal: "Produce a due-diligence dossier on {{target_name}} ({{target_domain}})"
vars: [target_domain, target_name]
env
env: [DEPLOY_REGION]
Array of environment variable names (pattern ^[A-Za-z_][A-Za-z0-9_]*$) this manifest is allowed to read through ${NAME}. Reading the environment is opt-in per variable: a ${NAME} reference resolves only when NAME is listed here or is prefixed WRIT_VAR_ (an operator-namespaced escape hatch that needs no declaration). Every other reference is a hard validation error naming the variable and both allowed forms — confirmed directly:
Manifest references environment variable '${SOME_VAR}' but it is not allowed to read it. Only two forms may be
interpolated: a name listed in the manifest's top-level 'env:' block (add 'env: [SOME_VAR]'), or a name prefixed
'WRIT_VAR_'. Anything else must be passed with --var.
Secret-shaped names — containing KEY, SECRET, TOKEN, PASSWORD, CRED, NWC, MACAROON, MNEMONIC, SEED, or PRIVATE — are refused even when declared here:
Refusing to interpolate a sensitive environment variable '${MY_API_KEY}' into a manifest. Secret values (keys, tokens,
credentials) must never flow into a manifest field; declaring the name in 'env:' or prefixing it does not change that.
Use a non-secret variable or pass configuration via --var.
A declared-but-unset variable is a hard error too, never a silent empty string. Omit the block entirely for a mission that reads no environment at all. Prefer --var over ${ENV} for ordinary configuration.
model
The model provider for agent steps and for call steps to any internal capability other than compose or compose.*: every such internal capability is a model call, whatever its name. Bring your own model. A mission with no agent steps and only compose/compose.* internal capabilities never invokes the provider, and you can omit this block. writ validate and writ run --dry-run print a note when a mission calls a model, naming what the run will need.
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
provider | enum | no | "anthropic" | One of anthropic, openai-compatible, claude-cli, codex. The two HTTP providers are the default path; the two CLI providers are opt-in (see below). |
endpoint | string | no | — | Base URL for openai-compatible/anthropic. Supports ${ENV} for a declared or WRIT_VAR_-prefixed name. SSRF-guarded: an endpoint resolving to loopback/private/cloud-metadata is refused, and the client follows no redirects. |
model | string | no | — | Model id for the provider. |
api_key_env | string | no | — | Name of the env var holding the API key (the key itself is never in the manifest). May not name a protected Writ/system secret: WRIT_ROOT_KEY, WRIT_RECEIPT_KEY, WRIT_AUDIT_KEY, DB_ENCRYPTION_KEY, NWC_CONNECTION_STRING, LND_MACAROON_HEX, STRIKE_API_KEY, OPENNODE_API_KEY. |
timeout_seconds | integer | no | provider-specific | Per-call LLM timeout override in seconds; at least 1. Omit to use the default: claude-cli/codex default to 1800 seconds (30 minutes) because they run a full headless agentic session (tool use, MCP calls, builds), not a single completion; openai-compatible/anthropic keep their own client default. |
model:
provider: anthropic # default — set ANTHROPIC_API_KEY (or name another var with api_key_env)
Provider notes:
anthropicis the default even when themodel:block is omitted. A manifest whose steps never call a model never constructs or calls the provider, so it needs noANTHROPIC_API_KEY, and its run summary prints noModelline.claude-cliandcodexneed no API key — they authenticate via your existing CLI sign-in — but are opt-in and not recommended for reproducible runs: each shells a local coding assistant that inherits its working directory's project context, so neither is a clean, deterministic model API.- Usage capture (
usage.json). Every provider reports tokens.anthropicprices them from a built-in list-price table, andclaude-clireports its own cost.openai-compatiblereads the response'susageblock (prompt_tokens,completion_tokens, andprompt_tokens_details.cached_tokens, which is moved out ofinput_tokensintocache_read_input_tokens);codexreads theinput_tokensandoutput_tokensof itsturn.completedevents. Neither of those two is priced, so each call counts towardunpriced_calls.reported_cost_usdisnullwhen no call reported a price, so an unknown cost does not read as0; otherwise it equalstotal_cost_usd. Prompt-cache writes thatanthropicreports appear ascache_creation_input_tokens. - When a manifest declares any paid (
l402-http) capability and resolves to a CLI provider (claude-cli/codex), Writ runs a one-time pre-flight probe of that CLI at run start — see Settlement — so a broken CLI is caught before any sats are spent, not on the first model call.
budget
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
total_sats | integer (min 0) | yes | — | Cumulative spend cap for the whole mission, enforced atomically at the credential-chain root. Must be greater than 0 if any capability is l402-http — a zero or missing cap on a mission with a paid capability is refused before it runs (budget.total_sats must be greater than 0 when the mission declares a paid (l402-http) capability; a zero or missing cap would allow unbounded spend.). |
per_call_max_sats | integer (min 0) | no | — | Ceiling for any single capability call. A call is refused before payment if the price exceeds this or the capability's own max_sats_per_call, whichever is lower. |
currency_display | enum | no | "sats" | sats or usd — display unit for human output only. All accounting is in sats regardless. |
budget:
total_sats: 200
per_call_max_sats: 25
writ validate reports the worst-case total (every worker's budget slice charged at its capability ceiling) against this cap, and refuses a manifest whose worker budgets sum to more than total_sats.
settlement
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
mode | enum | no | "simulated" | simulated runs the full pipeline — credential, reserve, pay, settle, receipt — against an in-process L402 endpoint, no real money. wallet pays real Lightning invoices via a detected wallet (LND → NWC → Strike), bounded by the manifest budget. |
settlement:
mode: simulated
See Settlement for the full comparison, including the --production fail-closed posture and the real-money banner writ run prints for wallet mode.
approvals
Human-in-the-loop gate. Omit the block, or leave it empty (approvals: {}), for fully autonomous operation within the budget/scope bounds.
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
threshold_sats | integer (min 0) | no | — | Any single call at or above this sat amount suspends the run for human approval. 0 means every paid call needs approval. |
cumulative_threshold_sats | integer (min 0) | no | — | The total sats the run may spend without approval. A call that would take the run's unapproved spend over this suspends for approval. See Cumulative and windowed thresholds. |
window_threshold_sats | integer (min 0) | no | — | The sats the run may spend without approval in any rolling window of window_seconds. Requires window_seconds. |
window_seconds | integer (1 to 31536000) | with window_threshold_sats | — | Length of the rolling window, in seconds. Requires window_threshold_sats. |
approval_ttl_minutes | integer (min 1) | no | 15 | How long a granted approval stays usable. |
approvals:
threshold_sats: 50 # any single call at or above 50 sats asks first
cumulative_threshold_sats: 200 # at most 200 sats in total without asking
window_threshold_sats: 60 # at most 60 sats per rolling hour without asking
window_seconds: 3600
The block is active when any of threshold_sats, cumulative_threshold_sats or window_threshold_sats is present; each one you omit is off. writ validate refuses a negative threshold, a window_threshold_sats without window_seconds (or the reverse), and a window_seconds outside 1 to 31536000 (one year).
capabilities
Array (minimum 1) of capabilities the mission may call. A worker's scope must reference these ids.
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
id | string | yes | — | Pattern ^[a-z0-9]+([.][a-z0-9]+)*$ (hierarchical, e.g. dns.whois, llm.write). Capability caveats match against this. |
kind | enum | yes | — | internal (in-process, no sats: a model call, except compose and compose.*, which assemble prior outputs with no model), http (plain HTTP, SSRF-guarded, no payment), l402-http (paid per-call over L402). |
base_url | string | required for http/l402-http | — | SSRF-guarded and DNS re-resolved at call time. |
path | string | no | — | Resource path appended to base_url. |
method | enum | no | "GET" | GET or POST. |
max_sats_per_call | integer (min 0) | no | 0 | Per-call price ceiling for this capability. An L402 challenge above this is refused before payment. 0 for internal. |
allow_local | boolean | no | false | Permit loopback/private targets for this capability only (local mock/demo endpoints). Cloud-metadata endpoints are still denied. writ validate flags this loudly. |
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: llm.write
kind: internal
Real writ validate output for a capability with allow_local: true:
!! 1 capability permit LOCAL targets (allow_local):
! capability 'test.local' permits LOCAL/loopback targets (allow_local) — cloud-metadata endpoints are still denied.
A duplicate capability id is a hard error: Capability id 'a.b' is declared more than once.
workers
Array (minimum 1). Each worker receives a delegated child credential — strictly narrower than the mission root (its scope, a slice of the budget, a shorter expiry). Workers run in order (v1 has no parallel execution).
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
name | string | yes | — | Pattern ^[a-z0-9][a-z0-9-]*$. Appears as the actor in the work record. |
scope | array of string | yes | — | The capability ids this worker's delegated credential may call. Must be a subset of the declared capabilities. A worker scoped to one capability gets that exact capability in its credential; a worker scoped to several gets a capability_in caveat listing exactly those ids, so the credential itself refuses anything else. When scope lists more than one capability, each id may contain only letters, digits, ., _, and - (the capability_in member charset); anything else is a validation error (Worker 'w1' scope entry 'c d' may contain only letters, digits, '.', '_' and '-' when a worker is scoped to more than one capability.). The id pattern above already satisfies this. A worker attempting a capability outside its scope is a validation error (Worker 'w1' call step references capability 'c.d' which is not in the worker's scope.) unless the step sets expect_refusal: true. |
budget_sats | integer (min 0) | no | — | Cumulative sat slice for this worker. Sum across top-level workers must not exceed budget.total_sats (writ validate enforces this: Top-level worker budgets sum to 16 sats, which exceeds budget.total_sats (10).). 0 = an internal-only worker with no external spend authority. |
expires_minutes | integer (min 1) | no | 30 | Lifetime of the worker's delegated credential. |
parent | string | no | — | Name of another worker (declared earlier) that delegates authority to this one — a real agent→agent hop: this worker's credential is attenuated from the parent's, not from the mission root. The grant must be strictly narrower than the parent's (scope ⊆ parent, budget ≤ parent, expiry ≤ parent); the authority engine enforces this cryptographically. Omit for a top-level worker delegated straight from the root. A child's budget is a sub-allocation of its parent's slice — it does not count again toward budget.total_sats. |
steps | array (min 1) | yes | — | See steps below. |
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 }]
Steps
Each item in workers[].steps:
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
type | enum | yes | — | call = one deterministic capability call. agent = a bounded LLM tool-loop choosing only among the worker's scoped capabilities. |
capability | string | required for type: call | — | The capability id to invoke. |
task | string | required for type: agent | — | The instruction to the worker model. May reference {{vars}}. |
max_iterations | integer (min 1) | no | 6 | For type: agent: hard cap on tool-loop iterations. Each iteration is one real LLM completion call. |
input | object | no | — | For type: call: structured input for the capability (query params / body / internal-executor instruction). |
output | string | no | — | Filename to write this step's output under runs/<run-id>/ (e.g. dossier.md). Must be a relative path confined to the run directory — absolute paths and .. escapes are refused. The file holds untrusted capability/LLM content; don't open it directly in a browser. |
expect_refusal | boolean | no | false | type: call only: assert this call is expected to be refused by the authority/budget guard (an overreach — out of scope, over budget, expired). A refusal is recorded as a signed denied work-record entry and the run continues. If the call unexpectedly succeeds, the run fails — the delegated bound had no teeth. |
writ run --dry-run's planning estimate for an agent step is max(scoped capability ceiling) × max_iterations, capped at the worker's own budget_sats if set. For the writ init scaffold, whose researcher is scoped to two 5-sat capabilities with max_iterations: 6 and budget_sats: 40:
· infra-researcher/infra-researcher:agent 30 sats planned
work_record
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
signing | enum | no | "dev-ephemeral" | dev-ephemeral generates a throwaway per-run key (loud warning; refused under --production). env reads WRIT_RECEIPT_KEY. key-file reads the path at key_file. |
key_file | string | required when signing: key-file | — | Path to the signing key. |
identity_file | string | no | — | Path to the signer identity record (signer-identity.json, written by writ keys init) for signing: env/key-file. Defaults to the file next to key_file, or WRIT_RECEIPT_IDENTITY_FILE for env. The record is copied into the run directory and its hash is committed into the first receipt. Required under --production; a warning when missing otherwise. |
output_dir | string | no | "runs/" | Root directory for run outputs. Must be a relative path with no .. escape — an absolute/rooted path is refused. |
work_record:
signing: key-file
key_file: keys/receipt.key
output_dir: runs/
See Keys and verification for the full writ keys init → run → writ verify lifecycle, including rotation and revocation.
Where the schema and the real validator agree — and one place they don't
writ validate and writ run share one parser and one validator, so an OK from validate means run accepts the same file. validate lists every validation problem it finds (Manifest invalid (2 problem(s)): and so on); a file that cannot be parsed at all reports the parse error alone.