Skip to content

Set up accounts

By the end, every external account OpenSwitchboard 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 AppFrom a manifest → paste slack-app-manifest.yaml.
  2. Basic InformationApp-Level Tokens → generate one with connections:write: xapp-… is SLACK_APP_TOKEN.
  3. Install AppInstall to Workspace: the Bot User OAuth Token xoxb-… is SLACK_BOT_TOKEN.

Socket Mode is on in the manifest. Its scopes cover mentions, replies, thread history, channel lists, user names, files, the 👀 reaction and direct messages. The bot logs any scope its token lacks on first connection.

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 SettingsDeveloper settingsGitHub AppsNew 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 keysGenerate 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 @coreplane/switchboard 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