Skip to content
ethpandaopsPublic

About

Definitions for ethpandaops automation agents, packaged for mc (zero-copy package manager for coding assistants). Edit a prompt → open a PR.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

28 Commits

Folders and files

Repository files navigation

ethpandaops/agents

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.

Agents

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.

Repository layout

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)

Agent config (agent.json)

prompt.md defines what an agent does; agent.json defines its package defaults (how it runs):

{
  "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": [] }
}

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.

Toolset allowlists (toolsets.json)

Agents never list raw tools directly — they reference a named toolset in toolsets.json, composed via includes:

  • read-only — read, grep, ls
  • reviewer — read-only + bash (read-only code inspection, OSV advisory lookups, small language-semantics repros; deliberately excludes edit / write)

Widening what an agent can invoke is therefore an explicit, reviewable change in toolsets.json.

How redpandabot runs these agents

Modes & triggers

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.

Runtime sandbox & provided commands

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, and CLAUDE.md are renamed to *.from-pr before the agent starts.
  • Context sections injected by the pipeline:
    • Since the last review (review mode) — last reviewed SHA, ancestry, commit log, and open finding threads.
    • Repository guidance — maintainers' AGENTS.md (and distinct CLAUDE.md) read strictly from the base branch (never the PR head), capped at 16 KB each.

Structured finalization & deterministic decisions

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_notes is capped at 2 and never blocks approval or 👍)
    • thread → { reply } (empty or NO_REPLY_NEEDED reacts ❤️ 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/redpandabot before 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 zero findings, plus a trusted non-bot author and approve capability.
  • Threads are never resolved by the bot — only humans click Resolve.

Updating an agent

  1. Edit agents/<name>/prompt.md and/or agents/<name>/agent.json (or toolsets.json).
  2. Validate locally before pushing (same check run by .github/workflows/validate.yml):
    ./scripts/validate.sh
  3. Open a PR and merge to main.
  4. Pin the new commit SHA in ethpandaops/redpandabot's AGENTS_REF (WRANGLER_TOML production config) and deploy. Because redpandabot fetches ethpandaops/agents@AGENTS_REF at run start, prompt-only changes do not require rebuilding the reviewer container image.

About

Definitions for ethpandaops automation agents, packaged for mc (zero-copy package manager for coding assistants). Edit a prompt → open a PR.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages