The reference workflow is available here!Automatically review pull requests, providing feedback on code quality, security, and best practices. Reviews can be triggered in two ways:
- Requesting
openhands-agentas a reviewer - Adding the
review-thislabel to the PR
The reference workflow triggers on either the “review-this” label or when the openhands-agent account is requested as a reviewer. In OpenHands organization repositories, openhands-agent has access, so this works as-is. In your own repositories, requesting openhands-agent will only work if that account is added as a collaborator or is part of a team with access. If you don’t plan to grant access, use the label trigger instead, or change the condition to a reviewer handle that exists in your repo.
Review Modes
The PR review workflow supports two modes:| Mode | Description | Required Secrets |
|---|---|---|
| SDK Mode (default) | Runs the agent locally in GitHub Actions | LLM_API_KEY, GITHUB_TOKEN |
| Cloud Mode | Runs asynchronously in OpenHands Cloud | OPENHANDS_CLOUD_API_KEY, GITHUB_TOKEN |
Cloud Mode Benefits
- No LLM setup - Uses your OpenHands Cloud account’s configured LLM
- Faster CI completion - Workflow exits immediately; review runs in background
- Track progress - Posts a comment on the PR with a link to the conversation URL
Cloud Mode Prerequisites
Quick Start
- SDK Mode (Default)
- Cloud Mode
Features
- Fast Reviews - Results posted on the PR in only 2 or 3 minutes
- Comprehensive Analysis - Analyzes the changes given the repository context. Covers code quality, security, best practices
- GitHub Integration - Posts comments directly to the PR
- Customizable - Add your own code review guidelines without forking
- Two Modes - Run locally (SDK) or in the cloud (asynchronous)
Security
- Users with write access (maintainers) can trigger reviews by requesting
openhands-agentas a reviewer or adding thereview-thislabel. - Maintainers need to read the PR to make sure it’s safe to run.
Customizing the Code Review
Instead of forking theagent_script.py, you can customize the code review behavior by adding a .agents/skills/code-review.md file to your repository. This is the recommended approach for customization.
How It Works
The PR review agent uses skills from the OpenHands/skills repository by default. When you add a.openhands/skills/code-review.md file to your repository, it overrides the default skill with your custom guidelines.
Example: Custom Code Review Skill
Create.openhands/skills/code-review.md in your repository:
Benefits of Custom Skills
- No forking required: Keep using the official SDK while customizing behavior
- Version controlled: Your review guidelines live in your repository
- Easy updates: SDK updates don’t overwrite your customizations
- Team alignment: Everyone uses the same review standards
See the software-agent-sdk’s own code-review skill for a complete example of a custom code review skill.
Reference Workflow
This example is available on GitHub: examples/03_github_workflows/02_pr_review/
examples/03_github_workflows/02_pr_review/workflow.yml
Action Inputs
| Input | Description | Required | Default |
|---|---|---|---|
mode | Review mode: sdk or cloud | No | sdk |
llm-model | LLM model (SDK mode only) | SDK mode | anthropic/claude-sonnet-4-5-20250929 |
llm-base-url | LLM base URL (SDK mode only) | No | '' |
review-style | Review style: standard or roasted | No | roasted |
sdk-version | Git ref for SDK (tag, branch, or commit SHA) | No | main |
sdk-repo | SDK repository (owner/repo) | No | OpenHands/software-agent-sdk |
llm-api-key | LLM API key (SDK mode only) | SDK mode | - |
github-token | GitHub token for API access | Yes | - |
openhands-cloud-api-key | OpenHands Cloud API key (cloud mode only) | Cloud mode | - |
openhands-cloud-api-url | OpenHands Cloud API URL | No | https://app.all-hands.dev |
Cloud Mode Workflow Example
For cloud mode, you don’t need an LLM API key - just the cloud API key:In cloud mode, the workflow posts a comment on the PR with a link to the conversation URL, then exits immediately. The agent runs asynchronously in OpenHands Cloud and posts review comments when done.

