Skip to Content

Config

SwB can run with environment variables alone. The MCP block starts by default. Some blocks start when you set their variables. Use a YAML file for more settings. YAML is a text format for settings.

Instance

VariableUse
SWB_KEY_OWNEROwner key for SwB tools and commands
SWB_PUBLIC_URLPublic address for sign-in and MCP. Use HTTPS for a remote server, for example https://swb.example.com.
SWB_HOSTAddress for incoming connections. The default is 127.0.0.1.
SWB_DATA_DIRThe data folder. The image uses /data.
SWB_OWNER_EMAILSOwner email addresses for OpenID Connect (OIDC) and Cloudflare Access. Separate addresses with commas
SWB_KEY_<NAME>Key for agent <name>. The agent sends it as a bearer key in the Authorization header
SWB_CONFIGThe path of the base YAML file
SWB_OVERLAYThe path of a private overlay file
SWB_PORTHTTP port. The default for swb up is 8870.

Set SWB_PORT in the shell or the instance .env file. If your hosting platform sets a different port, use --url to select the running server for client commands.

Use swb up --public-url https://swb.example.com to set the public URL on the command line. For this run, the option takes priority over YAML public_url. YAML takes priority over SWB_PUBLIC_URL.

Use --host to override SWB_HOST. Set a public URL before you use --host 0.0.0.0 or an address on your local network.

Use swb up --dir ./my-swb to read .env and config/switchboard.yaml from that folder. Use the same --dir with swb init. With plain swb up, use SWB_CONFIG to select a different config file.

swb status, swb login-link, swb connect and swb claim use --dir to find .env. They use --url to select the server address.

The server commands accept --dir. They are swb serve, swb export, swb log, swb config migrate, swb blocks and swb targets. SwB reads .env and the config from the selected folder. It also uses that folder to find the instance data for commands that use the database.

With plain swb serve, SwB reads the shell and the config file. The other server commands use the current folder by default.

Use swb config migrate [file] to print a config in version 2 format. Pass file to select a specific config. Otherwise, SwB uses the config from --dir, SWB_CONFIG or the default path.

Data folder

swb up and swb init create a data/ folder for a new instance. SwB uses that folder by default. Use swb up --dir to select a different instance folder.

Set data_dir in the config or overlay to change the path. That setting takes priority. SwB then checks SWB_DATA_DIR and SWB_DATA in that order. The default applies when all three settings are empty.

Plain swb up keeps existing config files. If the instance has a config file, SwB checks for the old database in ~/.local/share/switchboard when data/ is absent. SwB logs a notice once if it uses that database.

On Linux and macOS, SwB sets the data folder to private mode 0700. It sets database files to private mode 0600.

Blocks

Some blocks can start from credentials in the environment. See Blocks for setup. The release environment example shows the credential names for named workspaces and routines.

The config file

swb up sets up a new instance in its folder. It stores the owner key in .env and saves a custom SWB_PORT there. It sets the file mode to 0600.

Run swb init to create the files before you start SwB.

swb init

Both commands write version: 2 to config/switchboard.yaml by default. Pass an address to swb init --public-url to save it there. On its first run, swb up saves the address from --public-url or SWB_PUBLIC_URL. Add blocks to choose which blocks to load. Replace CAPTAIN_ID with your Capy Captain ID.

version: 2
public_url: https://swb.example.com
auth:
  owner_emails: [owner@swb.example.com]
blocks:
  mcp: {use: mcp}
  capy: {use: capy, identity: service}
targets:
  aliases: {}
routes:
  - {match: {}, to: capy:captain:CAPTAIN_ID}

SwB uses the blocks section in place of automatic block selection. Set enabled: false for the MCP block to turn it off. Block settings can still read credentials from the environment.

Overlays

An overlay is a YAML file for settings specific to your instance. Save it as local.yaml next to the base config file, or set its path with SWB_OVERLAY. The overlay takes priority over the base file. The base file takes priority over environment defaults. Settings grouped by name merge. The overlay replaces lists.

In a key, * stands for an entry name or a list item.

Core

KeyUse
versionYAML format version. Use 2 for blocks
public_urlPublic address for MCP and sign-in. OAuth lets an app sign in with your approval
data_dirPath to the data folder. Set it here or with SWB_DATA_DIR
timezoneTime zone for daily counts and limits. Default UTC
turn_capTurns before SwB pauses a conversation. Default 200. Set null to turn off the limit
blocksBlocks to load, named by type or by your own label
agentsAgent definitions by name
agents.*.labelDisplay name for an agent
targetsTarget names and their priority
targets.aliasesMap from a short name to a target name or address
targets.priorityOrder to use when targets share a name. For example, [capy:captain, agent, project]
routesInitial routes. SwB keeps routes that are already set
routes.*.matchMatch an agent, a project or both. Use {} for the global route
routes.*.toAddress to send to when the route matches

