Skip to content

Review pull requests for exploitable bugs

This agent reads a pull request diff and posts one review comment. It reports exploitable bugs: injection, authz bypass, secret leaks, SSRF, RCE. Style nits stay out.

The factory Security Reviewer runs a staged pipeline with parallel workers. This template is one model turn.

Scaffold

bash
npx @cursor/july init ./security-reviewer --template security-reviewer

init asks which GitHub repos to watch. Every repo must share one owner. Pass --var repos=acme/api,acme/web to skip the prompt.

The list lands in agent/lib/repos.ts. The GitHub channel reads it for cursorAccount and for the wake filter. Edit that file when the set changes.

Connect GitHub through Cursor

Connect GitHub in Cursor for those repositories (Settings or cursor.com/dashboard). Sign the host in:

bash
cd security-reviewer
agent-sdk login

cursorAccount pulls SCM events from Cursor and mints a short-lived, repo-scoped credential. ctx.host.github and child gh commands share it. See the GitHub guide.

First review

bash
agent-sdk dev

dev starts the Cursor event relay for the watched repos. To drive a known PR without waiting on a live push:

bash
agent-sdk github replay https://github.com/acme/api/pull/12 --dir .

replay needs pull access. Draft PRs and repos outside agent/lib/repos.ts are ignored. The channel writes pr/diff.patch after the wake is acknowledged, then starts a model turn. The model calls post_findings once.

Chat replies stay in the playground. post_findings writes the GitHub comment.

What to edit

  • agent/lib/repos.ts: watched repos
  • agent/instructions.md: what counts as a finding and the comment shape
  • evals/review.eval.ts: smoke cases

Evals

Two smoke cases: one XSS fixture and one docs-only change.

bash
agent-sdk eval

Eval sessions skip the GitHub write.

Deploy

bash
agent-sdk deploy

Run it from the agent's git checkout. The command infers repository, ref, path, and slug. The deployment uses the team's Cursor GitHub connection for the same watched repos.