This guide walks you through setting up Open SWE end-to-end: local development, GitHub App creation, Linear and Slack webhooks, and production deployment.
- **Callback URL**: Set this to `https://smith.langchain.com/host-oauth-callback/<your-provider-id>` (replace `<your-provider-id>` with the actual provider ID you configure in LangSmith during step #3. e.g. `github-oauth-provider`)
- **Request user authorization (OAuth) during installation**: Enable this
6. Note the **App ID** from the app settings page - you'll need this for the `GITHUB_APP_ID` environment variable.
7. Generate a **private key** (scroll down on the app page → **Generate a private key**). Save the `.pem` file contents. You'll need to set this under `GITHUB_APP_PRIVATE_KEY`.
- Note the **Installation ID** from the URL after installation (e.g. `https://github.com/settings/installations/12345678` → `12345678`) - you'll need to set this under `GITHUB_APP_INSTALLATION_ID`
Open SWE uses [LangSmith](https://smith.langchain.com/) for two things:
- **Tracing**: all agent runs are logged for debugging and observability
- **Sandboxes**: each task runs in an isolated LangSmith cloud sandbox
1. Create a [LangSmith account](https://smith.langchain.com/) if you don't have one
2. Go to **Settings** → **API Keys** → create a new API key
3. Save it as `LANGSMITH_API_KEY_PROD`
### GitHub OAuth (for user authentication)
Open SWE resolves GitHub tokens per-user via LangSmith's OAuth integration. This lets each user authenticate with their own GitHub account rather than sharing a single bot token.
You'll need these from your LangSmith workspace settings:
Open SWE routes Linear issues to GitHub repos based on the Linear team and project. The mapping is defined in `agent/utils/linear_team_repo_map.py` in the `LINEAR_TEAM_TO_REPO` dict:
1.**redirect_urls**: `"https://smith.langchain.com/host-oauth-callback/<replace-with-your-langsmith-oauth-provider-id>"` add your LangSmith OAuth provider ID you set when creating the OAuth provider in LangSmith.
2.**request_url**: `"https://<your-ngrok-url>/webhooks/slack"` add your ngrok URL pointing to `http://localhost:2024` for local development, or your LangSmith deployment URL if deployed on LangSmith Deployments.
Install the app to your workspace and copy the **Bot User OAuth Token** (`xoxb-...`).
**Credentials you'll need:**
-`SLACK_BOT_TOKEN`: the Bot User OAuth Token (`xoxb-...`)
-`SLACK_SIGNING_SECRET`: found under **Basic Information** → **App Credentials**
-`SLACK_BOT_USER_ID`: the bot's user ID (find it in Slack by clicking the bot's profile)
-`SLACK_BOT_USERNAME`: the bot's display name (e.g. `open-swe`)
**Configure default repo:**
Slack messages are routed to a default repo unless the user specifies one with `repo:owner/name`:
```bash
SLACK_REPO_OWNER="my-org" # Default GitHub org
SLACK_REPO_NAME="my-repo" # Default GitHub repo
```
### GitHub
GitHub triggering works automatically once your GitHub App is set up (step 2). Tag `@openswe` in PR comments on agent-created PRs to have it address review feedback and push fixes to the same branch.
In order for Open SWE to recognize users who should be able to trigger it via GitHub, you'll need to add them to the `GITHUB_USER_EMAIL_MAP` in `agent/utils/github_user_email_map.py`. The email should be the same email associated with their LangSmith account.