Agents and budgets
An Agent entry is a configured template for a provider, model, prompt, role,
and optional token budget. Autonomous Agents and Coordinators can own durable actors;
Workers never run on their own: a legacy Coordinator runs them, and in a native Session a lead
can delegate tasks to approved Worker templates. Sessions and Automations refer to templates by
stable id.
For a new setup, keep the team onboarding creates. In a Session, review and apply its Team & budget, then add required checks or a required review when you want those to gate completion. The YAML reference below is for changing templates; it does not replace that Session approval.
Define an Agent
Section titled “Define an Agent”agents: - id: coder name: Coder provider: ollama model: qwen3-coder:30b system_prompt: | Work inside the authorized repository. Make small verified changes and report the commands used to check them. tools: [read_file, list_dir, grep, glob, write_file, edit_file, bash] role: autonomous sampling: temperature: 0 max_tokens: 4096| Field | Meaning |
|---|---|
id | Stable identifier used by Sessions, Automations, APIs, and dependencies |
name | User-facing label |
provider, model | Model target for this Agent |
system_prompt | Persistent operating instructions |
tools | The exact tools the Agent is offered and may call. In a native Session an empty or missing list means the Agent has no tools and can only answer from the conversation, so list the ones it needs, for example [read_file, list_dir, grep, glob, write_file, edit_file, bash]; axocoatl validate, axocoatl doctor and daemon startup warn about an Agent that is not a Worker and lists none. Add workspace_knowledge to offer Workspace knowledge, and web_search or web_fetch for web research once configured, and, under network: egress, request_network_access to let a writer ask you for a host it was refused (Network egress); delegate comes from Team & budget. In a native Session, read_file returns a window of a file from a byte offset that fits the Agent’s model: 64 KiB, or a quarter of its context counted at one token per byte when that is smaller, and says where the next window starts. grep returns up to 64 KiB of whole matching lines; a result it cut says how many matching lines and bytes it left out (omitted_matches, omitted_bytes) and to narrow the search with a path or a more specific pattern. A legacy (1.0-format) Session still gives an Agent with an empty list the baseline tools |
writes | Repository paths the Agent may change in a native Session. Omit it to allow any file; [] makes a read-only helper. See Limit which files an Agent may change |
depends_on | Exact direct-parent completion predicate for a multi-Agent Session turn; also seeds legacy Automation edges during first-boot migration |
role | autonomous, coordinator, or worker |
activation_threshold, activation_decay | Removed in 1.1.0. The daemon warns and ignores them; events never start Agents |
sampling | Optional request-generation controls for autonomous Agents, Coordinators, and declared Workers |
max_tool_rounds | The most tool rounds one activation of this Agent may run in a native Session, from 1 to 1,024. Omit it to let the Agent’s grant set the limit: one round per invocation the grant allows, up to 1,024. See How long an Agent may work |
memory | Tier 1–4 tuning for autonomous Agents and declared Workers; a Coordinator itself uses Tier 1 plus orchestration checkpointing |
A Coordinator must be the entry_point of exactly one workflow and must appear in that
workflow’s roster. Every other member must be a Worker, and each Worker can belong to only that
one coordinator-led workflow. Unknown, duplicate, empty, or out-of-roster identities are rejected
because worker membership would otherwise be ambiguous. A Worker cannot run directly. A
Worker outside every workflow is a helper template: a native lead can delegate to it once
Team & budget approves it.
The default team
Section titled “The default team”axocoatl onboard, axocoatl init, and the repository’s example configurations define
one lead and two read-only helpers. A new Session starts with one Agent, the lead; the
helpers and a required review are opt-in in Team & budget:
agents: - id: lead name: Lead provider: ollama model: llama3.2 role: autonomous tools: [read_file, list_dir, grep, glob, write_file, edit_file, bash] system_prompt: "Answer only with tool calls until the change is made and checked; then write a short summary of what you changed. You own this change: find the relevant code and tests (if you have helpers, ask scout to find code you do not know), make the change, run the check command from the project instructions (AXOCOATL.md) or the tests and fix failures, then check your diff against the task (if you have helpers, ask reviewer to review it) and fix each defect found." sampling: { max_tokens: 4096 } - id: scout name: Scout provider: ollama model: llama3.2 role: worker tools: [read_file, list_dir, grep, glob, bash] writes: [] system_prompt: "Answer the lead's question with file paths, line numbers and short evidence. Change nothing." sampling: { max_tokens: 4096 } - id: reviewer name: Reviewer provider: ollama model: llama3.2 role: worker tools: [read_file, list_dir, grep, glob, bash] writes: [] system_prompt: "Review the described change. Check it against the task and against every contract and edge case the docs, comments and tests describe, one by one. Report each defect with file:line, or say you found none. Change nothing." sampling: { max_tokens: 4096 }axocoatl onboard with Ollama writes the same team on models installed on your server:
Lead and Scout on the Lead model, and Reviewer on a different model that fits. It
prefers an installed gpt-oss model, even when smaller than the writer, otherwise a
larger alternative; when no installed pair fits, it offers its memory-based defaults.
See Configure Axocoatl.
A new Session selects the first Agent that is not a Worker, here Lead, and runs it alone.
When its team is that one Agent, Team & budget offers every Worker with writes: [] as its
helpers: select Let this Agent delegate to helpers to add them, then enter every limit
and apply. See Default team. The Lead prompt asks
for scout and reviewer only if it has helpers.
To change the team, edit these entries and restart the daemon:
- change
modelon all three for a different local model; - rewrite a
system_prompt; - add another Worker with
writes: []to have it offered as a helper too, or remove one; - remove
writes: []from a Worker and it is no longer offered;delegatethen refuses it if it can write files or run commands.
In a native Session, every Agent, including a helper and the required reviewer, is given
the AXOCOATL.md at the root of its repository checkout (up to 64 KiB) with its system
prompt. Put the project’s check command and its conventions there; the default Lead prompt
tells the lead to run that command.
One Agent is the default and the cheaper choice for small tasks; see
What helpers cost. A configuration without
Workers that have writes: [] offers no helpers.
Define a Session team
Section titled “Define a Session team”Lattice Sessions select a config-owned team by ID. Workflow IDs are unique,
non-empty stable identities; human-readable punctuation and spaces are allowed. An autonomous
team is an exact, non-empty roster of autonomous Agents. Its depends_on graph must be closed
inside that roster, contain no duplicate or self dependency, and be acyclic, so every declared
Agent can actually become ready:
workflows: - id: feature-team name: Feature team agents: [planner, coder, reviewer] entry_point: plannerA legacy Session stores feature-team, then resolves current Agent membership and
dependencies when each all-team turn begins. On a 1.0 data root, a turn that would run
two or more Agents is refused with a message to run axocoatl session upgrade --confirm;
a Coordinator-led team runs only its Coordinator and keeps working. The Automation editor and the
compatibility /api/workflows routes operate on the separate canonical
Automation store; editing an Automation does not edit a Session team.
Native authority and budgets
Section titled “Native authority and budgets”In a native Session, Team & budget captures the selected Agent configuration and requires explicit activation, invocation, token, cost, and expiry limits. Each model call reserves an upper bound of what it can use against those limits before it is sent: for local Ollama the loaded context and the output limit, for OpenRouter a bound of the request’s own prompt plus its output and reasoning allowance (see What each request reserves). When the provider reports what the call used, only that stays charged and the rest of the reservation is available again; a call whose usage is not reported, such as an interrupted one, keeps its whole reservation. A helper’s limits are reserved from its lead’s approved aggregate allowance while the helper runs; when it finishes or is stopped, the lead is charged only what the helper used. Events do not refill an allowance. Current authority and any retained expansion requests are reviewed from the Agent inspector.
The enforced native provider boundary currently accepts reviewed local Ollama profiles and eligible OpenRouter-credit profiles with finite inference bounds. Axocoatl verifies the actual backend and model capabilities; an OpenAI-compatible endpoint is not itself an enforcement standard. Local API cost can be known zero while token usage remains incomplete. This does not promise a cap on an unrelated provider’s bill.
How long an Agent may work
Section titled “How long an Agent may work”An activation works in tool rounds: the model asks for tools, they run, and it reads their results. In a native Session the Agent’s grant sets how many rounds one activation may run: one for each invocation the grant allows, up to 1,024. Every round spends at least one invocation, so the grant normally runs out first, and when what is left cannot pay for another round and an answer, the Agent is asked for its final answer without tools.
Set max_tool_rounds on an Agent to stop its activations sooner, for example a helper
that should look around briefly:
agents: - id: scout name: Scout provider: ollama model: qwen3-coder:30b tools: [read_file, list_dir, grep, glob] writes: [] role: worker max_tool_rounds: 40An activation that reaches its limit while the model still asks for tools stops, and the
calls it asked for do not run. Its failure says so, with the class round_limit, and the
suggested next step is Continue, which runs the Agent again on the same request; files
it changed stay changed.
A Session keeps a record of every tool call and every repository capture the host makes, for the life of the Session, with no limit on how many. One turn has room for about 2,000 tool calls: its record holds up to 4,096 steps and 8 MiB, and a tool call takes two steps, its start and its outcome; its budget record holds up to 4,096 claims, and a tool round takes two, the model call and the tool call. When a turn has no room for another tool call, each Agent is asked for its final answer without tools, as when its budget runs out; the next turn starts with fresh room.
An Agent whose tool calls stop showing anything new is asked for its final answer
without tools too: after three rounds that only printed text (echo and the like),
after four rounds of the same calls with the same results, and when 8 of the last 10
calls with the same tool and arguments, or 8 of the last 10 bash commands with the
same pattern (the program and its first option, such as python3 -c), showed nothing
new, wherever they fall. A result shows nothing new when at most one in four of its
lines is one that no earlier result of the activation showed and that the call’s own
arguments do not contain. An edit or a write, or a command that printed nothing, starts
these counts again, and polling a terminal never counts. The request says why, for
example “you repeated the same call (read_file with the same arguments) 8 times without
new results”; a model that calls a tool instead of answering ends the activation as
failed, with that reason.
An Agent that can change no file (an empty write scope, writes: [], as every audit
Agent has) is also watched across tools and arguments: when 12 of its last 15 calls
showed nothing new, its next request asks once for its final answer and still offers
tools, and when 8 more calls show nothing new after that, the next request goes without
tools as above.
Limit which files an Agent may change
Section titled “Limit which files an Agent may change”agents: - id: docs-writer name: Docs writer provider: ollama model: qwen3-coder:30b tools: [read_file, write_file, edit_file, list_dir, grep, glob, bash] writes: [docs/, "*.md"] - id: reviewer name: Reviewer provider: ollama model: gpt-oss:20b tools: [read_file, list_dir, grep, glob, bash] writes: []Each entry is a repository path pattern. A trailing / covers everything below that
directory. A pattern without /, such as *.md, matches that file name in any
directory; a pattern with / starts at the repository root. * and ? stay within one
path segment and ** spans segments. Patterns cannot start with /, contain .. or
name a .git directory, and an Agent can name at most 64.
In a native Session:
write_fileandedit_filerefuse any other path, and any path inside.git, before writing, and never write through a symbolic link. A.gitignoredecides which files are checked, so the Agent may change one only inside a directory it may change whole, such asdocs/. The Agent is told to leave the file unchanged and describe the change in its answer.- Every change the Agent makes is checked after its work, whether or not it has
bash. Axocoatl compares complete manifests of the repository from before and after, including Git’s own settings and hooks and whatever the Git index says; a change outside its paths fails that work and is kept for you to review. The check does not undo a change. Files your ignore rules exclude, and anything outside the repository, are not checked. - A shell can still write anywhere in the sandbox, so for an Agent with
bashthe check is review evidence rather than confinement. Give an Agent that must stay within its paths the file tools withoutbash. - With
writes: []the Agent is not offeredwrite_fileoredit_file. Its ownbashcommands run under a Linux Landlock restriction (Landlock ABI 4, Linux 6.7 or later): they cannot write, create, rename or delete a file in the repository, open a TCP connection or bind a TCP port, loopback included. Landlock does not cover permission bits or timestamps, so a helper that runs as root, or any helper’s shell on macOS, can still change those. Listingbrowserlets it drive the Session’s apps through the browser container;browser_check, which runs test code it writes, makes an Agent count as one that can change files. Each command gets a fresh home directory instead of the Session’s. With workload users its file tools and shell read the repository whatever its file modes, and outside it only what any user may; its file tools write nothing and open no socket, and its shell writes only in a temporary directory of its own. Landlock does not cover UDP, so name lookups and other UDP traffic still follow the sandbox’snetworksetting; see Security for what else it leaves open. Where the runtime cannot apply the whole restriction, such as on Linux before 6.7, itsbashcommands do not run and the read-only file tools still work (with workload users, on Linux 6.2 or later).
Team & budget offers the same choice for each Agent under May change: Any file, Only these paths, or Nothing – read-only helper. The review lists what each approved profile may change. Work added to a running turn starts from one of the Session team’s Agents and keeps what that Agent may change. A Worker cannot change more than its Coordinator: when the Coordinator has a list, each of its Workers needs one too, and every path in it must appear in the Coordinator’s list exactly as written.
Required checks
Section titled “Required checks”A native Session team can have required checks: commands Axocoatl runs in the
Session’s repository after the required Agents of every turn finish. In Team &
budget, open Required checks and enter one command per line; a line you add or
change runs as sh -c <line>. A check applied through the API with its own argument
list shows each argument quoted as a shell would read it, and keeps that exact list
while you leave its line unchanged. If the Session has a detected check command, Add
detected offers it, but it runs only after you add it and apply the team. Required
checks do not run on attempts made with Explore several ways; run them there with
Run checks before you keep one.
After the Agents finish, Axocoatl captures the repository, runs each check, and captures the repository again. The turn completes only when every check passes and the checks leave the repository unchanged. A failing check leaves the turn needing attention, with each check’s exit code and output in the turn controls. Above them the turn says whether the checks are ready and, if not, why: a check failed, a check changed files, some checks ran on an older tree, the checks could not run, or an Agent finished after they captured the repository. The required reviewer only reads, so it does not count. Fix the cause, select a check and choose Continue: every check runs again between fresh captures, because each one must have passed on the same tree. Restarting an Agent with Continue also runs them all again after it finishes.
Checks run on the allowance of the first required Agent, in graph order, whose own
tools include bash; the tools of a lead’s helpers never count. While that Agent works,
Axocoatl holds back enough of its invocations to run every check and both captures
twice: once after the Agents finish and once more after a Continue. Its invocation
limit must be at least that allowance plus three, for the captures of its own changes
and one answer: 9 for one check, 11 for two. Apply is refused when no required Agent
has bash or that Agent’s limit is too small, and so is a request sent to a single
Agent that could not pay for them. A lead that pays cannot start a helper whose limits
would cut into the allowance. Each check may run for three minutes unless the team sets
another timeout for it, from 1 second to 30 minutes (a loadout’s
timeout, or check_options in the Team and budget API),
and keeps up to 768 KiB of output and 256 KiB of errors. Each repository capture may
run for three minutes. It reads every file in the repository: on a 6-CPU Podman machine
a capture of a repository of 200,000 files took 20 seconds and one of 500,000 files 53.
A very large repository or change (a million files or more), or a busy computer, can
take longer; the turn then needs attention and says that the capture did not finish
within its 180 seconds. A capture also fails, and says why, when it cannot read a file
it records (one in the repository or its .git directory that the Agents’ user may not
read), or when its listings of the repository’s files pass the 1 GiB it may write, which
takes millions of files. A submodule is one entry of a capture, recording its checked-out
commit (or its index entry when that commit cannot be read); its contents are not captured.
A nested Git checkout that is not a submodule is listed as unread. Captures fail when
those nested-checkout names exceed their 64 KiB encoded limit.
If the checks cannot be paid for because the paying Agent’s budget is spent, has expired or was revoked, the turn needs attention and says why, for example “Required checks could not run: Builder’s budget has 2 invocations left; they need 3 invocations.” Continue then does not offer to run them again. Use Finish partial result to finish without them, or raise the limit: Review current authority can raise a lead’s limits for the running turn, and Team & budget changes later turns.
Required review
Section titled “Required review”A native Session team can also name a required reviewer: a Worker template that
cannot change files, because it has no tool that writes files or runs commands or it
has writes: []. In Team & budget, open Required review, choose the reviewer,
how many rounds the host runs (1 to 3, two by default), its maximum output per request
and its budget for all rounds of one turn. Apply is refused when the template is not a read-only Worker,
when its budget cannot pay for every round (one activation and one invocation per
round, three with bash for the repository captures around it), or when the lead’s
activation limit is smaller than the rounds. When the team also has required checks
and more than one round, the Agent that pays for them needs a pass of the checks for
every round, never fewer than two, and its own two captures and one answer for every
round: 12 invocations for one check and two rounds.
After the required Agents finish and the required checks pass, Axocoatl, not the lead,
starts the reviewer in a fresh conversation. It is shown the request, each required
Agent’s final answer (up to 16 KiB each) and the change the turn made: every file
whose patch against HEAD differs from the one captured when the turn began. A binary
file is named with its size, never shown as data. The rest is shown whole when it fits
beside the rest of the reviewer’s request (the request, the answers, its instructions,
its attachments and the room kept for asking it again): three quarters of what one
request to its model may hold beside the output allowance (85% of the context), and at
most 48 KiB.
A larger change is shown source first, then generated and dense text, then binary
files, each file whole when it fits and else cut at a hunk boundary, or, for a source
file not one whole hunk of fits (a new file has only one), after its last whole line
that does; a note first says that not all of it is shown, and the files left out are
listed with their bytes. The patch shows a submodule only by its recorded commit:
those the turn changed are named after the change. Every unread nested checkout is
also named, whether its entry changed or not. The reviewer is told it has not
seen those parts and is asked to read those files before it judges them, and to judge a
binary file by its name and size. It is asked to start its answer with VERDICT: APPROVE
or VERDICT: CHANGES, followed by findings, each on its own line, numbered F1, F2, …
and written as path:line: what to change. A verdict
line anywhere in the answer counts, ignoring case and Markdown emphasis, and the rest of
the answer is the findings. The turn completes only when the reviewer approves the exact
result it was shown. An answer without a readable verdict approves nothing: one with no
verdict line, verdict lines that disagree, or a verdict line that says anything else.
While a round remains, Axocoatl asks the reviewer once more, in the next round, about
the same result, showing it the answer that had no verdict when that answer fits the room
every round’s request keeps for it (a sixteenth of what one request may hold beside the
output allowance, at most 2,048 tokens) and otherwise saying it is too long to show
again; that uses the round. The
verdict is bound to the answers and the repository tree it judged: a later revision of
the lead makes it stale, and when the reviewer can capture the repository, a tree that
changed before or while it read fails the verdict.
When the reviewer does not finish for one of the reasons below, Axocoatl runs its round
again, once, while a round remains, with the same prompt in a fresh conversation. After
a transient failure of its model call (a 429, a 5xx, a timeout or a reset connection) it
first waits for the provider’s Retry-After, or 4 seconds when the provider states
none, doubled for each round already run again in the turn, at most 30 seconds; a
Retry-After longer than 30 seconds is not waited for, and the review ends. While it
waits, the workbench shows the review as under way, and Stop ends the wait. When its
model kept calling tools and gave no answer, even when asked for its final answer without
tools, gave no answer and called no tool it was offered, used every tool round of its
activation or reached its token limit for the activation, it runs again at once. Otherwise, or when the run again does not finish
either, the turn needs your attention and the review says why in the reviewer’s own
words: for a request larger than its model takes, how many tokens it needed and the
limit. A run prints that reason on its Needs attention line.
When the reviewer asks for changes, Axocoatl sends its findings to the lead as a
revision in a new epoch, the way Revise does, then runs the required checks and the
review again on the new result. The revision asks the lead to answer every finding in an
ADJUDICATIONS block, accept or reject with a reason, then fix each one it accepts;
findings without numbers are answered as one finding, F1. A
fix loadout run records each answer as an adjudication;
in the workbench the answer is part of the lead’s reply. After the last round, or when more than one required
Agent’s result was reviewed, the turn needs your attention with the findings: Revise
the lead with them, change the files yourself and Continue the review, or
Finish. The turn controls show the verdict, the findings and the round. Continuing
restarted work or rerun checks also runs the review again. The reviewer does not run on
attempts made with Explore several ways.
The review is another model’s judgement of the result, not a proof that it is correct. What Axocoatl enforces is that the reviewer runs, cannot write, create, rename or delete the repository’s files, and approves this exact result before the turn completes. The reviewer template can use a different provider and model from the lead; see Cross-model review.
Actor token guards
Section titled “Actor token guards”The YAML token_budget is a local guard on actor calls. It also applies when a
native activation uses that actor, but cannot weaken the separately approved
native allowance. Budgets are local preflight controls. Before each model call, Axocoatl reserves
the estimated input plus the explicit or resolved bounded completion, including any
reasoning the provider allows on top of it, and compares that reservation with both
limits:
per_callcaps one call’s local reservation;per_executioncaps cumulative recorded usage plus the next reservation for one activation.
per_call must not exceed per_execution; axocoatl validate rejects that
configuration.
Enforce the local guard. A call is not sent when its reservation cannot fit either limit. A provider-reported overrun stops the current turn after the response. This is the YAML default.
Log the overflow and continue. Use this only when observability is more important than stopping locally over-budget work.
A deprecated compatibility spelling that behaves as warn. It does not
summarize spent tokens.
The estimate includes injected memory and tool schemas, not only the visible request. A provider can tokenize differently, report usage only after the call, or ignore a requested output limit, so the guard is not an absolute billing cap. Budgets are independent of automatic conversation compaction, which keeps context within a model window but cannot undo token usage.
Use sampling controls carefully
Section titled “Use sampling controls carefully”sampling accepts optional temperature, top_p, max_tokens, and
response_format (text or json). The configured values reach autonomous Agents,
Coordinator provider calls, and each declared Worker’s own provider calls. Adapter support is
not uniform. Temperature zero can reduce
variation but does not make a generative model deterministic. Omit a field to
use the provider default.
Tune memory
Section titled “Tune memory”memory: max_session_messages: 100 recall: passive_inject: true top_k: 5 min_score: 0.15 core: blocks: - { label: persona, limit: 2000 } - { label: project, limit: 2000 } - { label: team, limit: 1000, shared: true }An omitted or empty core block list creates the default persona, human, and
project blocks. A non-empty list replaces that default set. See
State and memory before changing retention behavior.
Native execution restores exact activation state. Its current actor factory does not attach daily-log, core-memory, or semantic-recall stores, so those settings do not enable native recall or shared-memory writes. The following scope rules apply to compatibility execution.
This memory block config applies to an autonomous Agent or a declared Worker. In a legacy
Session those stores are scoped under the Session runtime identity and survive actor restart;
only labels explicitly marked shared: true cross scopes. A Coordinator’s provider loop does
not expose core/daily/semantic memory tools in 1.0. Its declared Workers apply their own
memory configuration beneath {session}:{coordinator}:worker:{worker}, while ad-hoc Workers
are ephemeral.
Apply changes
Section titled “Apply changes”For durable changes, edit YAML, validate it, then restart the whole daemon:
axocoatl validate ./axocoatl.yaml# stop the running foreground process, then:axocoatl dev --config ./axocoatl.yamlSettings can edit an Agent and restart it immediately, but that patch is only
in memory for the current daemon process. YAML remains unchanged. The CLI
axocoatl agents restart coder --config ... sends a restart request to the
already-running daemon; its config flag does not reload that YAML file.
A role: worker Agent cannot be started or restarted directly. Edit its YAML and restart its
Coordinator. Settings disables the standalone Worker actions for the same reason.
The background supervision loop checks Agent liveness every five seconds and attempts to restart an unexpectedly stopped Agent from its latest checkpoint. After five consecutive failures it leaves the Agent down until configuration is corrected and it is restarted deliberately.
Next: Configure sandboxes →