Skip to main content
Version: 1.15.0

Run AgentWorks headless from a runtime file

A headless AgentWorks runtime runs your agents from one YAML file, agentworks.yaml, with no database, no Flightdeck and no web console. The file lists the agents, where they are deployed, which tools they may use, and who may call the runtime. The runtime keeps its runs in its own SQLite file and sends model, tool and agent-to-agent calls to the gateways you configure, such as DVARA, the AI gateway that governs model, tool and agent-to-agent calls.

This page runs the released image for real use: a real model gateway, caller keys from secrets, an identity provider, durable storage, and the checks the runtime makes on every change. To try AgentWorks on your own computer with a test model first, follow Run your first AgentWorks agent.

A runtime is a runtime

Since 1.15.0 a runtime starts either headless from a runtime file (agentworks.config.file) or enrolled with Flightdeck (agentworks.enrolment.base-url). It refuses to start with neither, and with both. The standalone server with its own control-plane database is gone: there are no users, passwords, sign-in, sessions, bootstrap token, API tokens, PostgreSQL or H2 in a runtime, and no API to create agents, build releases, create environments or promote. Any removed SPRING_DATASOURCE_*, AGENTWORKS_PLANES_* or agentworks.security.bootstrap.* setting stops startup.

What do you need?​

  • A GitHub credential that can read the private package ghcr.io/dvarahq/dvara-agentworks-ee: a personal access token (classic) with read:packages, or a fine-grained token or GitHub App with package read access.
  • The digest of the 1.15.0 image, recorded with the release. Deploy by digest; the tag is only for finding it.
  • Docker with Compose, or Kubernetes with Helm.
  • An OpenAI-compatible model endpoint, for example the DVARA LLM Gateway, and its key.

The image supports linux/amd64 and linux/arm64. It runs as a fixed non-root user with a read-only root filesystem, and contains no shell, package manager or credentials.

Pull the released image​

echo "$GHCR_TOKEN" | docker login ghcr.io --username "$GHCR_USER" --password-stdin
export IMAGE_DIGEST=sha256:<image-digest>
docker pull "ghcr.io/dvarahq/dvara-agentworks-ee@$IMAGE_DIGEST"

Replace <image-digest> with the digest recorded for 1.15.0. Use a token that can only read packages and rotate it like any other credential.

Write the runtime file and the agent​

Create a folder with the runtime file and one agent:

agentworks/
agentworks.yaml
agents/support-triage.yaml
secrets/admin-key
secrets/ci-key

agents/support-triage.yaml is an AgentSpec whose model role names the gateway dvara:

apiVersion: dvarahq.com/v1alpha1
kind: Agent
metadata:
name: support-triage
version: 1.0.0
spec:
executor:
type: spring-ai
instructions:
system: Classify the support ticket as billing, outage or account, and explain why in one sentence.
models:
reasoning:
gateway: dvara
model: gpt-5-mini
limits:
maxSteps: 4
maxRuntime: 2m
maxToolCalls: 0

agentworks.yaml deploys it in production and accepts two caller keys and one identity provider:

apiVersion: agentworks.dvarahq.com/v1alpha1
kind: Runtime
workspace: support # optional; default "default"

agents:
- file: agents/support-triage.yaml

deployments:
- name: triage
environment: production # optional; default "default"
agent: support-triage

callers:
keys: # the file names the variable that holds each key, never the key
- {name: admin, secretEnv: CALLER_KEY_ADMIN, role: admin}
- {name: ci, secretEnv: CALLER_KEY_CI, role: operator}
issuers: # identity providers whose signed tokens are accepted
- issuer: https://login.example.com
audience: agents
roleClaim: roles # optional; default "roles"
roles:
operator: [agentworks-run]
viewer: [agentworks-read]
SectionWhat it holds
workspaceThe one workspace this runtime serves. To serve another, run another runtime with its own file and data folder.
agentsEach agent once, at the version this runtime serves: a file relative to the runtime file, or an inline spec.
deploymentsA stable name in an environment that runs one agent. Optional placement and credentials (credential references, never secret values).
capabilityPacks, permissionsTools an agent may declare, each with its effect, and the permissions that allow them. See Define agents, models and tools.
callers.keysCaller keys: a name, the variable that holds the key, and a role (viewer, operator, author or admin).
callers.issuersIdentity providers whose signed tokens the runtime accepts, and how their role claim maps to roles.

Make each caller key at least 32 random characters, and keep them out of the folder you share:

mkdir -p agentworks/secrets
(umask 077; openssl rand -hex 24 > agentworks/secrets/admin-key; openssl rand -hex 24 > agentworks/secrets/ci-key)

Two keys must differ, and the variable that holds a key must not start with AGENTWORKS_: that prefix is read as an AgentWorks setting, and an unknown one stops startup.

Check the runtime file before you start​

The image's validate mode runs the runtime's own reader and starts nothing:

