YAML Schema Reference
This page documents the YAML schemas used by agentrelay: the task graph
schema (accepted by TaskGraphBuilder) and the credentials schema
(accepted by FileCredentialProvider).
Task Graph YAML
Schema accepted by agentrelay.task_graph.TaskGraphBuilder.from_yaml(...).
Top-level object
Required keys:
name: non-empty string.tasks: non-empty list of task objects.
Optional keys:
workstreams: non-empty list of workstream objects.max_workstream_depth: integer > 0. Default:1.
Unknown top-level keys are rejected by TaskGraphBuilder.
Operational keys
The following top-level keys are not part of the graph schema but are
recognized by run_graph.py, which extracts them before passing the dict to
TaskGraphBuilder.from_dict():
tmux_session: string. Override tmux session name for all agents.keep_panes: boolean. Leave agent tmux windows open after completion.model: string. Override model for all agents.tools: list of strings. Declared tool names (e.g.,["pixi"]).anthropic_credential: string. Default Anthropic credential name from the credentials YAML. Overridden by--anthropic-credentialCLI flag.
These can also be set via CLI flags (--tmux-session, --model,
--anthropic-credential). CLI flags take precedence over YAML values.
Task object
Required keys:
id: non-empty string, unique withintasks.
Optional keys:
role: string. Defaults togeneric. Accepts enum value (implementer) or enum name (IMPLEMENTER).description: string ornull.dependencies: list of task IDs. Default:[].paths: object with optionalsrc,test,spec.completion_gate: string ornull.max_gate_attempts: integer > 0 ornull.primary_agent: object with optionalframework,model,adr_verbosity,environment.review: object with requiredagentand optionalreview_on_attempt(default1).workstream_id: string ornull. Defaults todefault.
Validation rules:
- Dependency IDs must exist in
tasks. - Dependency graph must be acyclic.
- Duplicate dependency IDs in one task are rejected.
- Unknown task keys are rejected.
Workstream object
Required keys:
id: non-empty string, unique withinworkstreams.
Optional keys:
parent_workstream_id: string ornull.base_branch: non-empty string. Default:main.merge_target_branch: non-empty string. Default:main.
Validation rules:
parent_workstream_idmust reference an existing workstream ID.- Workstream parent hierarchy must be acyclic.
- Workstream parent depth must be
<= max_workstream_depth.
Important defaulting behavior
- If
workstreamsis omitted, a syntheticdefaultworkstream is used. task.workstream_iddefaults todefault.- If
workstreamsis provided and tasks omitworkstream_id, those tasks still resolve todefault. - That means if you provide explicit
workstreams, includeid: defaultwhen you want omittedworkstream_idtasks to remain valid.
Agent/review defaults (current implementation)
primary_agent.framework:claude_codeprimary_agent.adr_verbosity:noneprimary_agent.environment: tmux sessionagentrelayreview.review_on_attempt:1
Canonical examples
- Minimal graph: docs/examples/minimal.yaml
- Parent/child workstreams: docs/examples/workstreams.yaml
- Mixed default + explicit workstreams: docs/examples/mixed-default-and-explicit-workstreams.yaml
Credentials YAML
Schema accepted by agentrelay.sandbox.FileCredentialProvider. Passed to
run_graph.py via --credentials <path>.
Top-level object
Optional keys (all are optional; an empty mapping {} is valid):
token_tiers: mapping of tier name → env var mapping.anthropic: mapping of credential name → credential entry.
token_tiers
Maps TokenTier values (read_only, standard, elevated) to
dictionaries of environment variables injected into sandboxed agents.
Typically used for GitHub PATs.
token_tiers:
read_only:
GH_TOKEN: ghp_xxxx
standard:
GH_TOKEN: ghp_yyyy
elevated:
GH_TOKEN: ghp_zzzz
anthropic
Named Anthropic credential entries. Each entry has a type field
(api_key or oauth) and type-specific fields.
api_key entry — pay-per-token API key:
type:api_key(required)key: string. The Anthropic API key (inline).key_file: string. Path to a file containing the API key. Tilde (~) is expanded. The file is read at startup; leading/trailing whitespace is stripped.
Exactly one of key or key_file must be provided.
oauth entry — Max plan OAuth credentials file:
type:oauth(required)path: string (required). Path to~/.claude/.credentials.json. Tilde (~) is expanded.
anthropic:
dev_api_key:
type: api_key
key: sk-ant-xxxx # inline
dev_api_key_file:
type: api_key
key_file: ~/.config/anthropic/api_key # from file
max_plan:
type: oauth
path: ~/.claude/.credentials.json
Selection rules
- If
anthropichas exactly one entry, it is auto-selected. - If multiple entries exist, use
--anthropic-credential <name>on the CLI oranthropic_credential: <name>in the graph YAML. - If no
anthropicsection exists, no Anthropic authentication is configured for containerized agents.
Canonical examples
- API key only: docs/examples/credentials-api-key.yaml
- OAuth only: docs/examples/credentials-oauth.yaml
- Both (requires explicit selection): docs/examples/credentials-both.yaml