swarm.yaml; environment variables are not a
configuration source. swarm verify is the only command that runs without a runtime or a token. Every other command
targets the runtime’s API and needs a bearer token.
Connecting to the runtime
The runtime exposes one HTTP listener serving health, readiness,/v1/rpc, /v1/ws, and the
MCP routes. Its default address is http://127.0.0.1:8081.
Configuration is one file format — swarm.yaml — discovered in layers, later layers
overriding earlier ones:
- user-global
$XDG_CONFIG_HOME/swarm/swarm.yaml - project
./swarm.yaml - local operator
./.swarm/swarm.yaml(machine-local overrides; keep it out of git) - explicit
--config <path>(orSWARM_CONFIG, the one accepted env pointer)
string
Base URL of the runtime. Default
http://127.0.0.1:8081. Config: connection.api_server.string
File holding the bearer token. Required for every command except
swarm verify. Config:
connection.api_token_file (client side) / serve.api_token_file (server side). An inline
--api-token is not accepted, to keep secrets out of shell history.swarm run
swarm run start reaches a runtime in one of two ways:
- Local (default). With no
--connect, it boots a runtime in process on127.0.0.1:8081. Override the port with--api-port <n>. - Connected. With
--connect <url>, it attaches the run to an already-running runtime (started byswarm serve) instead of booting its own.
Local startup flags
These flags configure a runtime thatswarm serve or swarm run start boots in-process. They have no
effect when attaching to a running runtime with --connect.
string
Explicit
swarm.yaml config file; overrides the discovered layers listed above, then
built-in defaults apply for anything unset.Older releases read a separate
config.yaml next to the running binary. That two-file model
was unified into the layered swarm.yaml described on this page.string
Path to the agent-visible read-only
/data reference directory. Resolution order:
--data > workspace.data_source in swarm.yaml > the auto-default .swarm/data/
(created next to .swarm/dev.db if it doesn’t exist, so the runtime starts with no /data
configuration). Available on both swarm serve and swarm run start.--store and --backend are documented under Runtime store and
LLM backend and credentials.
The configuration file: swarm.yaml
One schema, discovered in layers (later overrides earlier):
Keys are trust-tiered:
A committed
swarm.yaml in a cloned repo cannot expose your machine.
The top-level sections (swarm doctor reports which layers loaded and what each supplied):
connection.*— CLI target:api_server,api_token_file, contextsserve.*— listeners and server token:api_listen_addr,mcp_listen_addr,api_token_filepaths.*—contracts_path,platform_spec_path, prompt and tooling pathsstore.*/database.*— backend selection and Postgres parametersllm.*— backend profile, model aliases per backend, session rotation, provider rate/concurrency limits,claude_clisettingsworkspace.*— backend preference,data_source, image settingsruntime.*—recovery_on_startup, decision-card cadence (first reminder, urgency, reminder interval, input draft TTL)budget.*— global/per-entity/system monthly caps, human-task budgetssharding.*— parallelism bounds for sharded agent workloadsprovider_triggers.*/channels.*— pack directories
Runtime section shape
--store > store.backend, --backend > llm.backend,
--data > workspace.data_source). There are no env-var equivalents. See the sections below
for each subsystem’s precedence.
Backend selection is
--backend or llm.backend only; for the removed spellings, see
Retired settings.Runtime store
The runtime stores events, entity state, gates, timers, and sessions in a relational database. SQLite is the default for local and development runs (file-backed at.swarm/dev.db, no
service needed); Postgres is the opt-in backend for external and production deployments.
Select the backend with --store sqlite or --store postgres, or store.backend in
swarm.yaml; the flag overrides the config key.
string
Runtime store backend:
sqlite (local/dev default, file at store.sqlite.path, default
.swarm/dev.db) or postgres (external/production opt-in).object
Postgres connection parameters (used when
postgres is selected): database.host,
database.port, database.name, database.user, database.sslmode,
database.pool_size. Defaults: 127.0.0.1, 5432, swarm, postgres, disable. The
password is never read implicitly: declare database.password_env: <VAR> and exactly that
named environment variable becomes the accepted source (see
Retired settings).LLM backend and credentials
Select the LLM backend with the--backend flag on swarm serve or swarm run start, or with
llm.backend in swarm.yaml. Environment variables never select the backend (see
Retired settings). The default backend when nothing is set is
anthropic. A flow with no agents boots without any credential.
Credentials are read from the environment and a local credential store, and are never logged
or persisted. For the removed profile ids, see Retired settings.
Storage
string
Runtime-private root for git repositories written by
artifact_repo_commit (a
deployment-environment variable, not a config key — one of the few the runtime reads
directly). Default /var/lib/swarm/artifacts. Never mounted into agent sessions.Budget caps
Thebudget_*_percent thresholds in policy.yaml are percentages of a monthly USD cap, set in
the budget: configuration section. A scope is monitored only when its cap is above zero. See
Budget and cost.
swarm.yaml
Sharding
When a node fans a workload across multiple instances of an agent (Agent sharding), thesharding: section bounds the
parallelism so it cannot run away. The defaults apply when a key is omitted.
swarm.yaml

