How Custom Checks Work
Custom checks run in a secure, read-only environment against your PR. The agent has access to:- Changed files, code snippets, and relevant git history
- PR title, description, linked issues, and review discussion
- Pattern and code search tools (ast-grep, ripgrep)
- Sandboxed shell commands to inspect the repo
- Web lookups for public documentation
- Connected MCP tools for internal systems
1
Analyze
CodeRabbit interprets your instructions against the PR context
2
Verify
The agent gathers evidence using available tools to substantiate findings
3
Decide
Emits Passed, Failed, or Inconclusive with reasoning
Limitations
Custom checks cannot:- Run your test suite ā dependencies are not installed in the sandbox
- Access
node_modules,dist, or build artifacts ā build steps are not executed - Execute arbitrary repository code ā security restriction
- Post inline comments on specific lines ā results appear in the summary table only
- Check PR approval status or reviewer assignments ā not available to the agent
- Modify the CodeRabbit review ā use Path Instructions instead
Writing Effective Instructions
Think of instructions as guidance for a smart teammate who needs explicit criteria, not subjective judgment.Be specific and actionable
Avoid vague instructions like āCheck for security issuesā
Define clear pass/fail criteria
Say exactly what causes failure
One concern per check
Donāt bundle security, testing, and documentation into one instruction
Include examples for complex rules
Show what passes and what fails
| Anti-pattern | Example | Why it fails |
|---|---|---|
| Vague instructions | āVerify best practicesā | No concrete pass/fail criteria |
| Unavailable information | āEnsure PR is approved by @security-teamā | Agent cannot check approval status |
| Speculation | āAssess if there are obvious performance optimizationsā | No definitive criteria; relies on subjective judgment |
| Review modifications | āKeep review comments conciseā | Use Path Instructions instead |
Examples
Custom checks can enforce a wide range of guardrails tailored to your teamās needs. Here are a few examples to get you started.Sensitive Data in Logs
Sensitive Data in Logs
Hardcoded Credentials
Hardcoded Credentials
Database Migrations
Database Migrations
Breaking Changes
Breaking Changes
Language Migration Policy
Language Migration Policy