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

# Create from reports

> Turn a past security report into a reusable agent file with agentgg create.

`agentgg create` reads a past vulnerability report and distills it into a new agent file, so a later scan catches the same anti-pattern again in this codebase.

## The three arguments

All three are required.

| Flag                  | Value                          | Meaning                                                                             |
| --------------------- | ------------------------------ | ----------------------------------------------------------------------------------- |
| `-c, --code <path>`   | A directory                    | The codebase the report came from. The model explores it with Read, Glob, and Grep. |
| `-r, --report <path>` | A file, a directory, or a list | The past report to distill. See below.                                              |
| `-o, --output <path>` | A directory                    | Where the generated agent file lands.                                               |

## What --report reads

| Input                                                          | Behavior                                                                             |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| A `.md` or `.txt` file                                         | That one report.                                                                     |
| A directory                                                    | Every `.md` and `.txt` file inside it, one level deep.                               |
| A `.txt` file whose every non-comment line is an existing path | A list. Each line loads as its own report, or expands again if it names a directory. |

A `#` at the start of a line marks a comment. `agentgg create` distills one report per session, in order, and prints a line for each.

## What it emits

For each report, the command writes one file, `<slug>-<hash>.md`, into `--output`. The hash comes from the code path, the report path, and the report content. A re-run on the same inputs overwrites that same file and does not add a duplicate.

Before it writes, the command parses the generated file with the same loader `agentgg scan` uses. A file that fails to parse never lands on disk.

The generated file carries the standard frontmatter fields: `slug`, `name`, `description`, `noiseTier`, `references`, an optional `precondition`, and `where`. See [Agent anatomy](/agents/anatomy) for what each field means, and [Targeting](/agents/targeting) for `precondition` and `where`.

## Install the result

```bash theme={null}
agentgg agents add ./generated-agents
```

Read the generated file before you trust it in a wide scan. The model wrote it from one report, so tighten `where` and add false-positive notes to the prompt body first.
