> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tembo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Review changes

> Run an agent that reviews pull requests and leaves inline comments.

This page is the automated reviewer: an [agent](https://docs.tembo.io/features/agents.md) that comments on pull requests. To read pull requests yourself, use [Review](https://docs.tembo.io/features/reviews.md).

The agent checks for bugs, security issues, and style guide compliance, then leaves inline comments on specific lines.

## How it works

**1. PR opened**

A pull request is opened or updated in your repository. Tembo picks it up via webhook.

**2. Code analyzed**

The agent reads the diff, understands the context of the changes, and evaluates them against your coding standards.

**3. Review posted**

Inline comments are added to specific lines in the PR. If no issues are found, the PR can be auto-approved.

## Set up automated PR reviews

### 1. Connect your source control

Open the [dashboard](https://app.tembo.io), go to **Settings > Integrations**, and connect [GitHub](https://docs.tembo.io/integrations/github.md), [GitLab](https://docs.tembo.io/integrations/gitlab.md), or [Bitbucket](https://docs.tembo.io/integrations/bitbucket.md).

### 2. Create an agent

Go to [Agents](https://docs.tembo.io/features/agents.md) in your dashboard and use the **PR Review** template, or create one from scratch.

**Trigger**: PR opened / PR updated (webhook from [GitHub](https://docs.tembo.io/integrations/github.md), [GitLab](https://docs.tembo.io/integrations/gitlab.md), or [Bitbucket](https://docs.tembo.io/integrations/bitbucket.md))

Example instructions:

```text theme={null}
Review this PR for:
- Bugs and logic errors
- Security vulnerabilities
- Performance issues
- Style guide compliance

Leave inline comments on specific lines.
Auto-approve if no issues found.
```

[Browse all templates →](https://tembo.io/for)

### 3. Customize with rule files

Add [rule files](https://docs.tembo.io/features/rule-files.md) to your repo so the reviewer knows your team's conventions: naming patterns, test requirements, forbidden patterns, and more.

## What gets checked (depends on your instructions)

| Category | Examples |
| - | - |
| **Correctness** | Logic errors, off-by-one bugs, null handling |
| **Security** | SQL injection, XSS, hardcoded secrets |
| **Performance** | N+1 queries, unnecessary allocations, missing indexes |
| **Style** | Naming conventions, formatting, import order |
| **Testing** | Missing tests, untested edge cases |

## Best practices

* **Add [rule files](https://docs.tembo.io/features/rule-files.md)**: The more context the reviewer has about your standards, the better the review.
* **Start with one repo**: Test the review quality on a single repo before rolling out to all.
* **Combine with human review**: Use automated reviews to catch the obvious stuff so human reviewers can focus on architecture and design.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.