docker run --rm \
-v "$PWD/agentworks:/etc/agentworks:ro" \
-e CALLER_KEY_ADMIN="$(cat agentworks/secrets/admin-key)" \
-e CALLER_KEY_CI="$(cat agentworks/secrets/ci-key)" \
"ghcr.io/dvarahq/dvara-agentworks-ee@$IMAGE_DIGEST" validate /etc/agentworks/agentworks.yaml

It exits 0 for a file the runtime starts from, 1 for a file with problems, and 2 for a wrong command line. Every problem is reported with where it is, as a JSON pointer:

/etc/agentworks/agentworks.yaml: 2 problems:
/deployments/0/agent: names no agent in /agents (support-triag)
/callers/keys/1/secretEnv: the environment variable CALLER_KEY_CI is not set

In CI, where the keys are not available, add --without-keys before the file name: keys that are not set are skipped and named, and a key that is set is still checked. Add --json for a machine-readable result. A model gateway an agent needs, and a tool a capability pack binds, are checked only when the runtime starts.

Start the runtime with Docker Compose​

Save this compose.yaml next to the agentworks folder:

name: agentworks
services:
agentworks:
image: ghcr.io/dvarahq/dvara-agentworks-ee@${IMAGE_DIGEST}
restart: unless-stopped
ports:
- "8080:8080"
read_only: true
tmpfs:
- /tmp:rw,noexec,nosuid,nodev,size=256m,uid=65532,gid=65532,mode=1770
volumes:
- ./agentworks/agentworks.yaml:/etc/agentworks/agentworks.yaml:ro
- ./agentworks/agents:/etc/agentworks/agents:ro
- agentworks-state:/var/lib/agentworks
secrets:
- {source: admin_key, target: CALLER_KEY_ADMIN}
- {source: ci_key, target: CALLER_KEY_CI}
environment:
SPRING_CONFIG_IMPORT: configtree:/run/secrets/
AGENTWORKS_CONFIG_FILE: /etc/agentworks/agentworks.yaml
AGENTWORKS_STORAGE_LOCAL_PATH: /var/lib/agentworks/run-plane.db
AGENTWORKS_RUNS_WORKER_ENABLED: "true"
AGENTWORKS_RUNS_CLEANUP_EVIDENCE_PATH: /var/lib/agentworks/runtime-cleanup.pending
AGENTWORKS_RUNTIME_BUILD_ID: "1.15.0"
SERVER_ADDRESS: 0.0.0.0
SERVER_FORWARD_HEADERS_STRATEGY: native
DVARA_GATEWAY_KEY: ${DVARA_GATEWAY_KEY}
SPRING_APPLICATION_JSON: >-
{"agentworks":{
"credentials":{"environment":{"dvara-gateway":{"variable":"DVARA_GATEWAY_KEY","scope":"platform"}}},
"gateway":{"gateways":{"dvara":{"type":"openai-compatible",
"base-url":"https://gateway.example.com/v1","credential-ref":"env://dvara-gateway",
"capabilities":"STREAMING,USAGE","models":[{"alias":"gpt-5-mini","model":"gpt-5-mini"}]}}}}}
security_opt: [no-new-privileges:true]
cap_drop: [ALL]
stop_grace_period: 60s

secrets:
admin_key: {file: ./agentworks/secrets/admin-key}
ci_key: {file: ./agentworks/secrets/ci-key}

volumes:
agentworks-state:
SettingWhy it is there
SPRING_CONFIG_IMPORT: configtree:/run/secrets/Turns each secret file into a property named after the file, so CALLER_KEY_ADMIN reaches the runtime without an environment variable.
AGENTWORKS_CONFIG_FILEMakes the runtime headless from this file. The file and the agent files are mounted read-only; a change is picked up without a restart.
AGENTWORKS_STORAGE_LOCAL_PATHThe SQLite run file, on the durable agentworks-state volume.
AGENTWORKS_RUNS_WORKER_ENABLEDThe worker is off by default. Without it, runs are accepted and stay QUEUED.
AGENTWORKS_RUNS_CLEANUP_EVIDENCE_PATHThe worker's cleanup journal. Its default resolves under the read-only image, and the worker then fails startup with cleanup evidence journal is unavailable.
AGENTWORKS_RUNTIME_BUILD_IDNames the build for run-claim compatibility when the image carries no build stamp.
SPRING_APPLICATION_JSONThe model gateway dvara, which the agent's model role names, and the credential reference its key comes from.

The gateway key is read from DVARA_GATEWAY_KEY only when a call needs it, and is never cached or logged. The runtime accepts plain http only to a loopback host and refuses to start otherwise; for a gateway on a network you trust, such as inside a cluster, set "private-network": true on the gateway, or use https.

Start it and check readiness:

export DVARA_GATEWAY_KEY=<your-gateway-key>
docker compose up -d
curl --fail http://127.0.0.1:8080/actuator/health/readiness

Call the runtime​

