Prompt definitions, role defaults, and toolset allowlists for ethpandaops/redpandabot — the ethpandaops automated GitHub PR reviewer, architecture sparring partner, Q&A responder, and CI failure doctor.
This repository is the single source of truth for what each agent says and which tools it may call. Improving agent behaviour means opening a PR here and moving the pinned commit (AGENTS_REF) in redpandabot — no container rebuild required.
| Agent | Mode | What it does |
|---|---|---|
reviewer |
review |
Reviews pull requests for real bugs (findings) plus optional non-blocking architectural trade-offs (design_notes, max 2). |
architect |
design |
On-demand architectural & design critique triggered via @redpandabot design / arch (works on open and draft PRs). |
responder |
question, thread, issue |
Answers code-grounded questions in PR conversations, inline review threads, or issues when summoned (@redpandabot …). |
ci-doctor |
ci |
Diagnoses failed GitHub Actions jobs on a PR from their logs, annotations, and diff: cause, category, and minimal fix. |
agents/
├── reviewer/
│ ├── agent.json # default model/provider settings, thinking level, toolset reference
│ └── prompt.md # standing system prompt
├── architect/
│ ├── agent.json
│ └── prompt.md
├── responder/
│ ├── agent.json
│ └── prompt.md
└── ci-doctor/
├── agent.json
└── prompt.md
toolsets.json # shared, composable tool allowlists
scripts/validate.sh # CI + local contract validator (bash + jq)
prompt.md defines what an agent does; agent.json defines its package defaults (how it runs):
In production, ethpandaops/redpandabot can override the model/provider per org via REVIEW_MODEL_ROUTES / MODEL_ROUTE_DEFS (decoupling inference endpoints from this prompt repo) or select "package" to use the agent.json defaults directly.
Agents never list raw tools directly — they reference a named toolset in toolsets.json, composed via includes:
read-only—read,grep,lsreviewer—read-only+bash(read-only code inspection, OSV advisory lookups, small language-semantics repros; deliberately excludesedit/write)
Widening what an agent can invoke is therefore an explicit, reviewable change in toolsets.json.
| Mode | Trigger | Agent | Context file | Output |
|---|---|---|---|---|
review |
PR opened / pushed (subject to policy), or redpanda-review label |
reviewer |
pr-context.md |
Review summary, inline diff threads, optional non-blocking Architecture & Trade-offs, or APPROVE + 👍 when clean |
design |
PR comment starting @redpandabot design / arch / architecture (optional focus text; works on draft PRs) |
architect |
design-context.md |
Standalone architecture & trade-offs comment |
question |
PR conversation comment starting @redpandabot … / redpanda … |
responder |
question-context.md |
Reply comment (or ❤️ if NO_REPLY_NEEDED) |
thread |
Reply in one of the bot's review threads, or any inline thread comment addressing the bot | responder |
thread-context.md |
In-thread reply stating whether a finding was addressed, is wrong, or still holds (humans resolve threads) |
ci |
Failed / timed-out workflow_run on a non-fork PR |
ci-doctor |
ci-context.md |
Single upserted CI diagnosis comment per PR; collapsed once head passes |
issue |
Trigger comment or redpanda-review label on an issue (when ISSUE_MODE=on) |
responder |
issue-context.md |
Reply comment |
Automatic review scope (all / members / allowlist / disabled per repo or org/*, plus global allowlisted authors) is managed dynamically through the redpandabot Admin UI (https://redpandabot.ethpandaops.io). Commenting @redpandabot gtfo (or @redpandabot mute) or applying the redpanda-mute label silences the bot on a PR until summoned again or unlabelled.
Each run executes in an ephemeral Cloudflare Container (ethpandaops/redpandabot, packages/reviewer) with a root/agent privilege split and deny-by-default egress allowlist enforced outside the container. The unprivileged agent user (uid 10001, zero capabilities) receives:
gh— authenticated with a read-only installation token (contents,issues,pull_requests,actions) revoked immediately when the agent exits:- Public PR: scoped strictly to that single repository (can still read public repos / cross-refs, never private repos).
- Private PR: scoped to the installation's repositories for that owner, never another owner.
react <emoji>/react --remove <emoji>— loopback broker command that can only add/remove reactions on the active PR (or issue). The agent never holds a write-capable GitHub token.- Command limits & prompt-injection fencing — commands are capped at 180 s, untrusted PR text is wrapped in per-run random fences, and any PR-authored
.pi/,AGENTS.md, andCLAUDE.mdare renamed to*.from-prbefore the agent starts. - Context sections injected by the pipeline:
- Since the last review (
reviewmode) — last reviewed SHA, ancestry, commit log, and open finding threads. - Repository guidance — maintainers'
AGENTS.md(and distinctCLAUDE.md) read strictly from the base branch (never the PR head), capped at 16 KB each.
- Since the last review (
Prompts describe what to establish; code in ethpandaops/redpandabot decides what to post:
- Enforced JSON Schema finalization (
packages/core/src/schemas.ts,packages/reviewer/src/finalize.ts):review→{ summary, findings[], design_notes[] }(design_notesis capped at 2 and never blocks approval or 👍)thread→{ reply }(empty orNO_REPLY_NEEDEDreacts ❤️ instead of posting)ci→{ summary, failures[] }- Because the prompt and schema share this contract, changing a schema field requires updating both this repo and
ethpandaops/redpandabotbefore moving the pin.
- Approval & 👍 are owned by the pipeline (
packages/reviewer/src/decision/review-decision.ts), never the prompt. Approval requires both the structured finalization and the agent's own closing JSON block to agree on zerofindings, plus a trusted non-bot author andapprovecapability. - Threads are never resolved by the bot — only humans click Resolve.
- Edit
agents/<name>/prompt.mdand/oragents/<name>/agent.json(ortoolsets.json). - Validate locally before pushing (same check run by
.github/workflows/validate.yml):./scripts/validate.sh
- Open a PR and merge to
main. - Pin the new commit SHA in
ethpandaops/redpandabot'sAGENTS_REF(WRANGLER_TOMLproduction config) and deploy. Becauseredpandabotfetchesethpandaops/agents@AGENTS_REFat run start, prompt-only changes do not require rebuilding the reviewer container image.
{ "name": "reviewer", "description": "Automated PR code reviewer for ethpandaops ...", "provider": "anthropic", "api": "anthropic-messages", "base_url": "https://api.anthropic.com", "model": "claude-sonnet-4-5", "api_key_env": "MODEL_API_KEY", "thinking": "high", "reasoning": true, "context_window": 200000, "max_tokens": 64000, "prompt": "./prompt.md", "capabilities": { "toolset": "reviewer" }, "env": { "required": ["MODEL_API_KEY"], "optional": [] } }