View on GitHub
Documentation

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

bash  ·  .env
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"># optional

3. Run locally

bash  ·  terminal
uv sync
uv run alembic upgrade head
uv run uvicorn prsentry.app:app --reload

Configuration

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

yaml  ·  .prsentry.yml
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 them

Severity levels

  • CRITICAL — security, data loss, runtime crashes
  • WARNING — bugs, race conditions, broken contracts
  • SUGGESTION — refactors, clarity, perf wins
  • NITPICK — style, naming, formatting

Deployment

Docker

bash  ·  terminal
docker run -d \
  --name prsentry \
  --env-file .env \
  -p 8000:8000 \
  ghcr.io/prsentry/prsentry:latest

Render

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.

yaml  ·  render.yaml
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: starter

CLI Usage

The prsentry-review CLI runs a review locally without going through GitHub. Useful for testing prompts and debugging filter rules.

bash  ·  terminal
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 CRITICAL

Observability

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

sql  ·  schema.sql
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);