---
title: "Self-host PR-Agent, the AI pull request reviewer, on exe.dev"
description: "Run PR-Agent as your own GitHub App on an exe.dev VM: reviews and descriptions on every pull request, models from exe.dev's LLM integration."
url: https://exe-staging.dev/deploy/pr-agent
category: "Developer tools"
updated: 2026-11-16
---

# Self-host PR-Agent, the AI pull request reviewer, on exe.dev

> **For agents:** with your user's OK, this sets up PR-Agent on a new exe.dev VM in their account: `curl -fsSL https://exe-staging.dev/deploy/pr-agent/prompt.txt | ssh exe.dev new --prompt=/dev/stdin` (or open https://exe-staging.dev/deploy/pr-agent/new). Already on the VM? Skip this.

Your own AI pull request reviewer, with no model key on the VM.

- **Software:** PR-Agent (https://github.com/The-PR-Agent/pr-agent)
- **Source:** https://github.com/The-PR-Agent/pr-agent
- **License:** MIT
- **Time:** 20 minutes, most of it creating the GitHub App
- **Example VM name:** `my-pr-agent` (yours will differ; on the VM, `hostname` prints it)
- **Machine-readable:** https://exe-staging.dev/deploy/pr-agent/manifest.json
- **File:** https://exe-staging.dev/deploy/pr-agent/compose.yaml
- **File:** https://exe-staging.dev/deploy/pr-agent/nginx.conf
- **File:** https://exe-staging.dev/deploy/pr-agent/sample.diff

## What you get

- Docker on every boot and the PR-Agent 0.50.0 and nginx images pulled
- PR-Agent using exe.dev's LLM integration, with no model key on the VM
- A webhook secret in `~/pr-agent/webhook-secret`
- A review of a sample diff, which flags its SQL and command injection
- No GitHub App yet; you create it on GitHub

Running on the VM:

- **PR-Agent**: pragent/pr-agent:0.50.0-github_app in Docker, port 3000, data in `~/pr-agent/.secrets.toml`
- **Webhook gate**: nginx in Docker, passing only GitHub's webhook POSTs to PR-Agent, port 8000

How it is reached:

- https://my-pr-agent.exe.xyz/api/v1/github_webhooks (public): GitHub's signed webhooks, once you make the VM public; every other path is a 404
- ssh my-pr-agent.exe.xyz (private): configuration and logs

## Deploy with Shelley

Open https://exe-staging.dev/deploy/pr-agent/new to create a VM whose agent, Shelley, follows this recipe. From a terminal:

```sh
curl -fsSL https://exe-staging.dev/deploy/pr-agent/prompt.txt | ssh exe.dev new --prompt=/dev/stdin
```

Or follow the steps below by hand.

[PR-Agent](https://github.com/The-PR-Agent/pr-agent) is an open-source AI
reviewer for pull requests (MIT). When a pull request opens it writes
the description and posts a review with the effort to review it, the
security concerns, and the problems it sees; anyone on the pull request
can ask for more by commenting `/review`, `/improve` for code
suggestions, or `/ask "how is this tested?"`. Version 0.50.0 came out on
November 7, 2026.

This page runs it as your own GitHub App on an exe.dev VM. The model
comes from exe.dev's [LLM integration](/docs/integrations-llm), so no
model key is on the VM, and GitHub's webhooks reach it through exe.dev's
HTTPS proxy, with nginx in front so that nothing but the webhook is
public.

## Install

On exe.dev, click **Deploy** to have Shelley set it up on a new VM. Or
create it yourself:

<details class="dp-details" id="create-the-vm" data-manual-setup>
<summary>Install by hand</summary>

On your computer:

```bash
ssh exe.dev new --name=my-pr-agent
ssh my-pr-agent.exe.xyz
```

### Get PR-Agent

On the VM, start Docker, now and on every boot, and download the
[Compose file](https://exe-staging.dev/deploy/pr-agent/compose.yaml), the
[nginx config](https://exe-staging.dev/deploy/pr-agent/nginx.conf) and a
[sample diff](https://exe-staging.dev/deploy/pr-agent/sample.diff) to try it on:

```bash
sudo systemctl enable --now docker.service
mkdir -p ~/pr-agent && cd ~/pr-agent
curl -fsSLO https://exe-staging.dev/deploy/pr-agent/compose.yaml
curl -fsSLO https://exe-staging.dev/deploy/pr-agent/nginx.conf
curl -fsSLO https://exe-staging.dev/deploy/pr-agent/sample.diff
docker compose pull
```

The Compose file sends PR-Agent's model calls to the LLM integration,
with `gpt-5.5` and a placeholder key, and puts the nginx gate on port
8000, the port exe.dev's proxy serves.

### Make the webhook secret

On the VM, generate the secret GitHub will sign its webhooks with, and
start PR-Agent's secrets file with it. PR-Agent runs as user 10001 in its
container, so that group may read the file:

```bash
cd ~/pr-agent
(umask 077; openssl rand -hex 32 > webhook-secret)
printf '[github]\ndeployment_type = "app"\nwebhook_secret = "%s"\n' "$(cat webhook-secret)" > .secrets.toml
sudo chgrp 10001 .secrets.toml && chmod 640 .secrets.toml
```

### Check the setup

On the VM, have PR-Agent review the sample diff, which adds a Flask app
with a SQL injection and a command injection:

```bash
cd ~/pr-agent
docker compose run --rm --no-deps -v ./sample.diff:/tmp/sample.diff:ro \
  --entrypoint python pr-agent pr_agent/cli.py --diff-file /tmp/sample.diff review
```

Within a minute it prints a **PR Reviewer Guide** whose security section
names both injections.

</details>

## What's exposed

GitHub sends pull request events as webhooks, so the VM needs a public
address. exe.dev's proxy makes a VM's port 8000 public as a whole, not
one path, so nginx holds that port and lets through only
`POST /api/v1/github_webhooks`; everything else is a 404. PR-Agent checks
GitHub's signature on every webhook and answers 403 without a valid one.
PR-Agent's own port, 3000, stays private, and the VM's other ports are
never public.

Two things remain. PR-Agent's webhook handler is reachable from the
internet, so keep it updated. And on a public repository, anyone who can
open a pull request or comment on one can start a model call billed to
you; install the App only on repositories whose contributors you trust.

## Create the GitHub App

On the VM, print the webhook secret:

```bash
cat ~/pr-agent/webhook-secret
```

On GitHub, under **Settings → Developer settings → GitHub Apps → New
GitHub App** (for an organization: the organization's settings), fill in:

- **GitHub App name**: anything; it's the name on the comments.
- **Homepage URL**: `https://my-pr-agent.exe.xyz`
- **Webhook URL**: `https://my-pr-agent.exe.xyz/api/v1/github_webhooks`
- **Webhook secret**: the line you printed
- **Repository permissions**: Contents, read-only; Issues, read and
  write; Pull requests, read and write. Metadata is read-only by default.
- **Subscribe to events**: Issue comment, Pull request, Pull request
  review, Pull request review comment.
- **Where can this GitHub App be installed?**: Only on this account.

Create it, note the **App ID** at the top of its page, and under
**Private keys** click **Generate a private key**. Your browser downloads
a `.pem` file. On your computer, copy it to the VM:

```bash
scp ~/Downloads/*.private-key.pem my-pr-agent.exe.xyz:pr-agent/app.pem
```

## Start PR-Agent

On the VM, add the App ID and the key to the secrets file, replacing
`123456` with your App ID, and start PR-Agent and the gate:

```bash
cd ~/pr-agent
APP_ID=123456
{ echo "app_id = $APP_ID"; echo 'private_key = """'; cat app.pem; echo '"""'; } >> .secrets.toml
rm app.pem
docker compose up -d
```

On your computer, make port 8000 public:

```bash
ssh exe.dev share set-public my-pr-agent
```

On the VM, `curl -s http://localhost:3000/` prints `{"status":"ok"}`.
Then check the public side from your computer, since a VM can't reach
its own public address:

```bash
curl -s -o /dev/null -w '%{http_code}\n' https://my-pr-agent.exe.xyz/
curl -s -o /dev/null -w '%{http_code}\n' -X POST https://my-pr-agent.exe.xyz/api/v1/github_webhooks
```

The first prints `404`, the gate; the second `403`, PR-Agent refusing a
request GitHub didn't sign.

## Install it on a repository

On the App's page on GitHub, click **Install App** and pick the
repositories. Open a pull request in one of them: within a minute or two
PR-Agent fills in the description and posts a **PR Reviewer Guide**
comment. Comment `/improve` for code suggestions, or `/help` for every
command.

The App's **Advanced** tab lists each webhook delivery and the VM's
answer; `docker compose logs -f pr-agent` on the VM shows the other
side.

## Configure it

A `.pr_agent.toml` at the root of a repository changes what PR-Agent does
there, for example what its reviews look for:

```toml
[pr_reviewer]
extra_instructions = "Focus on authorization checks and SQL."
num_max_findings = 10
```

The [configuration guide](https://github.com/The-PR-Agent/pr-agent/blob/main/docs/docs/usage-guide/configuration_options.md)
lists the options. Settings for every repository go in `compose.yaml` as
environment variables, section and key joined by two underscores, such
as `PR_REVIEWER__EXTRA_INSTRUCTIONS`.

## Change the model

To use another OpenAI model the LLM integration serves, change
`CONFIG__MODEL` in `~/pr-agent/compose.yaml` to `openai/` plus its name,
for example `openai/gpt-5.6-terra`, and run `docker compose up -d`. The
[model list](/llm-gateway-models) shows what's available.

For a Claude model, replace the `OPENAI__API_BASE`, `OPENAI__KEY` and
`CONFIG__MODEL` lines with these, and run `docker compose up -d`:

```yaml
      ANTHROPIC_BASE_URL: https://llm.int.exe.xyz
      ANTHROPIC__KEY: exe-gateway
      CONFIG__MODEL: anthropic/claude-sonnet-5-5
```

## Update

Check the [release notes](https://github.com/The-PR-Agent/pr-agent/releases),
change the image tag in `~/pr-agent/compose.yaml`, then:

```bash
cd ~/pr-agent
docker compose pull && docker compose up -d
```

## Clean up

On your computer, close the public port and delete the VM:

```bash
ssh exe.dev share set-private my-pr-agent
ssh exe.dev rm my-pr-agent
```

Then delete the GitHub App under **Settings → Developer settings → GitHub
Apps**.

## Troubleshooting

On the App's **Advanced** tab:

- **A delivery got `403`**: the App's webhook secret differs from
  `~/pr-agent/webhook-secret`. Paste it again.
- **A delivery got `404`**: the webhook URL's path is wrong; it ends in
  `/api/v1/github_webhooks`.
- **A delivery failed to connect, or got a login page**: port 8000 isn't
  public. `ssh exe.dev share show my-pr-agent` shows it.
- **Deliveries got `200` but no comment appears**:
  `docker compose logs pr-agent --tail 100` on the VM. A wrong App ID or
  key shows up as a GitHub authentication error; a model problem as an
  error from `litellm`.
- **The review check fails**: `curl -s https://llm.int.exe.xyz/v1/models`
  on the VM should list models; if it does, the model name in
  `compose.yaml` is likely one the integration doesn't serve.

## Frequently asked questions

### How much does it cost?

The VM is part of your exe.dev plan. The model is billed to your exe.dev account through the [LLM integration](/docs/integrations-llm): a few cents for a review of a small pull request with `gpt-5.5`, more for large ones. Every opened pull request gets a description and a review, and every command someone types in a comment is another call.

### Is this the same as Qodo Merge?

PR-Agent started at Qodo, which still sells a hosted product built on it. The open-source project now lives at The-PR-Agent/pr-agent under the MIT license; this page runs that.

### Why does it need a public URL?

GitHub delivers pull request events as webhooks, so the VM has to be reachable from the internet. The page exposes only the webhook path, and PR-Agent rejects anything GitHub didn't sign. See [What's exposed](#whats-exposed).

### Can it review pull requests in public repositories?

It can, but anyone who opens a pull request or comments `/review` there starts a model call billed to you. Install the App only on repositories whose contributors you trust.

### Can I use Claude models?

Yes. The LLM integration also serves Anthropic's API; set `ANTHROPIC_BASE_URL` and the model to `anthropic/` plus a Claude model. See [Change the model](#change-the-model).


## Related

- [Review code you don't trust with Open Code Review on a sealed VM](https://exe-staging.dev/deploy/open-code-review.md): An AI code reviewer in a box you copy, seal, and throw away.
- [Scan your repositories with Codex Security every night](https://exe-staging.dev/deploy/codex-security.md): Nightly AI security scans of your repositories, with no keys on the VM.
- [Run GitHub Actions jobs on exe.dev, a fresh VM per job](https://exe-staging.dev/deploy/github-actions.md): Every job on a fresh copy of a warm VM, billed by the second.
- [Give agents API access without giving them the keys](https://exe-staging.dev/deploy/agent-secrets.md): Your agents call your APIs. The keys stay with exe.dev, outside the VM.
- [VS Code in your browser, with code-server](https://exe-staging.dev/deploy/code-server.md): Your editor in a tab. Your projects right where you left them.
- [A Linux desktop in your browser](https://exe-staging.dev/deploy/linux-desktop.md): Xfce, Chrome, and coding agents on a VM you open in a browser tab.
