Overview
When Auto Approve PR is enabled, CodeAnt AI can submit anAPPROVE review after every CodeAnt review thread is resolved. You can keep this resolved-comments behavior or add a policy-aware approval agent that evaluates the pull request’s risk, your dashboard criteria, and a repository policy file.
This closes the loop on the standard CodeAnt workflow:
- CodeAnt reviews the PR and opens inline review threads on the issues it finds.
- The author addresses each thread (commits a fix, replies with context, or marks it resolved).
- Once all CodeAnt-opened threads are resolved, CodeAnt either approves immediately or runs the configured approval-agent checks.
- If the agent cannot establish that the pull request is safe and policy-compliant, it requires human review instead of approving.
Currently GitHub-only. Auto Approve PR is supported on GitHub and GitHub Enterprise. GitLab, Bitbucket, and Azure DevOps support is on the roadmap.
Approval modes
The policy agent is currently available for GitHub and GitHub Enterprise repositories.
How It Works
There are two paths that trigger the auto-approve check:1. After every review
Right after CodeAnt finishes reviewing a PR, it schedules a delayed check 60 seconds later. If all CodeAnt review threads are already resolved at that point, CodeAnt approves. The delay exists so that any in-flight pushes settle before the approve action fires. The reviewed head SHA is pinned at scheduling time - if you push a new commit during that 60-second window, CodeAnt will skip the approve rather than approve an unreviewed commit.2. When a thread is resolved
GitHub fires a webhook every time someone resolves a review thread. CodeAnt listens for these events and re-checks: if the resolution made every CodeAnt thread resolved, it approves immediately.What gets approved
CodeAnt only counts threads it authored. Threads opened by humans on the PR don’t block auto-approve — only the CodeAnt-authored ones matter. If CodeAnt has already approved the current head commit, the approve is a no-op (it doesn’t post duplicate reviews). If you push a new commit after an auto-approval, CodeAnt’s approval is dismissed by GitHub the same way any reviewer’s approval would be - and the cycle restarts.Configuring Auto Approve PR
Navigate to Settings → AI Code Review at app.codeant.ai/x/settings/prconfsettings. Find the Auto Approve PR row and choose an approval mode. When you select Policy agent, configure:
The default is Disable. Opt-in per organization or per repository as needed.
Org vs Repo
- Organization scope - sets the default for every repository in the org.
- Repository scope — overrides the org default for that one repo. Pick Inherited from Org to remove the override.
Repository approval policy
Add.codeant/approval.json to the repository’s base branch to version approval rules with the codebase. The approval agent always reads the policy from the base-branch commit, never from the pull request’s proposed version.
Policy schema and limits
Unknown fields or values make the policy invalid and force human review.
There are no word-count limits. Limits are measured in characters or array entries as shown above.
A rule applies when at least one changed file matches
files without matching exclude_files. In a mixed pull request, an included, non-excluded file still activates the rule. If multiple rules apply, any human_review rule takes precedence; otherwise the approval agent evaluates every applicable allow condition.
Policy-agent decision rules
The agent approves only when all of the following are true:- Every CodeAnt-authored review thread is resolved.
- The reviewed head commit has not changed.
- The repository policy is valid and no matching rule requires human review.
- The model returns
approve, reports no blockers, assigns a risk within the effective threshold, and has at least 80% confidence. - Complete review context is available.
Policy-agent model calls currently use CodeAnt’s managed AI provider and do not consume the organization’s AI-credit balance.
Required GitHub Permissions
The CodeAnt GitHub App needs the following permissions, which are part of the standard CodeAnt install:- Pull requests: Read & Write - to submit the
APPROVEreview. - Webhook event:
pull_request_review_thread- to react when a thread is resolved.