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

# Agents

> Configure automated Trail evaluations and write custom agents for your repository.

## What Are Agents?

Agents are configurable AI jobs that review changes in a Trail and evaluate them using customizable instructions. They run in isolated cloud sandboxes, or [on your own machine](#run-agents-on-your-own-machine), and can produce summaries, identify code review findings, or report evaluation scores.
Agents can evaluate different aspects of a change, such as Confidence, Risk, Security, and Drift. Each Agent can report a score and flag issues that need attention as Findings.

> [!NOTE]
>
> Project Agents are separate from file-based repository [Runners](https://docs.entire.com/cli-reference/runner.md)
> configured in `.entire/runners/`. `entire runner` manages those files, while
> `entire agent` manages local coding-agent integrations. To manage project Agents
> from the CLI, use [`entire api`](#manage-agents-from-the-cli). To run self-hosted
> Agents on your own machine, use [`entire project agent setup` and `serve`](#run-agents-on-your-own-machine).

[Gates](https://docs.entire.com/guides/trails/gates.md) define the requirements that determine whether a Trail can merge. Once configured, your Agents will look something like this:

<video autoPlay loop muted playsInline poster="/images/videos/agents-red-to-green.jpg">
  <source src="https://mintcdn.com/entire/yKSEaBtqgPAkqkkW/images/videos/agents-red-to-green.mp4?fit=max&auto=format&n=yKSEaBtqgPAkqkkW&q=85&s=cc626eebccd5ada9a4bec4c4abe80bff" type="video/mp4" />
</video>

Code review and Security review flag a change, then pass once the fix is pushed.

## How Agents Work

Each Agent's trigger settings determine when it evaluates changes in its selected repositories. An enabled push trigger runs when its readiness condition and branch or path filters match an open change. The repository's **Auto build on push** setting for Runners does not control project Agents. Each Agent uses its instructions and selected configuration to evaluate the changes.
Entire displays the results on the Trail. Reviewers can use the scores to focus their review, investigate Findings, and push fixes for another evaluation.
The available preset Agents include:

* **Code review:** Reviews every push and flags what needs to be fixed.
* **Security review:** Checks every change for anything that could lead to a security breach in your codebase.
* **Slop:** Catches sloppy patterns and drift before you merge them on your main codebase.

![Entire agent presets for code review, security review, and detecting sloppy patterns and drift](https://mintcdn.com/entire/7Crxbl28PbL5RtNq/images/trails-agent-presets.png?fit=max\&auto=format\&n=7Crxbl28PbL5RtNq\&q=85\&s=93c0acfa9a7304c2ba1d23c2e9814313)

Preset agents available on the project's Agents page.

An Agent's signal configuration determines how its result is represented and whether higher or lower values are better. You can read its rationale alongside the result and the underlying code. Here’s an example of how it looks:

<video autoPlay loop muted playsInline poster="/images/videos/agents-verdict-panel.jpg">
  <source src="https://mintcdn.com/entire/yKSEaBtqgPAkqkkW/images/videos/agents-verdict-panel.mp4?fit=max&auto=format&n=yKSEaBtqgPAkqkkW&q=85&s=b6429dfcb652297810de23819300f038" type="video/mp4" />
</video>

An agent's verdict on a change, with its reasoning and findings.

<video autoPlay loop muted playsInline poster="/images/videos/cli-agent-reads-verdicts.jpg">
  <source src="https://mintcdn.com/entire/yKSEaBtqgPAkqkkW/images/videos/cli-agent-reads-verdicts.mp4?fit=max&auto=format&n=yKSEaBtqgPAkqkkW&q=85&s=092c99f20a9d5d58d8a5970dbee513da" type="video/mp4" />
</video>

Your coding agent can read the same verdicts from the Entire CLI.

## Who Can Manage Agents

Who can create and edit Agents depends on where your project lives:

* **GitHub organization projects:** Only GitHub organization owners can create and edit Agents. Other organization members, including those with write access to the repositories, can't.
* **Entire projects:** Anyone with write access to the project can create and edit Agents.

To let people manage Agents without making them GitHub organization owners, you can move the repositories into an Entire project. This makes Entire the repositories' canonical Git source: Entire stops syncing with GitHub, and access comes from the Entire project instead of GitHub. See [Convert a GitHub Mirror to a Repository on Entire](https://docs.entire.com/guides/repositories/repository.md#convert-a-github-mirror-to-a-repository-on-entire) for the requirements and steps.

## Set Up Your First Agent

To create your first Agent:

1. Navigate to your project on Entire.com.
2. Open your project and go to **Agents** then click on **Manage Agents**.

[Open project Agents](https://customer-0x5hsk8lh27fm00g.cloudflarestream.com/e24c2efca1b9ae12221bcd13cf14b677/iframe)

3. Choose an Agent from the list of presets and click **Enable** to start using it.

[Enable a preset agent](https://customer-0x5hsk8lh27fm00g.cloudflarestream.com/87c891fe2bf2042b7c4e1b12c7e19248/iframe)

## Creating a Custom Agent

If you want to create an Agent with your own configuration, follow these steps:

Click **New agent**. Under Agent, give it a name and description. Select the harness, model, reasoning effort, and timeout. Then write the Instructions describing what the Agent should review and evaluate.
For example, you can create a Migration Risk Agent to evaluate database migration changes.
Under **Agent**, enter the following details:

* Name: Migration Risk
* Description: Evaluates database migration changes for potential deployment and rollback risks.
* Harness, model, reasoning effort, and timeout: Select the configuration that meets your evaluation requirements.

Instructions:

```text theme={null}
Evaluate database migration risk in the Trail's changes. Inspect changed migrations and related application code for destructive operations, locking, compatibility during rollout, and rollback safety.
Score risk from 0 to 100, where higher values indicate greater potential damage. If no migration-related changes exist, return 0 and explain why.
Provide a short rationale explaining the evidence behind the score.
```

Configure the signal the Agent reports by selecting its value type and polarity. The value type determines how the score is represented, while the polarity determines whether higher or lower values are better.

Under **Trigger**, choose when the Agent runs. You can select Trail branch pushed, Run manually, or Recurring schedule.

Under **Repositories**, select at least one repository where the Agent should run.

[Create a custom agent](https://customer-0x5hsk8lh27fm00g.cloudflarestream.com/54a12ce490642658eceaddaa1a963784/iframe)

Leave the **Active** toggle enabled and click **Create agent**.
After it is successfully created, you should see it under the Agents tab as in the image below.

![Agents page listing an active custom agent with its repositories and selected model](https://mintcdn.com/entire/7Crxbl28PbL5RtNq/images/trails-custom-agent.png?fit=max\&auto=format\&n=7Crxbl28PbL5RtNq\&q=85\&s=b5305477d17ae14bdf06b753c67850bc)

A custom agent listed on the project’s Agents page.

Once configured, the Agent can evaluate changes, report a score, and flag issues as Findings.

## Understand the Agent Configuration

| Setting | Purpose |
| - | - |
| Name and description | Identify the Agent and describe what it evaluates. |
| Harness | Select the coding agent environment used for evaluation. |
| Model | Choose the AI model used by the Agent. |
| Reasoning effort | Configure how much reasoning the model uses during evaluation. |
| Timeout | Set the maximum time allowed for an evaluation. |
| Instructions | Define what the Agent should review and how it should evaluate changes. |
| Value type | Define how the Agent's evaluation score is represented. |
| Polarity | Specify whether higher or lower scores indicate a better result. |
| Trigger | Choose when the Agent runs: on Trail branch pushes, manually, or on a recurring schedule. |
| Repositories | Select the repositories where the Agent runs. |
| Active | Enable or disable the Agent. |

## Run Agents Only for Relevant Paths

In a monorepo, use path filters to run specialized Agents only when a change touches relevant files. For example, set `frontend/**` for a frontend review Agent so changes confined to other directories do not trigger it.

1. Open the project's **Agents** page and select the Agent you want to configure.
2. Under **When to run**, click on **Add filters**.
3. Then on **Only when these paths change**, enter a repository-relative pattern, such as `frontend/**`, and press Enter to add it.
4. Save the Agent configuration.

[Configure Agent path filters](https://customer-0x5hsk8lh27fm00g.cloudflarestream.com/bd81fbb1bc03c27aed13a482bdbf229f/iframe)

An Agent's push trigger matches when at least one changed path matches any of its patterns. Use `*` to match within a folder and `**` to match across folders. For example, `frontend/**` matches files anywhere under `frontend/`, while `**/*.go` matches Go files across the repository.

Path filters check files changed across the whole change, from its merge base to its head, rather than only the latest push. An empty path filter matches every change. The Agent's repository selection, readiness condition, and branch filters still apply.

> [!NOTE]
>
> Manual runs ignore branch and path filters. Path filters control when an Agent runs; use its instructions to define what it should review.

## Manage Agents from the CLI

Use [`entire api`](https://docs.entire.com/cli-reference/api) directly or ask your coding agent to run it to manage project Agents and retrieve their results. Your coding agent needs terminal access to the CLI and your Entire login.

> [!WARNING]
>
> These API endpoints are internal and may change without notice. Retrieve the current routes and fields with `entire api --to cell /api/v1/openapi.json`.

### Prerequisites

Install the [Entire CLI](https://docs.entire.com/installation.md) and sign in with `entire login` if you have not already. The examples below also use `jq` and `uuidgen`.

Reading Agents requires access to the project. Creating or editing Agents requires permission to manage project agents and write access to the selected repositories. Custom Agents also require a payment method on the [billing account](https://docs.entire.com/billing.md).

> [tab] CLI
>
> Set your project path. Use `et/<project>` for an Entire project or `gh/<owner>` for a GitHub-backed project:
>
> ```bash theme={null}
> P=et/acme
> ```
>
> Replace the example project and repository names throughout with your own.
>
> ### Look Up Repository and Environment IDs
>
> Find the ID of a repository the Agent should evaluate. `entire repo list --project` accepts the project name or ULID:
>
> ```bash theme={null}
> entire repo list --project acme --json \
>   | jq -r '.. | objects | select(.name? == "pantry-app") | .id'
> ```
>
> List the project's environments and choose the environment in which the Agent will run. Projects get a **Repository sandbox** environment once Agents are enabled:
>
> ```bash theme={null}
> entire api --to cell "/api/v1/$P/environments" \
>   | jq -r '.items[] | "\(.id)  \(.name)"'
> ```
>
> ### List Presets, Models, and Existing Agents
>
> ```bash theme={null}
> # Presets, including code-review, security-review, and slop
> entire api --to cell /api/v1/agents/presets \
>   | jq -r '.items[] | "\(.id)  \(.name)"'
>
> # Models available for each harness when creating a custom Agent
> entire api --to cell /api/v1/agents/models | jq
>
> # Agents already configured in the project
> entire api --to cell "/api/v1/$P/agents" \
>   | jq -r '.items[] | "\(.id)  \(.name)  enabled=\(.is_enabled)"'
> ```
>
> ### Create an Agent
>
> Save the following preset configuration as `agent.json`, replacing the repository and environment IDs with the values you found above:
>
> ```json theme={null}
> {
>   "preset": "slop",
>   "is_enabled": true,
>   "repository_ids": ["<repository ID>"],
>   "triggers": [
>     {
>       "id": "push",
>       "kind": "push",
>       "when": "ready",
>       "branches": [],
>       "paths": []
>     }
>   ],
>   "environment_id": "<environment ID>"
> }
> ```
>
> `"when": "ready"` runs the Agent on pushes once a change is ready for review. In repositories without an approvals gate, open changes are treated as ready.
>
> For a custom Agent, omit `preset` and add `name`, `harness` (`claude`, `codex` or `pi`), `model`, `instructions`, `timeout_ms`, and `signal`. For example, a signal that reports whether issues were found uses:
>
> ```json theme={null}
> {
>   "value_type": "boolean",
>   "polarity": "lower_is_better"
> }
> ```
>
> Use this object as the value of `signal` in the custom Agent's configuration. Select a model returned by the models endpoint for your chosen harness.
>
> Generate an idempotency key once for this creation request:
>
> ```bash theme={null}
> IDEMPOTENCY_KEY=$(uuidgen)
> ```
>
> Create the Agent:
>
> ```bash theme={null}
> entire api --to cell -X POST "/api/v1/$P/agents" \
>   -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
>   --input agent.json
> ```
>
> The `Idempotency-Key` header is required. Omitting it returns `422 validation failed`. To retry the same creation request, rerun only the `entire api` command with the same key and unchanged `agent.json`. Do not regenerate the key for a retry.
>
> ### Update or Archive an Agent
>
> Both operations require the Agent's current `etag`. Set the Agent ID, then retrieve it:
>
> ```bash theme={null}
> A="<agent ID>"
> ETAG=$(entire api --to cell "/api/v1/$P/agents/$A" | jq -r '.etag')
> ```
>
> Update `agent.json` with the complete desired configuration, then replace the Agent's configuration:
>
> ```bash theme={null}
> entire api --to cell -X PUT "/api/v1/$P/agents/$A" \
>   -H "If-Match: $ETAG" \
>   --input agent.json
> ```
>
> `PUT` performs a full replacement. Include all configuration you want to retain. Retrieve the current `etag` again before another update or before archiving:
>
> ```bash theme={null}
> ETAG=$(entire api --to cell "/api/v1/$P/agents/$A" | jq -r '.etag')
> entire api --to cell -X POST "/api/v1/$P/agents/$A/archive" \
>   -H "If-Match: $ETAG"
> ```
>
> ### Retrieve Runs, Verdicts, and Findings
>
> List recent Agent runs in the project:
>
> ```bash theme={null}
> entire api --to cell "/api/v1/$P/runs" \
>   | jq -r '.items[] | "\(.id)  \(.status)  \(.created_at)"'
> ```
>
> Set the repository name and the repository's Change number (not the project Trail number) for the results you want to inspect:
>
> ```bash theme={null}
> REPO=pantry-app
> CHANGE_NUMBER=123
> ```
>
> Read the Trail's Agent verdicts. For a boolean signal with `lower_is_better` polarity, `true` means issues were found (Fail), and `false` means Pass. This example prints other or missing signal values as **See details**:
>
> ```bash theme={null}
> entire api --to cell "/api/v1/trails/$P/$REPO/$CHANGE_NUMBER" \
>   | jq -r '.agents[] | "\(.agent.name): \(if .reading.boolean_value == true then "Fail" elif .reading.boolean_value == false then "Pass" else "See details" end) — \(.reading.summary)"'
> ```
>
> Retrieve the findings behind those verdicts:
>
> ```bash theme={null}
> entire api --to cell "/api/v1/trails/$P/$REPO/$CHANGE_NUMBER/reviews/comments" \
>   | jq -r '.comments[] | select(.source.agent != null) | "\(.source.agent.name)  \(.severity)  \(.status)  \(.path):\(.line)"'
> ```

> [tab] Agent Prompt
>
> Open your coding agent and replace `<project>` and the example repository names with your own. These prompts use an explicit project so they also work when your current checkout belongs to a different project. The coding agent uses the same API and permissions as the CLI commands.
>
> ### Inspect Available Agents
>
> Start with a read-only check of the project and available configuration:
>
> ```text theme={null}
> Help me inspect project Agents for et/<project> and its repositories
> app, docs, and website using the Entire CLI.
>
> Run `entire agent-help`, then inspect the help for api, project list,
> and repo list. Find the named project with
> `entire project list --json`, confirm its jurisdiction, and resolve
> all three repository IDs
> with `entire repo list --project <project> --all --json`.
> Use this explicit project rather than inferring it from my checkout.
> Fetch the current API schema with:
> `entire api --to cell /api/v1/openapi.json`.
>
> Use read-only requests to find the repository IDs, project environments,
> Agent presets, models, and existing project Agents. If the project is
> outside my home jurisdiction, use `--jurisdiction` to reach its cell.
> Follow pagination where needed. Report which Agents already cover
> each repository and which environments are available.
>
> If the project cannot be found or accessed, report the error and ask
> me to confirm the project or login context. Do not guess IDs or create
> resources. Do not change Agent configuration or run any Agents.
> ```
>
> ### Create a Preset or Custom Agent
>
> After confirming the project and repository, use a prompt such as:
>
> ```text theme={null}
> Set up the Slop preset Agent for app, docs, and website in
> project et/<project> using the Entire CLI and the current API schema.
>
> Run `entire agent-help` and inspect the current API schema first.
> Resolve the named project and its jurisdiction, all three repository
> IDs, available environments, presets, and existing project Agents.
> Use the project's cell, not the project inferred from my checkout.
> Use the Repository sandbox environment; if more than one has that
> name, report their IDs and ask me which one to use.
>
> If Slop is already configured, report its current repository selection
> and triggers, including whether it covers all three repositories.
> Do not create a duplicate or replace the existing configuration.
> Otherwise, create one Agent covering all three repositories with
> is_enabled=true and one push trigger: id=push, kind=push, when=ready, branches=[], paths=[].
>
> Save the request body as agent.json. Create the Agent through
> `entire api --to cell` using an Idempotency-Key. Keep the same key
> and body if retrying that creation request.
>
> Read the saved Agent back and report its ID, environment, repository
> selection, and trigger settings. Do not start a manual run or change
> other Agents.
> ```
>
> For a custom Agent, replace the Slop request with your desired name, review instructions, harness, model, timeout, and signal. Ask your coding agent to check the available models and the [billing requirements](https://docs.entire.com/billing.md) before creating it.
>
> ### Update or Archive an Agent
>
> Specify the Agent ID and the exact change you want:
>
> ```text theme={null}
> In project et/<project>, update Agent <agent ID> so its push trigger
> runs only for paths matching frontend/**. Use the Entire CLI and
> the current API schema.
>
> Resolve the named project and its jurisdiction explicitly.
> Read the current configuration and its JSON etag first. Prepare a
> complete replacement body that preserves the other settings,
> repository selection, environment, and trigger ID. Send it using
> PUT with the etag in If-Match. If the etag is stale, read the current
> configuration again and report the conflict before replacing it.
>
> Read the Agent back and summarize the saved change. Do not archive
> it, change other Agents, or start a manual run.
> ```
>
> To archive instead, replace the update request with: “Archive Agent `<agent ID>` in project `et/<project>`. Read its current JSON `etag`, then POST to its archive endpoint with `If-Match`. Confirm that it is archived.”
>
> ### Read Runs, Verdicts, and Findings
>
> ```text theme={null}
> Inspect recent Agent runs in project et/<project> and the verdicts
> and findings for a Trail spanning app, docs, and website using the
> Entire CLI.
>
> Run `entire agent-help` and inspect the current API schema before
> choosing commands. Resolve the named project and its jurisdiction
> explicitly. List its Trails and ask me which one to inspect if there
> is more than one match. Cover every linked change across all three
> repositories, using each change's repository and number.
> Use dedicated CLI commands where available and
> `entire api --to cell` for the remaining project Agent endpoints.
> Follow pagination where needed.
>
> Summarize run statuses, each Agent's reading and rationale, and its
> findings with severity, status, and file location. Interpret readings
> using the Agent's signal type and polarity. Treat missing readings as
> pending or unavailable, rather than Pass. Include the Trail or change
> URL returned by Entire.
>
> Do not modify Agents, dismiss findings, trigger runs, or merge changes.
> ```

## Run Agents on Your Own Machine

A self-hosted Agent runs on a machine you control instead of Entire's cloud sandbox. You need billing set up, permission to manage the Entire project for setup, and `git`, `git-remote-entire` and a signed-in Claude Code on that machine.

1. Create a [custom Agent](#create-an-agent) with `"runs_on": "self_hosted"` and `"harness": "claude"`, and leave out `environment_id`. The first one also creates the project's self-hosted environment.

2. From a checkout of a repository the Agent reviews, create a service account that can run the project's self-hosted Agents ([reference](https://docs.entire.com/cli-reference/project.md#entire-project-agent-setup)):

   ```bash theme={null}
   entire project agent setup --name my-machine
   ```

3. Create its secret, using the service account ID that `setup` printed. The secret is shown only once:

   ```bash theme={null}
   entire service-account secret create <service account ID> > agent.secret
   ```

4. Start the worker. Add `--once` to handle a single job and exit:

   ```bash theme={null}
   ENTIRE_TOKEN="$(cat agent.secret)" entire project agent serve
   ```

5. Trigger a run: push to a change that is ready for review, or start a run by hand.

The worker picks up the job, checks out the change's commit, and runs Claude Code read-only. Findings show up on the Trail as usual.

## Agent Insights

Agent Insights helps you understand how coding agents use tokens across your Trails and repositories. You can track token consumption by activity, compare usage across models, and identify changes that required more agent effort than expected.

### How to Enable Agent Insights

To start tracking agent token usage, go to the Plugins tab in your project and find the Agent Insights extension.
Click Install, select the repositories on Entire where you want to enable Agent Insights, and click Install again.

[Install Agent Insights](https://customer-0x5hsk8lh27fm00g.cloudflarestream.com/0445a8cbe2442fc3528bde0ce38fcc3e/iframe)

### View Token Usage in a Trail

Once it is enabled, open a Trail and navigate to Sessions to see a breakdown of token usage across agent activities, such as understanding code, building, checking, reworking, reviewing, and coordinating.
Hover over the visualization to see the percentage of tokens spent on each activity. This helps you understand how the agent worked on a change and whether it spent more tokens implementing changes or making repeated fixes.

<video autoPlay loop muted playsInline poster="/images/videos/trail-token-usage.jpg">
  <source src="https://mintcdn.com/entire/yKSEaBtqgPAkqkkW/images/videos/trail-token-usage.mp4?fit=max&auto=format&n=yKSEaBtqgPAkqkkW&q=85&s=d6665ab9c3fa7a976f2aa6c16e27da0a" type="video/mp4" />
</video>

Token usage by activity in a Trail's Sessions section.

### View Agent Insights in Repository Analytics

Open your repository's existing Analytics page and scroll to the Agent Insights section.
The Analytics page is available independently of the plugin. Enabling Agent Insights adds more detailed token usage metrics across merged Trails through three visualizations:

* **Token Volume by Model:** Track daily token consumption grouped by the models used.
* **Tokens vs. Lines Changed:** Compare token usage against the number of lines modified in each Trail. This helps identify which Trails consume the most tokens.
* **Tokens by Activity:** Compare token usage across activities between the current and previous week to understand how agent behavior changes over time.

You can use these metrics to identify unusual token consumption, understand which activities require the most effort, and compare agent usage across Trails.

<video autoPlay loop muted playsInline poster="/images/videos/repo-agent-insights.jpg">
  <source src="https://mintcdn.com/entire/yKSEaBtqgPAkqkkW/images/videos/repo-agent-insights.mp4?fit=max&auto=format&n=yKSEaBtqgPAkqkkW&q=85&s=752008ef5100572cf38b444acd37a491" type="video/mp4" />
</video>

Agent Insights on the repository Analytics page.
