Secure AgentWorks identity and credentials
An AgentWorks Runtime keeps no users, passwords, sessions or API tokens. Every request carries a bearer credential that the Runtime checks on each use, and every secret an agent needs is named by a credential reference and read only when a call needs it. What checks a caller depends on the mode: a headless Runtime accepts the caller keys and identity providers its runtime file names, and a Runtime connected to DVARA Flightdeck accepts Flightdeck's tokens. Model, MCP and agent-to-agent calls made through the DVARA Gateway then carry the governance the gateway applies to every call: policy, personal-data checks and a tamper-evident audit trail.
How do callers authenticate to a headless Runtime?
The runtime file's callers section names who may call the Runtime. It names the environment variable that holds
each key, never the key itself:
callers:
keys:
- {name: ci, secretEnv: CALLER_KEY_CI, role: operator}
- {name: dashboards, secretEnv: CALLER_KEY_DASHBOARDS, role: viewer}
issuers: # identity providers whose signed tokens are accepted
- issuer: https://login.example.com
audience: agents
jwkSetUri: https://login.example.com/.well-known/jwks.json # optional; this is the default
roleClaim: roles # optional; default "roles"
roles:
admin: [agentworks-admin]
operator: [agentworks-run]
viewer: [agentworks-read]
- Caller keys are sent as
Authorization: Bearer <key>and act with their role in the file's workspace. A key must be at least 32 characters, every key must differ, and its variable must not start withAGENTWORKS_. The Runtime keeps only a SHA-256 digest of each key. - Identity-provider tokens must be signed by a key from the issuer's JWK set, name the issuer in
iss, include the audience and be within their lifetime. The values ofroleClaimmap to roles asrolessays; a token with no mapped value is refused withFLIGHTDECK_ROLE_MISSING. The token'sgroupsare recorded with the run, so tool permissions can name a group. - Anything else is refused with
401. A credential in a URL, as a query parameter named like a credential, is refused withCREDENTIAL_IN_URL.
| Role | Holds |
|---|---|
viewer | Read the workspace and answer interactions |
operator | The viewer's permissions, plus start, cancel, pause and resume runs and operate deployments |
author | The viewer's permissions, plus write agents, releases and artifacts, where a headless Runtime serves them |
admin | Every permission |
Rotate a key by changing the runtime file: the Runtime picks the change up without a restart, a removed key stops
working at once, and its open run streams end. A caller's pause request, its withdrawal and a cancel are recorded in
the Runtime's run store with the caller and how they signed in (runtime-key or runtime-issuer); a viewer reads
them at GET /api/v1/administrative-audit. See Run AgentWorks headless for the rest of
the file.
How do callers authenticate to a connected Runtime?
Flightdeck signs users in and issues product tokens whose roles are per environment. The Runtime checks each token's signature, audience, account and workspace against the workspaces its verified bundle assigns, and writes no identity of its own.
| Refusal | Cause |
|---|---|
401 AUTHENTICATION_FAILED | A bad signature, another audience, an expired token, or a token without its environment claims |
403 FLIGHTDECK_WORKSPACE_UNKNOWN | An account or workspace the bundle does not assign to this Runtime |
403 FLIGHTDECK_ROLE_MISSING | A token with no AgentWorks role |
403 FLIGHTDECK_WORKSPACE_REQUIRED | A Flightdeck user who has not picked a workspace; AgentWorks never picks one |
A run starts only in the environment the user selected and needs the permission there; a run in another environment is refused. When the DVARA Gateway calls an agent for a user, it exchanges the user's token at Flightdeck. The run is then the user's, and its recorded actor names both the user and the gateway. See how identity works in a connected Runtime.
How do credential references keep secrets out of agents?
Agent specifications, runtime files and releases carry credential references, never secret values. A runtime file refuses a deployment credential that is not a reference. The packaged Runtime resolves two kinds of reference:
| Reference | Resolves to | Available |
|---|---|---|
env://<id> | The environment variable that agentworks.credentials.environment.<id>.variable names | Headless and connected |
flightdeck://dvara-gateway, flightdeck://dvara-gateway:<slug> | By default, the Runtime's current Flightdeck service token for the gateway, for its first workspace or for workspace <slug> | Connected only |
agentworks:
credentials:
environment:
crm-api:
variable: CRM_API_TOKEN
scope: platform # required: platform, organization:<uuid> or workspace:<uuid>
gateway:
gateways:
dvara:
type: openai-compatible
base-url: https://gateway.example.com/v1
credential-ref: env://dvara-gateway
A deployment in the runtime file then binds crm: env://crm-api under its credentials. An id is lower-case
letters, digits, . or -. The scope is required, and a missing or unknown scope stops startup and names the
setting. A reference used outside its scope, or one no provider knows, is refused. The secret is read only when a
call needs it, and is never cached or logged; each use is logged under agentworks.credentials.audit with its action,
outcome and reference, never the value. A connected Runtime also sends each use to Flightdeck's audit trail.
Environment variables can be visible to child processes and diagnostics. Fill them from Docker or Kubernetes secrets rather than from a configuration file, and never bake them into an image.
How does a connected Runtime get its gateway credentials?
An enrolled Runtime proves its identity with its own certificate, created at enrolment and renewed before it expires. Keep the enrolment directory on a protected durable volume: it holds the Runtime's private key, certificate, Flightdeck's CA, the last verified bundle and the audit spool.
For gateway calls the Runtime requests short-lived service tokens from Flightdeck over that certificate, one per
workspace, and for a run in an environment the bundle lists, one bound to that environment. Tokens stay in memory and
are not written to the run store, logs or the records sent to Flightdeck. If a token cannot be issued, the call fails
with SERVICE_TOKEN_UNAVAILABLE instead of continuing without a credential, and after a revocation
flightdeck:// references resolve nothing. A run started for a user keeps that user's authority on its governed MCP
and A2A calls rather than borrowing the Runtime's.
What network and process boundaries should you set?
- TLS. Under the
productionorprodprofile the Runtime refuses to start withoutserver.ssl.enabled=trueor an explicit trusted-proxyserver.forward-headers-strategy. The same profiles refuse local-development mode and obvious placeholder values in secret settings. - Model gateway transport. An
openai-compatiblegateway'sbase-urlmust be HTTPS, or plain HTTP to a loopback host.agentworks.gateway.gateways.<id>.private-network=true(defaultfalse) allows plain HTTP elsewhere; set it only on a network you trust. - Egress. Allow only what the agents need: the DVARA Gateway or model endpoint, tool, MCP and A2A services, the
identity providers' key sets, DNS and telemetry, plus Flightdeck's enrolment port (
8443by default) for a connected Runtime. - No database credentials. A Runtime has no database; a removed
spring.datasource.*oragentworks.planes.*setting stops its start. - Container. The packaged image runs as non-root uid
65532with a read-only root filesystem. Mount only the data volume writable, and run one Runtime per volume. - Secrets at rest. Keep caller keys, enrolment tokens, provider credentials and signing keys out of images, Git, logs, support bundles and agent specifications.
Production checks
Before accepting production work:
- Verify the exact AgentWorks version and image digest.
- Start under the
productionprofile and confirm it accepts your TLS or proxy configuration. - Send a request without a credential and confirm
401; confirm aviewerkey cannot start a run. - Remove a test caller key from the runtime file and confirm it stops working.
- For a connected Runtime, revoke a test Runtime and confirm its
flightdeck://references stop resolving. - Confirm credential-use and run-control records name the caller and the reference, and contain no secret value.