Set path-based review instructions in CodeRabbit
Target review feedback to a folder in your repository by adding one rule to .coderabbit.yaml.
One focused check in a test repository
This guide assumes CodeRabbit already reviews the repository’s pull requests and you may propose configuration changes. Choose a genuinely useful rule for one area: checking input validation and authorization in API routes. Review guidance is not an automated test proving security.
1. Inspect existing configuration
Open the root .coderabbit.yaml when present and preserve its other settings. Check real file paths and active filters. Path instructions guide review of matching files; they do not automatically include an excluded directory or configure unrelated features.
2. Add an entry without replacing the list
Under reviews.path_instructions, add an entry whose path is src/api/** if that matches your project. An example instructions value is: “Check input validation and authorization before data access. Explain each issue by identifying the affected route.” Merge with existing entries rather than creating duplicate reviews keys in YAML.
3. Test targeting
Review the configuration change through the repository’s normal process, then open a small test pull request touching a matching file. Use a non-deployed example with a known defect. Inspect the resulting comment and reasoning, then an out-of-scope file to check your targeting expectation.
Troubleshooting and limits
If no useful result appears, inspect the glob, exclusions and active configuration before adding repetitive instructions. For V3 configuration, consult its reference instead of assuming every field is unchanged. CodeRabbit can miss defects or suggest incorrect changes, so retain human review and tests. For a separate pass/fail result, investigate custom checks rather than treating prose guidance as a merge gate.

