Skip to content
Engine has no release yet: these pages describe unreleased main.

Configuration

Crewlet splits configuration into two tiers so a founder can evolve the company at runtime (add a role, swap an LLM provider, plug in an MCP server, rotate a credential, update a policy) without redeploying or restarting.


TierStorageOwnerUpdate modelContents
Acrewlet.yaml on diskOps / SRERestart-onlyStore files and the object store’s backend (store.objects), stream and coordination slots, this node’s identity and roles, API host/port and auth, the addresses people, vendors and sandboxes reach it at (api.external_url) with the optional published listener serving them (api.public, api.public.external_url), the secret keyring, the retention estate (store.snapshot_dir, stream.tracker_retention, backup ownership retention.backup_owner), logging (level, shape, optional rotating log file)
BThe store (company_config, versioned)FounderLive, API-editable, validated, versionedEverything else: name, mission, vision, policies, the company’s one clock (timezone), providers (LLM + embeddings), turn engine, learning, MCP servers, delegate workers, scheduling, skill_variables, the tracker, knowledge and chat backends, how long an inbox keeps a notice (inbox.retention_days), notification coalescing and rate limit, integrations (Slack / Mattermost / Jira / Confluence / GitHub / GitLab / Datadog / Atlassian / Cloudflare / Expo / DigitalOcean / Scaleway / Google Cloud, plus the Forge app id that verifies relayed Cloud events), Gitlet, the engine’s own git host (code: whether it hosts the company’s repositories, what a push may hold, the repositories it declares with protection rules (a branch rule’s merge gate among them) and path owners, and the least a merge into any protected branch needs, merge_by_floor), the org chart (roles: and units:), and token budgets

Tier A controls how the engine boots. Tier B is what the company is.

The company’s clock is Tier B because where a company keeps its hours is a fact about the company, and every node must cut the same day from it. It is one top-level timezone, not a host’s clock (Local is refused) and not a zone per subsystem: the tracker’s “today”, a person’s day and the hour a schedule fires are one calendar. See The company’s clock.

roles: and units: are keys of the Tier B document like any other, so a hire, a move and a provider change are the same kind of write: a new revision, activated fleet-wide through the control plane and turned into the running organization once per applied epoch on every node. Edit it whole (PUT / PATCH /config) or one seat or unit at a time (PUT /config/roles/{handle}, PUT /config/units/{id}); see Per-entity read and write.

A seat’s handle and a unit’s key are its identity and never change. Every write mints the ones a document leaves out (a seat’s handle from its name, a unit’s id from its name) before the revision is stored. An edit that starts from the stored document (the org builder, GET then PUT /config, PATCH /config, the per-entity routes) carries them, so correcting a name changes what people read and nothing else: the seat keeps its agent id, mailbox and memory. A file is minted afresh on every import, so correcting a name in one that omits the handle or id replaces that seat or unit: declare both in any file you keep. A different handle is a different seat. See Handles and keys.

Removing a human seat somebody holds is refused. A revision that removes a human seat, or turns it into an agent seat, is refused 409 seat_held naming each holder (an invitation by its id, never its address) when the identity directory binds somebody to it at any stage short of their removal, or an open invitation names it. Free the seat first (move the person to another human seat or remove them; a person’s seat is never cleared; unbind a service account; cancel the invitation), then resend the write.

A company with no human seat can admit nobody. An invitation or a create names the human seat the person will hold, so a company declaring no kind: human seat has nowhere to put anybody. That is right for a company its agents run alone, administered through the deployment’s Tier A tokens, so it is never refused: crewlet validate and every /config write name it in an advisory warning at roles, and every node logs that warning when it applies the company (config_advisory).

The company’s charter is mission, vision and policies: what the company is for, where it is going, and the standing rules it runs by. Every seat is handed all three word for word at the top of its prompt, on every round of every turn, so it never needs a knowledge lookup for them.

mission: Help friends split shared costs fairly.
vision: Splitting a bill is never the awkward part of a trip again.
policies:
- Every amount is exact to the cent.
- Work is tracked on the board, and nothing ships without acceptance criteria.

An administrator edits them on Company › Principles, which writes through PUT /config/charter: a new revision of the whole document, conditional on the charter itself rather than the revision, so a draft is refused only when somebody changed the charter meanwhile.

Every character reaches every prompt, so the charter is bounded, in characters: mission 1024, vision 2048, at most 25 policies of at most 1024 each. The mission and each policy are one line (a seat reads the mission inline and each policy as one list item); the vision may have paragraphs, and the prompt quotes it line by line so no line reads as the prompt’s own. A policy may not be blank or repeat another word for word. Bounds are counted on the stored value, surrounding space trimmed.

These rules judge what an edit CHANGES, against the stored revision it replaces, so an old fault never locks a company out:

  • An edit through the API (PUT /config/charter, PATCH /config, PUT /config from the org builder or a script, a per-entity write, /setup) is refused only for a part it changes and leaves at fault: a mission or vision it edits, a policy it adds or edits, a policy count it raises past the bound, a repeat it adds. Reordering policies changes none. A write that leaves a faulty part untouched (a budget, a seat, another policy) is admitted, with a warning naming the part in its answer.
  • An import never refuses for the charter: crewlet config import into a stopped node, -company and -import-company at boot, a restore, a migration. Faults print as warnings, and every node logs them as org_admission_warning when it applies the company, because refusing would leave an upgraded node unable to boot on its own file. An import to a running node is the same: the CLI sends PUT /config?import=true, which judges the charter warn-only, is admin’s alone and records the revision as imported from a file. The dashboard never sends it.
  • crewlet validate prints the faults as warnings and exits 0: it cannot know what the store holds, so not whether a write would edit the faulty part.

A stored revision that breaks one still applies.

logging:
level: info # debug, info (default), warn, error
format: console # console (default), text, json
stderr: true # default. false hands the stream to the file below,
# and needs one — a node logging nowhere is refused
file: # optional — a durable copy, IN ADDITION to stderr
path: "/var/log/crewlet/${CREWLET_NODE_ID}.log"
format: json # empty follows logging.format
level: debug # empty follows logging.level
max_size_mb: 100 # rotates here; there is no "never" (default 100)
max_backups: 5 # `.1` (newest) … `.5`; 0 keeps none (default 5)
node:
id: "node-0" # optional; see below
stream:
type: embedded # a JetStream server inside this process; `nats` points
# the same slot at an external server or cluster
store_dir: "./crewlet-data/stream"
store:
path: "./crewlet-data/company.db" # ONE file, owned exclusively
coordination:
type: local # one node; a fleet needs `embedded-kv`
api:
host: "0.0.0.0"
port: 8000
auth:
tokens:
- id: founder
token: "${CREWLET_API_TOKEN_FOUNDER}"
- id: ops
token: "${CREWLET_API_TOKEN_OPS}"

Names this process within the company. It labels every log line and the /health payload: the difference between “a config apply failed” and “the config apply failed on node-2”, and the only way a caller behind a load balancer can tell which process answered.

Resolution order: node.id (a ${VAR} reference works, as in any Tier A text field, and the resolved id is judged by the rules below; see Environment Variable References for reading a number or boolean field) → the CREWLET_NODE_ID environment variable → node-0. A single engine needs none. It starts with a letter or digit and holds only letters, digits, ., _ and -, at most 64 characters, because it ends up in broker consumer names and subjects; an operator gesture naming a node, such as crewlet retention evict, holds its id to the same rule. One id of that shape is reserved: operator, under which the fleet’s backup register files the operator’s acknowledgements, so a node of that name would have its own backups read as one.

It must be stable across restarts, so it comes from the deployment rather than being generated per boot: anything registered under it would otherwise be orphaned on every restart. In Kubernetes use the pod name (a StatefulSet ordinal is ideal); under systemd, the host name.

What this process is willing to do. Five roles; the default is all five, one process running a whole company, which is every single-node deployment:

node:
id: "${CREWLET_NODE_ID}"
roles: [seats] # a stateless satellite: agents only, no data
labels:
zone: eu
RoleWhat it doesWhat a fleet loses without it
dataKeeps the company’s durable state on this node’s disk: a copy of the replicated estate and the event log. The company’s files are not under it: they are in the object store, which on the default nats backend is a stream the broker’s members keep. It says nothing about the broker (see below). ingress and workers require itEvery seat’s tracker, knowledge and chat tools, which a node without data answers through one that has it
gitletServes the company’s git repositories where its company sets code.backend: gitlet: keeps a disposable cache of them on this node’s disk (gitlet.cache_dir, below) and runs git for their clones, fetches and pushes. Its routes are the API’s, so it requires ingress. It does nothing for a company that hosts no codeNobody can clone, fetch or push the company’s repositories — said only where the company sets code.backend: gitlet
ingressServes the HTTP API: webhooks, the dashboard, the REST endpoints, and the tool bridge (/mcp/{token}) every seat’s executor reaches its tools through from its box, which relays each call to the node holding the run’s seat — served where the node is given CREWLET_MCP_BRIDGE_URL, or, for its own direct boxes alone, where it runs seats too (Running a Fleet). A node without it serves the network only its probes on api.portNo integration can reach the company, no executor run can reach its tools, and there is nothing to look at
seatsClaims seat leases and runs agents, and answers their executor runs’ tool calls: a container box reaches it through an ingress node’s tool bridge at the fleet’s CREWLET_MCP_BRIDGE_URL, and a direct box dials its own node’s listener on loopback — on a node without ingress, api.port, where the node serves its own host the bridge beside its probesEvery trigger queues up unread
workersThe company-wide singleton duties: the scheduler tick, the maintenance sweep (retention, removed-seat mailbox retirement, and forgetting the chat read state and Home board of a human seat the company no longer has), the state logs’ trim, the embedding duty, the launch-node watch, the integration reconcile loop, the atlas collect duty, the atlas wake duty, the object store’s collector, the trash reaper, the identity sweep, Chatlet’s message horizon, the code-retention duty, the delegated decisions sweep, and the learning background passes (episode lifecycle, skill curation, clustering and promotion)Nothing fires on a schedule, no node that left for good has its launches ended (a box is its launching node’s own, polled there under no duty), no table is swept, no state log is trimmed (each grows until its ordinary writes are refused log_full), no knowledge is embedded for semantic search, no integration is reconciled, no unnamed object is collected, nothing in a trash is purged past its term, the identity estate’s retention never runs, no chat message is pruned at its room’s horizon, and no deleted repository is purged

Subtracting a role subtracts it from this node, never from the company, so the fleet still needs every role somewhere. The engine checks this against live node presence and logs fleet_role_unmanned when nobody does a job. gitlet is checked only where the company sets code.backend: gitlet. A role that stops being needed while nobody held it is logged as fleet_role_unneeded, never as a node coming back. A node that does not run seats is left out of the denominator its peers divide the seats by; counting it would strand the difference.

A node that lists its roles serves git only if it names gitlet. An undeclared node has every role, so a single-node deployment, and every fleet that never wrote node.roles, serves git as soon as its company sets code.backend: gitlet; a node whose list leaves gitlet out serves none.

data is the one role that promises something about the disk. A node without it keeps nothing that must outlive it, and Tier A holds it to that whatever its broker: store.scratch: true is required (its store is deleted at every boot), and store.replicated_path and store.snapshot_dir are refused. store.objects is not refused: it names the one store the whole fleet keeps its files in, and a node without data uploads and downloads through it directly. See Running a Fleet.

The broker is not a role. A node’s broker kind is derived from the stream block and nothing else:

Broker kindThe stream block that makes itWhat the broker is
memberembedded, with no stream.leaf.urls (a solo node included)runs JetStream in this process, holds stream replicas, votes in the metadata group
leafembedded, with stream.leaf.urlsJetStream off: reaches the members’ across a leaf link, holds nothing, votes in nothing
clienttype: natsa plain client of an external cluster somebody else runs

Every node advertises its kind on its presence lease (crewlet fleet broker list and the dashboard’s Settings › Nodes screen show it); a newer build’s unknown kind shows as unknown. Broker rules are asked of the kind, whatever the roles:

  • A member (a solo node included) must set stream.store_dir: it holds every reaching node’s streams, its own state logs among them, and an in-memory stream leaves a node unable to serve after its first restart.
  • A leaf carries no cluster block, no store directory, no leaf listener and no declined stream.sync: it runs no JetStream, so has no file store.

Three pairings are refused, each refusal naming both ways out: a data node on a leaf, a broker member without data, and ingress or workers without data. A node without data on an embedded stream joins as a leaf through stream.leaf.urls. gitlet without ingress is refused on every broker: its routes are served on the API listener, which only an ingress node mounts.

Two valid shapes are warned about, by crewlet validate and at every node start (logged as config_advisory):

  • a member whose peer list names more than four other members (no stream keeps more than five copies, so a sixth member votes and holds nothing; add leaves instead);
  • a fleet node that left node.roles undeclared and so runs every role. The start judges the roles it runs with, so a node given -roles is not told they are undeclared.

How a node with the gitlet role serves the company’s repositories. Every field is a fact about this node’s machine, so the block is Tier A, read once per process:

