Implement CodeRabbit webhook signature validation and event handling. Use when setting up webhook endpoints, implementing signature verification, or handling CodeRabbit event notifications...
Use the Git provider as event authority for normal PR review automation. Reviewed CodeRabbit docs do not establish a general outgoing CodeRabbit webhook and secret.
references/official-docs.md and re-check any time-sensitive contract before execution.Treat Git-provider sessions, CodeRabbit web sessions, CLI credentials, and CodeRabbit API keys as separate credentials. Use only an already-approved session or secret-manager reference, never print a secret, and do not place credentials in .coderabbit.yaml, source files, logs, or deliverables.
Define provider event, identity evidence, repositories, action, idempotency, and replay window.
Verify provider signature over raw body before parsing.
Normalize required fields and queue an idempotent event behind a policy gate.
Test valid, invalid, replay, wrong-identity, duplicate, and out-of-order fixtures.
Require security approval for webhook secrets and owner approval before any live mutation. Keep analysis and drafts local until approval is explicit, and record who approved the action and its scope.
An event contract, trust boundary, validation, fixtures, dead-letter policy, and mutation gate. Include source dates, unknowns, and the exact boundary between observed fact and recommendation.
| Condition | Response |
|---|---|
| Current contract is unclear or docs disagree | Stop mutation, cite both sources, and request owner resolution. |
| Required access or approval is missing | Produce a draft and evidence plan only. |
| Validation or pilot behavior differs from expectation | Restore the prior state and retain the failed evidence. |
| Output contains secrets or private code | Stop, quarantine the artifact, redact it, and notify the data owner. |
Notify on a verified CodeRabbit changes-requested review.
Reject a forged comment that merely mentions @coderabbitai.
references/official-docs.md.