---
title: Agents as data
summary: An agent is a versioned Markdown document. Labels point at versions, canaries split traffic, and evals gate the release.
section: architecture
order: 4
---
Argus treats an agent as **data**, not as code inside a deployed application. That one choice decides how a change reaches production, how it is reviewed, and how it is undone.

## The definition

An agent is one Markdown file with YAML front matter, in the format `argus.agent/v1`, named `namespace/name`. The front matter declares the model (and optional fallbacks), the tools the agent may use, its limits, an optional workflow (each step that runs an agent may name the model that agent runs on, so one flow can use a small model for a draft and a larger one for the review), optional `routes` that pick a model, tools and step limit per kind of request, optional `model.select` rules that pick a model per call, and `model.requires`, `model.prefers` and `model.fallback_on` for what a model must have and which failures move to a fallback, context rules such as compaction and what to do when a long conversation passes its ceiling (truncate or summarise), and the evals gate. The body is the instructions. The API accepts the same document as JSON, validates it against the agent schema, and can report errors and warnings without storing anything.

Instructions that several agents share are stored as **fragments**, and output formats as **schemas**. Both are versioned like agents, and a definition that includes one pins its version, so a change to a shared fragment cannot silently change an agent that did not opt in.

## Where the truth lives

The Argus database is the source of truth. A repository file creates a version with `argus apply`, and the app editor creates versions the same way. This gives teams both things they want: reviewable files in their own repository, and the ability to change an instruction without deploying the application that uses it. `argus diff` shows where the two disagree.

## Versions are immutable

Every change creates a new, numbered **version** with a content hash. A version is never edited, and applying content identical to the latest version creates nothing. Anything that ran can therefore be reproduced exactly: a session records the version it actually ran.

## Labels are the release mechanism

A **label** is a movable pointer to a version. `production` is what applications run; `canary`, `draft`, `dev` and custom labels are for everything else. Applications start sessions on a label, so shipping is moving a pointer, not redeploying code.

Moving a label is an audited event with the actor and the reason, and rollback is moving the label back.

<figure class="diagram" data-diagram="release">
<div class="diagram-scroll" role="region" aria-label="Figure 4, scrolls sideways" tabindex="0">
<svg class="d-w780" viewBox="0 0 780 200" role="img" aria-labelledby="dg-release-t dg-release-d" focusable="false">
<title id="dg-release-t">The path of an agent change from edit to production</title>
<desc id="dg-release-d">A definition is saved as an immutable version. An eval suite runs against the version. The gate checks that the latest run passes and does not regress against the version the label holds now. If it passes, the label moves and new sessions start on the new version. A rollback moves the label back to an earlier version, which must pass its own run but is not compared with the version being rolled back.</desc>
<defs><marker id="dg-release-head" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="d-headfill" d="M0 0L10 5L0 10z"/></marker></defs>
<rect class="d-box d-client" x="16" y="30" width="108" height="60" rx="6"/>
<text class="d-t" x="70" y="55" text-anchor="middle">Definition</text>
<text class="d-s" x="70" y="71" text-anchor="middle">file or editor</text>
<rect class="d-box d-argus" x="144" y="30" width="108" height="60" rx="6"/>
<text class="d-t" x="198" y="55" text-anchor="middle">Version N</text>
<text class="d-s" x="198" y="71" text-anchor="middle">immutable</text>
<rect class="d-box d-argus" x="272" y="30" width="108" height="60" rx="6"/>
<text class="d-t" x="326" y="55" text-anchor="middle">Eval run</text>
<text class="d-s" x="326" y="71" text-anchor="middle">suite and scorers</text>
<rect class="d-box d-inner" x="400" y="30" width="108" height="60" rx="6"/>
<text class="d-t" x="454" y="55" text-anchor="middle">Gate</text>
<text class="d-s" x="454" y="71" text-anchor="middle">pass, no drop</text>
<rect class="d-box d-argus" x="528" y="30" width="108" height="60" rx="6"/>
<text class="d-t" x="582" y="55" text-anchor="middle">Label moves</text>
<text class="d-s" x="582" y="71" text-anchor="middle">a pointer move</text>
<rect class="d-box d-plat" x="656" y="30" width="108" height="60" rx="6"/>
<text class="d-t" x="710" y="55" text-anchor="middle">New sessions</text>
<text class="d-s" x="710" y="71" text-anchor="middle">start on the label</text>
<line class="d-line" x1="124" y1="60" x2="144" y2="60" marker-end="url(#dg-release-head)"/>
<text class="d-s" x="134" y="24" text-anchor="middle">1. save</text>
<line class="d-line" x1="252" y1="60" x2="272" y2="60" marker-end="url(#dg-release-head)"/>
<text class="d-s" x="262" y="24" text-anchor="middle">2. run</text>
<line class="d-line" x1="380" y1="60" x2="400" y2="60" marker-end="url(#dg-release-head)"/>
<text class="d-s" x="390" y="24" text-anchor="middle">3. check</text>
<line class="d-line" x1="508" y1="60" x2="528" y2="60" marker-end="url(#dg-release-head)"/>
<text class="d-s" x="518" y="24" text-anchor="middle">4. move</text>
<line class="d-line" x1="636" y1="60" x2="656" y2="60" marker-end="url(#dg-release-head)"/>
<text class="d-s" x="646" y="24" text-anchor="middle">5. start</text>
<path class="d-line d-dash" d="M582 90 V150 H198 V92" marker-end="url(#dg-release-head)"/>
<text class="d-m" x="390" y="172" text-anchor="middle">rollback: move the label back to a version it held before</text>
<text class="d-s" x="390" y="190" text-anchor="middle">that version must still pass its own latest run</text>
</svg>
</div>
<figcaption>Figure 4. The path of a change. A new version is saved, evaluated, and shipped by moving a label. The gate sits on the label move itself, so no editor can bypass it. Dashed boxes are outside Argus (people and their tools).</figcaption>
</figure>