gitlet:
cache_dir: /srv/crewlet-git # default <store dir>/git; a volume of its own
cache_max_bytes: 214748364800 # default: derived at boot, see below
max_processes: 0 # default: one a core (GOMAXPROCS)
max_transfers: 0 # default: four a process slot, by memory
max_checks: 4 # default: a quarter of the cores, at least one
import_allow_private: false # default: dial only the public internet
  • cache_dir: where the node keeps its disposable copies of the repositories. A relative path resolves against the store’s directory, as store.snapshot_dir does. A volume of its own (own filesystem, own space) is recommended: a btrfs subvolume or ZFS dataset drawing on the store’s pool shares that pool’s space, and the engine reads it as shared whatever recordsize is tuned. The cache is never backed up: it is rebuilt from the code log and the object store, and its CACHEDIR.TAG keeps tar, borg and restic out of it with --exclude-caches. A directory that holds the store, the replicated estate or the snapshots is refused at crewlet validate, because the cache empties its own tmp/, scratch/ and trash/ at every boot.
  • cache_max_bytes: the budget the cache evicts down to, least recently used first; at least 1 GiB when set. Unset, it is derived at every boot from the room the cache can use: the volume’s free space, plus what the cache already holds (so a warm node’s budget does not shrink at every restart), less what an embedded broker storing its streams on the same volume may still write under its limit (stream.store_max_bytes, or three quarters of the free space when unset), less the request spools’ allowance (64 MiB a transfer slot, on this volume and never in the budget) and the revision facts’ patch spools (two patches at once of up to 256 MiB each, 512 MiB, there too). The cache takes half of that room where the volume also holds the store, the replicated estate, the snapshots or the broker’s streams (the rest is for them to grow into), and seven eighths of a volume of its own (the eighth is for removals in flight and a new index written beside the old). Never more, no floor, no ceiling. The node logs what it chose, and every figure it chose from, as code_cache_sized, as a warning naming what to change where a derived budget is under 1 GiB or an explicit one is more than the room. A volume with no room at all derives no budget, and the node refuses to build Gitlet: the boot (or the apply that brings Gitlet up) fails naming the figures and what to change: a volume of the cache’s own, cache_max_bytes, a lower stream.store_max_bytes, or fewer max_transfers. On the single-volume layout that is a cold cache whose quarter of the free space is no more than the spools: under 16 GiB free on a sixteen-core node’s default lane.
  • max_processes: the git processes the node runs at once to answer reads, one core each, and half as many again for its caches’ background maintenance. 0 is one a core.
  • max_transfers: the clones, fetches and pushes the node serves at once. 0 is four for each process slot, and no more than one for every 512 MiB of the memory the executor’s pools leave (Memory): a transfer holds memory for its whole life and a core only now and then, so size it to memory. A figure set by hand is taken as written, and the node keeps 224 MiB of its memory for every transfer it names whatever they serve, beside 896 MiB for each core its memory backs at 2 GiB a core, both of what the executor’s pools (107 MiB, or 1 889 MiB on a node running seats too), the answers in flight (284 MiB), the store’s page cache and the read lane (128 MiB a core) leave; the caches’ background indexing has what is left. So a figure well short of what that memory holds at 224 MiB each already leaves it nothing — as little as 56% of that, where the node has a core for every 2 GiB of memory or more: on 16 GiB and eight cores, 42 transfers, of the 73 that 16 GiB holds — every repository’s bitmap is refused, and code_maintenance_refused says so until the figure is lowered or unset, or the node is given memory past what it keeps, in place or at a boot. A restart alone changes nothing.
  • max_checks: the company’s checks this node runs at once in container cells, each a container on this machine running a repository’s build or tests. Unset is one for every four cores (GOMAXPROCS), at least one; 0 is none, leaving the company’s container checks to its other Gitlet nodes; at most 1 024. Deployment says how to size it.
  • import_allow_private: lets the git this node runs dial a host on a non-public network (a forge on the node’s own network, at a loopback, link-local, private or unique-local address). It governs every host a Gitlet node dials for the company: an import’s source and both kinds of mirror, pull and push.
    • Off, the engine resolves the host itself before git runs and refuses it when ANY resolved address is not on the public internet, judged as the artifact CDN fetch judges one. Git is handed exactly the addresses judged, so it never asks DNS again. On, the host’s addresses are pinned as they resolve.
    • An IPv6 address under a NAT64 prefix is judged by the IPv4 address it carries where the prefix is the well-known 64:ff9b::/96, or one the network’s own resolver names in global unicast or in 64:ff9b:1::/48. A network translating through a unique-local prefix reaches no IPv4-only forge this way; name a proxy in HTTPS_PROXY. A resolver that fails the prefix lookup, rather than answering it has none, fails the dial, which is worth retrying.
    • Either way the dial is https alone, follows no redirect, verifies TLS, and carries its credential in git’s environment rather than its command line.
    • A proxy the node’s environment names for the host (HTTPS_PROXY, with NO_PROXY read as the engine’s own clients read it) is dialed as itself whatever this says: the proxy resolves the host, so what it may reach is its to decide.
    • The certificate authorities git trusts are the process’s: SSL_CERT_FILE, and the one directory SSL_CERT_DIR names; a list of several is refused at the dial, since libcurl reads one.

A gitlet block on a node whose roles name no gitlet is read by nothing, and crewlet validate warns about it.

Two consequences belong to neither file alone. They are said wherever both are in hand: by crewlet validate given both files, in the answer of a configuration write (PUT or PATCH /config, and the dashboard) judged against the Tier A of the node that served it, and in the node’s log as config_tier_warning, once per node per applied epoch:

WarningWhereWhy
A company with code.backend: gitlet in a fleet on the default object storestore.objects.backendEvery broker member holding a copy of the files bucket holds every pack of every repository; a company whose code outgrows a member’s disk takes store.objects.backend: s3
A Gitlet node whose cache budget is below code.limits.repo_max_bytesgitlet.cache_max_bytesA repository at its size limit cannot be cached within the budget: it is served, and evicted as soon as it is idle, so every fetch of it is a cold sync

crewlet validate and a configuration write compare only an explicit gitlet.cache_max_bytes: a derived budget is a share of a volume neither file describes. A Gitlet node compares the budget it resolved (derived from its volume where unset, the default) at every epoch it applies, and names where the budget came from.

Free-form facts about where this process runs, matched by a seat’s role.placement selector. Values are strings compared exactly, so key and value are trimmed of surrounding whitespace first, and two keys that are one once trimmed are refused rather than collapsed.

  • A key is at most 63 bytes (Kubernetes’ limit on a label name) and holds no whitespace or unprintable character.
  • A value is at most 64 bytes (a seat handle’s width, which holds Kubernetes’ 63) of printable characters: a space inside is fine; a tab, control character or line separator is refused.
  • A node carries at most 16 labels: the presence lease is re-sent on every heartbeat and the coordination store bounds what it carries (The presence’s bound). A 17th label, or a value past 64 bytes, is refused by crewlet validate and at startup, naming node.labels or the key. The published schema states the count, so an editor flags a 17th label as you type; the byte bound cannot be expressed in a schema, so crewlet validate checks it.
  • Labels are advertised on the presence lease, so a change takes effect one heartbeat after the restart that made it, not at the next config activation.

Nothing here means anything to the engine on its own: the org decides what to select on.

Everything that defines the company — see examples/nimbus.company.yaml for a complete working document, and the configuration reference for every field including the ones that example does not use.


