Build a pull request reviewer agent as code: it sizes every PR as trivial, moderate or large, approves only safe small changes and asks a person to review the rest, with instructions and tools you version like the rest of your repo: AI agent prompt
Teams that want an AI reviewer usually end up with a prompt in a dashboard that nobody can test or review. In late October 2026 Cursor released Agent SDK, which defines an agent as a project folder: an instructions.md file for its behavior, a tools folder of TypeScript actions, and built-in evals, deployable to Cursor-managed hosting or your own infrastructure; Cursor says it uses the same harness that powers Bugbot and Security Review. Its quickstart builds a PR reviewer that calls an inspect tool, rates each pull request trivial, moderate or large by lines and files changed, approves only safe changes, never approves drafts and requests a human review for anything large. The prompt below plans the same reviewer for your repository with any coding agent, before anything is allowed to post reviews.
The prompt
Help me build a pull request reviewer agent defined as code in my repository. Repo: [what it is, language, CI setup, who reviews today]. Our rules: [files or folders that always need a human (e.g. payments, auth, migrations), max size for auto-approval, labels we use]. 1) Write the reviewer's instructions file in plain Markdown: always inspect the PR first, rate it trivial / moderate / large by lines and files changed (suggest thresholds for our repo), approve only trivial changes that match the title and touch no sensitive paths, never approve drafts or PRs by the bot's own account, and otherwise comment asking for a human review that names the riskiest files. 2) Design two tools: one that fetches the PR title, files and capped patches, and one that posts the verdict, with input fields and failure handling. 3) Write 8 test cases (eval PRs) including tricky ones: a tiny change to an auth file, a large docs-only PR, a PR whose title doesn't match the diff. 4) Give me a rollout plan: run in comment-only mode for two weeks, compare its verdicts with human reviewers, then decide on approvals. Ask me before any step that posts on GitHub or deploys, and keep secrets out of the repo.
Fill in the blanks, then copy
This prompt has 1 [bracket] to fill in. Type your details below and the prompt updates as you go. Your answers stay in this browser and are reused on other prompts with the same blanks. Nothing is sent to us.
Example values are fictional, just to show how a filled-in prompt reads. Replace them with your real details.How to use it
- Copy the prompt above.
- Replace every [bracket] with your own details (use the fill-in-the-blanks box above, which remembers your answers for the next prompt).
- Paste it into Cursor Agent SDK, Cursor, GitHub and review the answer before you use it.
Works with: Cursor Agent SDK, Cursor, GitHub, TypeScript, Claude Code
Real-world example: cursor.com/docs/agent-sdk/quickstart
Before you use it: what to check
Already built into this prompt
- payments, auth, migrations), max size for auto-approval, labels we use].
- Ask me before any step that posts on GitHub or deploys, and keep secrets out of the repo.
Check yourself
- This prompt works on text other people wrote (emails, reviews, messages or web pages). That text can hide instructions aimed at AI, such as "ignore your rules and…". Paste it as material to work on, and never let the AI act on requests inside it, like paying, sharing logins or changing records. How prompt injection works →
- Check every figure, price and total against your own records before anything is sent, posted or booked. A person approves refunds, discounts, payments and price changes.
- Read and edit the draft before it reaches a customer or goes public. If you later automate this prompt, start with "draft and notify me", not "send automatically".
- Check names, dates, numbers and any claim against your own source material before you use the answer. AI can misread or invent details.
Using an AI agent? Download this prompt as a SKILL.md agent skill with these checks built in, or get the .zip for Claude.ai. How to install skills.
Want to make this prompt even better? Grade it with the free prompt grader or build your own with the AI prompt generator.
32 copy-paste agent prompts (PDF) plus 5 new prompts every week.
Get it free