Open Code Review: inspect review scope, filters and model work
Operate Open Code Review without overtrusting path exclusions
Understand what path filters protect, how configuration can execute commands and why privileged CI review needs a separate permissions review.
What you will learn
- Protect content beyond conventional filenames
- Treat configuration as an execution input
- Limit what review results can trigger
Before you start
- Git changes and merge-base comparisons
- Basic CLI use and model API credentials
Choose a review scope, explain exclusions, prepare a controlled pilot and distinguish source inspection from runtime evidence.
Key takeaways
- Path exclusions do not inspect source contents.
- A credential command gives configuration an execution role.
- Review output should not automatically authorize a merge.
Protect content beyond conventional filenames
Built-in secret paths are checked before user include rules and against both old and new paths. This protects known filename patterns in scope selection. It cannot identify every secret embedded in ordinary source files, and the code explicitly limits this predicate to paths.
Use synthetic examples when learning, then define which repositories and data classes an approved provider may receive. Inspect selected material and the provider’s data-handling conditions. Keep a separate process for secrets that appear in source content or historical changes.
Treat configuration as an execution input
The documented api_key_cmd option invokes a command and uses its output as a credential. Configuration ownership therefore matters. A team should not accept an unreviewed configuration file from a pull request and execute its credential command inside a privileged runner.
The configuration guide also documents precedence between static keys, key commands and provider environment variables. Diagnose the effective source without printing the credential itself. Removing one setting may reveal another configured credential source rather than disabling access.
Limit what review results can trigger
Generated comments and repository instructions are untrusted material for downstream automation. Keep human approval before merges or other consequential actions. If you publish comments, grant only the permissions needed for that publication and inspect the platform’s response.
Keep logs and review artifacts private when they may contain code or sensitive context. During an incident, disable the trigger, preserve sanitized diagnostic evidence and rotate an affected credential through the normal account process. The isolated path tests do not establish these operational protections.
Decision guide
| Criterion | Option A | Option B |
|---|---|---|
| Best when | You need predictable behavior and easy auditing | You need adaptive optimization and have reliable telemetry |
| Main risk | May leave performance on the table | Can become difficult to explain or debug |
Implementation steps
- 1
Define allowed source data and model destinations before enabling review.
- 2
Protect configuration ownership and inspect credential-command settings.
- 3
Separate result publication from merge authority and prepare a stop procedure.
Copy-ready example
{
"policyExample": true,
"approvedRepositories": [
"synthetic-demo"
],
"publishComments": false,
"automaticMerge": false,
"configurationWritableBy": "designated operator",
"logSecrets": false,
"securityAuditExecuted": false
}Frequently asked questions
Does a template exception prove a file contains no secrets?
No. The exception is based on its name, not the values stored inside it.
Can I safely print configuration to debug authentication?
Avoid exposing secrets. Inspect the selected provider and credential source through sanitized diagnostics.
Sources
- Open Code Review / internal/agent/selection.goSource checked 2026-09-18
- Open Code Review / internal/config/allowlist/secret_path.goSource checked 2026-09-18
- Open Code Review / pages/src/content/docs/en/configuration.mdSource checked 2026-09-18
- Open Code Review / pages/src/content/docs/en/integrations/ci.mdSource checked 2026-09-18