# Annotations

> Learn how to add annotations such as errors, warnings, or notes to LLM output for integration with VSCode or CI environments.

Annotations are errors, warnings, or notes that can be added to the LLM output. They are extracted and integrated into VSCode or your CI environment.

```js
$`Report issues with this code using annotations.`
```

## Configuration

[Section titled “Configuration”](#configuration)

If you use `annotation` in your script text without specifying the `system` field, `system.annotations` will be added by default.

Utilizing the `system.annotations` system prompt enables the LLM to generate errors, warnings, and notes.

```js
script({
    ...
    system: [..., "system.annotations"]
})
```

To get a pretty rendering in the Markdown preview, try the [Markdown Preview for GitHub Alerts](https://marketplace.visualstudio.com/items?itemName=yahyabatulu.vscode-markdown-alert) extension.

### Line numbers

[Section titled “Line numbers”](#line-numbers)

The `system.annotations` prompt automatically enables line number injection for all `def` sections. This enhancement increases the precision of the LLM’s responses and reduces the likelihood of hallucinations.

## GitHub Action Commands

[Section titled “GitHub Action Commands”](#github-action-commands)

By default, the annotations use the [GitHub Action Commands](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message) syntax. This means that the annotations will automatically be extracted by GitHub if you run your script in a GitHub Action.

## GitHub Pull Request Review Comments

[Section titled “GitHub Pull Request Review Comments”](#github-pull-request-review-comments)

Use the `--pull-request-reviews` flag in the [cli run](/genaiscript/reference/cli/run/#pull-request-reviews) to add annotations as [review comments](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request#about-pull-request-comments) on a pull request.

```sh
npx --yes genaiscript run ... --pull-request-reviews
```

## Visual Studio Code Programs

[Section titled “Visual Studio Code Programs”](#visual-studio-code-programs)

Annotations are converted into Visual Studio **Diagnostics**, which are presented to the user through the **Problems** panel. These diagnostics also appear as squiggly lines in the editor.

## Static Analysis Results Interchange Format (SARIF)

[Section titled “Static Analysis Results Interchange Format (SARIF)”](#static-analysis-results-interchange-format-sarif)

GenAIScript converts these annotations into SARIF files, which can be [uploaded](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github) as [security reports](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning), akin to CodeQL reports.

The [SARIF Viewer](https://marketplace.visualstudio.com/items?itemName=MS-SarifVSCode.sarif-viewer) extension facilitates the visualization of these reports.

GitHub Action

```yaml
name: "Upload SARIF"