> ## 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

> Get automated code reviews on every PR with inline comments.

Tembo reviews [pull requests](/features/pull-requests) automatically, checking for bugs, security issues, and style guide compliance, then leaving inline comments on specific lines.

## How it works

<Steps>
  <Step title="PR opened">
    A pull request is opened or updated in your repository. Tembo picks it up via webhook.
  </Step>

  <Step title="Code analyzed">
    The agent reads the diff, understands the context of the changes, and evaluates them against your coding standards.
  </Step>

  <Step title="Review posted">
    Inline comments are added to specific lines in the PR. If no issues are found, the PR can be auto-approved.
  </Step>
</Steps>

## Set up automated PR reviews

### 1. Connect your source control

Navigate to the [Integrations page](https://app.tembo.io/integrations) and connect [GitHub](/integrations/github), [GitLab](/integrations/gitlab), or [Bitbucket](/integrations/bitbucket).

### 2. Create an agent

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

**Trigger**: PR opened / PR updated (webhook from [GitHub](/integrations/github), [GitLab](/integrations/gitlab), or [Bitbucket](/integrations/bitbucket))

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](/features/rule-files) 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](/features/rule-files)**: 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.
