External agents
Axocoatl can run the Claude Code CLI or the Codex CLI as the writer of a run, in place of
its own tool loop. Two built-in loadouts do it with one command: fix-claude-code and
fix-codex. Each is the built-in fix with the program
as its writer: the repository’s check command runs on the exact final files as a
required check, a reviewer on a different model must approve the change, for up to 3
rounds, and the program answers every finding the host sends back with accept or reject
and a reason. You can also name the program in a loadout of your own
(below).
The program runs inside the Session container, not on your computer, under the same rules as any loadout Session:
- network
egress: the program reaches its model API only through a route, and other hosts only when the loadout or your configuration lists them; the route refuses a model request that asks the provider to fetch a URL, search the web, connect to an MCP server or run a tool itself (what it checks); - the
hardenedworkload: it runs as the non-rootwriter_userthrough the in-sandbox supervisor with--harden, under its seccomp filter and in a Landlock domain of its own; - the activation is admitted, granted and captured like a native writer: Axocoatl
captures the repository before and after it, checks the change against the writer’s
writes, and then runs the loadout’s required checks and review.
The program’s credential never enters the container. The container holds a placeholder
in the variable the program reads, and the daemon adds the real value on your computer,
on the route, to each request the route’s rules allow. Codex can use either an OpenAI API
key or the sign-in of your ChatGPT plan (axocoatl connect codex); for the sign-in, the
daemon also keeps the access token current on your computer.
Run Claude Code or Codex
Section titled “Run Claude Code or Codex”-
Set up this computer once.
axocoatl onboardasks who writes the code; choose Claude Code or Codex. It installs or starts Podman, builds the program’s image, signs you in through your browser and sets up the reviewer, asking before each download or change:Terminal window axocoatl onboardThe next steps do the same by hand.
-
Optionally, build the program’s Session image ahead of time, once per upgrade (see Build the image). A run builds the one it needs when it is missing: the program’s recipe with your repository’s toolchain, such as
claude-code python:Terminal window axocoatl recipe build claude-code python # or: axocoatl recipe build codex node -
Connect its account, once, by signing in in your browser (see Store the credential). The connection command captures and stores the credential for you:
Terminal window axocoatl connect claude-code # Claude Code: stores claude-code-oauthaxocoatl connect codex # Codex on your ChatGPT plan: stores codex-chatgpt -
With the daemon running (
axocoatl dev), run it in your repository:Terminal window cd ~/src/my-appaxocoatl run fix-claude-code --task "Paging skips the last item when the total is a multiple of the page size"axocoatl run fix-codex --task "Paging skips the last item when the total is a multiple of the page size"
The reviewer is one of Axocoatl’s own Agents, on Ollama or OpenRouter as your
configuration defines them (see Providers): Claude Code and Codex
can write but not review, and a reviewer on any other provider, or on one that is not
configured, is refused before anything starts (exit code 3). When your configuration has
run.models.reviewer, which axocoatl onboard writes,
the run uses it and --model reviewer=… is needed only to choose another. For a reviewer
on OpenRouter, connect it once by signing in in the browser:
axocoatl connect openrouter --reviewer <vendor/model> checks the model, stores the key
OpenRouter issues without showing it and adds OpenRouter to your configuration (see
Configure OpenRouter). Choose a model other
than the writer’s: a same-model pair, through any provider, is refused when either
model is inherited from your setup. Explicitly naming both models permits it with a
same_model_reviewer warning (see Choose the models).
Every other flag of axocoatl run applies: --check "<command>" when
Axocoatl detects no check command in the repository, --junit and --record,
--keep branch|pr, and --dry-run to list what would stop the run without starting it
(it loads the reviewer’s Ollama model once, as a run would).
Before anything starts, the run is refused with every problem at once: a credential that
is not stored (exit code 3, saying how to connect), a reviewer that cannot run, and with
--no-build an image that is not built (exit code 3, naming the axocoatl recipe build
command).
Once axocoatl connect has stored a sign-in, it prints the run command for this computer:
the image build when none is recorded, and the reviewer from your setup. With no reviewer
set up yet, it says to choose one first (axocoatl onboard saves it as
run.models.reviewer) and prints the command that then runs as written, or the --model reviewer=… to add instead.
The writer runs in an image that combines its recipe with the repository’s language
toolchain, such as claude-code and python for a Python repository (see
Repository toolchains). Before the first model call, the run
installs the repository’s dependencies and checks that the check can start. When the
image is missing, axocoatl run builds it first, or with --no-build refuses and names
the axocoatl recipe build command.
What the built-in loadouts run
Section titled “What the built-in loadouts run”fix-claude-code | fix-codex | |
|---|---|---|
| Writer | Claude Code 2.1.292 (runtime: claude-code) from the claude-code recipe image | Codex 0.160.1 (runtime: codex) from the codex recipe image |
| Writer’s model | writer_model, default anthropic:sonnet | writer_model, default openai:gpt-6.1-sol |
| Credential | claude-code-oauth | credential, default auto: codex-openai when it is stored, else codex-chatgpt |
| Required check | tests: the repository’s check command (--check, AXOCOATL.md, or detected), in the repository’s toolchain; 3 minutes | the same |
| Required review | reviewer_model (required; run.models.reviewer when configured), read-only tools, up to 3 rounds, every finding adjudicated | the same |
| Writer’s budget | 4 activations, 400 invocations, 20,000,000 tokens, $10 | 4 activations, 200 invocations, 20,000,000 tokens, $10 |
| Reviewer’s budget | 3 activations, 120 invocations, 1,500,000 tokens, $3 | the same |
| Wall clock | 60 minutes | the same |
| Sandbox | network: egress, workload: hardened | the same |
The writer’s instructions, the reviewer’s instructions and the prompt are fix’s. The
program brings its own tools, so the writer lists none. axocoatl loadouts show fix-claude-code (or fix-codex) prints the exact file, and Settings → Loadouts shows
it with its parameters and graph.
Choose the models
Section titled “Choose the models”--model writer=… replaces the writer’s default. Its provider is the one whose API the
program calls: anthropic: for Claude Code, with a Claude model or one of Claude Code’s
aliases (anthropic:opus, anthropic:haiku, anthropic:claude-opus-5-5), and openai:
for Codex, with one of its models (the table in What a run costs).
Any other provider is refused (exit code 3). The default anthropic:sonnet is an alias
that Claude Code 2.1.292 resolves to claude-sonnet-5-5 from the model catalog bundled
in that build. The default openai:gpt-6.1-sol is the first model of the catalog bundled
in Codex 0.160.1, and Axocoatl’s price table lists it; Codex runs it in code mode, in
which the model writes JavaScript that calls Codex’s tools (exec_command,
apply_patch) in an isolate Codex starts inside the container. Axocoatl’s Podman tests
run both built-ins with their default models, from the recipe images, against a fake
model API: Claude Code’s requests named claude-sonnet-5-5, and Codex’s code mode ran
its command in the Session.
The reviewer comes from your setup or --model reviewer=…. The same-model check
compares models through whichever provider each runs: a reviewer on
openrouter:anthropic/claude-sonnet-5.5 matches the default Claude Code writer, since
sonnet runs claude-sonnet-5-5; one on openrouter:openai/gpt-6.1-sol matches the
default Codex writer. Onboarding requires different models. A matching pair is refused
when either model comes from your setup; explicitly naming both models permits it
with a warning. See Models from your setup.
Choose the Codex credential
Section titled “Choose the Codex credential”fix-codex’s writer sends one of two stored credentials:
codex-openai: an OpenAI API key, sent toapi.openai.comand billed at API rates to the key’s OpenAI Platform organization; this version stores none through a sign-in (Codex with an OpenAI API key);codex-chatgpt: your ChatGPT sign-in, fromaxocoatl connect codex, sent tochatgpt.comand counted against your plan’s usage limits. The daemon keeps it current (Codex with a ChatGPT sign-in).
With the default credential=auto, the run takes codex-openai when it is stored and
codex-chatgpt otherwise. “Stored” means a secret of that name in the data root, or a
credentials entry of that name in your configuration. With neither, the run is refused
before anything starts (exit code 3):
Agent writer (codex) has credential auto, and neither codex-openai nor codex-chatgpt is stored: run `axocoatl connect codex` to sign in with your ChatGPT plan (stored as codex-chatgpt), then run again--param credential=codex-chatgpt (or codex-openai) chooses one; then that one must
be stored. Any other value is refused (exit code 3).
The run says which credential its writer’s route sent, so it is never a guess. As the
run starts, axocoatl run prints a note such as
· note: Agent writer (codex) sends the stored credential codex-chatgpt (a ChatGPT sign-in, sent to chatgpt.com); credential auto chose it, the first of codex-openai and codex-chatgpt that is stored.The same line is among the Outcome’s notes, which the summary, the JUnit file’s run
case, the Run outcome panel and the record bundle show, and the run’s manifest in the
record keeps the choice ("credentials": {"writer": "codex-chatgpt"}), which a daemon
restart applies again instead of choosing anew. A fix-claude-code run says the same of
claude-code-oauth. When auto chooses codex-openai while codex-chatgpt is stored
too, the note adds that the run is billed at OpenAI API rates to the key’s OpenAI
Platform organization, not to your ChatGPT plan, and that
--param credential=codex-chatgpt uses the plan: storing a key moves auto’s runs to
API rates, and every such run says so as it starts.
Budgets
Section titled “Budgets”Before a run starts, the writer’s tokens must hold one call of its model, or the run is
refused (exit code 3, What a run costs): 1,000,000 tokens for a Claude
model with a 1M-token window (the default sonnet, opus, fable), 200,000 for haiku,
400,000 for Codex 0.160.1’s models. The built-ins give the writer 20,000,000 tokens, far
above that: the program reports every input token of every request it makes, cached
context included, and a session reads its context again on each request, so one program
run can report several million tokens, and a program run that reports more tokens than
its grant still allows fails. The tokens leave room for the first run and the two
revisions three review rounds can ask for.
Spend is bounded by cost_usd, $10 for the writer. Claude Code runs with its own
spending stop, --max-budget-usd, at what its grant still allows, and settles to the cost
it reports. Codex has no spending stop of its own: each of its requests counts against
the writer’s 200 invocations, and the host stops it when they run out; its cost, computed
from the tokens it reports at its model’s price, settles against the $10. These numbers
are a starting point, not a measurement. To change them, write your own loadout.
Build the image
Section titled “Build the image”axocoatl recipe build claude-code # or: axocoatl recipe build codexThis builds an image named localhost/axocoatl-recipe-… with Podman from a base and the
recipe’s pinned versions, prints it, and records its image id in the data root. Sessions
trust a recipe image by that id, as they do the browser image, without
allow_untrusted_images. Run it with the daemon’s --config (or AXOCOATL_DATA_DIR),
so the id lands in the data root the daemon reads. Recipes can be combined, as in
axocoatl recipe build claude-code e2e, and with a language toolchain, as in
axocoatl recipe build claude-code python, which is the image a fix-claude-code run
in a Python repository uses. axocoatl recipe list shows the recipes, the toolchains and
the images built from them. The image’s tag carries a digest of its recipes, so after an
upgrade that changes a recipe, a run asks you to build again. The build downloads the
base image and the programs; that is network access you start, on your computer.
A loadout names the image by its recipes, as the built-ins do:
environment: recipes: [claude-code]Store the credential
Section titled “Store the credential”Claude Code: axocoatl connect claude-code
Section titled “Claude Code: axocoatl connect claude-code”axocoatl connect claude-codeThis runs claude setup-token for you and stores one complete captured OAuth token
as the secret claude-code-oauth. You sign in in the browser as claude setup-token
asks; Axocoatl filters the terminal output instead of asking you to copy or paste a token:
claude setup-tokenruns in a pseudo-terminal the size of your terminal, and is resized with it when you resize the window, so its screen looks as it does when you run it yourself. In a terminal smaller than 40 columns by 24 rows it gets 40 by 24 instead (in a smaller one Claude Code may not draw the whole token), and its screen may then look broken. Capture must still identify one complete token before it can be stored. Your terminal is in raw mode while it runs (your keystrokes go to it) and is restored when it ends, also on an error or a signal. Keystrokes stop going to it the moment it exits: what you type while the token is checked stays for your shell.- Everything it prints reaches your terminal through a filter that keeps a model of the
terminal, so it sees each character in the cell it lands in, as you would. Claude Code
draws the token in rows wrapped at the width of its box and placed by cursor movement;
the filter reads token characters from those cells, including characters retained
from an earlier frame when the renderer writes only changed cells. It follows the
token’s prefix, body, wrapped rows and final suffix, using the cells’ positions and
styles. Each recognized token cell shows the next
character of
[token hidden by axocoatl](then a blank), so the rest of the screen stays where Claude Code put it. At most the public prefixsk-antshows before the mask. Writes to your clipboard (OSC 52, and the kitty, iTerm2, tmux and screen forms of it) are dropped, and so is any other escape sequence holding a token. - Axocoatl reads the token from that output in memory only: exactly one
sk-ant-oat01-…token must be captured, or nothing is stored and the command says why. If the filter detects an uncertain credential redraw, it keeps the affected characters hidden and refuses capture with exit 2 before verification or storage. This refusal also applies with--no-verify; that flag skips only the Anthropic check. Runaxocoatl connect claude-codeagain to start a new sign-in. The token ends where it does on screen: the next line Claude Code prints is not stored with it, nor is text after a blank on its last row. The captured value is kept out of command lines, environment variables, logs, temporary files and messages, and the buffers that held it are overwritten when they are freed. - It then checks the token with Anthropic over HTTPS (
GET /v1/modelswith the token, which costs nothing; the response is never shown). A token Anthropic rejects (401or403) is not stored. When Anthropic cannot be reached, nothing is stored either: run the command again, or add--no-verifyto store the token unchecked. TheAuthorizationheader is built in a buffer that is overwritten when the request ends; the copies the HTTP and TLS libraries make while sending it are freed then, and the connection is not kept open. - It stores the token exactly as
axocoatl secret setdoes (secrets/claude-code-oauthin the data root,0600, replaced atomically) and printsConnected Claude Code: stored secret claude-code-oauth (the token was never shown)with the next step.
It needs an interactive terminal and the claude CLI: the first claude on PATH,
then ~/.local/bin/claude, or the path given with --claude PATH. --secret NAME
stores the token under another name. Like recipe build, it uses the data root of
--config or AXOCOATL_DATA_DIR. Exit codes: 0 stored, 1 rejected by Anthropic, 2 no
single complete token captured or an uncertain credential redraw, 3 usage (no terminal,
a bad name, no claude), 4 not checked
(network), 5 the data directory or the secret store failed, 6 interrupted by a signal.
Run it again whenever the token expires or is revoked.
Codex with a ChatGPT plan: axocoatl connect codex
Section titled “Codex with a ChatGPT plan: axocoatl connect codex”axocoatl connect codex # signs in in your browseraxocoatl connect codex --device-auth # shows a code to enter on another deviceaxocoatl connect codex --no-browser # does not open the sign-in page for youaxocoatl connect codex --sign-in-timeout 10 # gives the sign-in 10 minutes, not 30axocoatl connect codex --status # shows the stored sign-in, never a tokenaxocoatl connect codex --refresh # asks the running daemon to refresh it nowThis runs the official codex login for you and stores the ChatGPT sign-in it makes as
the secret codex-chatgpt. You approve the sign-in in the browser (or, with
--device-auth, enter the code Codex shows at the address it gives); you never see, copy,
paste or type a token. Nothing but Podman needs to be installed on your computer (with,
on macOS, its machine created and running; axocoatl onboard installs Podman after
asking where Homebrew (on Apple silicon) or a package manager it knows is present, and
otherwise names the installer, creates and starts the machine after asking, and
connect codex starts a stopped machine itself): by default the pinned Codex 0.160.1, the one the codex recipe
installs, runs in a throwaway container.
- The image. It is the
codexrecipe image recorded in the data root byaxocoatl recipe build codex, used by its exact image id. When none is recorded (or Podman no longer has it), the command builds and records it first, asaxocoatl recipe build codexwould, through the same Podman connection (CONTAINER_CONNECTIONand the rest of Podman’s own configuration apply). - The container. It runs as a non-root user with a read-only root file system, no
capabilities, no new privileges, no log driver and nothing from your computer mounted.
Its
CODEX_HOME(also its home and working directory) is a private0700tmpfs, in memory, and Codex runscodex -c cli_auth_credentials_store="file" login, so the sign-in is written to a file there, never to a keyring. Your own~/.codexand your environment (noCODEX_API_KEY,OPENAI_API_KEYor other variable of yours) do not reach it, nor do the proxy variables Podman would otherwise copy in (http_proxy,https_proxy,ftp_proxy,no_proxy, in either case; it runs with--http-proxy=false). It is on Podman’s default bridge network, not on Axocoatl’s egress routes:codex loginreachesauth.openai.comdirectly, without a proxy. Where that needs a proxy, sign in with--codex PATHinstead, which keeps your proxy variables. It holds no Axocoatl secret, and Podman stops and removes it when the sign-in time has passed, even if Axocoatl is killed: 30 minutes, or 1 to 60 minutes with--sign-in-timeout MINUTES(it goes to the container’spodman run --timeout; it does not go with--codex PATH, where no container runs). The command says so when the sign-in starts (You have 30 minutes to finish signing in., with the time chosen). When the time runs out first, it saysThe Codex sign-in was not completed within 30 minutes; nothing was stored. Run `axocoatl connect codex` again.(again with the time chosen) and exits with code 2. - The browser sign-in returns to
http://localhost:1455/auth/callback, the address Codex prints. The container publishes that one port on your computer’s loopback only (127.0.0.1:1455); inside it, a small forwarder passes each connection to Codex’s login server, which listens on the container’s own127.0.0.1:1455(nothing else holds that port there, so Codex never moves to another). When127.0.0.1:1455(or[::1]:1455) is already in use on your computer, the command stops before starting anything and suggests--device-auth. The device sign-in (--device-auth) publishes no port. - Opening the sign-in page. Codex cannot open a browser on your computer from the
container, so Axocoatl opens the address Codex prints, once: with
openon macOS orxdg-openelsewhere (the first onPATH; in WSLwslviewfirst, which opens Windows’ browser), the address as its only argument, without a shell. It then printsOpened the sign-in page in your browser.It opens only an address shown on screen that is exactlyhttps://auth.openai.com/oauth/authorize?…(with--device-auth, exactly the device pagehttps://auth.openai.com/codex/device, where you enter the code Codex shows): no other host, look-alike, scheme, port or path, and no hyperlink’s hidden target. The address is not secret (Codex’s PKCE verifier never leaves the container), and Axocoatl writes it to no file or log. With--no-browser, or when there is no opener or it fails, nothing is opened: open the address Codex prints in a browser on this computer yourself. codex loginruns withpodman exec --interactive --ttyin the same pseudo-terminal asclaude setup-tokenabove, and its output reaches your terminal through the same filter, which here also hides OpenAI API keys (sk-…) and JWTs (eyJ…, all three parts), each at the start of a word, as[token hidden by axocoatl], and drops clipboard writes. Codex 0.160.1 prints no token: it shows the sign-in address (or the device code) and writes the tokens toauth.json. Ctrl-C goes to Codex, as it would on your computer. Once Codex has exited, Ctrl-C (or closing the terminal) reaches Axocoatl, which catches it; thepodmancommands that start the container, read the sign-in and remove the container run in a process group of their own and ignore the signal, so it does not stop them, not even while one is being started.- Axocoatl reads the tokens from that file, never from the screen:
podman execprintsauth.json(a regular file, a link is refused, of at most 64 KiB) straight into Axocoatl’s memory, and Axocoatl never writes it to disk; the only other copy is Codex’s own, in the container’s tmpfs, which goes with the container. It must hold a ChatGPT sign-in, with an access token and a refresh token; an API-key sign-in is refused. Axocoatl stores the access token, the refresh token, your ChatGPT account id (from the file, or the id token’schatgpt_account_id) and the time, as one line, the wayaxocoatl secret setstores a value (secrets/codex-chatgptin the data root,0600, replaced atomically). The id token is not kept, nor is the OpenAI API key Codex may have obtained with the browser sign-in (below). - Then the container is removed (
podman rm --force), and with it its in-memoryCODEX_HOME: after a sign-in, and also when the sign-in fails, is refused or is interrupted. - The tokens are not checked with OpenAI before they are stored: they are the ones Codex just obtained, and the first run uses them.
With --codex PATH, the Codex CLI at that path on your computer runs instead, and no
Podman is needed:
- It makes a private temporary
CODEX_HOMEin the data root (connect-codex-<random>,0700) and runscodex -c cli_auth_credentials_store="file" loginthere, withCODEX_HOMEset to it (as an absolute path, also when the data root is relative) and that directory as its working directory, so the sign-in is written to a file in it, never to your system keyring, and no repository’s.codex/config.tomlapplies. Your own~/.codexis not read or written by Axocoatl, and Codex is told to use the temporary home instead. Codex 0.160.1 first signs out of the sign-in its home holds, revoking it; the temporary home holds none, so your other Codex sign-ins are not touched. Codex runs withoutCODEX_API_KEY,OPENAI_API_KEY,CODEX_ACCESS_TOKEN,OPENAI_BASE_URL,CODEX_SQLITE_HOMEand the variables that move where it signs in, refreshes or revokes (CODEX_REFRESH_TOKEN_URL_OVERRIDE,CODEX_REVOKE_TOKEN_URL_OVERRIDE,CODEX_APP_SERVER_LOGIN_CLIENT_ID,CODEX_AUTHAPI_BASE_URL,CODEX_AGENT_IDENTITY_AUTHAPI_BASE_URL,CODEX_AGENT_IDENTITY_JWKS_BASE_URL). - Its output is relayed and filtered the same way, and the sign-in is read from the
auth.jsonit writes there (opened without following a link) and stored the same way. Codex opens the browser sign-in itself, so Axocoatl opens nothing (--no-browserdoes not apply). - Then every file in the temporary home (Codex also writes a log and other state there) is overwritten with zeros and removed, and so is the directory: also when the sign-in fails, is refused or is interrupted. A temporary home a killed run left is erased by the next run once it is 30 minutes old (a sign-in in progress elsewhere keeps its own). On an SSD or a copy-on-write file system an overwrite does not guarantee that the old blocks are gone; the data root is readable only by you.
It needs an interactive terminal, and Podman (the first podman on PATH) unless
--codex PATH names an executable Codex CLI. The secret is
always named codex-chatgpt, because that is the one the daemon refreshes. Like recipe build, it uses the data root of --config or AXOCOATL_DATA_DIR. Exit codes: 0 stored,
2 codex login stored no ChatGPT sign-in (also when the sign-in was not completed within
the sign-in time), 3 usage (no terminal, no Podman on PATH, a --codex that is not an
executable, port 1455 in use, --api-key or --api-key-only, which this version refuses
(below), a value on the command line, or a command line
axocoatl connect does not take, such as --sign-in-timeout 0), 5 the data directory,
the secret store, Podman, the image build, the pseudo-terminal or auth.json failed
(also when auth.json is a link, or the login container stopped before the sign-in time
was up and before the sign-in was read), 6 interrupted by a signal. Nothing is stored
unless it exits 0. Run it again when a run says the sign-in was refused.
Check and refresh the sign-in
Section titled “Check and refresh the sign-in”axocoatl connect codex --status reads the stored sign-in from the data root (the
daemon need not run) and prints whether one is stored, its ChatGPT account id by its
last four characters only (…4d2f), when its access token expires (the token’s JWT
exp, in your computer’s time zone, or that it has expired) and when its tokens were
last refreshed or, when there has been no refresh since, signed in. It never prints a
token. Exit codes: 0 a sign-in is stored, 2 none is, 5 the stored value cannot be read
or is not a sign-in connect codex stored.
axocoatl connect codex --refresh asks the running daemon to refresh the sign-in now,
even when it is not due. It reaches the daemon the way axocoatl run does: at --url,
AXOCOATL_URL or the server address in --config, with AXOCOATL_TOKEN or the local
API token in the data root. The daemon refreshes through POST /api/connect/codex/refresh with the same broker that refreshes the sign-in before a
request (below): the same request to OpenAI, the same rotation and atomic write under
the secret store’s lock, the same remembered refusal, one refresh at a time with the
route’s own. The command never sends a refresh token itself. The daemon records the
refresh asked for and how it ended in its log, without a value. The command prints, for
example,
✓ Refreshed the ChatGPT sign-in at 2026-10-12 16:03:00 +02:00 and stored it as secret codex-chatgpt (no token was shown). The new access token expires at 2026-10-22 16:03:00 +02:00 (in 10 days).Exit codes: 0 refreshed (also when a sign-in that axocoatl connect codex stored while
the refresh ran is kept instead of the new tokens, which the command says), 1 OpenAI
refused the refresh for good (sign in again with axocoatl connect codex; asked again,
the daemon does not send that refresh token again and says so), 2 no sign-in is stored,
3 usage, 4 the refresh could not be completed (the token endpoint could not be reached,
did not answer in time, or gave an answer that is neither new tokens nor a refusal; the
stored sign-in is unchanged), 5 anything else (the stored value is not a sign-in, the
daemon refused the API token, the new tokens could not be written, which the daemon
then keeps in memory and writes again on their next use, or a daemon older than 1.3.1),
7 no daemon answers at that address (start it with axocoatl serve). The route answers
only an authenticated request from this computer: a daemon that accepts API requests
without authentication (server.auth.allow_unauthenticated) refuses it with 403, and
so does any daemon for a request from an address that is not a loopback address.
Codex with an OpenAI API key
Section titled “Codex with an OpenAI API key”A Codex writer’s codex-openai credential is an OpenAI API key. Requests a writer makes
with it go to api.openai.com and are billed at OpenAI API rates to the OpenAI Platform
organization the key belongs to, not to your ChatGPT plan. Running Codex with an API key
has not been tested live. A key stored as codex-openai before 1.5.0 (by
axocoatl connect codex --api-key in 1.3.1 to 1.4.x) is still used: fix-codex’s
auto takes it before codex-chatgpt. To bill your ChatGPT plan instead, run
axocoatl connect codex and pass --param credential=codex-chatgpt, or remove the key
with axocoatl secret remove codex-openai so that auto takes the sign-in. The only way
this version stores a key is axocoatl secret set codex-openai --from-env VAR, for
automation without a browser (below).
Other credentials: axocoatl secret set
Section titled “Other credentials: axocoatl secret set”axocoatl secret set <name> stores a credential that no connect command obtains, and
Codex’s API key or Claude Code’s token for automation without a browser (for example in
CI), from an environment variable the automation already has. It reads the value from
standard input, or with --from-env VAR from that environment variable of the command,
and stores it in the data root as secrets/<name>, a file only your user can read
(0600), replaced atomically. It never takes the value as an argument, never prints it, and never writes
it to a log or a record. Standard input must be a pipe or a file: when it is a terminal,
where typing or pasting would show the value, the command refuses and says how to store
it instead: for codex-openai, the ChatGPT sign-in (axocoatl connect codex) first, and
for claude-code-oauth the connect command, then --from-env for automation without a
browser; for other names, how to pipe it.
An unset or empty --from-env variable is refused. --from-env takes the variable’s
name, without $: --from-env "$OPENAI_API_KEY" would put the key itself
on the command line, so a value there (or after the name) is refused, and the message
never repeats it.
# Automation without a browser (for example in CI), from the job's environmentaxocoatl secret set codex-openai --from-env OPENAI_API_KEYaxocoatl secret set claude-code-oauth --from-env CLAUDE_CODE_OAUTH_TOKENOn your own computer, use axocoatl connect codex (your ChatGPT plan) and
axocoatl connect claude-code instead: you never type or paste a key.
A value is one line of at most 8 KiB with no control characters; one trailing line break
is ignored. For another credential, if the command that prints it prints more than the
token, pipe only the token into secret set. A route sends the value exactly as stored, so secret set warns on standard
error, and still stores it, when the value has whitespace inside it, starts with
Bearer (the route adds that itself), looks like JSON or holds several tokens, and, for
claude-code-oauth (the secret Claude Code’s route sends), when it does not start with
sk-ant-oat01-, as the token claude setup-token prints does, and, for codex-chatgpt,
when it is not a sign-in axocoatl connect codex stored (the ChatGPT route refuses
anything else). The warning never shows the value. When the model API rejects a stored
credential (401 through the route), the run’s not-covered reason names the credential
and says how to store it again: for Claude Code, axocoatl connect claude-code; for the
ChatGPT sign-in, run again (the daemon asks OpenAI for a new access token after the
rejection) and, if it is rejected again, axocoatl connect codex; for Codex’s API key,
a working key with axocoatl secret set codex-openai --from-env VAR, or the ChatGPT
sign-in instead (axocoatl connect codex and --param credential=codex-chatgpt); for
others, axocoatl secret set <name>, piping in only the token.
axocoatl secret list prints the stored names, never values, and
axocoatl secret remove <name> deletes one. A route’s credential resolves to a
credentials entry in the configuration first, then to a stored secret of that name; a
name found in neither refuses the run (exit code 3).
You supply the credential, for your own account. axocoatl connect claude-code obtains
the Claude Code token through claude setup-token when you run it, and
axocoatl connect codex your ChatGPT sign-in through codex login. The only credential
Axocoatl refreshes by itself is that ChatGPT sign-in (see
Codex with a ChatGPT sign-in).
Write your own loadout
Section titled “Write your own loadout”The built-in loadouts are loadout files like any other. To change their budgets, check,
review rounds or instructions, print one with axocoatl loadouts show fix-claude-code,
save it in your loadouts directory under
another id, and edit it. A built-in id is reserved: a file of yours that declares
fix-claude-code or fix-codex is not used, and while it does, a run of that id is
refused, naming the file (exit code 3). Give your file another id, such as
my-fix-claude-code, and run it by that id, or remove it to run the built-in. Earlier
versions of this page showed a fix-claude-code loadout to write yourself; that id is now
built in.
schema: axocoatl.loadout/1id: my-fix-claude-codeversion: 1name: Fix with Claude Code, two roundskind: fixparams: writer_model: { kind: model, default: "anthropic:opus", description: "anthropic:<model> for Claude Code" } reviewer_model: { kind: model, required: true, description: a different provider:model }agents: - id: writer role: writer runtime: claude-code model: { param: writer_model }checks: - { name: tests, run: { detected: true }, timeout: 5m }review: model: { param: reviewer_model } rounds: 2 tools: [read_file, list_dir, grep, glob]budgets: agent: { activations: 3, invocations: 300, tokens: 12000000, cost_usd: 10 } reviewer: { activations: 2, invocations: 80, tokens: 1000000, cost_usd: 2 } wall_clock: 60mprompt: | {task}environment: recipes: [claude-code]axocoatl run my-fix-claude-code --task "…" --model reviewer=ollama:gpt-oss:20bFor Codex, the writer’s credential says which stored credential its route sends:
codex-openai (the default when you leave it out: an OpenAI API key, to
api.openai.com; see Codex with an OpenAI API key),
codex-chatgpt (your ChatGPT
sign-in from axocoatl connect codex, to chatgpt.com), or auto (the first of the two
that is stored when the run is admitted, as fix-codex does). It can be a text
parameter, so a run chooses it with --param. Both credentials run the same program from
the same codex image:
params: writer_model: { kind: model, required: true, description: "openai:<model> for Codex" } credential: { kind: text, default: auto, description: codex-openai, codex-chatgpt or auto }agents: - id: writer role: writer runtime: codex credential: { param: credential } # or a name: codex-chatgpt, codex-openai, auto model: { param: writer_model }environment: recipes: [codex]axocoatl run my-fix-codex --task "…" --model writer=openai:gpt-5.5 \ --model reviewer=ollama:gpt-oss:20b --param credential=codex-chatgptA run whose credential is not stored is refused before it starts (exit code 3), with how
to store it: axocoatl connect codex for the sign-in, and for the API key the ChatGPT
sign-in instead, or axocoatl secret set codex-openai --from-env VAR for automation
without a browser. Claude Code’s only credential is claude-code-oauth (auto is that one
too), and a native Agent names none; axocoatl loadouts validate refuses any other name,
and a run refuses any other parameter value.
For Claude Code the model is {provider: anthropic, model: …}, for Codex
{provider: openai, model: …} with either credential: the provider whose API the program calls through the route
Axocoatl adds for it, and the model name the program itself takes. Any other provider is
refused: axocoatl loadouts validate refuses a literal model such as
{provider: openrouter, model: openai/gpt-5.5} on a Codex writer, and a run refuses
--model writer=openrouter:… (exit code 3), so the model a run records is the one that
ran. An external program brings its own tools, so tools is ignored, and only a writer
may be external.
The same-model reviewer check compares that model with the reviewer’s, from the loadout,
from the finished turn and in Team and budget, through whichever provider each one runs:
a reviewer on openrouter:anthropic/claude-haiku-4.5 runs a Claude Code writer’s
anthropic:claude-haiku-4-5, and one on openrouter:openai/gpt-5.5 a Codex writer’s
openai:gpt-5.5, so both match (same_model_reviewer). Loadout validation warns;
run admission refuses a matching pair when either model is inherited from setup,
while explicitly naming both models permits it with the warning. The comparison ignores
case, . against -, a snapshot date such as -20251001, -latest and an OpenRouter
:variant suffix. A Claude model is compared by its family and version: Claude Code’s
aliases count as the model they run (anthropic:haiku is claude-haiku-4-5, so a
reviewer on openrouter:anthropic/claude-haiku-4.5 matches; best and
opusplan count as the model they run by default, claude-fable-5-1 and
claude-sonnet-5-5), a [1m] suffix is ignored, and the older order of a Claude id
(claude-3-5-haiku) is the same model. Claude Code’s default, which runs your
account’s default model, is not resolved.
The routes Axocoatl adds
Section titled “The routes Axocoatl adds”You do not list these routes; the run adds them to its Session’s egress policy.
| Runtime | Host | Requests allowed | Credential | Added as | Placeholder variable |
|---|---|---|---|---|---|
claude-code | api.anthropic.com | POST /v1/messages | claude-code-oauth | Authorization: Bearer <value> | CLAUDE_CODE_OAUTH_TOKEN |
codex | api.openai.com | POST /v1/responses | codex-openai | Authorization: Bearer <value> | OPENAI_API_KEY |
codex with credential: codex-chatgpt | chatgpt.com | POST /backend-api/codex/responses | codex-chatgpt | Authorization: Bearer <access token> and ChatGPT-Account-ID: <account id> | CODEX_CHATGPT_ACCESS_TOKEN |
Each route refuses every other request. Claude Code 2.1.292 also asks the route for its
account’s policy limits and remote settings (GET /api/claude_code/policy_limits and
GET /api/claude_code/settings); the route refuses both, the network record shows the
refusals, and Claude Code goes on without them: a run with the pinned version passes
with both refused.
Each of these routes also reads every request body and refuses one that asks the
model provider to reach other hosts or run tools itself (provider_fetch: refuse; what
it refuses is in Requests to model APIs).
Without that, the provider could fetch pages, search the web or connect to MCP servers
for the program, past the Session’s egress policy.
So that the programs never send such a request, Axocoatl starts them without the tools
their provider runs for them while the route that serves their model API refuses
provider fetches, which is the default: Claude Code 2.1.292 with
--disallowedTools WebSearch (its WebSearch tool sends a request of its own offering
Anthropic’s server-side web_search_20250305), and Codex 0.160.1 with
-c web_search="disabled" and --disable image_generation (without them it offers
OpenAI’s hosted web_search, with live access, on every request). The pinned programs’
model calls, as captured in Axocoatl’s Podman runs, then pass the check: Claude Code’s
offer only its own tools, which it runs in the container, and Codex’s only function and
custom tools and a tool_search it runs itself. A model that calls WebSearch anyway
gets Error: No such tool available: WebSearch from Claude Code, and the run goes on:
in Axocoatl’s Podman test the pinned Claude Code, led to search, then ran its shell
command and the run passed, with no request refused. Should a program ask anyway, the
route refuses it (403 provider_fetch_refused) and the network record shows the
refusal.
To let a writer’s provider search or fetch for it, list a route for the same host in
the loadout’s routes with provider_fetch: allow. The program is then started with
its hosted tools as it has them: in Axocoatl’s Podman test, Claude Code’s search request
reached the API through such a route.
The route stays this small on purpose. The daemon adds your credential to every request
a route’s rules allow, so each rule is one more endpoint that receives it; these routes
allow only the model calls a run needs, which is what the pinned versions were seen to
send. A refused request is answered with 403 and a hint that names this route as the
one Axocoatl adds for the writer, not a sandbox.egress.routes entry. A loadout that
needs more can list its own route for the same host in its routes, which then
replaces this one: give it the same credential, injection and placeholder variable,
and the rules you choose. Claude Code also runs with
DISABLE_TELEMETRY=1, DISABLE_ERROR_REPORTING=1,
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 and DISABLE_AUTOUPDATER=1. The Session’s
certificate authority, which signs the route’s TLS on your computer, is trusted through
NODE_EXTRA_CA_CERTS and SSL_CERT_FILE. How routes check and record requests is in
Credentials and routes.
Codex with a ChatGPT sign-in
Section titled “Codex with a ChatGPT sign-in”A Codex writer with credential: codex-chatgpt runs codex exec with the same HTTP
provider as with an API key, aimed at the ChatGPT backend Codex itself uses for a ChatGPT
sign-in (https://chatgpt.com/backend-api/codex, its key in CODEX_CHATGPT_ACCESS_TOKEN,
which holds the route’s placeholder). Codex in the container has no sign-in of its own:
there is no auth.json in the container, and its provider sends that variable’s value as
its bearer token and nothing else. So it has no refresh token to refresh, revoke or send;
in Axocoatl’s Podman run of the pinned version it made no request but its model calls.
The route to chatgpt.com allows only POST /backend-api/codex/responses. For each
request it allows, it asks the daemon for the current access token and sends it as
Authorization: Bearer …, with your account id as ChatGPT-Account-ID, replacing any
Authorization or ChatGPT-Account-ID (or ChatGPT_Account_ID) the program sent. The
daemon keeps the token current on your computer, the way Codex 0.160.1 does:
- Before a request, when the access token expires within five minutes (read from its
JWT
exp; for a token without one, when it was obtained more than eight days ago), it refreshes: onePOST https://auth.openai.com/oauth/tokenwith{"client_id": <Codex's client id>, "grant_type": "refresh_token", "refresh_token": …}. OpenAI’s answer replaces the access token, and the refresh token when it sends a new one (it rotates them, and refuses one that was already used); the account id is taken from the new id token or access token when one names it. The new sign-in is written back atomically (0600). Refreshes are serialized, and the daemon writes the new sign-in while holding the lock thataxocoatl connect codex,axocoatl secret setandaxocoatl secret removetake on the data root’ssecretsdirectory, after reading the file again: ifaxocoatl connect codexstored a new sign-in while a refresh was under way, the new sign-in is kept; if the sign-in was removed (or replaced by another value), it stays that way, and the refreshed token is sent with that one request only. When the new sign-in cannot be written, the daemon keeps it in memory, uses it and tries to write it again on each request for as long as the file still holds the sign-in it replaced, so the refresh token OpenAI already rotated is not sent again; a daemon restarted before it was written has only the old one, which OpenAI may refuse as reused; then connect again. - On request, with
axocoatl connect codex --refresh(above), it refreshes the same way, whether or not the token is due. - After a
401to a request sent with the current token, it refreshes the same way, so the next request carries the new token. The401itself goes back to Codex: the route does not send the request again. In Axocoatl’s Podman test, the pinned Codex 0.160.1 sent a model call answered401again, and that retry carried the new token. When Codex ends with that error, the run’s not-covered reason namescodex-chatgptand says to run again, then to connect again. - When OpenAI refuses the refresh for good (
401,invalid_grant, or a refresh token expired, reused or invalidated), the daemon remembers it for that refresh token and does not send it again, stores nothing, and refuses the route’s requests once the access token has expired (503 credential_unavailable), saying to runaxocoatl connect codex; why is in the daemon’s log, not in the answer to the container. When a refresh fails otherwise (no answer, another error), an access token that has not expired yet is still sent, as Codex does. - Refresh tokens and access tokens are never written to a log, a record or a message.
From the container nothing reaches the token endpoint: no route serves auth.openai.com,
so a refresh the program attempted would be refused where the Session’s connections are
decided, and recorded in the network record, and any request to chatgpt.com other than
POST /backend-api/codex/responses is refused by the route and recorded. The daemon sends
the access token and account id only on a route to chatgpt.com whose credential is the
stored codex-chatgpt: this one, or a route to chatgpt.com that a loadout lists in its
routes in place of this one (or the configuration lists), with whatever requests its
rules allow. A route to any other host whose credential is codex-chatgpt reads the
secret as a plain credential, which refuses the stored sign-in, and answers
503 credential_unavailable without sending anything. The refresh token is never sent
on any route: it leaves your computer only in the daemon’s refresh request to OpenAI’s
token endpoint.
What is recorded
Section titled “What is recorded”- Every model call. Each request the program makes on its route is written to the
Session’s network record before it is sent, with the rule that allowed it and the name
of the credential, never its value; a refused one is written with its reason, such as
provider_fetch_refused. Session network shows them. - The program’s output. Claude Code’s
stream-jsonand Codex’s JSON Lines output (at most 16 MiB) is parsed into the activation’s evidence: its text, and bounded previews of its tool calls and their results. Its final text is the activation’s answer, which the checks and the reviewer then judge. - The change. The repository captures before and after the activation, as for any
writer. A change outside
writesfails the activation. - The credential. Which stored credential the writer’s route sent, and, for
auto, why: the run’s manifest (credentials), anoteevent and the Outcome’s notes; see Choose the Codex credential. Its name only, never its value.
What a run costs
Section titled “What a run costs”Claude Code reports what its run cost (total_cost_usd, its own computation from list
prices), and the run settles to that.
Codex reports tokens but no cost. Axocoatl computes the cost from the tokens Codex reports
(with either credential; with a ChatGPT sign-in, the run counts against your plan’s usage
limits, and the computed cost is what those tokens would cost at API list prices, not a
charge),
each part at its rate: uncached input, input read from the prompt cache, input written to
the prompt cache, and output, reasoning included. The rate is the configuration’s
pricing entry for exactly that model name when
there is one, otherwise the list price Axocoatl pins for the model:
| Codex 0.160.1 model | Input | Cached input | Cache writes | Output |
|---|---|---|---|---|
gpt-6-astra | $10.00 | $1.00 | $12.50 | $50.00 |
gpt-6.1-sol | $2.00 | $0.10 | $2.50 | $10.00 |
gpt-6-sol | $2.00 | $0.20 | $2.50 | $10.00 |
gpt-6-luna | $0.10 | $0.01 | $0.125 | $0.50 |
gpt-5.6-sol | $4.00 | $0.40 | $5.00 | $20.00 |
gpt-5.6-terra | $2.00 | $0.20 | $2.50 | $12.00 |
gpt-5.6-luna | $0.20 | $0.02 | $0.25 | $1.20 |
gpt-5.5 | $5.00 | $0.50 | $5.00 (billed as input) | $30.00 |
Dollars per million tokens: OpenAI’s Standard prices for prompts of at most 272K input
tokens, as OpenAI’s model pages listed them on 2026-10-08, for the models the pinned Codex
0.160.1 lists for API use. Codex 0.160.1 keeps a 272,000-token context for each of them, so
no request reaches the long-context price, and codex exec asks for no service tier, so a
run is billed at Standard rates. GPT-5.6 Sol’s is OpenAI’s promotional price, which OpenAI
says runs at least through 2026-11-21; when OpenAI changes a price, set it in pricing
until Axocoatl’s table follows. A pricing entry has one input rate, which then applies to
every input token, cached or not.
The run settles to that cost, the activation’s work log says how it was computed and at
which price, and the Outcome marks it (usage.cost_computed: true): the summary, the
JUnit file’s axocoatl.usage property, the Run outcome panel and the pull request body
show “$X (includes cost computed from reported tokens at list prices)”, never as a charge
a provider reported. A computed cost above what the grant still allowed fails the
activation, as a reported one does.
A Codex model that neither the table nor pricing names has no price. Its cost is not
known: each such activation reserves an equal share of the cost left, divided by the
activations left with its own, so a later activation, such as the revision a review asks
for, can still run, and its reservation stays charged. The Outcome then says the cost is
not known (usage.cost_known: false), and the summary, JUnit, panel and pull request body
show “cost unknown (reserved up to $X)”, where $X is what the run’s grants were charged,
never as a price.
Before a run starts, its writer’s tokens budget must hold one model call of its model,
or the run is refused, naming the budget and the minimum (exit code 3). For a model in
Axocoatl’s pinned table, one call can use the context the program keeps plus the model’s
output limit, within the model’s window: 400,000 tokens for each Codex model above (a
272,000-token context plus 128,000 output tokens), 1,000,000 for a Claude model with a
1M-token window (claude-fable-5-1, claude-mythos-5-1, claude-fable-5,
claude-mythos-5, claude-opus-5-5, claude-opus-5, claude-opus-4-8,
claude-opus-4-7, claude-opus-4-6, claude-sonnet-5-5, claude-sonnet-5,
claude-sonnet-4-6, claude-haiku-5-5) and 200,000 for a 200K-token one
(claude-opus-4-5, claude-sonnet-4-5, claude-haiku-4-5), from Anthropic’s model
overview and model pages. A dated snapshot such as claude-haiku-4-5-20251001 counts
as its model.
Claude Code’s aliases are checked as the model each one runs in Claude Code 2.1.292: the aliases in the model catalog bundled in that build, which it goes by since its route serves it no model list of its own. The refusal names that model:
| Alias | Model | One call |
|---|---|---|
opus | claude-opus-5-5 | 1,000,000 |
sonnet | claude-sonnet-5-5 | 1,000,000 |
haiku | claude-haiku-4-5 | 200,000 |
fable | claude-fable-5-1 | 1,000,000 |
best | claude-fable-5-1, or claude-opus-5-5 for an account without Fable | 1,000,000 |
opusplan | claude-sonnet-5-5, and claude-opus-5-5 in plan mode | 1,000,000 |
[1m] after a model or alias (sonnet[1m], opus[1m], fable[1m]) is the same call
when the model’s window is already 1M tokens. A model the table does not list (a newer
or retired model, default, whose model is your account’s or organization’s, or [1m]
on a 200K-token model such as haiku[1m]) is not checked, and the run carries the
warning external_model_not_pinned, which also says whether its cost will be known.
What is enforced, and what is not
Section titled “What is enforced, and what is not”| Where it runs | Enforced: inside the Session container, as the non-root writer user, under --harden. |
| What it can reach | Enforced: only the route to its model API and the hosts the loadout and your configuration allow. |
| What its model provider reaches for it | Enforced for what a request body asks: the route refuses a model request that offers a tool the provider runs, names an MCP server, turns on a provider’s web search or plugins, or asks the provider to fetch content from a URL (the full list). Not seen: settings stored with your provider account. The provider receives everything a request sends. |
| Its credential | Enforced: added on your computer; the container holds a placeholder. A token the API returns in a response body would reach the container, as on any route. A ChatGPT sign-in is refreshed by the daemon, on your computer; the container never holds its refresh token. |
| Its time | Enforced: the activation’s wall-clock timeout, and the run’s wall clock. |
| Its spend | Bounded, not per call. The activation reserves what its grant still allows before the program starts: all of its tokens and, when its cost will be known, all of its cost. Each request on the route counts against the grant’s invocations, and the host stops the program when they run out. Claude Code also gets its own spending stop, --max-budget-usd, at what the grant still allows. The program’s own usage report settles the reservation; without one, usage is marked incomplete and the reservation stays charged. How the cost is known is in What a run costs. |
| Its tool calls | Recorded, not admitted. The program’s own tool calls are evidence in the record; Axocoatl does not approve or refuse them one by one. They run as the writer user inside the container, like a writer’s bash. |