
Language model
The review agent uses whichever language model you have configured in yourconfig.json. All providers supported by Sourcebot (OpenAI, Anthropic, AWS Bedrock, Azure OpenAI, and others) work out of the box.
If you have multiple models configured, set REVIEW_AGENT_MODEL to the displayName of the model you want the agent to use. If this variable is unset, the agent uses the first configured model.
GitHub
Register a GitHub app
Follow the official GitHub guide for registering a GitHub app.
- GitHub App name: Any name you choose (e.g. Sourcebot Review Agent)
- Homepage URL: Any URL you choose (e.g.
https://www.sourcebot.dev/) - Webhook URL (required): Your Sourcebot deployment URL at
/api/webhook(e.g.https://sourcebot.example.com/api/webhook). Your deployment must be reachable from GitHub. If you are running Sourcebot locally, use smee to forward webhooks to your local deployment. - Webhook Secret: Any string (e.g. generate one with
python -c "import secrets; print(secrets.token_hex(10))") - Permissions
- Pull requests: Read & Write
- Issues: Read & Write
- Contents: Read
- Events
- Pull request
- Issue comment
Install the GitHub app in your organization
Navigate to your new GitHub app’s page and press Install.
Configure environment variables
Set the following environment variables in your Sourcebot deployment:
You can generate a private key in your app settings.
Example
| Variable | Description |
|---|---|
GITHUB_REVIEW_AGENT_APP_ID | The client ID of your GitHub app, found in your app settings |
GITHUB_REVIEW_AGENT_APP_WEBHOOK_SECRET | The webhook secret you set when registering the app |
GITHUB_REVIEW_AGENT_APP_PRIVATE_KEY_PATH | Path to your app’s private key file inside the container (e.g. /data/review-agent-key.pem). Copy the key file into the directory you mount to Sourcebot. |

docker-compose.yml:GitLab
Create a GitLab access token
Create a personal access token or project access token with the following scope:
api
Configure a webhook in GitLab
In your GitLab project, go to Settings → Webhooks and add a new webhook:
- URL: Your Sourcebot deployment URL at
/api/webhook(e.g.https://sourcebot.example.com/api/webhook) - Secret token: Any string (e.g. generate one with
python -c "import secrets; print(secrets.token_hex(10))") - Trigger events: Merge request events, Comments
Configure environment variables
Set the following environment variables in your Sourcebot deployment:
Example
| Variable | Description |
|---|---|
GITLAB_REVIEW_AGENT_WEBHOOK_SECRET | The secret token you set on the GitLab webhook |
GITLAB_REVIEW_AGENT_TOKEN | The GitLab personal or project access token |
GITLAB_REVIEW_AGENT_HOST | Your GitLab hostname. Defaults to gitlab.com. Set this for self-hosted GitLab instances (e.g. gitlab.example.com). |
docker-compose.yml:Using the agent
By default, the agent does not review PRs and MRs automatically. To enable automatic reviews on every new or updated PR/MR, setREVIEW_AGENT_AUTO_REVIEW_ENABLED to true.
You can also trigger a review manually by commenting /review on any PR or MR. To use a different command, set REVIEW_AGENT_REVIEW_COMMAND to your preferred value (without the leading slash).
Environment variable reference
| Variable | Default | Description |
|---|---|---|
REVIEW_AGENT_AUTO_REVIEW_ENABLED | false | Automatically review new and updated PRs/MRs |
REVIEW_AGENT_REVIEW_COMMAND | review | Comment command that triggers a manual review (without the /) |
REVIEW_AGENT_MODEL | first configured model | displayName of the language model to use for reviews |
REVIEW_AGENT_LOGGING_ENABLED | unset | Write prompt and response logs to disk for debugging |