Sign-in and keys

KeyUse
authSign-in and key settings
auth.owner_emailsEmail addresses that can sign in as the owner through OIDC or Cloudflare Access
auth.cloudflare_accessCloudflare Access sign-in settings. Supply both fields and set auth.owner_emails
auth.cloudflare_access.team_domainYour Cloudflare Access team domain
auth.cloudflare_access.audAudience tag that identifies the Access application
auth.redirect_urisAllowed OAuth return addresses. This list replaces the built-in set. Use /* to match a path and its subpaths
auth.source_namesMap from part of an OAuth host or client name to the agent name used for sign-in
auth.key_scopesAccess scopes by key or agent name, such as [project:example]. These scopes limit routes, messages and conversations. They also limit configured keys and OAuth clients when they use memory. For paired keys, SwB adds named memory scopes to the grants at pairing
auth.key_toolsMap from key name to allowed MCP tools, for example [send]
auth.key_targetsAllowed message targets by key name, for example [agent:claude]. A key with this limit must name an allowed target
auth.inbox_keysMap from key name to the one agent whose inbox it can read. The built-in entry is channel: claude-code

For Cloudflare Access sign-in, SwB uses the token from the Cf-Access-Jwt-Assertion header. If the header is empty or absent, SwB reads the token from the CF_Authorization cookie. A cookie is a value the browser sends with a request. SwB checks the RS256 signature with public keys from team_domain. The token issuer must match the HTTPS address of team_domain. The token must name aud as an audience. SwB checks the issue, start and expiration times when the token supplies them. SwB compares the email in lower case with owner_emails.

Visibility

KeyUse
visibilityRules for who can access a resource. Tools stay private
visibility.defaultsDefault rules by resource type. All types start as private
visibility.defaults.channelDefault rule for channels
visibility.defaults.memoryDefault rule for memory scopes
visibility.defaults.routeDefault rule for routes
visibility.defaults.targetDefault rule for send targets
visibility.resourcesRules for specific resources such as channel:home/#agents. Each rule takes priority over its type default

For Slack, channel:home/#agents is a channel rule. For GitHub, share both channel:github/acme/app and target:beta to let outside senders reach agent:beta. See channel visibility.

Use private for the owner and their agents. Use shared to open access. List user IDs or entries such as workspace:home to share with selected people. Changes made with visibility_set take priority over this file.

GitHub sender trust

KeyUse
blocks.github.owner_idsDefault list of numeric GitHub user IDs trusted as owners
blocks.github.spaces.*.owner_idsList of numeric GitHub user IDs that replaces the default for this space

GitHub uses owner and external trust. On Slack, Discord and Telegram, known helps SwB choose whose messages to accept. Messages from other senders keep external trust. See Owner accounts for Work mode setup.

MCP

KeyUse
blocks.mcpSettings for the block that serves MCP clients
blocks.mcp.useBlock type. Use mcp
blocks.mcp.legacy_aliasesKeeps older MCP tool names such as agent_send, capy_delegate, capy_wait and capy_reply available. Default true
blocks.mcp.waitLimits for tool calls that wait for a reply
blocks.mcp.wait.default_sWait time in seconds when the caller leaves it blank. Default 60
blocks.mcp.wait.max_sMaximum wait in seconds. Default 200
blocks.mcp.wait.agentsMap of wait limits by agent. Claude Code uses 45 seconds by default and at most 55 seconds
blocks.mcp.wait.agents.*.default_sDefault wait in seconds for this agent
blocks.mcp.wait.agents.*.max_sMaximum wait in seconds for this agent

Memory and channel modes

See Channel modes to bind a project route and set triage actions.

KeyUse
memorySettings for the Markdown copy of memory
memory.mirrorControls the Markdown copy. Set false to stop updates
memory.mirror_dirFolder for the Markdown copy
memory.mirror_debounce_sSeconds to wait after a memory change before writing the copy. Default 2
modesSettings for how SwB acts on incoming events
modes.defaultDefault mode. The default is off
modes.projectsDefault mode for spaces assigned to each project
modes.assist_max_charsCharacter limit SwB gives agents for an assist reply. Default 1500
modes.digest_minutesMinutes to collect watch events before a summary. Default 60. SwB also sends a summary at 50 events

Branding

branding:
  display_name: SwB
  accent_color: "#64748b"
KeyUse
brandingSettings for the name, icon and colors that SwB shows
branding.display_nameDisplay name. Default SwB
branding.accent_colorAccent color in #RRGGBB format
branding.iconCustom icon
branding.logo_assets_dirFolder for custom logo files
branding.public_identityInternal field fixed at swb in this release

Full reference

config/switchboard.example.yaml has a YAML example with notes.

On this page