CodeRabbit Guardrails
Enforces CodeRabbit configuration standards. Validates that a CodeRabbit configuration file exists for customizing review behavior.
coderabbit to your lunar-config.yml:uses: github://earthly/lunar-lib/policies/coderabbit@v1.0.5
Included Guardrails
This policy includes 1 guardrail that enforce standards for your devex build and ci.
config-exists
Ensures a CodeRabbit configuration file (.coderabbit.yaml or .coderabbit.yml) exists at the repository root. A config file allows teams to customize review behavior, set path filters, and configure review instructions.
How Guardrails Fit into Lunar
Lunar guardrails define your engineering standards as code. They evaluate data collected by integrations and produce pass/fail checks with actionable feedback.
Policies support gradual enforcement—from silent scoring to blocking PRs or deployments—letting you roll out standards at your own pace without disrupting existing workflows.
Learn How Lunar Works →Example Evaluated Data
This policy evaluates structured metadata from the Component JSON. Here's an example of the data it checks:
{
"ai": {
"native": {
"coderabbit": {
"config_file": ".coderabbit.yaml",
"config_exists": true
}
}
}
}
Required Integrations
This policy evaluates data gathered by one or more of the following integration(s).
Make sure to enable them in your lunar-config.yml.
Documentation
View on GitHubCodeRabbit Guardrails
CodeRabbit configuration and best-practices guardrails.
Overview
This policy enforces CodeRabbit configuration standards. It validates that a CodeRabbit configuration file exists for customizing review behavior, path filters, and review instructions.
Policies
| Policy | Severity | Description |
|---|---|---|
config-exists |
warning | A .coderabbit.yaml config file should exist at the repo root |
Required Data
| Path | Provided By | Description |
|---|---|---|
.ai.native.coderabbit.config_exists |
coderabbit collector |
Whether a CodeRabbit config file was detected |
Installation
collectors:
- uses: github://earthly/lunar-lib/collectors/coderabbit@main
on: ["domain:your-domain"]
secrets:
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
policies:
- uses: github://earthly/lunar-lib/policies/coderabbit@main
enforcement: report-pr
Examples
Passing
CodeRabbit config file exists:
{
"ai": {
"native": {
"coderabbit": {
"config_file": ".coderabbit.yaml",
"config_exists": true
}
}
}
}
Failing
No CodeRabbit config file found:
{
"ai": {
"native": {
"coderabbit": {
"config_exists": false
}
}
}
}
Remediation
- config-exists: Create a
.coderabbit.yamlfile at the repository root. See CodeRabbit docs for configuration options.
Open Source
This policy is open source and available on GitHub. Contribute improvements, report issues, or fork it for your own use.
Common Use Cases
Explore how individual guardrails work with specific integrations.
Ready to Automate Your Standards?
See how Lunar can turn your AGENTS.md, engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 100+ built-in guardrails.