The engine boots in this order:

  1. Read crewlet.yaml (Tier A only — the store path, the stream, coordination, api host/port/auth, secrets, logging)
  2. logging.Configure(level, format, stderr) — once, in cmd/crewlet, the only thing that sets the console destination; a later command changes only loudness with SetVerbosity. Level and format come from the file’s logging: block with any -log-level / -log-format / -debug flag folded in, only where given. Lines emitted before this (the file’s own ${VAR} warnings, a refused field) come out under the flags alone.
  3. logging.SetFile(…) if logging.file.path (or -log-file) names one: a second destination by default. Stderr keeps every line and the file has its own handler, so it can carry json at debug while the terminal keeps columns at warn. logging.stderr: false hands the stream over to the file instead, and is refused with no file. It opens before the store and the stream, so their failures are in it. A path that cannot be opened stops the boot, naming the path (every other bad logging value resolves to a default, but a durable record asked for and silently not delivered is worse). A boot that fails on the Tier A document itself never reaches this step, so stderr is the only record of it, logging.stderr notwithstanding.
  4. Hold the Tier A this process is about to run (the file with every run flag applied: -roles, -api-host, -api-port and the four logging flags) to Tier A’s rules once more. A flag reaches every rule that reads what it moved (-api-port on a file with no api: block turns on an API that has to name api.external_url), so crewlet run asks before it binds or opens anything, and its refusal names the flags. Then every advisory Tier A raises is logged, one config_advisory line at WARN each, on that same document (see what every start says)
  5. Bind api.host:api.port (and api.public.port and api.artifacts.port on an ingress node that sets them) and log api_bound. A port somebody holds fails the boot here, before anything slow has run. Until step 13 the sockets answer as a starting node: /health 503 with "phase": "recovering" until step 11 and 200 with "phase": "preparing" from step 11 to step 13, /ready 503 starting throughout, and every route the node will serve 503 starting with a Retry-After (see While a node is starting)
  6. Decide, once, what the Tier B file on the command line is for and what the engine starts on. The engine’s start and the import in step 12 both take this one decision, so the engine never starts on a file the import then ignores.
    • On a data node, read the revision its own store boots on (is_active) and the fleet’s revision as the node last saw it (is_fleets); this opens and migrates the store and closes it again. The process keeps the store’s lock until the engine opens the same file in step 8. Meanwhile a command that opens this node’s store meets it as it meets a running node: crewlet config activate, rekey or show, crewlet migrate and the rest are refused, naming it; crewlet config import and the commands that reach the fleet’s secret store (crewlet secrets, crewlet llm, the provisioners) go to its API instead, which answers 503 starting until step 13, so run them again once the node serves.
    • A start with -import-company reads no store here and takes no lock until step 8, so a stored revision this build cannot run does not refuse the boot that replaces it.
    • The revision it boots on is the last one its engine applied, or a change an offline command made on it (see Versioned Revisions): at the instant of the activation it applied, or at no instant for an offline change the fleet has not taken yet, which the first apply of the activation that publishes it stamps. A node that refused the fleet’s revision starts on what its boot row names (the one it was serving, unless the write moving the row was still being retried when the node stopped, which leaves the one before), never on the one it refused.
    • A -company file beside it is either that revision byte for byte or one the store’s company outranks, which is logged as company_seed_ignored. A node that boots on nothing but has seen the fleet run a company (it joined and refused that company’s revision, or never finished applying it) starts with no company, and a -company file is ignored there the same way.
    • With neither, or with -import-company, the engine starts with no company and the file is considered for import in step 12, once the fleet’s pointer can be read.
    • A node without data reads nothing here (its store is scratch) and starts with no company. On a managed deployment a -company file is not read at all, and the node decides as one given none.
    • The engine never starts on a Tier B file: building a company starts its tool servers, restores its harnesses’ logins and opens the store at its embedding width, and the reconcile that would replace it undoes none of that.
  7. The engine holds Tier A to its rules again as it starts, before it starts the stream or opens a store of its own, because a bootstrap a tool built in code reaches it having passed no rule
  8. Start or dial the stream, then open the store file. An embedded member first takes stream.store_dir’s lock (crewlet-broker.lock, inside the directory), because nats-server takes none and would accept a second broker writing the same store: a directory another broker holds (another engine’s, or a crewlet command’s while this engine was stopped) refuses the start, naming its holder. The broker then recovers its file store, which takes as long as the store is large. A node without data opens a scratch store, deleted at every boot, and joins the members’ broker as a leaf
  9. Run migrations — every file, in one pass, with no lock and no phase ordering: this process owns its file, and no DDL depends on a value only the config knows. Embedding columns are declared as plain blobs and the vector width is validated in Go against the company at write time (see crewlet migrate).
  10. Start the core runtime — on every data node, with a company or without one: the state log for every registered domain, the node gate over every identity-claiming log, the identity estate with the loops that keep this node’s view of it, and, on a node that publishes, the log’s own trim and the identity duties. None of it depends on a company, and a node with none is the one that has to sign a Tier A token’s session in (ingress requires data, so the node anybody signs in on always has it), because the dashboard creates the company through that session; the company’s first person is invited or created once it declares the human seat they will hold. It is every domain because a join replaces the whole replicated file, a snapshot names every registered domain, and the trim counts nodes per log: a node that applied part of the register could neither adopt nor donate, and would pin the other logs’ trims while up. A node without data starts none of it: it applies no log, and reaches the estate, the identity directory included, through a node that holds it (A node that holds no data)
  11. The node has recovered what it holds. It logs engine_recovered, and /health turns 200 with "phase": "preparing". Everything above is the node’s own and is bounded by the deployment’s startup probe (a data node’s join in step 10 included, when a fleet’s logs can no longer bring its rows level, which is why that probe is sized by stream.tracker_retention.rejoin_window on a data node of a fleet). Everything below is the company’s, which no probe bounds: a part that waits on something else has its own bound, and the apply has none beyond its parts’ (see Sizing the startup probe). The state logs step 10 started catch up in the background from here, and hold the node’s seats rather than its probes. Then, with the revision step 6 chose:
    • A company: apply it, which spawns the full company: the sandbox backends it configures, the Worklet, Doclet and Chatlet halves it declares (their writers and readers over the logs step 10 applies, their lexical index and chat’s keyword index, change feeds, embedding duty and chat’s message horizon), and its seats’ tools, the shared MCP servers among them, each within its own startup_timeout_seconds
    • No company: the engine stays unconfigured. The API serves from step 13 so an operator can push the first revision via PUT /config or crewlet config import, and a Tier A token’s session signs in (how the dashboard creates the company). Nobody can be invited or created yet: every person holds a human seat the company declares. A node whose file step 6 decided to import builds that company in step 12, before any seat is claimed
  12. Start the control plane: import the Tier B file where step 6 decided to, or otherwise publish what this node knows.
    • Import: -company only where the fleet runs no company either, create-only (of two nodes starting a fleet’s first company one wins and the other defers); -import-company where it differs from the revision the fleet runs, unconditionally (the one activation that expects nothing of the pointer).
    • Publish, by a compare-and-set against what the node was built on:
      • a change an offline command made on this node, only while the fleet still runs the revision that change was built on (or the earlier offline change it replaced, where a start published that one and could not confirm it);
      • the company this node knows, create-only, where the fleet’s pointer is gone;
      • the fleet’s revision this node last saw, where the pointer is a restore (put back by a node after the coordination store lost it) of a revision this node holds that was activated before it: a pointer recreated over a fleet that had moved on. A pointer somebody chose is the company, however old its instant reads.
    • A change the fleet moved on from is not published, and every boot says so at warn as offline_revision_not_published, for as long as the node boots on it (see Control Plane § What a booting node publishes).
    • A file about to be imported is first held to every rule a written document meets and built as this node’s apply would build it (the company over this node’s ${VAR} chain, and the sandbox catalogue it configures), because nothing else builds it before the whole fleet is pointed at it. A file this node cannot build (a ${VAR} that resolves to nothing where a backend refuses an empty value, a harness whose profile cannot be loaded, a sandbox cell this host cannot run) refuses the boot with nothing stored or activated.
    • Then one reconcile against the activation pointer runs (on a node that booted with no company and finds one active, the just-imported file included, this builds step 11’s company), before the loop that polls the pointer. That loop, and a broadcast crewlet.config.revision_activated nudge that wakes it early, run from step 14 on. That reconcile failing does not fail the boot: initial_reconcile_failed says whether the node still serves the company it started on or, having started on none, serves none until a later tick applies the fleet’s revision; a part of the apply that could not start (the inbound edge, the native halves) is started again by that tick
  13. Hand the listeners the API inside this process (auth middleware, the /config/* routes and the rest) and, when api.public.port is set, the routes a vendor or a box calls (/webhooks/*, /otlp/{token}, /mcp/{token}, and a Gitlet node’s /box/git/* and /box/gitlet/*, where a box reaches Gitlet) on that second listener instead (see Deployment → Exposing webhooks without the admin API). A node without the ingress role serves the network only its /health and /ready probes on api.port, and, to its own host’s loopback alone, the tool bridge and telemetry receiver its own direct boxes dial: an executor run in a container box reaches its tools through an ingress node’s bridge, which relays each call over the broker. Logged as api_listening (api_probes_listening)
  14. Start the engine — claim this node’s seats, each with its per-role MCP children — and the reconcile loop

A boot that fails leaves nothing running. Any step can fail (an unreachable broker, a keyring the node cannot open, a provider whose model is a ${VAR} nothing sets), and the node then unwinds everything the earlier steps started, in shutdown order: the state log’s apply loops and its snapshot donor, the shared MCP child processes, every duty loop, this node’s publish admission, and the store file and stream it opened itself. So a supervised crewlet run retries onto a clean host rather than contending with its own previous attempt (one process owns the store file exclusively, and a second open behind a leaked handle fails with a locking message naming neither the original failure nor the file). The engine_boot_abandoned line says the unwind finished.

Option 1 — bootstrap before run (CLI):

Terminal window
crewlet config import company.yaml # one-shot bootstrap of Tier B
crewlet run # boots from ./crewlet.yaml + the store

Option 2 — run first, configure the running node:

Terminal window
crewlet run # boots in UNCONFIGURED state
crewlet config import company.yaml -summary "initial bootstrap"
# Detects the running engine, goes through its API, and every node
# reconciles onto the new activation epoch — no restart needed.

The same thing by hand, which is what the CLI is doing:

Terminal window
curl -X PUT https://crewlet.example.com/config \
-H "Authorization: Bearer $CREWLET_API_TOKEN_FOUNDER" \
-H "Content-Type: application/yaml" \
-H "X-Summary: initial bootstrap" \
--data-binary @company.yaml

This is also how you change a company that is already running: the same command, against a node that already has one.

crewlet run defaults -config to ./crewlet.yaml and -company to ./company.yaml in the working directory. A missing ./company.yaml is not an error: a node starts on what its store says, never the file, so with no Tier B file it boots on the revision its store boots on, or unconfigured when it holds none.

-company only ever bootstraps a company that does not exist yet: none the node’s store boots on or has seen the fleet run, none the fleet runs, and only while the fleet runs no company either. A node whose own store is empty (one without data, at every boot, or a data node joining a running fleet) leaves the fleet’s company alone and converges on it. Once a company exists the file is ignored, with a company_seed_ignored warning naming it and the revision that outranks it, and the node starts on the company that exists (the revision its store boots on, or none until its first reconcile applies the fleet’s). So a restart cannot revert a change made live, and what the node builds once per process (the native halves — Worklet, Doclet, Chatlet and Gitlet, the code sandbox’s runtime, the store’s embedding width) comes from the company it serves, not even for the moments before that reconcile. An empty store is not a company with none: a fresh node joining a running fleet has one, and so does every node without data at every boot, and each defers to the fleet’s company (silently, when the file is the very revision the fleet runs). The warning’s hint names the other intents, which the table gives:

I want to…Use
start a company at its first bootcrewlet run -company company.yaml (the default)
change a running fleet, no restartcrewlet config import company.yaml while this node’s engine is up, or with -api naming any node that is: it goes through that node’s PUT /config
change the company from a stopped nodecrewlet config import company.yaml, then start the node: it boots on the import and publishes it only while the fleet still runs the revision the import was built on (below)
make a file the company again on restart, whatever the fleet runscrewlet run -import-company company.yaml

-company and -import-company together are refused: they ask for opposite things, and silently picking a winner would be doing so about the flag that overwrites a running company.


Until a node’s engine has a company (none in its store to boot on, none applied since start), it holds an empty Organization (no name, roles or units), an empty provider map, no running MCP processes, no integration clients, no notification transports, and no Worklet, Doclet or Chatlet halves.

What stays running:

  • The Tier A resources: the stream, the store’s files, the API socket.
  • The core runtime, on a data node (Bootstrap Sequence step 10): every domain’s state log, the node gate and the identity estate, plus the trim and identity duties on a node that publishes. So an unconfigured node signs a Tier A token’s session in (how the dashboard creates its company) and can be evicted from and readmitted to the logs it is counted on. It cannot yet put anybody on a seat: every person holds a human seat the company declares, so an invitation or create naming a seat answers 409 no_active_revision, as GET /iam/seats does, until a company declaring one is applied. Then the first person is invited or created onto it under a Tier A token like everybody after (crewlet iam invite -seat, crewlet iam create -seat).
  • The API’s /config/* routes and the node’s reconcile loop, which is what wakes an unconfigured node when the first revision lands.
  • A structured log line carrying state=unconfigured.

What returns degraded responses:

RouteBehaviour while unconfigured
GET /health200 {"status": "unconfigured", "node": "node-0", "configured": false, ...}: 200 because the status code is liveness; read configured for readiness
GET /ready503 {"ready": false, "configured": false, "reason": "unconfigured", ...}: an unconfigured node cannot verify a webhook signature, so it stays out of rotation. reason names what took it out (unconfigured here); every reason /ready can name, in precedence order, is in the routes table
GET /config404 {"error": "no_active_revision"} with a hint, while the fleet has no activation pointer and this node has never seen one name a revision. Every /config answer is the fleet’s (Live Propagation), so a node that is unconfigured beside a fleet running a company (not yet applied, or refused) answers that company like every other node; one that cannot read the coordination store answers 503 unavailable with a Retry-After
GET /config/revisions200 [] from a store holding no revision
PUT /configAccepted, creating the first revision, as long as the FLEET has no company either. The write is create-only at the pointer: if another node’s first company lands first, this one is refused 409 revision_advanced naming it (412 already_configured with If-None-Match: *), its own revision kept as history. Where the fleet runs a company, the write is built on it like any other and If-None-Match: * answers 412 already_configured naming it. Send no precondition, or If-None-Match: * to insist nothing is configured yet; an If-Match names a revision, so with no company it answers 412 no_active_revision
POST /config/revisions/{id}/revert404: no revisions exist yet
Per-entity routes (PUT /config/roles/{handle}, /config/units/{id}, /config/llm-providers/{key}, /config/mcp-servers/{name}) and PATCH /config409 Conflict while the fleet runs no company (they edit a document and there is none); initialise via PUT /config first. Beside a fleet running one, they edit that company’s document
GET /agents, GET /tokens/breakdown200 with empty lists / zero counters
/auth/*, /iam/*Served as on a configured node (they are the core runtime’s). What names a seat answers 409 no_active_revision, since there are no human seats to check against: GET /iam/seats, an invitation, a person’s create, a bind
/worklet/*, /doclet/pages/*, /chatlet/*, /operator/mcp, and the work, page, chat and search questions503 no_active_revision with a 15-second Retry-After; over the socket, an unavailable frame naming the same refusal with the same retry_after and words. The routes are mounted and say why they cannot serve, rather than answering the 404 of a missing route. They read the halves per request, so the first company’s apply brings them up with no restart. A company keeping its tracker, wiki or chat on a vendor answers that half’s routes with 404 from then on, while /operator/mcp keeps serving whatever it keeps natively beside the seat controls every node serves
POST /webhooks/...Answered before the signature check (a node with no revision has no secrets to check, and verifying first would answer every delivery with the no-secret refusal and its five-minute wait) as 503 no_active_revision with a 15-second Retry-After, so the sender retries; webhook_rejected_unconfigured is logged at WARNING with the source and event. A 200 would tell the sender the delivery was accepted while discarding it, an unrecoverable loss when one process of several has merely not caught up. See Webhook refusals

Transition out of unconfigured: the first activation moves the pointer, the reconcile tick picks it up, the apply runs, and the spawn cascade executes, including everything boot starts only for an existing company: the three halves with their tools, the projects, knowledge containers and rooms the org chart’s units declare, the code sandbox’s coordinator and completion poll, the reflect dispatcher and the inbound edge (see the native, sandbox_runtime, learning, integrations and maintenance stages below). The engine is fully alive with no restart. The already-serving API answers for the new company too, since it reads the native halves at every request: the board’s, pages’, file list’s and ranked search’s questions, the routes over them, and the operator’s tools (the catalogue behind the dashboard’s buttons and an operator’s assistant, /operator/act and /operator/mcp, is built per call), so the person the first revision invites can file a task from the dashboard at once (see /operator/mcp). The dashboard shows the state in always-on chrome (a caution banner that inbound webhooks are refused, an engine pill, the first row of the overview’s attention queue), cleared on the next health tick once /health reports configured: true. See the attention queue.


An empty providers.llm is valid: an org chart written before its credentials exist, and what a company created in the dashboard’s org builder is until a provider is added. crewlet validate accepts it (reporting 0 LLM providers), PUT /config and its dry run accept it, and every node applies it: the fleet view reports ok, agent seats are placed, and their mailboxes attach and keep what arrives.

No seat can take a turn, and each node handles that the same way:

  • It logs company_has_no_models when the revision becomes current, naming providers.llm: the line to look for on a company nobody has messaged yet.
  • It holds every delivery to a seat on that seat’s inbox: the inbox is paused and the delivery requeued, never consumed, and the node logs seat_inbox_paused naming providers.llm.
  • The apply that adds a provider releases every inbox the node paused (seat_inbox_resumed), and the held work runs on the new provider; nothing sent meanwhile is lost. A line with held_again=true met a pause taken against a no-provider revision while the release was in flight: that inbox stays held until a revision with a provider releases it.
  • The revision that adds the first provider to a company with an agent seat must configure providers.sandbox in the same edit (every agent seat’s executor runs in one of its cells), or it is refused at providers.sandbox, naming the first such seat. local: {} with default_run_in: direct is the engine host itself (see Code Sandbox).

Schedules do not fire while the company has no provider: firing is work on a seat’s inbox, so firing through the wait would stack every missed standup behind the hold and run the backlog at once. The scheduler stays disarmed and each node logs schedules_waiting_for_a_model; the apply that adds a provider arms it, and its first tick catches up at most the most recent missed fire (Scheduling).

Learning work that calls a model is not built for such a company: the persist decider, the skill synthesizer and refiner, the counterparty profiler that run after each turn, and the background compaction, clustering and promotion passes. The apply that adds a provider builds them all. The skill curator calls no model and runs as usual.

A delivery is held rather than failed on purpose: a turn that cannot build its runner proves nothing reached outside the engine, so the dispatcher would hand it back to the broker, which would redeliver until its delivery budget ran out and then drop it, losing every message sent before the provider arrived.


When a revision is activated (via PUT /config, PATCH /config, a per-entity write, a revert, or crewlet config import through a running node), it is stored, its sealed document is written to the coordination store under its digest, and the fleet’s activation pointer is then moved to it, naming that body; the pointer’s own KV sequence is the epoch, so two activations never share one. Every node polls the pointer and converges onto it; a broadcast crewlet.config.revision_activated event wakes the poll early but carries no work. A crewlet config command run while the engine is stopped cannot move the pointer; what it writes is an offer the node’s next start publishes.

The two steps are not one transaction and span two stores: the node’s database and the coordination KV. The order is deliberate: a crash between them leaves a revision nothing points at, inert and replaced by the next activation, where the other order would point the fleet at bytes no node had stored. The revision is stored as history and becomes what a node boots on (the writing node included) only once that node’s engine has applied it: a write that lost its compare-and-set stays inert history, and a revision a node refused is never what it starts on. See Control Plane § The company, and what each node keeps of it.

There is no leader, so any node’s API may write. The flip is a compare-and-set against the revision the write was derived from, so two operators cannot silently overwrite each other: the loser gets a 409 naming what won, not a 201 for a change the fleet never took. See Concurrent writes.

That revision is the fleet’s, on whichever node serves the write. GET /config and its entity-tag, the revision list’s is_active, a diff against active and the base every write is built on all answer the revision the pointer names, never the one the serving node runs. A node that has not reconciled since the pointer moved answers from the body the pointer names, and one that refused the revision still answers it, so the read after a write answers the write and an If-Match from one node’s entity-tag lands on any other. What each node runs is separate: GET /fleet gives it per node. When the coordination store cannot be read, a /config request needing the fleet’s revision (every read above, every write) answers 503 unavailable with Retry-After: 2 rather than a guess, since “the fleet has no company” is the guess that sends a create-only write to replace the company it has. See Control Plane § Every config answer is the pointer’s.

The nudge carries no work, and that is load-bearing. A group subscription is a work queue (exactly one member of a group receives each message), so a revision delivered that way would be applied by whichever process won it while every other node kept serving the previous company. Polling a pointer inverts that: every node reads the same value, and a lost nudge costs a poll interval, not a revision. The full mechanism (the pointer and epoch, what a lagging node does about its traffic, the operator surface) is Control Plane; what follows is the apply itself.

Converging applies the payload. Engine.Apply is a straight line with no comparison and no early return: no apply lock, no payload short-circuit, no rollback of captured state. It rebuilds the whole epoch in a fixed order and names each stage it got through.

  1. secrets: re-read the secret store and install a fresh resolver snapshot. First, because re-activating an unchanged revision is the rotation gesture: the payload has not moved, so only what its ${VAR} references resolve to can have.
  2. company: validate and build the new epoch, resolving ${VAR} where each provider is constructed. A refusal changes nothing: the node keeps serving the previous epoch. A company with no providers.llm is not refused; it builds with no model registry (see A Company With No Model Provider). The sandbox catalogue (providers.sandbox) is built straight after, on every node whether or not it runs a sandbox yet (otherwise the company’s agent seats’ executors would launch into a box nobody can mint); one that cannot be built refuses the apply there, reporting secrets, company only.
  3. native: on a node running none of them, for its first company on them, bring up Worklet’s, Doclet’s and Chatlet’s halves (and Gitlet’s where the company sets code.backend: gitlet): read and write sides, lexical and chat keyword indexes, Gitlet’s index of changes’ words, and on a node that publishes the embedding, chat-prune and code-retention duties and the change feeds. Not their logs: every data node has applied every domain’s log since boot (Bootstrap Sequence step 10). A node without data builds none of it; its seats’ tools reach every half through a data node. Before tools and integrations (their tools and parsers need the halves). A failed start refuses the apply. Conditional: reported only on the apply that started it (once per process), never on a node that met its company at boot. The halves follow the fleet’s logs, so a later refusal of the same apply does not take them down. Changing tracker.backend, knowledge.backend, chat.backend or code.backend: gitlet afterwards takes a restart, and every later apply asking for one warns native_backend_needs_restart (see A native backend changes at a restart). code.limits takes effect at activation (every committer reads the current limits per decision); a revision turning Gitlet off leaves a node still serving Gitlet on the last hosting revision’s limits until restart.
  4. sandbox_runtime: on a node running neither, for the first revision whose providers.sandbox reaches a cell, bring up the code sandbox’s coordinator and completion poll and prepare the seats the node already holds: each attaches its completion topic and recovers its recorded runs. A seat whose preparation fails is handed back (a voluntary unprepared release), so its next acquisition runs the whole of it. Before tools: an executor run launches only where the runtime exists. A failed start refuses the apply. Conditional: only on the apply that started it (once per process), never on a node that met a sandbox company at boot; a later refusal does not take it down.
  5. tools: equip the new epoch with this node’s builtins. Each epoch gets its own registry, since epochs are published, never mutated. (Shared MCP servers’ tools do change without an apply: a server coming up after a failed start, or back from a crash with a different tool list, is refiled into the current registry. See A server that dies, or will not start.)
  6. learning: rebuild the reflection workers against the new org. Swapped into the dispatcher only at epoch, so no pass runs the revision’s models before its login is in place or for a revision a later stage refuses. Cannot fail the apply: reflecting against a stale org is a far smaller wrong than not reflecting. Exception: a node’s first company, where no reflect dispatcher exists, so this stage builds it and a failed build refuses the apply as it fails a boot. Each seat’s reflection subject is attached by the node acquiring the seat, beside its mailbox.
  7. sandbox: swap the sandbox manager only; the coordinator and waiter hold the busy set and poll loop, and rebuilding them would forget mid-run seats and start a second loop. A dropped cell’s backend is carried as retired for runs still on it, and a revision with no providers.sandbox keeps the last manager for runs in flight (see Code Sandbox). Cannot fail (the catalogue was built at company) and runs after every stage that can refuse a serving node. Conditional: only where this node runs a sandbox runtime.
  8. integrations: rebuild the inbound surfaces against the new epoch (Confluence, Datadog, Jira, GitLab, GitHub, and the chat transports: Slack on every apply, Mattermost when a value it is built from moved), so work items route by the new org chart. An app the revision retires (block removed, or enabled: false for GitHub and GitLab) has its parser unregistered, so its deliveries route to no seat; GitHub’s and GitLab’s webhook routes then answer 503. Confluence also loses its searcher. Confluence and Jira re-derive a lead map (space or project key to unit lead), which an unrouted page or issue falls through to; GitLab and GitHub have none and re-resolve the engine credential and the participants lookup. On a node that booted with no company, the first apply starts the inbound edge here through boot’s function (boot starts one only for an existing company, since the consumer group is fleet-wide and a node with no parsers would take deliveries its peers can route); later applies reconcile it. A failed start (the broker refuses the subscription) refuses the apply before the epoch is published and takes down what it brought up, so the retry starts from nothing. A node in a maintenance mode has no edge and starts none: a node starting no publisher at boot must not begin routing deliveries onto mailboxes because a revision was activated.
  9. epoch: publish the new epoch. Immediately before the swap, each providers.llm entry’s credential bundle is restored into its credential directory where that holds no login (and a logout has not withheld it), and the learning workers are swapped in, so only a revision about to be published writes a login.
  10. maintenance: rebuild the retention sweep on a node’s first company (or the apply that started the three halves), since a node booted unconfigured read its job list before the halves contributed Worklet’s repairs and the inbox sweep or a company stated the conversation horizon. Operation ledgers are swept from boot either way. After the swap, since it reads horizons off the current company; the old sweep stops, its in-flight tick waited out, first. Conditional: only on that first apply, only on a node that publishes.
  11. learning_passes: hand the background learning loops (episode compaction, the skill curator, clustered synthesis and promotion) the passes this revision turns on. After the swap, since the loops walk the current company’s seats and a later refusal would leave them on a revision never served. The loops are armed once per process and keep their clocks across an apply (see Agent Learning); this is where a node that booted with no company, or a company gaining its first provider, starts them. Reported on every apply, including on a node with no store or no worker role. Not part of the convergence, since nothing it builds derives from the org chart.
  12. to 21. the convergence: everything derived from the published company itself. These are not the apply’s own stages but the list a node’s boot runs, through the same function, because a boot publishes a company exactly as an activation does. They are described under What follows a published company, and an apply names each in applied_subsystems in this order: parties, seat_identities, seat_tools, tracker_projects, knowledge_containers, chat_rooms, code_repos, mailboxes, scheduler, published. seat_tools hands each held seat’s per-role children their reconcile and does not wait for it: a start is a subprocess handshake and a first tool listing, each able to take a whole startup_timeout_seconds, and every later step would otherwise wait behind it. mailboxes is where a company that gained its first model provider lets through the mail every seat inbox held, after the seat tools, since a released inbox first runs a turn.

Then a config_revision_applied event is published on crewlet.config.revision_applied with status, the applied_subsystems list and any error.

A failure is reported by how far it got, not undone. Every refusal happens before the epoch swap, so the previous epoch stays current and serving; that, not a rollback, makes a failed apply safe. The returned list is the stages that did complete, in order (“secrets, company” names what was rebuilt and where the refusal landed). It travels on config_revision_applied into the audit event log, outliving the fleet view’s one-minute bucket. The fleet view carries each node’s epoch, the revision that epoch named, status and failure text, the epoch last applied (config_applied_epoch), the revision served (config_serving_revision_id) and the one it would boot on (config_boot_revision_id), but not the stage list. A refusal moves nothing in the node’s store but its record of the fleet’s revision: the node keeps serving its previous revision and on restart returns to the one its boot row names (except while a boot-row write is being retried, and none on a node whose database is discarded at every start), never the refused one. The control plane records the revision refused and the one still served (see Control Plane).

Read that list by name, never by number. Five of the nineteen names are conditional: native, sandbox_runtime and maintenance only on the apply that first needs them, sandbox only where this node runs a sandbox runtime, mailboxes only on an engine with a node. An ordinary apply on a node already serving a company with no sandbox reports fifteen, the swap being the sixth. The numbering is the order the code runs, not an index into the report. published is always last: it tells every open socket the company changed, so it waits until everything a socket reads is rebuilt.

A stopping node applies nothing. Stopping waits for an apply already running (it returns quickly on the cancelled context) and refuses every later one with error; one running past teardown would restart the scheduler, the learning passes and, on a first company, the inbound edge.

“No rollback” is not “no mutation”. A revision that cannot be built changes nothing: NewCompany validates, resolves the org and constructs providers without the network, so stage 2 (sandbox catalogue included) is the cheapest place to refuse. Past it the guarantee narrows. On a node serving a company, tools is the last stage that can refuse (an embeddings width it cannot serve, below); learning and sandbox cannot fail there, integrations returns no error, epoch is the swap. A tools refusal has already mutated the resolver snapshot (secrets) and what tools did before refusing (any shared MCP child whose spec moved, the skill variables): the node’s shared tool processes run the new company while it serves the previous epoch, and reports error. A sandbox runtime the same apply brought up stays up, harmlessly: a launch reads its turn’s pinned epoch’s catalogue, which the previous epoch may lack (a company validates without one only with no agent seat or no providers.llm entry), so it launches nothing, while polled runs and prepared seats are the fleet’s. Reflection workers, the party index and the convergence are rebuilt after the last failure point, which is why they are ordered there. A node’s first company is the exception on both sides of tools: native refuses when the runtime cannot start, learning when the reflect dispatcher cannot be built, integrations when the inbound edge cannot start. With no previous epoch to protect, what is left behind (shared MCP children, the dispatcher, the party index, the halves) serves nothing until the retry, which finds it already there. Widening that window would make degraded reachable, so everything an apply cannot un-apply stays behind the swap.

The party index is rebuilt before the swap as well as in the convergence, deliberately not named as a stage. Before the swap, a seat the revision removed stays addressable for an instant (a recorded skip); only after, a seat it added is unresolvable while its epoch is already current. A rollout adopts the new company, so the window favouring it is right. An apply refused between that call and the swap has indexed a company nobody can reach, costing a rebuild.

One knob is refused rather than applied live, because applying it would corrupt data:

  • providers.embeddings.dimensions: rows already written carry vectors of the old width, and similarity across two widths compares nothing. The apply fails naming the declared width and the width the store holds. Changing width is a restart (vector columns are sized at open); after it the knowledge corpus re-embeds itself (vectors are kept per model and width) and the node holding each seat re-fills its diary and raw episodes. Recall compares only vectors of the query’s model and width, so until a row is filled similarity does not reach it: personal memory reaches a note through its recent half, ## Similar prior work leaves a turn out, and query_episodes reaches it with conversation or by recency, saying how many turns it could not reach. A change of providers.embeddings.model at the same width is live: every vector names its model, recall never ranks across two spaces, and the diary and episodes are re-filled in the new space. Adding or removing the whole embeddings block is live both ways: a company dropping it degrades on the next turn to keyword-only search, personal memory from each seat’s recent notes alone, and no recall of similar prior work.

providers.sandbox is live in every direction. Adding it brings the code sandbox up on the next apply (sandbox_runtime), on a node that booted with no company or one without it; changing it swaps the manager (sandbox), keeping runs in flight whole, a dropped cell’s included; removing it (admitted only for a company with no agent seat or no providers.llm entry) stops new launches while runs in flight finish. A block that cannot be built is refused on every node, at company. See Code Sandbox.

Token caps need no apply stage. The fleet’s counter stores only what each scope has spent; the limit travels as an argument on every charge, read off the epoch the turn is pinned to. A raised ceiling takes effect on the next turn on every node, with nothing seeded and nothing to drop when a seat goes away (a role removed, flipped to human, or set to 0 = unlimited simply stops having a limit passed). Per-node caps would turn an org ceiling of 500 000 into N × 500 000.

Shared MCP children are reconciled per server against the new epoch’s specs, comparing every field: a change to url or headers restarts only that server. The comparison is over resolved values, so a rotated credential reads as a changed spec (see Rotation). A server found down is not restarted and not waited for: it is asked to try again at once, and its tools are filed into the new epoch as if it were up, refusing until it is back (see A server that dies, or will not start).

A server the revision removed is stopped, not merely dropped from the catalogue. This is a separate step, since the reconcile is driven by the specs the current config names and never visits a gone name; otherwise the child would hold the company’s credentials until the engine stopped, and a rename would run two. Retiring happens first, so a rename frees the name and tools before the replacement files its own. Deleting a leaking integration’s mcp_servers entry takes effect on the next turn.

Per-role children are reconciled by the seat, not the epoch. They belong to a seat’s lease: spawned when claimed, torn down when released, only on the node holding it. The epoch reconcile skips every non-shared server; each node reconciles the children of its held seats in the seat_tools step of the convergence, once the new company is current. The spec compared is the template with the seat’s mcp_env laid over it (carrying the per-agent Slack, GitHub or Mattermost credential), resolved through the snapshot this apply re-read. An apply that stops declaring a server for a seat retires its child, one that starts declaring one starts it, and an mcp_env edit, or a credential sealed or rotated since the child started, restarts only that seat’s child, in place without releasing the seat. A child whose seat credential does not resolve is not started, and a running one whose credential stopped resolving is stopped: it waits for a credential a provisioning pass is minting, and is reported failed for one nothing will mint or a pass cannot mint until somebody acts (see Tools & MCP). A seat the revision removes loses all its children in the same step, while this node still holds it, since placement releases it up to a sweep interval later and a child left running would keep acting at the vendor for a gone agent.

The same step rebuilds each held seat’s registry, a clone of the epoch’s surface that goes stale on a new epoch, while a child holds the seat’s credentials and must not restart for an edit that did not name it. The apply re-files each seat’s live children into a fresh clone of the new builtins and shared servers, then reconciles the children; a child whose resolved spec did not move pays no credential re-handshake.

Unlike shared servers (reconciled before the swap, which waits for each start), a seat’s children are reconciled after it and the apply does not wait. A turn starting in between runs on the refiled registry, which still lists the children as found, and a call to one being restarted is refused, classed unavailable; the seat refiles again once its reconcile is done, so its next turn sees the restarted children. A child whose start failed is retried on its own while the seat is held, and one that dies after starting is restarted; an apply asks a child found down to try again at once rather than reconciling it. A child held back for its credential is not retried on a timer: the next start is the pass a snapshot change runs, an apply or the pass a provisioning run asks for on its own node once it has sealed what it minted. No reconcile, retry or restart starts a child for a seat this node can no longer prove it holds. See Tools & MCP.

A company is published by two paths: a node’s boot publishes the company it starts on, and a config apply publishes the revision an operator activated. Everything derived from a company must follow both, so there is one list and both paths run it. A seat a revision added but a path skipped would sit in the org tree only (not addressable, no vendor account, no tool children, project, mailbox, dashboard entry or schedule) until something unrelated ran the missing step. In order:

StepWhat it brings upWhy every published company needs it
partiesThe party index every routing decision resolves a name throughA registry is derived from one org and answers for it permanently. Left behind, a new seat’s lookup answers “nobody matches”, the same answer a stranger gets, so nothing fails or logs
seat_identitiesThe vendor account each seat holds, re-resolved for Jira, GitLab and GitHubA code host names a seat by an account, read from the seat’s own credential. Lookups are token-keyed and cached, so unmoved credentials cost no requests
seat_toolsEach held seat’s registry, and its per-role MCP childrenSee Shared MCP servers. The registry is refiled before the step returns; the children are each seat’s own reconcile, handed over and not waited for, because a start’s handshake and first tool listing can each take a whole startup_timeout_seconds
tracker_projectsThe projects the org chart names, as objects, stamped with the revision’s activation instantA project belongs to a unit, so the revision that first names one usually adds the unit. A create takes its key from the project’s own counter, so a project that is not an object refuses every task filed into it
knowledge_containersThe containers each unit’s and seat’s space: namesSame reason, one subsystem along
chat_roomsOn Chatlet, the room each unit’s own channel: names (members: the unit’s subtree and its lead; stamped with the revision’s activation instant); a room whose unit stopped declaring it is released, staffed by nobody; and every public room an administrator set to auto-join takes in the seats this revision’s chart holds that it has not accounted for, each with a joined lineA unit’s seats talk in its room from their first turn, and only the chart writes a unit room’s membership, so only a revision that adds a unit or moves a seat can open or restaff one. A room is opened only for a unit that declares its channel, never one it inherits. No lease: a create arbitrates on the room’s name, so two nodes racing at the broker see the loser told the name is held, which is this step succeeding. A node in a capacity window opens none, because it publishes nothing. An auto-join room accounts for every seat it puts in, so a newcomer who leaves is not put back; two nodes race on it at the broker as on a unit room
code_reposWith code.backend: gitlet, the repositories code.repos declares: created, settled and deleted behind the code log’s activation fence, so an apply that changes none writes one record and an older activation applied late changes nothingAs the containers, but decided beside the apply, not inside it, so no number of changes holds a node behind its epoch; a reconcile that leaves one undone is rerun by the node until it applies (see Gitlet). Written wherever this node may write, whether or not its inbound edge runs
mailboxesA durable subscription per seat; the release of every inbox held while the company had no model; a fresh judgement of every seat parked on its token budget against the ceilings now current; and the end of every pause whose seat the revision removedUntil a mailbox exists, events published to that seat are dropped, not retained. A convergence, not a walk: it asks the broker what is missing and writes only that, so a company whose mailboxes all exist costs a comparison and no consumer proposals. It runs unconditionally, because a mailbox lost under an unedited company is a broker fact no comparison of two companies would notice. A pause is keyed by the seat’s id, so it clears only when the seat itself is gone
schedulerThe cron loop, armed or disarmedIt reads schedules off the current company, so it is armed after the pointer moves; armed earlier, it would fire the outgoing company’s crons. Never on a node in a maintenance mode, which arms no loop at publish as at boot: every fire is a task on a seat’s mailbox
publishedThe socket push that re-sends the roster, org tree, tool catalogue and schedules wholeThe dashboard’s company-derived screens come from the company, so no event corrects them and an overlay merge cannot express a seat going away
the directory — not a step of this listThe party index again, rebuilt for the same company when the identity directory movedNot a configuration change: suspending, reinstating, binding or removing a seat’s person is a record on the identity log, and a registry rebuilt only on a published company kept attributing a suspended person’s Slack messages to their seat. See below

Every step notices for itself that there is nothing to do, so running the list on every apply is cheap (re-activating an unchanged revision is the credential-rotation gesture): the registry compares the company it was built from, identity lookups are token-keyed and cached, the mailbox pass compares its set against the broker’s, the tracker, containers and unit rooms compare the row against the company, the repositories’ reconcile writes one record for an activation that changes none, and the scheduler arms or disarms rather than rebuilding.

The party index has a second trigger. Who holds a seat, and at what stage, is the identity directory’s answer, not the company’s: a seat whose holder is suspended, retired or removed registers no contact identity (see Humans in the Org Chart). The identity applier signals after every committed batch that moved a seat’s standing; the node reads the directory once and, if the answer moved, builds a whole new registry for the company it already serves and swaps it in, as parties does. Both triggers take one lock, so neither swaps a half-built registry past the other, and neither is a diff against the live one. This happens within one apply on every data node, with a thirty-second re-read as the net. A node holding no data applies no log and asks a data node for its directory reading; there the re-read is the trigger, and it never appears in applied_subsystems, because no apply ran.

The order is not arbitrary. A released inbox runs a turn immediately, and that turn resolves parties, loads its tool surface and files work into a project, so everything a turn reads is converged before the mailboxes are ensured and held mail is let through, except a seat’s per-role children, which seat_tools hands off without waiting. published is last, because it tells every open dashboard what this node now serves.

There is no second projection to keep in step. The API answers every read through closures over the engine’s current epoch, not a cached payload: GET /agents, /org and the dashboard’s queries resolve against whatever Apply last published, and inbound webhook secrets are re-read per delivery. A rotated signing secret is picked up by the epoch swap itself.

The API is served inside the engine’s process, over its own backends, and every node runs exactly one reconciler whatever its node.roles, so the two halves cannot disagree about the epoch.

configured is true when the engine’s current epoch holds a company, and flips the moment an apply brings a node its first revision. A failed apply leaves the node serving the previous epoch, still a configured node; it changes the posture, which /ready reads. Collapsing the two would take a correctly-serving node out of a load balancer’s rotation for being behind.


company_config is an append-only table: every change is a new revision. It is swept (what a revision is not). A write of part of the document that changes nothing, a PATCH /config or a per-entity PUT that leaves the document as it stands, stores none and answers with the revision that already says it (A write that changes nothing). The schema:

CREATE TABLE company_config (
revision_id TEXT NOT NULL PRIMARY KEY,
parent_revision_id TEXT REFERENCES company_config(revision_id),
created_at INTEGER NOT NULL, -- unix microseconds, UTC
created_by TEXT NOT NULL, -- the AUTHOR: the seat's handle for a person
-- or a credential bound to one, a login
-- for a credential bound to none —
-- token:<id> for a Tier A token — the
-- engine's own name for its own writes
created_by_kind TEXT NOT NULL DEFAULT '', -- agent | human | operator | system
operator_id TEXT NOT NULL DEFAULT '', -- the credential it was written
-- through: pat:<id>, session:<lineage>,
-- a Tier A token's login; empty for a
-- write no credential made
source TEXT NOT NULL, -- "api" | "file" | "rekey"
summary TEXT NOT NULL, -- short human-readable change note
payload TEXT NOT NULL, -- the whole document, sealed under
-- the keyring every node holds
is_active INTEGER NOT NULL DEFAULT 0, -- this node BOOTS on it
activated_at INTEGER, -- an activation instant: see below
is_fleets INTEGER NOT NULL DEFAULT 0, -- the fleet's revision as this
-- node last saw it
offered INTEGER NOT NULL DEFAULT 0, -- the boot row is an offline
-- offer the fleet has not taken
offered_over TEXT, -- the revision the offer was built
-- on; NULL for none
offered_unconfirmed TEXT, -- the offer this one replaced, which
-- a start published and could not
-- confirm; NULL for none
offered_at INTEGER, -- the instant the boot publish
-- planned for the offer
served_at INTEGER -- the boot row's: the activation
-- this node applied
);
-- At most one row this node boots on, and at most one it records as the
-- fleet's, each enforced by the database rather than by the application
-- remembering to.
CREATE UNIQUE INDEX company_config_one_active_idx
ON company_config (is_active) WHERE is_active <> 0;
CREATE UNIQUE INDEX company_config_one_fleets_idx
ON company_config (is_fleets) WHERE is_fleets <> 0;

Types are the four SQLite has (TEXT, INTEGER, REAL, BLOB), not UUID / TIMESTAMPTZ / JSONB, and a timestamp is unix microseconds: Turso is SQLite-compatible in query language and file format.

A revert creates a new revision whose payload equals a prior one; the audit chain stays intact via parent_revision_id.

Which revision is the company is not a column here. It is the fleet’s activation pointer in the coordination store, which every node answers (Live Propagation). The table marks three facts only this node can know:

  • is_active is the revision this node boots on. Online, only the reconciler moves it, only to the revision its engine just applied, so a node never starts on a revision it refused; reconcile ticks move it in the order they read the pointer. Offline, a crewlet config command chooses it (below).
  • is_fleets is the fleet’s revision as this node last saw it, recorded by the reconciler for every pointer revision whose seal opens under the node’s keyring, before validating it, refused here or not.
  • offered, offered_over, offered_unconfirmed and offered_at mark an offer: a boot row an offline command chose that the fleet has not taken, the revision it was built on, the earlier offer it replaced where a start published that one and could not confirm it, and the instant the boot publish planned for it.

With no pointer (one lost under a running fleet), the company is the one this node knows, by the first that holds:

  1. an offer built on the fleet’s revision it last saw, or built while it had seen none;
  2. that fleet revision, even one this build refused, because every node that could run it does and the older revision this node runs would roll them back;
  3. the revision it boots on.

That is what GET /config answers while the pointer is gone, what the next boot restores, and what an offline command builds on.

Two instants stay apart. activated_at, on every row (the boot row’s included), is the latest instant this node knows the fleet activated that revision at, raised and never lowered: what a node restoring a lost pointer asks for, and what the sweep below dates a re-activated revision by. served_at is the boot row’s alone: the instant of the activation this node applied, which the engine stamps the org chart and knowledge spaces with when it boots on the revision; it moves only when the node applies an activation. An offer has none and starts the engine at no instant, because the fleet has not taken it. One column could not serve both: a re-activation of the running revision that this node refused (the rotation gesture on a node that lost the credential) could raise neither, since the boot row’s instant had to stay the one it applied. See Control Plane § A node’s own store keeps three facts apart.

crewlet config import, activate and rekey run while the engine is stopped do not open the coordination store (on an embedded broker it lives inside the running engine), so they cannot move the pointer. Each writes an offer: the revision this node boots on at its next start, built on the company this node knows (above). “Stopped” means not starting either: a start holds the store from the read it decides on (step 6 of the Bootstrap Sequence), so the offer it publishes is the one it read, and a command run while it starts is refused or sent to its API as beside the running engine.

  • import writes the file as a new revision built on that company, with a redacted file’s masks restored from it. A file equal to it imports nothing.
  • activate <id> makes a stored revision the offer, holding it to the runnable rules first: a revision this build cannot run is refused with nothing written. Activating the fleet’s own revision is the offline rotation gesture: it is published over itself, as a new epoch.
  • rekey re-seals the revision this node boots on (which, on a node that refused the fleet’s revision, is not the fleet’s) and offers the copy over that revision, or, where it is itself an offer, over the revision that offer was built on. On a node that refused the fleet’s revision the copy is therefore withheld, as below, and the fleet’s own document is re-sealed through a running node with POST /config/reload.

The next start publishes the offer by a compare-and-set against its base: only while the pointer still names the revision it was built on, expecting the very activation of it the start read (so it lands at exactly that instant or not at all), at an instant later than the pointer’s, so it always mints a new epoch. Where the company this node knew was itself an offer an earlier start published and could not confirm (it crashed between publish and record), whether the fleet took it is unknown offline: the new offer is built on both it and the revision under it, and is published over whichever the pointer names. Where the pointer is gone, it is published create-only if its base is the fleet’s revision this node last saw, or if this node saw none; built on no company, it is published only while the fleet has none.

An offer the fleet moved on from is withheld, never published over the fleet. The node boots on it, logs offline_revision_not_published at warn on every boot (naming the offer, what it was built on and what the fleet runs), and runs it until it applies the fleet’s revision, which then becomes what it boots on, the offline change left in its history. Making such a change the company as it stands would undo what the fleet changed since, so the warning’s hint names the alternatives: GET /config/revisions/<revision>/diff?against=<built_on> on that node shows what it did, to repeat on the fleet’s document (through the dashboard, or crewlet config import -api), and POST /config/revisions/<revision>/revert on that node puts it up as it stands, for an operator who means that. crewlet run -import-company is the one way to replace the company unconditionally. The whole decision, restoring a lost pointer included, is What a booting node publishes.

crewlet config revisions says which row is which in its STATE column: boots, fleet's, and offered over <id>, or offered over <id> or the unconfirmed <offer> (see the CLI reference).

A revision is immutable as a configuration, not as an archive of people

Section titled “A revision is immutable as a configuration, not as an archive of people”

This narrows “append-only”, deliberately.

It is swept. Every node keeps its own copy of every revision it has met (one row per config write, per node, each the whole document). The ordinary maintenance tick keeps every revision created or activated inside 400 days (a row is dated by the later of the two, so an old revision the fleet re-activated yesterday stays) plus, whatever their age, the revision this node boots on, the fleet’s revision as it last saw it, and the whole parent chain behind each. It runs on every node, not under the fleet singleton, because each node owns its copy. The two marked rows are often different: a node that refused the fleet’s revision boots on an older one, and needs both (one to start on, one to restore a lost pointer from). The chain is kept by id, not date: a revert re-activates an older revision and crewlet config diff walks it, so a swept ancestor would turn both into an error naming a row that used to exist. See Retention for where 400 days comes from and its floor.

A revision is an archive of the org chart it ran. A human seat’s email and contact account ids are inside every revision that carried them, on every node and in every backup; removing the seat writes a new revision and does not reach the old ones. They leave the store when the sweep takes their revision, and a backup when it is deleted.

A stored revision passed the validation of the build that wrote it, not necessarily the build reading it: during a rolling upgrade a newer peer can store a document this build would refuse. So reading and running are held to different standards.

  • Reading holds a revision to no rule. GET /config, a revision read, the diff, the reference index, the entity reads, crewlet config show, export and diff, and the prior a write restores its masks from or merges onto all decode the stored document as it is. A revision this build would refuse is exactly the one an operator needs to see and replace.
  • Applying holds a revision to the runnable rules. A node’s reconcile tick validates a revision before anything on the node changes, so a refused revision leaves the previous epoch serving untouched and leaves it what the node boots on: the tick records the refused revision only as the fleet’s, so the next start runs what it ran before. Booting from the store validates the revision the node boots on and names it when it cannot run. Online that cannot happen, because a node boots only on a revision its engine applied or one an offline command of the same build held to these rules; a refused boot row was written by another build or store (a binary downgraded after the node applied it, an offline command run with a newer build’s CLI, or a store restored, copied or edited by hand), so the refusal names the build that wrote it first. The way out has to reach this node’s own store, which the boot reads alone: a correction written through another node fixes the fleet but reaches this store only through a reconciler a refused boot never starts. What writes the store directly is an offline crewlet config import of a corrected document, which the next start boots on and publishes only while the fleet still runs the revision it was built on (or, built on no company, only if the fleet has none), so it never replaces a revision the fleet has moved on to; where the fleet has, the import is this node’s alone until it applies the fleet’s revision. The refusal does not name -import-company, which would replace whatever the fleet runs, a newer company included, to start one node. On a managed deployment the offline import is refused, so the refusal names the way that reaches the store: take the document back on this node for one start (remove api.auth.company_writers from its Tier A, import the managing system’s current document with crewlet config import, and start the node, which publishes the import only while the fleet still runs the revision it was built on), then restore api.auth.company_writers and restart. A company file named with -company or -import-company is held to the runnable rules as it is read, and to the rest only where it is written, because most boots write nothing from it: it is already the revision the node boots on (for -import-company, the one the fleet runs), or a bootstrap a company that exists outranks (one this node boots on or has seen the fleet run, or the fleet’s). POST /config/reload and a revert validate what they re-activate.
  • A written document is held to every rule. PUT, PATCH, a per-entity write, a /setup submission that changes the document, crewlet config import, crewlet validate and a company file crewlet run imports as a new revision (-company where no company exists yet, -import-company over a different company) validate the entire document the write produces, after its masks are restored. A write over a revision this build refuses therefore succeeds exactly when it corrects it. The company file crewlet run imports is also built as the node’s apply would build it before anything is stored, because nothing else builds it before the fleet is pointed at it (see Bootstrap Sequence step 12).

The last two differ by the admission rules: authoring hygiene nothing about running a company depends on, the part of the rule set a later build may add to or relax. A revision that breaks one still runs, so an apply does not refuse it: during a rolling upgrade a newer peer may activate a revision it admitted under rules this build does not share, and refusing it would split the fleet’s epoch. Today they are:

  • unique unit keys; a display name, a seat’s or a unit’s, is prose and never held unique.
  • Unique sandbox setup step names within one setup list (providers.sandbox.setup, or one seat’s sandbox.setup): a step’s env and files are credentials restored by the step’s name, so two steps of one name would leave every write carrying that list refused on masks nobody edited.
  • A unit: reference on a seat declared inside a unit it does not name: the reference places only a root seat, so there it moves nothing and reads as a placement (see the organization model).
  • What a human seat holds on a code host: a seat’s code access tier (code), which caps nothing for a person, who acts on every code host as their own identity, and a seat’s own GitHub App (integrations.github), the identity an agent acts as on GitHub where a person acts as their own contact.github_login. Nothing creates an app for a person or reads a tier off one, so either block would read as a setting and do nothing.
  • A schedule’s cron that has five fields and still breaks the cron grammar (61 * * * *): the company runs with that schedule never firing and every other schedule untouched.
  • A seat’s avatar naming a character or colour this build does not draw, or written on a human seat: nothing that runs a seat reads it, and the set of characters will grow, so a revision a newer peer admitted with an unknown character still applies here, and the dashboard draws that seat as the original Crewlet until upgraded.
  • A sandbox setup step writing a file a box some seat runs in would refuse (/usr/local/bin/… for a seat that runs direct, or the home itself in any cell): the company runs, and only the boxes that step reaches fail at setup (see Code Sandbox).
  • A providers.llm entry’s credential configured where its harness never reads it, or handed over under a variable name no store can hold (an overrides.token_env or overrides.api_key_env outside the reference grammar), and an opencode entry’s model with no provider segment (see LLM Backends).
  • Two units that declare one channel on Chatlet: a unit’s room there belongs to one unit at a time, so the second would be left out of a room its seats are told is theirs; the engine opens it for the first and reports the other at every apply.
  • An executor’s optional_keys entry, on a seat’s sandbox or a setup step, that leaves nothing out: a key or path its block does not write, a variable’s name where its key belongs, or a key whose values reference nothing, each leaving the intended key expected, so the run’s start logs a gap (sandbox_env_unresolved) wherever its value resolves to nothing (see Code Sandbox).
  • A run environment naming one of the engine’s own Gitlet variables, CREWLET_GIT_ACCESS_FILE or CREWLET_GIT_URL, in a seat’s sandbox.env, a seat’s setup step’s env or providers.sandbox.setup’s: the engine’s value wins on every run given repositories, and nothing reads it on any other run (see Code Sandbox).
  • A seat’s sandbox.browser where a run of the seat can land outside a container box, in a container on its host’s network, or on an entry that denies its harness the web: the launch withholds the browser from such a run itself, and the run goes on without it (see Code Sandbox).
  • An MCP server named browser, the name a browser seat’s box sees its own browser under: there the box’s browser takes the server’s place, and everywhere else the server runs as before (see Tools & MCP).
  • providers.sandbox.local.chromium_sandbox set where no browser seat launches in container, which nothing then reads, or to a value this build does not know, which runs as required (see Code Sandbox).
  • Gitlet’s two policy bounds, at most 10 000 repositories in code.repos and a code.deleted_retention_days of at most 365: the reconcile creates and settles any number, and the retention duty purges by any retention, so running depends on neither. Once Gitlet holds 10 000 projects, a tool’s create of one more is refused repo_limit, the runtime cap the same number sets (Repositories made by tools). A retention too long for the engine to count in, about 292 years, is refused as a runnable rule, because every deleted repository would already have outlived it.

Five more are whole-document rules: each compares one part of the document against another, or one seat against every other seat.

  • An mcp_env key must name a tool server. The engine looks a seat’s credentials up per server, so a block keyed on a name mcp_servers does not declare is never read, while the server it was meant for starts with none. Six names need no server, because the engine reads those blocks itself: github, gitlab, datadog, and Atlassian’s atlassian, jira and confluence. A sandbox.mcp.servers entry must name one too, those six included: a box is given only a server the company declares. Removing a server clears both kinds of field in the same write (DELETE /config/mcp-servers/{id}).
  • A tool server’s optional_keys entry must leave something out. It names a key of the server’s own env or headers, or of a seat’s or unit’s mcp_env block for it, whose value carries a ${VAR} reference. A variable’s name where its key belongs, a variable only the url references, a key nothing writes and a key whose values reference nothing are refused, because each leaves the intended key required and the server not started wherever its value resolves to nothing (see Tools & MCP).
  • An http header is spelled one way where nothing says which is sent. HTTP does not tell authorization from Authorization, so two spellings of one header in one map, or in a unit’s mcp_env block and one of its members’, would send whichever came last. A seat’s spelling over its template’s is not refused: the seat’s replaces the template’s however either is written.
  • Two seats may not declare one email. The party registry keys on the address and the first seat wins, so the rest silently stop being findable and mail meant for one person resolves to another. The same rule covers every external account id.
  • lead:, unit: and manages: must be shaped like what they name: a seat’s handle, a unit’s key, or (for manages:) either. lead: QA Lead can never resolve. Only the shape is refused: a well-formed reference that resolves to nothing stays a warning, because an organization is assembled in pieces and a lead naming a seat nobody has hired yet must still apply.

A seat may not be called none either (what integrations.datadog.route_to means by nobody, so it would be silenced by its own handle). That one is a runnable rule.

A written document is refused for breaking an admission rule. A revision being applied that breaks one is applied, booted on, reloaded and reverted to like any other, and each node logs org_admission_warning once per violation when it applies the epoch. Every other rule is a runnable rule, and nothing applies a revision that breaks one.

The charter’s rules are judged on an edit’s change, not the document it leaves: an API write is refused only for a fault in a part of the charter it changes, judged against the stored revision it replaces, and an import (offline, at boot, to a running node, a restore) is never refused for one. Every fault an edit leaves untouched, and every fault an import carries, is warned about like an admission rule, on the write’s answer, in the import’s output and as org_admission_warning on every apply.

A revision can be valid and carry a consequence: a company with no human seat, which can admit nobody; a human seat with no account on the Mattermost or Slack workspace the company talks on, which nobody can mention there; a token ceiling another ceiling leaves unable to refuse a turn; a -e NAME in providers.sandbox.local.run_args that nothing supplies; an agent seat whose llm chain mixes a claude-code, codex, gemini-cli, qwen-code, opencode, cursor-agent, copilot, grok, muse-code, kimi-code, hermes or pi entry with another harness, which a launch skips (it still serves the reviewer, workers and side passes); a stdio MCP server that launches Playwright MCP, a browser on the engine host for every seat and phase that reaches it (Tools & MCP). crewlet validate, a /config write and a dry run answer these to whoever asked, as advisory warnings. Every node also logs them, once for each epoch it applies, one config_advisory line at WARN each, never for a revision it refused:

FieldMeaning
configcompany: which tier. A node’s start logs its Tier A’s advisories under the same event with config=bootstrap (see crewlet run), and so does an apply for the one advisory only the two tiers together raise: on a Linux ingress node that starts a container box (a seat’s placed in container, with the seats role, or a check’s, with the gitlet role in a company that runs checks), the listener a box dials binding loopback alone, which no container box on that host can reach (Local sandboxes)
revision, epochThe revision and the activation the node applied
pathWhere in the document the remedy is written
seat, unitThe seat’s handle or the unit’s name the advisory is about, present only when it is about one
detailThe whole message: what will happen, then what to do instead

The log is the only place some companies are told: a /config answer goes to whoever wrote, but a company imported from -company or -import-company is answered to nobody. The two other kinds of warning keep their own lines at apply, org_dangling_reference for a reference that resolves to nothing and org_admission_warning above, so no fact is logged twice.


Every route requires a credential, reads included. The only exceptions are the handful that authenticate by other means or must be reachable to obtain a credential at all, listed below. Tokens are listed in Tier A under api.auth.tokens and resolved from environment variables at API startup. Each revision a request produces records its author as created_by (a Tier A token’s whole login, token:ci-pipeline, or the seat it is bound to, or the seat a signed-in person holds), its kind as created_by_kind, and the credential it came through as operator_id: a machine token’s pat:<credential id>, a browser session’s session:<lineage>. A revision somebody’s token wrote is theirs and is never mistaken for one they wrote themselves. Every node’s copy says the same: the three travel on the activation pointer as author, author_kind and operator_id, beside the revision’s source and created_at, so a node keeping the revision from its fleet records the writer rather than peer. A revision the engine wrote itself (the boot seed, the reconcile loop) carries the kind system and no credential. See the API reference.

admin is the one permission that writes this document, and it also runs the company’s credentials, people and deployment. Confer it as you would shell on the engine’s hosts, because that is what it is. The configuration runs code:

  • an mcp_servers entry is a command every engine host executes;
  • a seat’s mcp_env and its per-phase model keys (llm_*, each naming a harness the engine host runs) decide what the seat’s children run and which credentials they get;
  • every agent seat’s executor is its harness’s own fully permissioned run, which a providers.llm entry’s run_in: direct (or providers.sandbox.default_run_in: direct) runs on the engine host as the engine’s user;
  • a seat’s worker grants decide which tools a worker holds.

So whoever holds admin can run anything on every engine host and read whatever a process there can, the keyring included. There is no separate “runtime” permission: it would be this one’s whole reach under a second name. A node can refuse admin altogether: api.auth.admin: refuse clamps it away on that node and keeps every app, which is how a node published to the company’s users is kept from being a way in.

In practice:

  • Grant it only to people and pipelines you would give a shell on those hosts. A machine token can carry it (applying a configuration from a deploy job is what one is for), so minting one with it hands that job host access. A token cannot do what needs a person present: reveal a secret, change who may do anything, or end everybody’s sessions (two locks).
  • Everything a company does with its apps (filing work, writing pages, making artifacts, chat, reading and pushing its code) needs no admin: that is worklet, doclet, artifacts, chatlet and gitlet, which most people hold.

The org chart in this document is also written by its leads, with no permission needed: a person who leads a unit may change the seats and units inside it, judged change by change on both sides of the write, and never a setting, a credential, a ${VAR} in any field, or a project, space, channel, address or contact id (A lead edits their own team). Settings stay admin’s, but a lead may point a seat at any model chain the company declares, and so at the cell each entry’s run_in (or the default) names. Every providers.llm entry, each a harness on the engine host, and every cell an entry places runs in on the engine host is therefore one a lead can hand to their own seats. Configure those only where every lead may use them.

What allow_anonymous_read was, and why deleting it was the only fix

Section titled “What allow_anonymous_read was, and why deleting it was the only fix”

Reads used to serve without a credential by default. That exposed /events, /agents/{id}/memory and /ws/stream, which carry full LLM transcripts (prompts, tool arguments, diary entries), and a roster naming everybody who works here, to anyone who could reach the port.

Changing its default could not fix it: it was a bool whose safe value was its zero, declared omitempty, so false did not survive an export round trip, and a deployment that had closed it re-opened itself the first time its configuration went through PUT /config.

A script that only reads what the company is doing now holds a service account’s token with no permission at all: it reads the overview and nothing else, is listable, revocable without a restart, and present in the audit log. A file that still carries the key is refused (Tier A is decoded strictly, so an unknown key is an error, never silently the opposite posture), and the refusal says it was removed and to give a read-only client an api.auth.tokens entry with only the apps it reads.

api.auth.disabled went with it. It authenticated the empty credential into full operator authority with no bind-address check, so one unset environment variable was a total bypass. Local development uses crewlet run -dev-principal <login>, which has two guards that field never had: api.host must bind a loopback address (the bind, not api.external_url, because the bind is what stops another machine reaching it), and the binary must be a development build, so no copied setting carries it into a deployment that pulled a tag. That is why it is a flag: a field gets copied into an image. It grants every app, and admin only where api.auth.admin is serve, where disabled granted everything regardless.

api.auth.oidc is retired too: the engine no longer signs anybody in through an identity provider. A person signs in with a login, a password and (unless the company’s sign_in.require_second_factor says false) a second factor the engine holds. A file that still carries the block is refused, saying it was removed and that people sign in with a password and two-step verification.

Password sign-in has no switch: it is always served. A deployment nobody has been invited to signs nobody in, because nobody holds a password, so a switch would change nothing a stranger could reach. A deployment states what a password sign-in may ask for at most: api.auth.limits, the bounds this node holds the company’s sign-in policy within (its second_factor unset is required, so an optional second factor is always the operator’s explicit choice), and api.auth.accept_insecure. What a sign-in does ask for is the company’s (sign_in, see Identity and access § The company sets its sign-in policy).

These authenticate by other means, or must be reachable to obtain a credential:

PathWhy
/health, /readyProbes. An orchestrator has no token, and a liveness check that 401s fails. A single trailing slash is tolerated (/health/): the guard runs before routing, so the router’s redirect to the canonical path would only happen after the guard, and a slash must never be the difference between healthy and evicted
/webhooks/*Each verifies its provider’s HMAC first, stronger than a shared bearer token. Includes the Slack OAuth landing page, which a browser reaches mid-install
A route whose secret is unset has nothing to verify with, so it fails closed: 503 + Retry-After, never an accepted delivery. The sender retries and the delivery flows once the secret is configured; nothing unsigned is ever recorded, published, or shown on the dashboard
/otlp/*, /mcp/*The signed per-run token in the path is the credential. Both are reached from inside a sandbox, where the API’s own token must never go
/box/git/*A box’s git: a coding box’s run’s signed token, or a check’s box’s check’s, as git’s Basic password, is the credential, and Gitlet admits the box by its run’s row, or its check’s attempt’s, on every request (see Gitlet → Coding boxes and Check boxes). Reached from inside a sandbox
/box/gitlet/*A check’s box’s reads of the commit its check measures, with the credential its git presents, admitted the same way (see Gitlet → Check boxes)
/, /dashboard, /favicon.ico, /static/*The page that prompts for a credential cannot itself require one. It ships no data: everything it renders comes from an authenticated fetch
/auth/config, /auth/login, /auth/invite/*, /auth/reset/*A login cannot require a login: these are how somebody obtains a credential, and an invitation link and a password reset link are each the credential. Exact paths plus the two prefixes, never /auth/, since the same surface ends sessions and enrols second factors. The sign-in throttle and the origin check stand in for the guard
/auth/logoutSigning out of this session clears the cookie whatever the node can read, and verifies every bearer it ends itself. Signing out everywhere and ending a named session stay guarded

The public listener serves only what an outside party calls. With api.public.port set, /webhooks/*, /otlp/*, /mcp/*, /box/git/* and /box/gitlet/* are served on it and nowhere else, behind the same guard; every other route, every /auth/ route included, is served only on api.port, so the address a vendor is given never reaches a sign-in form. A node without ingress serves its probes on api.port, behind the guard as well: /health answers, /dashboard is 404 and every guarded route is 401 (see probes on a node without ingress).

/ws/stream follows the same rule as every other route: the session cookie a signed-in browser sends on its own (a browser cannot set a header on a WebSocket, so the cookie is all the dashboard presents), or an Authorization header from any other client. Nothing is read off the URL: a ?token=… authenticates nobody, because a query string lands in proxy access logs and browser history. The socket takes the guard’s own answer for who is calling rather than re-reading the credential, so it never accepts a narrower set than the REST routes beside it. A handshake presenting nothing is refused before the upgrade, which the dashboard learns by re-asking over plain HTTP: 401 means the credential is the problem, 426 means the engine is fine and the protocol was wrong. A node that cannot read its identity estate answers 503 rather than 401, and a person whose seat the running company no longer holds gets the guard’s 403 naming the seat.

A git client reaches /git/* with a token (a Tier A token, or a machine token cwl_pat_… a person minted) as the password of a Basic credential (the user name is ignored), because git answers a Basic challenge from its credential helper and presents a token no other way without configuration. That is the one route family where Basic is accepted: a browser caches a Basic credential it was asked for and replays it to every route of the origin. See API Endpoints → Routes for the challenge and the logging, and During a drain for which git requests a draining node still serves.

The guard is mounted whether or not api.auth is configured, and it decides who is asking, never what they may do. Every request leaves its middleware with one of three answers:

  • resolved: a session cookie, a Tier A token or a machine token matched, and the principal it names;
  • anonymous: nothing was presented, or what was presented is refused;
  • unknown: this node could not read what it needed to tell. Answered 503 with a Retry-After, never the 401 that tells a browser to sign in again.

Exactly the list above is unguarded; every other route is guarded, whatever its method, with no second list of “especially” guarded routes. What a resolved caller may do is each surface’s own question, asked where it is enforced: every route states the grant its verb takes, and internal/authz’s router decides it against the principal: 401 for somebody unresolved, 403 for a grant they do not hold or a proof of identity that is too old (step_up_required). Tier A supplies the posture (which credentials exist and the ceiling their grants are cut to), never the existence of a check: an API built with no Tier A has no token that can match, and every guarded route answers 401. So no process can serve /config writes with nothing in front of them.

api.auth.company_writers names the Tier A tokens that alone may change the company document; unset, whoever the authority table admits may. See Managed configuration.

secrets.keys is required on every node, whatever its roles and whether or not it serves the API, and crewlet validate refuses a Tier A file without it. It has no default (a key the engine invented would be one no other node holds), and much more than the company’s credentials rests on it:

  • every record on every state log is signed and verified under it, because the broker’s admission vouches for a connection, never a record, and every data node applies every log; every request a node without data sends through the estate router, and every answer it gets, is signed under it too;
  • the company document a node fetches from its peers is authenticated by its seal, so a node refuses one that arrives unsealed (see Secrets);
  • on a node serving the API it signs every session cookie and derives the key that verifies each per-run token;
  • an embedded fleet’s broker derives its credentials from it: a route, a leaf link and the operator’s nats tool are admitted only on a key derived from a key of this keyring (The fleet’s broker admits only its own nodes).

Each key’s material must be the base64 of a 32-byte key, which is what crewlet secrets keygen prints. crewlet validate checks the value its ${VAR} resolves to with the node’s own keyring decoder, so a key that is not base64 or has the wrong length is refused by validate naming secrets.keys[i].material, not at boot.

What Tier A must state once the API is served

Section titled “What Tier A must state once the API is served”

Three more settings become required once a node serves the API (api.port non-zero on a node running ingress; a port on a node without it serves only probes and needs none of them). crewlet validate refuses each on a laptop rather than a process at bind time:

SettingWhy it cannot be defaulted
api.external_urlThe session cookie’s Secure flag and __Host- prefix follow its scheme, its host is the origin every write is checked against, and it is every link a person follows (invitation, password link, a page’s address in a notification). Without a public listener it is also what every webhook URL is built on. The engine sits behind a TLS-terminating proxy and can read none of that off the request
api.auth.adminWhether this node grants admin to those who hold it (serve) or clamps it away and keeps every app (refuse). Admin is host access, so whether a node publishes it is the operator’s decision, never a default
api.auth.tokensA fresh deployment’s identity estate is empty, so a Tier A token is what creates the company and puts its first person on their seat; on a running one it is the way back in when an administrator has locked themselves out

With api.public.port set on an ingress node, api.public.external_url is required too: the address vendors and sandboxes reach the public listener at, on which every webhook URL is built. A box’s per-run OTLP and tool-bridge endpoints are built on CREWLET_SANDBOX_OTEL_RECEIVER_URL and CREWLET_MCP_BRIDGE_URL, which name that same address, except a direct box’s, which dial its own node on loopback (see Deployment). They are separate settings because they are separate sockets (a person reaches api.port, a vendor the public one), and neither is read off a request. Without a public listener the two are the same address and only api.external_url is stated.

Three API postures are valid, work exactly as written with their consequence elsewhere, and so cannot be refusals. crewlet validate prints each, and every start of a node serving the API logs each as a config_advisory line at WARN:

WarningWhy it is not a refusal
api.auth.accept_insecure is setIt makes an otherwise-refused posture legal: limits.second_factor: optional on an address a browser reaches over the network. The acknowledgement is a decision made once that everybody after inherits, so crewlet validate says it every time and every start logs it
api.external_url is http:// off loopbackThe session cookie cannot carry Secure and no __Host- prefix protects it, so every credential travels in the clear, but a tunnel, a staging box and an internal network genuinely look like this. The one posture it would be a refusal for, an optional second factor, already is one
api.external_url is https:// and api.trusted_proxies is emptyThe engine never terminates TLS, so something in front of it does, and unless it is named every caller’s source is its address. The sign-in throttle then keys every caller’s attempts at one login together, so a stranger guessing at somebody’s login slows that person’s own sign-in, and every audit row names the proxy. Not a refusal because one front end is right with the list empty: a balancer that passes each client’s own address through as the peer rather than in a header

api.trusted_proxies is a CIDR list, never a bool, because the question a forwarded header poses is “is this peer the proxy”, not “is there a proxy”. A bool set true trusts a header anybody can send, handing an attacker their own throttle key and audit row; set false behind a real proxy it buckets the whole internet under one address. 0.0.0.0/0 is refused for the first reason, and an https external URL with the list empty is warned about for the second.

CORS defaults to same-origin. The dashboard is served by this process and needs no entry; list any other browser origin explicitly in api.auth.allowed_origins. * is refused at boot (it let any site a logged-in operator visited read every endpoint): name each site.

An entry is compared against the browser’s Origin header, always scheme://host[:port], in the browser’s spelling: scheme and host in lower case, an IP address in canonical form, no port where it is the scheme’s default. So https://Ops.Example.com:443 permits the https://ops.example.com a browser sends. An entry is refused when:

  • no browser could send it: no scheme, no host, a port outside 1-65535 (an allow-list that looks configured and never matches fails in a browser console this engine never sees);
  • it carries more than an origin: a path, a trailing slash, a query, a fragment or a user (all dropped before comparison, so https://ops.example.com/dashboard would admit every page of the host);
  • its host is one a browser rewrites before sending, and the refusal names the form to write instead: a host outside ASCII, which a browser sends in punycode (xn--bcher-kva.example); an IPv4 address not written as four decimal octets (127.1, 0x7f.0.0.1, a leading zero, which a browser reads as octal); an IPv6 zone, which no browser can address.

api.external_url is held to the same three. A permitted origin’s response carries Access-Control-Allow-Origin, Access-Control-Expose-Headers and Vary: Origin; an unlisted one carries only the Vary and the browser blocks it. It is not refused with a status, because a same-origin POST carries an Origin too and the default allow-list is empty.

Preflights are answered before the auth guard: a browser sends the OPTIONS itself with no Authorization header, so answering behind the guard would 401 every cross-origin write and the real request would never be sent. The request headers a permitted origin may send are a closed set, exactly the ones the routes read, never an echo of what the browser asked for: Authorization, Content-Type, Idempotency-Key, If-Match, If-None-Match, X-Summary, X-Request-Id and the two link secrets. An answer to a permitted origin exposes exactly the headers a client acts on (Access-Control-Expose-Headers): X-Crewlet-Engine, ETag, Retry-After, Accept-Patch, Allow, Content-Disposition, Location and X-Request-Id; an unlisted origin gets none. A header left out is not stripped: the browser refuses the whole request, or hides the header from the page, so a route reading a header a permitted origin cannot send is a route that origin can never use. Ask Crewlet’s Last-Event-ID is not offered, since the one route that reads it, Ask Crewlet’s stream, answers only a person’s own browser session, and no answer here allows another origin credentials. The dashboard’s X-Crewlet-Reader is not offered, since only the dashboard sends it and it is same-origin. The methods are exactly the ones the routes serve, OPTIONS among them, for OPTIONS /config. The API reference says which route reads each one. A preflight is cacheable for ten minutes, short enough that removing an origin takes effect within one.

The auth middleware compares tokens in constant time (crypto/subtle). Logging:

  • A credential presented and refused logs api_auth_failed at WARNING with reason credential_refused, the route and the resolved client address (never the candidate token), a wrong Basic password on /git/* included.
  • A request that presented none (a signed-out tab, an invitation’s page) logs api_auth_anonymous at DEBUG.
  • A /git/* request that presented none is answered git’s Basic challenge and logs api_auth_challenge at DEBUG, because git’s first request never carries a credential: it asks its credential helper only after the 401 challenge.
  • Successes log api_auth_ok at DEBUG with actor (who a write would be attributed to), operator_id (the credential it came through) and route.
  • Every write this surface logs (config_revision_written, secret_written, backup_taken, retention_gate and the rest) carries the same pair as by and operator.

A write to the config, the secrets or a model (a model’s check, retry and sign-in on its host included, which are writes without being config) that is refused with a 4xx (a stale If-Match, a validation problem, a missing step-up, a grant the caller does not hold) logs one write_refused at INFO, on the api.config, api.secrets or api.llm logger. Fields: route (the pattern served, such as PUT /secrets/{name} or DELETE /config/llm-providers/{id}, never the path, which would name it), method, status, code (the problem’s code from the answer’s error), by, kind, operator, base_revision (the If-Match written against, where it is one revision tag of at most 128 bytes, and <invalid> otherwise), dry_run and request_id. It never carries a value, a secret’s name or the problem’s detail. INFO because a refusal is the engine working as meant: a stale tab or an expired step-up refuses routinely. Each write answers an X-Request-Id header: the caller’s own where it sent one (one token of at most 128 bytes of letters, digits and ._~:+/=-), a minted UUID where not, so a refusal a user reports can be found in the log.

See the API endpoints reference for the per-route auth + status semantics.

Some deployments never edit the company document by hand: a GitOps pipeline applies it from a repository, or tooling such as a Kubernetes operator renders it from custom resources and writes it on every reconcile. Such a system replaces the fleet’s revision each run, so a dashboard or API edit lasts only until then, silently. Naming the system’s token as the document’s only writer turns that loss into a refusal at the moment of the edit:

api:
auth:
tokens:
- {id: gitops, token: "${CREWLET_API_TOKEN_GITOPS}"}
- {id: founder, token: "${CREWLET_API_TOKEN_FOUNDER}"}
company_writers: [gitops] # only this token may change the company document

With company_writers set, every write that changes the document refuses any other credential with 403 config_managed, naming the writers and what to do instead. The credential is judged, never the author: a listed token writes because the request came through it (operator_id is its login, token:<id>), so a person’s session, a machine token acting as its owner, a session exchanged from a listed Tier A token and a lead writing their own team are each refused, since each is an edit the next reconcile would overwrite. The check runs after the route’s own grant and before the body is read, so a refusal costs no parse. Reads are unchanged: every administrator still reads /config, its history and its diffs.

Refused for a credential not listedStill open to whoever the authority table admits
PUT and PATCH /config, every per-entity PUT /config/{kind}/{id}, POST /config/revisions/{id}/revert, and the ?dry_run=true check of each — a check answers what the write would, and the write would be refusedPOST /config/reload, which re-publishes the fleet’s document’s own bytes
A /setup connect that writes a pointer, a disconnect, and an agent’s GitHub App — each refused before anything is sealed, queued or created at the vendorA /setup submission that only rotates a value the document already names, and the provisioning pass and its check
An offline crewlet config import, an offline crewlet config activate of any revision but the company’s own, and crewlet run -import-company; a -company bootstrap seed is not read at all — neither imported nor run, so a stray ./company.yaml neither becomes the company nor fails the boot — and a company_seed_ignored warning names it/secrets, crewlet secrets and crewlet config rekey, and crewlet config activate of the company’s own revision (the one crewlet config show prints), the offline re-publish a rotated credential needs

Why the secret store and a rotation stay open. A leaked credential must be replaced now, by whoever holds the new one, and the managing system cannot know it is needed. Writing the new value and re-publishing the unchanged document (PUT /secrets/{name} then POST /config/reload, or one rotation through Company › Integrations) changes nothing the managing system renders, so it is the break-glass a person keeps. If the managing system also syncs the secret store, it overwrites a rotated name it owns at its next sync; fix the value at its source too.

The engine’s own writes are not judged by the list. A reconcile pass that records what it discovered at a vendor writes as the engine itself (kind system), not as a credential; a managing system that re-renders the document should carry those values (they are in the revision GET /config answers) or set them itself. That includes a provisioning pass any operator starts on demand from /setup or Company › Integrations: where integrations.jira or integrations.confluence has no cloud_id, the Atlassian pass records the cloud_id and site_url of the site it found, and the revision is credited to the engine (reconcile loop, kind system), not to the person who pressed the button.

It prevents drift; it is not a privilege boundary. company_writers stops a person’s edit from being silently overwritten, nothing more. Every administrator still writes the secret store and can reload, so a non-writer can still change what the managed document does by rewriting a value it references (a model’s API key, a webhook secret, any URL or endpoint kept as a ${VAR}) and publishing it with POST /config/reload. To keep somebody away from the company’s behaviour, do not grant them admin.

The dashboard shows the document as managed. The viewer answer says whether the caller’s credential may change the document (config_writer) and who manages it (config_managed_by); every control that writes the document, a lead’s edit of their own team included, is drawn disabled with that sentence, and the org builder opens read-only.

crewlet validate warns about a list that is valid and almost certainly wrong, and so does every start of the node, as config_advisory: an id that names no token in api.auth.tokens (it lets nobody write), and a list naming no configured token at all (nothing may change the document through the API: a frozen document). An entry outside the token-id grammar every api.auth.tokens[].id is held to, or a repeated one, is refused outright. The list is per node, like the rest of api.auth: give every node the same one.

To take the document back, remove company_writers from every node’s Tier A and restart. The decision and its boundaries are ADR-0030.


Every node holds a Tier A keyring (crewlet validate refuses a crewlet.yaml without one and a node refuses to start; see What Tier A must state on every node), so Tier B has one secret-handling behaviour, not two.

A credential in the company document is normally a ${ENV_VAR} reference, stored verbatim and resolved where a provider, transport or integration is constructed (internal/engine). It resolves from the encrypted secret store first, then the process environment, so a provisioner can hand a minted credential straight to the engine without a file to source, and a deployment keeping credentials in its platform’s own secret mechanism needs nothing else.

A repository’s mirror and import credentials in code.repos (mirror_from.credential, mirror_to.credential, import.credential) are held to more: each must be one whole ${VAR} and nothing else, and crewlet validate refuses a literal or a reference with text around it. The code log records each repository’s settings on every data node and in every backup, so it records the reference, never what it resolves to; Gitlet resolves it (store first, then environment) only when it dials the other host (Declaring repositories). Rotating the token is then a crewlet secrets set and no new revision. Each must also name a variable code.remote_credentials declares for its URL’s host: the Gitlet node sends the value there, so that table is where an administrator decides which value may leave for which host, for these declarations, for the mirrors and imports a person asks for, and at every dial.

Crewlet encrypts the entire company_config payload as one opaque blob (AES-256-GCM) under the keyring before it reaches the DB:

# crewlet.yaml (Tier A) — the keyring is the sole root of trust
secrets:
active_key_id: "2026-01"
keys:
- id: "2026-01"
material: "${CREWLET_SECRET_KEY_2026_01}" # base64(32 bytes); crewlet secrets keygen

The document is stored as {"__encrypted__": "enc:v1:<key_id>:<base64>"}: nothing about the company’s structure (org chart, policies, model choices, integrations, secrets) is visible in the database.

  • Encrypt on write. Every write path (PUT /config, per-entity PUT, crewlet config import, crewlet run -company / -import-company) encrypts the whole document before it reaches the DB.
  • Decrypt at the read boundary. The engine, the API, migrations and the CLI each decrypt the blob (secrets.Open, then config.DecodeCompany) before use, so the Tier A key is required for every config read. ${VAR} references inside the config stay verbatim in the blob and resolve from the environment at construction.
  • Fail closed. A revision sealed under a key this node’s keyring does not hold is refused rather than run as an opaque blob, and so is one sealed in a form this build does not read, most likely by a newer build. No write replaces either: each is somebody’s document that the key, or the build that sealed it, recovers whole.
  • Authenticated, not only hidden. The document a node fetches from its peers comes through the coordination store, which anything reaching the broker can write, so the seal also proves a node of this fleet wrote it. A revision stored unsealed is never applied, kept, shown, edited or reverted to. The error says an admin sends the whole document again, from their own copy, with PUT /config or crewlet config import, and either stores it sealed. Neither reads anything from the unsealed revision; they only replace it (see A whole document replaces an unsealed revision). See Control Plane § The design.
  • One key, not N env vars. The engine needs only the Tier A key in its environment, not a per-secret env var for every LLM key, MCP token and webhook secret.

Because the key gates every read, keep it as available as the database itself: the API, dashboard, migrations and CLI all fail closed without it.

Threat model. Encryption at rest defends against data-at-rest exposure: a leaked backup, a copied store file, a stolen volume snapshot, a coordination-store dump on a laptop, where the attacker gets one opaque ciphertext blob per revision. It also keeps config egress clean (GET /config, dashboard views and revision diffs are decrypt-then-redact) and absorbs accidental plaintext (a raw key pasted into company.yaml is encrypted on write). It does not defend against a compromised engine host holding both the DB and the Tier A key (it must decrypt to run; keep the key out of the store’s backup domain), a malicious operator with a valid key and API access, or in-memory extraction from the live process. Plaintext config exists only transiently in the encrypt/decrypt path and in the live engine’s memory, never in durable storage.

Rotating one secret (e.g. a leaked LLM key) needs no host access: PUT /config (or a per-entity write) with the new value re-encrypts the whole document under the active key as a new revision.

Rotating the master key uses the keyring’s multi-key support, with no downtime. The rotation runbook is the whole procedure; in outline:

Terminal window
crewlet secrets keygen -key-id 2026-07 # mint the new key
# 1. add it to secrets.keys on every node, leaving active_key_id alone; restart
# 2. set active_key_id: 2026-07 on every node; restart again
crewlet secrets rekey # 3. the secret store and every person's sealed values, through the running node
curl -X POST "$CREWLET_URL/config/reload" \
-H "Authorization: Bearer $CREWLET_API_TOKEN" # and the company document
# 4. drop the old key only once the runbook's conditions hold

Both re-seals are required. The company document, the secret store (the engine’s own blind-index key included, once anybody has been added) and every person’s name, address and second factor in the identity estate are all sealed under this keyring, so a key dropped while any is still under it leaves that thing unreadable.

  • A reload stores the fleet’s document again under the node’s active key and activates it.
  • On a stopped node, crewlet config rekey re-seals the revision that node boots on, and its next start publishes the re-sealed copy only while the fleet still runs the revision it was built on (offline commands make an offer); crewlet config rekey -dry-run reports whether it would re-encrypt without writing. The envelope carries the id of the key that sealed it, so either way the document is decrypted under whichever key sealed it and re-encrypted under the active key.
  • crewlet secrets rekey moves every person’s sealed values only through a running node, whose engine holds the identity estate. With the node’s engine stopped, it reaches the fleet’s store itself and re-seals that store’s rows (the engine’s own keys among them), and says to run it again through a running node for the rest.

On a single node, steps 1 and 2 can be one restart. On a fleet they cannot: a node that flips first signs records, cookies and requests under a key its peers do not hold yet, and presents a broker credential its peers do not hold either, so a leaf restarted onto a flipped keyring before any member links nowhere and fails its boot naming the key. The broker needs no step of its own beyond that order: every node accepts every key of its keyring. An operator key crewlet fleet broker credential wrote keeps working until its key is dropped; write it again after step 4.

Every configuration read redacts credentials: GET /config (JSON and ?format=yaml), GET /config/revisions/{id}, the revision diff, the entity reads (GET /config/roles/{handle}, /config/units/{id}, /config/llm-providers/{key}, /config/mcp-servers/{name}), the dashboard’s config and config_entities queries, crewlet config show and crewlet config diff. The read opens the whole document and replaces every credential value with the literal "__redacted__". The /org view, read by everybody signed in, needs no masking: it is an explicit projection of the charter and organization tree with no credential field (see API endpoints). A revision sealed under a key the node does not hold is refused, not served.

What counts as a credential is structural. A field is a credential because its Go type carries a secret tag (secret:"true", or secret:"content" for a file’s body, which is read whole; see setup steps), never because of how its value or key reads. A tag on a list or map covers every element. Tagged company fields: a providers.llm entry’s auth.token, auth.api_key, auth.credential_bundle and env, the embeddings and sandbox api_key, integration tokens, admin tokens, API and app keys, webhook and signing secrets, a seat’s integrations.slack bot token and signing secret, integrations.mattermost.bot_token, the GitHub App private key and webhook secret, every mcp_env value on a seat or unit, mcp_servers[].env and mcp_servers[].headers, role.sandbox.env, each sandbox setup step’s env and files (under providers.sandbox.setup and role.sandbox.setup), and code.checks.env. Everything else (URLs, hosts, flags, model names, the org chart) is served as stored, including explicit toggles: a schedule kept with enabled: false reads as disabled, so sending the read back never re-enables it.

A test fails the build when a field named like a credential, or a map[string]string named env, headers or files, lacks the tag, in either tier. Tier A’s credentials carry it too (secrets.keys[].material, api.auth.tokens[].token, stream.token, store.objects.s3.secret_access_key; see credential positions). The same tag marks each position "x-crewlet-secret": true in the generated JSON Schema, which a second test holds to exactly the set a read masks. Tooling that writes a company without the engine (an editor, a CI linter, a Kubernetes operator rendering from its own Secrets) thus knows where a ${VAR} belongs instead of a value.

Only a whole ${VAR} reference is shown. A credential field whose value is exactly one reference ("${TRACKER_TOKEN}") stays visible: it names a credential and carries none, since the value lives in the environment or the secret store. Every other non-empty value is masked, including one embedding a reference beside literal text: "Bearer sk-live-${SUFFIX}" and "sk-live-SECRET-${ROTATION}" are legitimate (the resolver expands embedded references) but their literal half is a credential. A value using brace syntax the resolver ignores (${line#host=}, ${1}, an unclosed ${) is not a reference and is masked. What is a reference is the engine’s own grammar (internal/envref). GET /config/references reads the unredacted document and lists, with paths, the variable names embedded references carry (names only).

A redacted GET, an edited field and a full-document PUT round-trip safely: the write path swaps each marker back to the stored value before validating, so a round trip never clobbers or exposes a credential. To change one, supply the new value (or a ${VAR}) at that field.

Members are matched by identity, not by position. Positional matching would silently hand a reordered member its neighbour’s credentials, since lengths agree and no marker is left to refuse. Each member that can name itself is matched by that name:

  • A seat by its handle, and a unit by its key, anywhere in the document. One index covers the whole stored revision, so a seat moved from the root into a unit, between units, or back to the root keeps its credentials, as does a unit moved under another unit. Reordering the roster or adding a seat restores every other member’s credentials.
  • An MCP server, and a sandbox setup step, by name within its own list. Names are unique within a list: two MCP servers of one name are refused, and two setup steps of one name are refused on every write (an admission rule). Reordering a list or adding a member restores every other member’s credentials.

An identity that does not name exactly one member matches nothing. A seat with a new handle, a unit with a new key, and an MCP server or setup step with a new name carry no prior value. An identity that is empty, or that the stored revision holds twice, is left out of the match: picking either member, or falling back to position, would hand one member’s credentials to another. In every such case the mask stays and the write is refused with a validation error naming the field, so the caller writes the real value, or a ${VAR}, there.

The untyped maps (mcp_servers[].env and .headers, a providers.llm entry’s env, a sandbox step’s env and files) are masked whole, every value, whatever its key. A host or region set beside a token in one is masked with it; write it as a separate untagged setting where one exists, or as a ${VAR}.

crewlet config export runs on the host, where the keyring is, and prints the revision as YAML with credentials in the clear: it opens a sealed revision and renders the document, importable as it stands, as a restore or migration needs. It is the one command that prints credentials. crewlet config export -redact masks exactly what the reads above mask, for a dump safe to share.


An engine runs exactly one company. It opens one store file holding one company_config table, which marks at most one row the node boots on (is_active; none in the unconfigured boot state) and at most one as the fleet’s revision (is_fleets). There is no tenant column or row-level scoping: the revision the fleet’s pointer names is the company, and each engine runs it once applied. The secret store follows the same rule: one company per coordination estate, so a variable name alone is the key.

To run a second company, run a second engine with its own database.

Part of Crewlet. Generated from crewlet/crewlet main at 3f5565e.