Approval agent
Define risk criteria to auto-approve pull requests.
Overview
Inspect evaluates every pull request revision against custom policies stored in the repository. Policies can target file paths and authors, including GitHub teams, and optionally use LLM-based classifiers to assess risk. When every applicable rule and classifier passes, Inspect submits a GitHub approval. If a change needs judgment or does not satisfy policy, Inspect leaves it for human review.
Enable Approval agent
A workspace administrator turns on the organization-wide switch in Settings → Approval agent. This switch permits evaluation. A repository becomes eligible when its default branch contains a valid policy bundle under .inspect/approvals/.
Select Configure policies on the settings page to start a guided Inspect session, or invoke the /configure-approvals skill in an existing session for the repository. Inspect asks what policy you want and creates or updates the policy files while preserving existing rules.
Choose behavior by path
Create .inspect/approvals/path_rules.yaml to cover changed files. Every changed path must be covered before Inspect can approve. A rule can:
allowchanges without classification,denythem so they always require human review, orclassifythem with one or more repository-specific risk classifiers.
Explicit rules accumulate when they overlap. An allow rule does not cancel a matching denial or classifier. The optional default applies only to paths not covered by an explicit rule.
# .inspect/approvals/path_rules.yaml
default:
action: classify
targets: [classifier:change-risk]
rationale: Evaluate changes not covered by a specific rule.
rules:
- paths: ['docs/**']
action: allow
rationale: Documentation-only changes are safe to approve.
- paths: ['migrations/**', 'security/**']
action: deny
rationale: These changes always need human review.Paths are case-sensitive, repository-relative globs. Rules can also use excluded_paths, authors, and excluded_authors. Author selectors use quoted GitHub names such as '@octocat', '@dependabot[bot]', or '@acme/platform'.
Add risk classifiers
A named classifier describes risk in language specific to your repository. Store it at .inspect/approvals/classifiers/<name>.yaml, then select it from a classify path rule. Inspect evaluates the entire pull request diff and approves only when the result is at or below the configured threshold.
# .inspect/approvals/classifiers/change-risk.yaml
threshold: low
risk_tiers:
major: Authentication, authorization, or privileged access changes.
medium: User-visible production behavior changes.
low: Bounded internal changes with limited operational impact.
no_risk: Documentation, comments, and formatting only.Use named classifiers for most policies because path rules can select them only where they apply. A classifier declared directly in repo_rules.yaml runs for every eligible pull request. Reserve it for criteria that must always apply.
Thresholds are no_risk, low, medium, and major.
Understand evaluation results
Each new commit starts an evaluation for the new revision. A passing evaluation submits or updates the Approval agent's GitHub approval. A latest, authoritative rejection can dismiss an earlier approval.
A result that says Needs human review is a safe fallback, not necessarily an error. Common causes include an uncovered changed path, an explicit deny rule, a failed ownership gate, a classifier result above its threshold, or invalid policy configuration. Review the gate details in the Approval agent result, update the policy on the default branch if needed, and push a new pull request revision to evaluate again.