Status: Private beta. The commands below were checked in an end-to-end run on 2026-11-13. Flags can still change. Check
allternit-agents-server admin help on your build.Admin commands
The admin CLI is part of the server binary. With Docker Compose, run it inside the server container:docker compose exec server allternit-agents-server admin ....
Every command takes --config <path> (or -c) to point at the settings file.
Migrate
The compose bundle runs a one-shotmigrate container before the server starts. Run it again after every upgrade:
Backups
PostgreSQL. All state lives in the database: agents, environments, sessions, the event log, the work queue, tool calls, key hashes and encrypted credentials. Back it up with your usual PostgreSQL tooling, for example:- The settings file.
- The encryption key that
secrets.encryption_key_refpoints to. Without it, stored credentials in a restored database cannot be read.
database.url): stop the server, then copy data_dir.
Test a restore before you need one.
Rotate keys
Encryption key for stored credentials.- Add the new key in your secret store.
- In the settings file, point
secrets.encryption_key_refat the new key and move the old key’s reference intosecrets.previous_key_refs. - Run
admin rotate-key --config <path>. It re-seals every stored credential with the new key. Values sealed with the old key stay readable because it is inprevious_key_refs. - Remove the old key from your secret store and from
previous_key_refs.
admin rotate-key writes each credential only if nobody changed it since it was read. When a credential changed in between, the command reads it again and retries, up to 3 times, and reports how many it retried. A credential that kept changing on every try is listed as failed and the command exits non-zero; run it again. A credential deleted meanwhile is skipped.
If the command reports credentials that did not open with any key, add the key that sealed them to previous_key_refs and run it again.
Server API keys. Create a new key, switch the client to it, then revoke the old key (DELETE /v1/api_keys/{id}). The last admin key cannot be revoked.
Environment keys. Create a new key for the environment, roll it out to the workers, then revoke the old one. Workers still using the old key get 401 on their next call.
Upgrades
- Back up the database.
- Pull the new images.
- Run
migrate. - Restart the server, then the workers. With several replicas, roll them one at a time (see below).
SIGTERM the replica stops taking new turns: /health/ready and new messages answer 503 agent_loop_unavailable, so the load balancer and clients move to another replica, while workers are still served. The server waits server.shutdown_grace (default 45s) for running turns to finish. If it does not, the session ends with status error and the error code server_restarted. Resend the message. See Known limits.
Run several replicas
Several server replicas share one PostgreSQL database. They need PostgreSQL. SQLite is single node.- Helm. Set
replicaCountin theagents-serverchart values, for example3. The chart refuses to render more than one replica with a SQLite database URL. With more than one replica it also adds a PodDisruptionBudget. - Rolling updates. The chart uses a rolling update with
maxUnavailable: 0, so a new pod is ready before an old one stops. Each stopping replica waits up toserver.shutdown_gracefor its turns. - Live events. Replicas tell each other about new events with PostgreSQL
LISTEN. Give the server a direct PostgreSQL connection for this. Behind PgBouncer, use session mode, or point the server at the database directly. WithoutLISTEN, events arrive by polling, within 1 to 5 seconds. - Own data directory per replica. Each replica keeps its id in
<data_dir>/replica-id. Never sharedata_dirbetween replicas: a second replica with the same id would end the first one’s turns when it starts. The Helm chart gives each pod its ownemptyDir. - Check it.
GET /v1/server/infoshowsreplicas, the number of live replicas.
server_restarted.
Upgrade from 1.0
Migration 003 runs when the server starts, or withadmin migrate. It does these things:
- It adds a rule that a session has at most one open work item. Before it adds the rule, it cancels older duplicate open items, so each session keeps one.
- It adds the tables and columns that replicas, idempotency keys and worker affinity use.
Doctor
admin doctor prints one line per check and exits non-zero when one fails. It covers the settings file and secret references, the database (and migrations on PostgreSQL), the gizzi binary, reachability of the inference host, the egress rules and the OpenTelemetry setup. admin doctor --offline skips the checks that make network calls. Run it after any change to the settings or the deployment.
Kubernetes
Helm charts live atdeploy/selfhost/charts/:
agents-server: the server, its migrate job and its settings.sandboxes: the workers.
settings in its values. With the default provider, anthropic, it adds credentials.api_key: env:ANTHROPIC_API_KEY and a model map entry when you set none. With any other provider (see Models), set settings.inference in full: the provider, its credentials or gateway, and model_map. Nothing from the Anthropic defaults is added. If the provider or gateway listens on a port other than 443, also set networkPolicy.provider.ports.
The sandboxes chart’s README has the pod settings bubblewrap needs, and the extra node changes for a test cluster on kind.