modified
--- a/approvals.md +++ b/approvals.md @@ -8,7 +8,12 @@ ## Find Claude Approvals on a pull request -Approvals adds a check named **Claude Approvals** to the pull requests that it evaluates. The check’s title says what’s still needed, such as **Waiting on human review from any person (1/2)**. A title that starts with **(observe mode)** means that the policy wasn’t enforced when the check ran. In observe mode, the check shows what your policy would decide. Claude also posts a comment with the reasons. Where the policy allows it, Claude can post an approving review. For the common titles and what to do about each, see [Find your approval status and what to do next](</docs/en/approvals-pull-requests#find-your-approval-status-and-what-to-do-next>). If a pull request has no check, see [No Claude Approvals check appeared](</docs/en/approvals-troubleshooting#no-claude-approvals-check-appeared>). +Approvals adds a check named **Claude Approvals** to the pull requests that it evaluates. The check’s title says what’s still needed, such as **Waiting on human review from any person (1/2)**. A title that starts with **(observe mode)** means that the policy wasn’t enforced when the check ran. In observe mode, the check shows what your policy would decide. Claude also posts a comment with the reasons. Where the policy allows it, Claude can post an approving review: + + * **In github.com repositories where the Claude GitHub App reports the check** : that review comes from `claude[bot]` + * **On a pull request that`claude[bot]` opened**: that review comes from `claude-approvals[bot]`, once you add the [Claude Approvals GitHub App](</docs/en/approvals-pull-requests#pull-requests-that-claude-opens>) + +For the common titles and what to do about each, see [Find your approval status and what to do next](</docs/en/approvals-pull-requests#find-your-approval-status-and-what-to-do-next>). If a pull request has no check, see [No Claude Approvals check appeared](</docs/en/approvals-troubleshooting#no-claude-approvals-check-appeared>). ## Example policy
added
--- a/approvals.md +++ b/approvals.md @@ -0,0 +1,86 @@ +Claude Approvals is a check on GitHub pull requests that reports who still has to approve. It follows a [policy](</docs/en/approvals-policy>), a file in your repository that can set how many people have to approve a change to a path and where Claude may approve. + +To turn on Claude Approvals in a repository, follow [Set up Claude Approvals](</docs/en/approvals-setup>). + +To evaluate a pull request, Approvals reads the policy, finds the rules that apply, and counts approvals: Use Approvals to set how many people have to approve a change, with more on risky changes and fewer on routine ones. For example, billing code can need two people, and test fixtures can need one person once [Code Review](</docs/en/code-review>) passes. + +For permission prompts in a Claude Code session, see [Configure permissions](</docs/en/permissions>). + +## Find Claude Approvals on a pull request + +Approvals adds a check named **Claude Approvals** to the pull requests that it evaluates. The check’s title says what’s still needed, such as **Waiting on human review from any person (1/2)**. A title that starts with **(observe mode)** means that the policy wasn’t enforced when the check ran. In observe mode, the check shows what your policy would decide. Claude also posts a comment with the reasons. Where the policy allows it, Claude can post an approving review. For the common titles and what to do about each, see [Find your approval status and what to do next](</docs/en/approvals-pull-requests#find-your-approval-status-and-what-to-do-next>). If a pull request has no check, see [No Claude Approvals check appeared](</docs/en/approvals-troubleshooting#no-claude-approvals-check-appeared>). + +## Example policy + +You write a policy as a list of rules in `.claude/approvals.yml`. This policy has one rule, which asks for two people on every change: + + # .claude/approvals.yml + version: 1 + mode: observe + rules: + - purpose: "A change takes two people, and Claude doesn't approve." + paths: ["**"] + verdict: { claude: comments, seats: 2 } + advisory: [claude/code_review] + +Each part of the policy sets one thing: + + * **`mode: observe`** : starts the policy in observe mode + * **`purpose`** : says why the rule exists + * **`paths`** : names the files that the rule matches, which here is every file + * **`seats: 2`** : asks for two people, one of whom [can be the author](</docs/en/approvals-policy#whether-a-pull-request%E2%80%99s-author-counts>) + * **`claude: comments`** : means that Claude doesn’t approve + * **`advisory`** : keeps automatic Code Reviews + +You can also give a rule a condition, which can read facts about the pull request and classifiers’ answers: + + * **[Facts](</docs/en/approvals-policy#if>) about the pull request**: such as how many lines changed, who opened it, and which branch it targets + * **A[classifier’s](</docs/en/approvals-classifiers>) answer**: a model’s judgment on a question such as how risky the change is + +A condition can’t read CI results, so keep CI as its own required check in GitHub. + +## Before you turn on Approvals + +Before you add a policy file to a repository, check that your organization qualifies and who can turn Approvals on or off. Then see what Approvals changes for merges, Code Review, and billing. + +### Availability + +Approvals is in public beta for Claude organizations on [Team and Enterprise](</docs/en/feature-availability#features-that-require-a-claude-subscription>) plans, as part of [Claude Ship](</docs/en/claude-ship>). It works on github.com, including GitHub Enterprise Cloud. Compliance settings limit who can use it: + + * **Not available** : with [Zero Data Retention](</docs/en/zero-data-retention>) enabled, the [HIPAA configuration](</docs/en/hipaa-setup>) applied, or customer-managed encryption keys (CMEK) + * **Can’t start Approvals** : with FERPA or Access Transparency settings + +### Who can turn Approvals on or off + +Once the [prerequisites](</docs/en/approvals-setup#prerequisites>) are met, anyone who can merge a policy file into the default branch can turn Approvals on. An Owner of the Claude organization can [turn Approvals off](</docs/en/approvals-setup#turn-off-approvals>) for the whole organization, and it then stays off when a policy file merges. + +### Merges without human review + +A pull request can merge when nobody but its author has looked at it. Check your policy and your GitHub rules for cases such as these: + + * **The check isn’t required** : the **Claude Approvals** check blocks a merge only where you make it a required check in GitHub, and normally not in observe mode + * **The policy asks for nobody else** : the author can fill a seat, so with `seats: 1` nobody else has to look. With `seats: 0`, a pull request that a bot wrote can merge when no person has looked at it + * **GitHub counts Claude’s approval** : where a GitHub branch rule requires one approval, Claude’s approving review can be that approval + * **Claude approves with no review** : a rule with `claude: approves` starts no Code Review by itself, so Claude can approve a change that nothing has reviewed. To get a review first, [let Claude approve only when Code Review passes](</docs/en/approvals-setup#let-claude-approve-when-code-review-passes>) + +For the other cases, and a rule that asks for a person who isn’t an author, see [Merges without human review](</docs/en/approvals-github-rules#merges-without-human-review>). + +### Keep automatic Code Reviews + +[Code Review](</docs/en/code-review>), another Claude Ship agent, can review each pull request automatically. Adding a policy file can stop those reviews. Where every file that a pull request changes lies under a policy file, automatic reviews normally stop, unless a rule for those files names `claude/code_review`. That holds in observe mode and when the policy is enforced. To keep automatic reviews, [list `claude/code_review` in a rule](</docs/en/approvals-policy#advisory>), as the example policy does under `advisory`. + +### Billing for Approvals + +Approvals bills your organization’s [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>), by tokens, for the Code Reviews and classifier runs that a policy starts. See [what starts a charge](</docs/en/approvals-setup#what-approvals-costs>). + +## Set up Claude Approvals + +To set up Approvals, start your policy in observe mode, where the **Claude Approvals** check shows what your policy would decide. Reviews and classifier runs are billed in observe mode. For starter policies and the steps, see [Set up Claude Approvals](</docs/en/approvals-setup>). + +## Related resources + + * [Work with Claude Approvals on a pull request](</docs/en/approvals-pull-requests>): check titles and comment commands + * [Approvals and your GitHub rules](</docs/en/approvals-github-rules>): required reviews, CODEOWNERS, and merge queues + * [Policy file reference](</docs/en/approvals-policy>): keys and an example policy + * [Troubleshoot Claude Approvals](</docs/en/approvals-troubleshooting>): when no check appears or a policy file is refused + * [Configure permissions](</docs/en/permissions>): permission prompts in Claude Code