Docs
Everything you need to install, configure, and operate PrSentry.
Getting Started
PrSentry runs as a small Python service alongside a Postgres database. You can install the GitHub App pointing at your hosted instance, or run it entirely locally for development.
1. Create your own GitHub App
Register a GitHub App in your org with pull_requests: write and contents: read permissions, then point its webhook URL at your self-hosted PrSentry instance.
2. Set environment variables
ANTHROPIC_API_KEY=sk-ant-...
GITHUB_APP_ID=12345
GITHUB_APP_PRIVATE_KEY=class="tok-str">"-----BEGIN RSA PRIVATE KEY-----..."
GITHUB_WEBHOOK_SECRET=...
DATABASE_URL=postgres://prsentry:pw@localhost/prsentry
LANGFUSE_PUBLIC_KEY=pk-lf-... class="tok-com"># optional
LANGFUSE_SECRET_KEY=sk-lf-... class="tok-com"># optional3. Run locally
uv sync
uv run alembic upgrade head
uv run uvicorn prsentry.app:app --reloadConfiguration
Per-repo configuration lives at .prsentry.yml in the default branch. Anything not specified falls back to sensible defaults.
File filtering
Glob patterns under skip: are matched against each file path in the diff. Files matching any pattern are dropped before tokenization.
Token budgets
tokens:
per_file: 8000 class="tok-com"># max input tokens per file
per_pr: 64000 class="tok-com"># hard ceiling for the whole PR
output: 4096 class="tok-com"># max output tokens per agent step
severity:
enabled: [CRITICAL, WARNING, SUGGESTION]
class="tok-com"># NITPICK off by default — opt in if you want themSeverity levels
- CRITICAL — security, data loss, runtime crashes
- WARNING — bugs, race conditions, broken contracts
- SUGGESTION — refactors, clarity, perf wins
- NITPICK — style, naming, formatting
Deployment
Docker
docker run -d \
--name prsentry \
--env-file .env \
-p 8000:8000 \
ghcr.io/prsentry/prsentry:latestRender
A one-click render.yaml blueprint provisions the web service, a worker, and a Postgres database. Drop your env vars in and you're done.
services:
- type: web
name: prsentry
env: docker
plan: starter
healthCheckPath: /healthz
- type: worker
name: prsentry-worker
env: docker
dockerCommand: python -m prsentry.worker
databases:
- name: prsentry-db
plan: starterCLI Usage
The prsentry-review CLI runs a review locally without going through GitHub. Useful for testing prompts and debugging filter rules.
class="tok-com"># Review a local diff
prsentry-review --diff my-changes.patch
class="tok-com"># Review a PR by URL (requires GH_TOKEN)
prsentry-review --pr https://github.com/acme/api/pull/482
class="tok-com"># Dry-run: print comments instead of posting
prsentry-review --pr ... --dry-run
class="tok-com"># Show only CRITICAL findings
prsentry-review --pr ... --severity CRITICALObservability
Langfuse
If LANGFUSE_PUBLIC_KEY is set, every agent run is traced. You'll see the full prompt, every tool call, every token of output, and the cost breakdown.
Postgres schema
CREATE TABLE runs (
id uuid PRIMARY KEY,
repo text NOT NULL,
pr_number int NOT NULL,
head_sha text NOT NULL,
status text NOT NULL, -- queued|running|done|error
started_at timestamptz NOT NULL DEFAULT now(),
finished_at timestamptz,
files_seen int,
files_skipped int,
comments int,
input_tokens int,
output_tokens int,
langfuse_trace_id text,
error text
);
CREATE INDEX runs_repo_pr_idx ON runs (repo, pr_number);