Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions docs/product/ai-in-sentry/sentry-prevent-ai/index.mdx
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
---
title: Sentry Prevent AI
sidebar_order: 30
description: "Get code reviews and new tests for better code and coverage using Sentry Prevent AI."
description: "Get error predictions, code reviews and new tests for better code and coverage using Sentry Prevent AI."
---

Sentry Prevent AI is a generative AI assistant developed by Sentry. It helps you generate new tests for uncovered code and reviews your code changes, offering suggestions for improvement before merging pull requests.
Sentry Prevent AI is a generative AI assistant developed by Sentry. It helps you generate new tests for uncovered code and reviews your code changes, predicting errors and offering suggestions for improvement before merging pull requests.

<Alert>
Sentry Prevent AI is currently in <strong>beta</strong>. Beta features are still a work in progress and may have bugs. Please join the [Discord conversation](https://discord.com/channels/621778831602221064/1385700674557444190) to share your feedback.
</Alert>

## Getting Started

To enable Sentry Prevent AI in your GitHub organization or on specific repositories, you need to install the [Seer by Sentry app](https://github.com/apps/seer-by-sentry). This allows the assistant to analyze pull requests, provide insights, and write tests.
To enable Sentry Prevent AI in your GitHub organization or on specific repositories, you need to install the [Seer by Sentry app](https://github.com/apps/seer-by-sentry). This allows the assistant to analyze pull requests, provide insights, and write tests. **You must also have the [Sentry Github integration](/organization/integrations/source-code-mgmt/github/) enabled.**

If you're not an admin, copy the Sentry Prevent AI GitHub App Integration link and share it with your organization's admin or owner to install it.
If you're not an admin, copy the Seer by Sentry GitHub App Integration link and share it with your organization's admin or owner to install it.

**Note:** Both `Show Generative AI Features` and `Enable PR Review and Test Generation` settings must be enabled in your [organization settings](https:sentry.io/settings/organization/) to run Sentry Prevent AI on your pull requests.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small typo in the url here

Suggested change
**Note:** Both `Show Generative AI Features` and `Enable PR Review and Test Generation` settings must be enabled in your [organization settings](https:sentry.io/settings/organization/) to run Sentry Prevent AI on your pull requests.
**Note:** Both `Show Generative AI Features` and `Enable PR Review and Test Generation` settings must be enabled in your [organization settings](https://sentry.io/settings/organization/) to run Sentry Prevent AI on your pull requests.


## Sentry Prevent AI Commands

After installing the app, use these commands in your pull request comments:
After installing the app, Sentry Prevent AI can help you in three ways:

- `@sentry review` - The assistant will review the PR and make suggestions.
1. **Error Prediction** - When you create a pull request and set it to `Ready for Review`, Sentry Prevent AI will check for errors in your code. If no error is found, you will see a 🎉 emoji as a reaction to your PR description. Otherwise, Sentry Prevent AI will add comments to your PR.

- `@sentry generate-test` - The assistant will generate tests for your PR.
2. **`@sentry review`** - Use this command in a PR comment, and the assistant will review the PR and predict errors, as well as make suggestions.

3. **`@sentry generate-test`** - Use this command in a PR commnent, and the assistant will generate tests for your PR.

Once you have added a comment, the assistant will reply, acknowledging the request. For code reviews, you will then see comments added to your PR. For test generation, you will see a comment with a link to the generated tests.

![Sentry Prevent AI Overview](./img/sentry-prevent-review.png)

## Frequently Asked Questions

- **What data does Sentry Prevent need access to for the AI system to function, and what information is sent to third-party AI providers?**
- **What data does Sentry Prevent AI need access to for the AI system to function, and what information is sent to third-party AI providers?**

Sentry Prevent requires access to your pull requests, including PR metadata, repository information, file names, directory structures, and code diffs. The file names, code diffs, and PR descriptions are sent to the AI provider for analysis.
Sentry Prevent AI requires access to your pull requests, including PR metadata, repository information, file names, directory structures, and code diffs. The file names, code diffs, and PR descriptions are sent to the AI provider for analysis.

- **Does Sentry Prevent run anywhere outside of GitHub, and does it run in the background?**
- **Does Sentry Prevent AI run anywhere outside of GitHub, and does it run in the background?**

Sentry Prevent AI only runs on GitHub, and only runs when triggered by a comment.

You can learn more about AI privacy and security [here](/product/ai-in-sentry/ai-privacy-and-security/).

- **Why aren't `@sentry` commands working?**

Sentry Prevent AI will respond with a message to enable the `Show Generative AI Features` and `Enable PR Review and Test Generation` settings in your [organization settings](https:sentry.io/settings/organization/), if you have not already enabled them. Once enabled, try `@sentry review` or `@sentry generate-test` again to run Prevent AI.
Sentry Prevent AI will respond with a message to enable the `Show Generative AI Features` and `Enable PR Review and Test Generation` settings in your [organization settings](https://sentry.io/settings/organization/), if you have not already enabled them. Once enabled, try `@sentry review` or `@sentry generate-test` again to run Sentry Prevent AI.