In words: a person or `argus apply` saves a definition as a new version. An eval suite runs against that version. Moving the `production` label, or giving a canary label a share of traffic, passes through the gate. Only then do new sessions start on the new version, and the old version stays available for a rollback.

## Canary

A label other than `production` can take a share of new `production` sessions through `traffic_percent`, from 0 to 100, where 0 stops the split. The split is **sticky** per end user: a session that names an end user always lands on the same side for that agent, and a session without one is assigned at random. Production keeps its version while the canary runs. The Studio offers shares of 5 to 50 percent. Promoting is a label move; stopping is setting the share to 0.

## Eval gates

Moving a gated label, by default `production`, is refused with `422 eval-gate-failed` unless:

- the candidate version's latest completed eval run passes its suite's verdict and, when one is set, `min_pass_rate`; and
- its pass rate does not fall more than `max_regression` (default zero) below the latest run, on the same suite, of the version the label holds now.

These numbers come from the project's eval gate floor (`GET`/`PUT /v1/projects/{project}/eval-gate-floor`, admins write it, audited). A definition's `evals.gate` can make them stricter, never looser. The suite is the floor's when it names one. Otherwise, once the secure default is on (until then Argus only reports), a move of `production`, or of a label that takes traffic, counts only runs of an admin-owned suite, started since an admin took it over.

A version also ships what its explicit child refs reach. At a gated move, a `child:label` subagent or workflow ref must name a label other than `draft` whose version was moved there through the gate, and a `child@N` pin must name a version that some label move took through the gate. A bare name runs the child's `production`, which is always gated. Otherwise the move is refused with the ref and the reason, unless an admin overrides it (recorded).

A version with no completed run cannot be shipped, and the refusal names the missing run. Because the gate is on the label move rather than in one editor, it applies equally to the API, the CLI and the app.

Suites are scored by a model judge, code checks and tool checks.

### Rollback skips the comparison

An incident is the worst time for a comparison against a broken baseline. So returning a gated label to a version it held before is treated as a **rollback**: that version must still pass its own latest run, but it is not compared with the version it replaces. It still has to show it works; it just does not have to beat what is failing.

### Override

A project `admin` can move a gated label past a failed gate by giving a reason, which is recorded in the move's event. In the app an override first asks the person to confirm their sign-in again.

## Online evals and drift

A label can also have an **online eval**: after each completed run, a sample is scored off the run's path. If the pass rate of the latest window falls by more than a configured amount below the window before it, or under a floor, a drift alert opens and a gauge is exported so an alert rule can page. It resolves when the pass rate recovers or the label returns to an earlier version. This catches a release that passed its suite and still got worse on real traffic.

## Why this design

- **Rollback is cheap and audited.** It is a pointer move with a reason, with no build or deploy.
- **Review still works.** Files in a repository, `argus apply` and `argus diff` keep the review habit.
- **Evidence is part of the release.** The gate makes "is it at least as good as what is running?" a precondition rather than a habit.
- **The cost is two places to reconcile.** The database and a repository can disagree, which is what `argus diff` is for.

## Read next

[Tools, tokens and the egress guard](/docs/architecture/tools.md) covers what a granted tool can reach.
