Skip to content

Set up accounts ​

By the end, every external account Switchboard can use exists with exactly the permissions the code needs, and each credential is where the bot reads it.

You need: admin rights in the Slack workspace, the GitHub organization and, for production, the Cloudflare account.

AccountRequired?What it unlocksCredential
A Slack appfor SlackMentions, threads, status cardsSLACK_BOT_TOKEN, SLACK_APP_TOKEN
One model provideryesEvery agentANTHROPIC_API_KEY, or the variable your provider block names
A GitHub Appfor coding and reviewRepository reads; pull requestsGITHUB_APP_ID, GITHUB_APP_INSTALLATION_ID, GITHUB_APP_PRIVATE_KEY
Cloudflarefor productionHosting; the Workers; AccessCLOUDFLARE_API_TOKEN
E2BoptionalPer-thread sandboxes without CloudflareE2B_API_KEY
Brave SearchoptionalThe research agent's web searchBRAVE_SEARCH_API_KEY

Credentials are environment variables: .env locally, a Worker secret on Cloudflare (Deploy).

Create the Slack app ​

  1. At api.slack.com/apps: Create New App → From a manifest → paste slack-app-manifest.yaml.
  2. Basic Information → App-Level Tokens → generate one with connections:write: xapp-… is SLACK_APP_TOKEN.
  3. Install App → Install to Workspace: the Bot User OAuth Token xoxb-… is SLACK_BOT_TOKEN.

Socket Mode and interactivity are on in the manifest. Its scopes cover mentions, replies, thread history, channel lists, user names, files, the 👀 reaction and direct messages, and its Messages tab is enabled so people can DM the bot. The bot logs any scope its token lacks on first connection. An app created from an earlier manifest needs Interactivity & Shortcuts switched on by hand (no request URL is asked for under Socket Mode): the Run and Cancel buttons a routed state change is offered with reach the bot only with it on; until then the message still carries the line to type.

Add a model provider key ​

yaml
providers:
  anthropic:
    type: anthropic
    apiKeyEnv: ANTHROPIC_API_KEY
  openai:
    type: openai-compatible
    baseUrl: https://api.openai.com/v1
    apiKeyEnv: OPENAI_API_KEY

openai-compatible covers Groq, Ollama or vLLM with another baseUrl. An Admin API key in ANTHROPIC_ADMIN_KEY adds model spend to the costs page.

Create the GitHub App ​

  1. Organization Settings → Developer settings → GitHub Apps → New GitHub App. Under Webhook, untick Active.

  2. Repository permissions:

    PermissionLevelUsed for
    ContentsRead and writeCloning; branches and pushes
    Pull requestsRead and writeReading a PR; opening one; posting the review
    IssuesRead and writeReading tasks; creating, commenting, labelling
    MetadataRead-onlySet automatically
  3. Private keys → Generate a private key: the .pem is GITHUB_APP_PRIVATE_KEY.

  4. The General page shows the App id: GITHUB_APP_ID.

  5. Install App → your organization → Only select repositories. The installation id ends the URL you land on: GITHUB_APP_INSTALLATION_ID.

bash
npx --yes @coreplane/switchboard@<version> init --force --organization <org> --anthropic-key <key> --github-app-id <app id> --github-installation-id <installation id> --github-private-key-file <path to .pem>
  • A repository outside the installation is refused by name; the review agent gets a read-only token.
  • The resident Worker needs the same three secrets.
  • Fallback for a solo installation: GH_TOKEN, a fine-grained personal token.

Cloudflare ​

Cloudflare is the one production target. You need an account, a zone in it, and an API token for the account in CLOUDFLARE_API_TOKEN with Workers Scripts: Edit, Containers: Edit, Workers R2 Storage: Edit and Account Settings: Read on the account, plus Workers Routes: Edit and DNS: Edit on the zone. Containers Edit is also what the image copy into your registry needs.

An Access application's team domain and AUD go in the profile's access block.

E2B ​

yaml
execution:
  type: e2b
  apiKeyEnv: E2B_API_KEY
  timeoutMinutes: 30

Set BRAVE_SEARCH_API_KEY; without it the research agent has no web search.

Next ​

Optional Slack source read account ​

To read linked sources without adding Switchboard to those channels, an admin can authorize one read-only Slack user account on the existing app. Store its user OAuth token as SLACK_READ_TOKEN in the deployment profile's secret source and set slack.readerTokenEnv: SLACK_READ_TOKEN. Provision that secret on the bot Worker and restart through the normal deployment path. Do not put the token in configuration, chat or the repository.

The read account needs channels:read, channels:history and users:read. Add groups:read and groups:history only for approved private sources, and files:read when file reads are needed. The app manifest lists these user scopes separately from the bot's scopes. The connection must belong to a full user in the same workspace and have no other scopes. Users do not connect accounts individually.

This account makes HTTP reads only. It neither joins channels nor changes the bot's subscriptions. Public sources require a full workspace requester. Private sources additionally require fresh requester membership and private delivery. The bot retains listening, current-thread context and replies. Configuring the connection without its named token fails startup; leaving it unconfigured preserves the existing bot-member-only source reader.

Slack documents user-token access for thread replies and channel history.