Every request carries one bearer credential: a caller key from the file, or a token from one of its identity providers. List the deployments and start a run:

KEY="$(cat agentworks/secrets/ci-key)"
DEPLOYMENT=$(curl -s -H "Authorization: Bearer $KEY" http://127.0.0.1:8080/api/v1/deployments \
| jq -r '.items[] | select(.name == "triage") | .id')
curl --fail-with-body -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
-d '{"input":{"prompt":"I was charged twice for my November invoice."}}' \
http://127.0.0.1:8080/api/v1/deployments/$DEPLOYMENT/runs

The answer is 201 with the run, lifecycle QUEUED. Follow it at /api/v1/runs/<run-id>/events or as Server-Sent Events at /api/v1/runs/<run-id>/stream. A request without a key gets 401 AUTHENTICATION_REQUIRED, and a viewer that starts a run gets 403 ACCESS_DENIED.

To send Idempotency-Key headers on run starts, or A2A message ids, give the runtime idempotency keys: agentworks.idempotency.active-key-version and agentworks.idempotency.hmac-keys.<version>, the key as a secret. Without them A2A message/send answers IDEMPOTENCY_UNAVAILABLE.

The CLI calls the same API: agentworks deploy list, agentworks run start, agentworks stream. It is built from the private release tag; see Use the API, CLI and configuration reference.

Run on Kubernetes with Helm​

The Helm chart ships with the private release, not from a public chart repository; replace <agentworks-chart> below with the chart folder from the release. It runs one runtime as a StatefulSet with one replica and a volume for the SQLite file; its values schema refuses any other replica count. In headless mode it takes the runtime file and agent files as values, renders them into a ConfigMap mounted read-only at /etc/agentworks, and reads caller keys from a Secret you create:

kubectl create namespace agentworks
kubectl -n agentworks create secret docker-registry ghcr-agentworks \
--docker-server=ghcr.io --docker-username="$GHCR_USER" --docker-password="$GHCR_TOKEN"
kubectl -n agentworks create secret generic agentworks-callers \
--from-literal=CALLER_KEY_ADMIN="$(openssl rand -hex 24)" \
--from-literal=CALLER_KEY_CI="$(openssl rand -hex 24)"
helm install agentworks <agentworks-chart> \
--namespace agentworks \
--set image.digest="$IMAGE_DIGEST" \
--set 'imagePullSecrets[0].name=ghcr-agentworks' \
--set-file headless.runtimeFile=agentworks.yaml \
--set-file 'headless.agentFiles.support-triage\.yaml=agents/support-triage.yaml' \
--set headless.callerKeys.existingSecret=agentworks-callers

Here the runtime file names its agent as - file: support-triage.yaml, since agent files sit beside it in the ConfigMap. Turn on the worker with runs.worker.enabled=true and add the gateway under gateway.gateways.<id>; the chart then puts the cleanup journal on its volume. The values schema accepts only non-secret gateway fields, so a key cannot be placed in values. See Deploy on Kubernetes for the cluster side.

How are changes and problems handled?​

WhenWhat the runtime does
At startup, the file has any problemIt does not start, lists every problem with where it is, and writes nothing: the run store is not created or migrated.
Later, a change has any problemIt refuses the whole change, logs it once, and keeps the last good version. A file is never partly applied.
A change passesIt is used from the next read (every 5s by default, agentworks.config.reload-interval), with no restart.
A deployment's release cannot be built yet, for example its gateway is not configuredThat deployment is left out with the reason, the rest are served, and health is DEGRADED. The runtime tries again at most every 30 seconds.

Each time the file puts a deployment on something new, the deployment gets a new revision, numbered by generation. New runs use it, and a run that started earlier finishes on its own revision. See Manage agents, releases and deployments.

Where does the runtime keep its state?​

The runs, events, checkpoints and deployment revisions are in the SQLite file at agentworks.storage.local.path (default data/run-plane.db), written with a write-ahead log so a committed step survives a crash.

  • Put the file on a durable volume, and run one replica per volume: a run belongs to the volume it started on, and reading a run must reach the runtime that owns it. To run more, run more runtimes, each with its own volume.
  • Back up the whole folder, not only the file: recent writes sit in run-plane.db-wal beside it. Stop the runtime or take a volume snapshot for a consistent copy, and rehearse a restore onto a new volume.
  • A restarted runtime on the same volume resumes each run from its last checkpoint.

What does a headless runtime not do in 1.15.0?​

  • It serves one workspace per runtime file.
  • A caller key holds its role in the whole workspace; it cannot be limited to some deployments.
  • An agent served from a runtime file cannot declare skills.
  • Entity memory (the remember and recall tools) is not available; conversation and working memory are.
  • It keeps no artifacts, so a tool's or sandbox's result is not kept as an artifact.
  • It serves no web pages. A runtime's pages, and agent publishing, releases and promotion, are in Flightdeck; see Connect AgentWorks to Flightdeck.

Next steps​