Agent and Trigger Reference
This page shows the file format for agents and triggers. You can copy and edit all examples. To learn what the agents you build do, see Build Your Own Agents.
If you use Claude Code, Cursor, Codex, or GitHub Copilot, you can install the Autoheal CLI skills. Your coding agent can then create agents for you.
autoheal skill install
Your coding agent gets access to the complete agent schema. It can create, test, and improve agents. This means you do not need to write YAML manually.
See the CLI guide for installation steps.
How the pieces fit
| Piece | What it is | Where it lives |
|---|---|---|
| Agent | What to do: instructions, model, tools, skills, result shape | agents/<agent-name>/agent.yaml in your project's Git repository |
| Trigger | When to run it: an event, filters on that event, and the prompt to send | The Triggers page, or the /api/v1/triggers API |
| Integrations | The systems the agent can reach, such as GitHub, Datadog or PagerDuty. Every run can use all of its project's active integrations. | Integrations |
| Skills | Reusable know-how that the agent loads when it needs it | skills/<skill-name>/SKILL.md in the same project |
The agent file and the trigger are separate. One agent can have many triggers. For example, you can have one trigger for critical alerts and one trigger for a specific repository. You do not need to copy the agent.
Your first agent
Create agents/pr-summarizer/agent.yaml:
apiVersion: agents.autoheal.ai/v1
name: PR Summarizer
description: Summarizes a pull request for reviewers.
model: claude-sonnet-5
instructions: |
You summarize GitHub pull requests for busy reviewers.
Read the diff and the linked issue, then reply with:
- what changed, in two or three bullets
- anything risky (migrations, config, auth, public API)
- which files a reviewer should read first
system_tools: operation_type == "read"
integration_tools: integration_type == "github" && operation_type == "read"
The folder name is the identifier (agents:pr-summarizer). The name field is just the display name.
Agent file reference
Top-level fields
Every agent has these fields:
| Field | Required | Description |
|---|---|---|
apiVersion | Yes | Always agents.autoheal.ai/v1. |
name | No | Display name, inherited from a builtin when omitted in an overlay. Otherwise the folder name is used. |
extends | No | Current builtin base, for example builtin/agents:reflection. See Platform agents and skills. |
description | No | What the agent does and when to use it. The agent list shows it. |
icon | No | A Phosphor icon name, for example siren or shield-check. |
labels | No | Labels on the agent, as a list of - key: value items, for example - team: payments. Repeat a key for each of its values. See Labels. |
timeout | No | Wall-clock limit for the agent. Default: 10m. Maximum: 1h. See Timeout and limits. |
inputs | No | Named inputs the agent accepts. See Inputs. |
outputs | No | Values extracted from step results. See Steps. |
limits | No | Budget limits for LLM steps: cost, tokens, model requests. See Timeout and limits. |
steps | No | A graph (map) or sequence (array) of steps to execute. See Steps. |
If you use an unknown field, validation will fail. For example, if you write instruction: instead of instructions:, you will get an error.
An agent with steps (a workflow agent) can have only apiVersion, name, icon, labels, description, timeout, inputs, outputs and steps at the top level. It has no top-level limits or evals. Put limits on each LLM step. If you add another field at the top level of a workflow agent, validation fails, and it can report this one mistake as many errors. The agent list shows the workflow agent's description. When another agent calls it as a subagent, write the description in the parent's subagents entry.
Platform agents and skills
Autoheal supplies builtin resources alongside the definitions in your project's repository. Use an explicit prefix to select them:
subagents:
helper: builtin/agents:<id>
builtin/agents:<id> selects a platform agent, and builtin/skills:<id> selects a platform skill. A bare reference such as agents:reflection still selects a project resource. A missing builtin never falls back to a project resource with the same name. Private builtin children can be used only through their parent's declared dependencies.
All agents run in a project context. The personal Assistant is the only exception; use its Assistant interface for personal conversations. A direct builtin invocation supplies the project as execution scope:
POST /api/v1/runtime/runs?project_id=<project-id>
Content-Type: application/json
Idempotency-Key: <unique-key>
{"reference":"builtin/agents:<id>","arguments":{}}
/api/v1/tools is deprecatedThe run API moved from /api/v1/tools to /api/v1/runtime. The old paths still work, with the same requests and answers, but they will be removed. Use the new paths:
| Old path | New path |
|---|---|
POST /api/v1/tools/call | POST /api/v1/runtime/runs |
GET /api/v1/tools/call (tool-call audit) | GET /api/v1/runtime/calls |
/api/v1/tools/runs/... | /api/v1/runtime/runs/... |
GET /api/v1/tools/pending | GET /api/v1/runtime/pending |
/api/v1/tools/agent-sessions/... | /api/v1/runtime/sessions/... |
POST /api/v1/tools/discover | POST /api/v1/runtime/tools |
Today the one platform agent a project can use is builtin/agents:reflection, and it works only through the reflection role. Called directly or as a subagent, its memory steps are refused and the run fails. See Choose the project's reflection agent.
Builtin references select the content in the serving API server's current deployment. They do not pin that content to your project commit. Runs record the selected address and content digests, but old builtin definitions are not stored. To maintain a fixed implementation, copy the definition into an independent project agent without extends and version it in your repository.
Extend a builtin agent
Use extends to customize a builtin without copying it:
apiVersion: agents.autoheal.ai/v1
name: Project reflection
extends: builtin/agents:reflection
timeout: 45m
This keeps the base's steps and gives the whole agent 45 minutes. A builtin with steps is a workflow agent, so an extension can't add the top-level fields only a single-step agent has, such as model, instructions or skills: the earlier single-step Reflection took them, and an extension written for it now fails validation until you remove them. Inherited input and subagent shorthand forms also retain their type or reference when you add map fields such as a description.
| Override | Result |
|---|---|
| Omit a field | Inherit its current base value. |
| Supply a map | Merge it recursively with the inherited map. |
| Supply a scalar or list | Replace the inherited value. An empty list clears it. |
Supply steps | Replace the entire graph or sequence, including its step IDs. |
Supply null | Remove the field; ordinary defaults still apply where defined. |
Supply instructions | Replace the instructions, without concatenating them. |
When switching a single-step base to a graph, remove incompatible inherited root fields with null. Only a canonical builtin root agent can be a base: project bases, multiple bases and inheritance chains inside the builtin collection are not supported. Skills do not support extends.
Inherited files and dependencies retain their builtin source. References and files introduced by your overrides use the project revision. Indexing reports warnings against the current assembled definition; execution validates it with the same model and tool-name checks as an ordinary agent. A later builtin deployment can change that result. The Eval page and benchmark execution also read the assembled definition, while the project stores your authored overrides.
Historical run steps and conversations remain readable from recorded execution rows if a builtin or inherited base is removed or changes. Current definition metadata may then be unavailable. A new turn or resumed attempt still selects current content and can be refused if the definition is missing or no longer compatible. A running graph keeps its stored plan.
Choose the project's reflection agent
Open Settings → System agents in the project. Choose a branch and compatible project agent, then select Save selection. Use built-in default clears the binding and restores builtin/agents:reflection. You need project read permission to see the selection, project update permission to change it, and registry read permission to browse candidates. Selection does not grant execution or tool permissions.
Reflection reviews one model step of a finished run. For each agent memory the step fetched, it records whether the memory was relevant, whether the step acted on it, and whether it helped or misled; then it proposes the lessons the step learned as pending memories for a person to accept or dismiss. The run page's Memory card shows both.
The reflection role takes one input, run_id: the model step's own run, in the same project. An agent's own run is refused, and so is a tool step's: every Git agent, single-step included, runs its model in a step run of its own. Pass that step's run id, from the run's metadata.agentStepRuns[].runId (autoheal runs view <run ID> -o json) or from read_agent_run on the run. The role records the reviewed step's conversation on the reflection run (as its subject, agent_session/<session_id>), which is how the run page tells a step Reflection hasn't reviewed from one where it found nothing.
POST /api/v1/runtime/runs?project_id=<project-id>
Content-Type: application/json
Idempotency-Key: <unique-key>
{"systemRole":"reflection","arguments":{"run_id":"<llm step run id>"}}
The role's result has two lists of memory ids. memories_used lists the memories the step acted on, and memories_proposed the pending memories the review created. The findings and pending memories are the records: open a memory by its id to read it. The result is what the review reports it saved, and nothing checks it against them. A replacement agent must take a run_id string input and declare exactly these two results, as a graph outputs: mapping or its one final step's returns. The platform checks that before dispatch and validates the composed result before success. An ordinary agent's returns continues to describe its structured result without imposing that role contract on every SDK run; malformed output schemas are rejected before model execution.
Nothing starts Reflection automatically yet: call the role for the step you want reviewed. The built-in default, builtin/agents:reflection, meets this contract. To use another agent, select a compatible project agent in System agents; Use built-in default brings Reflection back. Extending an agent does not select it for the role; save that selection separately.
Labels
Labels describe the agent. Write each label as one - key: value item. A value is one string; to give a key two values, write the key twice:
apiVersion: agents.autoheal.ai/v1
name: Release readiness
labels:
- team: payments
- service: checkout
- service: cart
instructions: ./instructions.md
When a key is the name of a blueprint, such as service or team, and the value is the name of an entity, the context graph links the agent to that entity. Any other key only describes the agent. Keys and values are lowercased. A label that is not valid is left out with a warning, and the agent keeps its other labels and still runs. Labels never change what the agent runs, which tools it gets or which skills it is offered.
To add a label from the agent's page, open Agent details and click Add label. The editor opens agent.yaml with the label written; commit the draft when you're done.
Steps
When an agent has a steps field, it runs multiple operations. Each step can be:
- An LLM call
- A tool call
- Code execution
- A call to another agent
- Control flow (if/else, while)
Structure
You can organize steps in two ways:
- As a graph (map of steps)
- As a sequence (array of steps)
Graph (map of steps)
Each step has an ID. Use after: to control the order:
steps:
fetch_data:
tool: builtin.tool.datadog_query_logs@1
with: {query: "error", time_range: "1h"}
analyze:
instructions: Find the root cause of these errors
model: claude-sonnet-5
after: [fetch_data]
with:
logs: ${{ steps.fetch_data.output }}
notify:
tool: builtin.tool.slack_post_message@1
after: [analyze]
with:
channel: "#incidents"
text: ${{ steps.analyze.output.summary }}
Steps with no dependencies run at the same time.
Sequence (array of steps)
The array order is the execution order:
steps:
- id: prepare
runtime: bash
code: echo '{"status": "starting"}' > "$AUTOHEAL_OUTPUT"
- id: process
instructions: Analyze this data
model: claude-sonnet-5
with:
data: ${{ steps.prepare.output }}
- id: finish
runtime: bash
code: echo '{"status": "done"}' > "$AUTOHEAL_OUTPUT"
You can nest a parallel group inside a sequence:
steps:
- id: start
runtime: bash
code: echo "Begin"
- steps: # parallel group
left:
runtime: bash
code: echo '{"side": "LEFT"}' > "$AUTOHEAL_OUTPUT"
right:
runtime: bash
code: echo '{"side": "RIGHT"}' > "$AUTOHEAL_OUTPUT"
- id: finish
runtime: bash
code: |
echo '{"both": "${{ steps.left.output.side }} and ${{ steps.right.output.side }}"}' > "$AUTOHEAL_OUTPUT"
A code step returns its output as a JSON object written to $AUTOHEAL_OUTPUT. What it prints is not its output. See Code execution.
LLM steps
An LLM step calls a model. The step must have instructions. The step can have model:
steps:
analyze:
instructions: Find the root cause of these errors
model: claude-sonnet-5
system_tools: operation_type == "read"
integration_tools: operation_type == "read"
with:
logs: ${{ steps.fetch_data.output }}
returns:
conclusion: {type: string, required: true}
confidence: number
An LLM step can have these fields: instructions, model, system_tools, integration_tools, skills, subagents, artifacts, returns, evals, compaction. A step's evals score that step's own conversation. See Evals.
Calling agents and tools
Call another agent:
steps:
summarize:
agent: agents:incident-summarizer
with:
incident_data: ${{ steps.investigate.output }}
Call a tool:
steps:
deploy:
tool: builtin.tool.kubernetes_apply_manifest@1
with:
manifest: ${{ steps.build.output.manifest }}
Conditionals (if/else)
steps:
check:
instructions: Check severity of this alert
model: claude-sonnet-5
with:
alert: ${{ inputs.alert }}
returns: {severity: string}
high_severity:
if: ${{ steps.check.output.severity == "high" }}
then:
page:
tool: builtin.tool.pagerduty_create_incident@1
with:
title: "High severity alert"
else:
notify:
tool: builtin.tool.slack_post_message@1
with:
channel: "#alerts"
text: "Low severity alert"
The steps in then and else belong to the if step. A step outside it cannot name them. It reads them through the if step's output, {branch, steps}: branch is then or else, and steps holds the output of each step in the branch that ran. In this example, ${{ steps.high_severity.output.steps.page }} is the output of page.
Loops (while)
Repeat steps while a condition is true. max_iterations is required. The condition is checked before each iteration. It cannot name the steps in the loop: it reads the previous iteration's steps as loop.prev.<step-id>.output, and loop.index counts the iterations from 0:
steps:
retry_deploy:
while: ${{ loop.index == 0 || loop.prev.check_status.output.status != "ready" }}
max_iterations: 10
steps:
check_status:
tool: builtin.tool.kubernetes_get_deployment
with:
deployment: my-service
wait:
runtime: bash
code: sleep 5
A step outside the loop reads it through the while step's output, {iterations, steps}: the number of iterations, and the output of each step in the last iteration. For example, ${{ steps.retry_deploy.output.steps.check_status.status }}.
Code execution
A code step runs a script in the run's sandbox. The code reads its with values from the JSON file at $AUTOHEAL_INPUT. The code writes its result as one JSON object to the file at $AUTOHEAL_OUTPUT. The fields of that object are the step's output, and they keep their JSON types. In this example, ${{ steps.count.output.count }} is a number:
steps:
count:
runtime: python
with:
items: ${{ steps.previous.output.list }}
code: |
import json, os
with open(os.environ["AUTOHEAL_INPUT"]) as f:
data = json.load(f)
count = len(data["items"])
with open(os.environ["AUTOHEAL_OUTPUT"], "w") as out:
json.dump({"count": count}, out)
returns: {count: integer}
Rules for code steps:
| Rule | Details |
|---|---|
| Code in a file | code can be the path of a file in the agent's folder, on one line, starting with ./: code: ./check.py. The content of the file runs. Without the ./, the text runs as code. A path that leaves the folder (../) is refused. |
| Runtimes | python (or python3), bash and sh. There is no node runtime. Node.js is installed in the sandbox, so you can run it from a bash step, for example node scan.js. |
| Output | The file at $AUTOHEAL_OUTPUT must hold one JSON object, or nothing. If the code writes nothing, the step's output is empty ({}). If the file holds plain text, key=value lines or a list, the step fails with AUTOHEAL_OUTPUT must contain a JSON object. |
| stdout | What the code prints is not the output. It goes to stderr. If the code exits with a non-zero code, the step fails and its error message is that stderr text. |
| Output size | Keep the output under about 44 KB. A larger output is cut off, and the step fails with script output is missing or truncated. Write larger data to a file in the sandbox instead. |
| Timeout | A code step without timeout stops after 3 minutes. For longer work, set timeout on the step, for example timeout: 10m. The step's timeout cannot be longer than the agent's timeout. |
| Files | All steps of one run use the same sandbox. A later code or LLM step can read the files that an earlier step wrote. A step that calls another agent (agent:) runs in a different sandbox and does not see these files. |
Conditional execution (when)
You can control when a step runs. The step can run based on success or failure of another step:
steps:
deploy:
tool: builtin.tool.deploy_service
notify_success:
when: success(deploy)
tool: builtin.tool.slack_post_message
with:
text: "Deploy succeeded"
notify_failure:
when: failure(deploy)
tool: builtin.tool.slack_post_message
with:
text: "Deploy failed"
cleanup:
when: always()
runtime: bash
code: echo "Always runs"
Functions: always(), success(step_id), failure(step_id).
A step that does not run shows on the run page as Skipped when its own when was false, or when a step it needs was skipped and nothing before it failed. It shows as Not reached when a step before it failed. In expressions, its steps.<step_id>.status is skipped or not_reached to match.
Retries
You can retry a step when it fails:
steps:
api_call:
tool: builtin.tool.http_request
retry:
max_attempts: 3
backoff: exponential
Step outputs
You can extract values from step results. These values become agent outputs:
outputs:
root_cause: ${{ steps.analyze.output.conclusion }}
severity: ${{ steps.check.output.severity }}
Common step fields
| Field | Meaning |
|---|---|
id | Step identifier (required in sequences) |
after | List of step IDs this step waits for (graph only) |
with | Arguments passed to the agent/tool, or variables available to code |
timeout | Time limit for this step. It cannot be longer than the agent's timeout. LLM steps can also set limits |
when | Condition for running: always(), success(step_id), failure(step_id) |
retry | {max_attempts: 3, backoff: exponential} |
Shorthand for single-step agents
Some agents make only one LLM call. You can write the LLM step at the top level. You do not need to use steps. These two agents do the same thing:
# Shorthand (top-level LLM fields)
apiVersion: agents.autoheal.ai/v1
name: Summarizer
instructions: Summarize this incident
model: claude-sonnet-5
# Explicit (steps form)
apiVersion: agents.autoheal.ai/v1
name: Summarizer
steps:
main:
instructions: Summarize this incident
model: claude-sonnet-5
You can use these fields at the top level:
| Field | Required | Description |
|---|---|---|
instructions | Yes | The system prompt. You can write it inline. You can also give the path to a .md file in the agent's folder. |
description | No | What the agent does. When another agent calls this agent as a subagent, it sees this description. |
model | No | The model to use. If you do not set this, the agent uses your deployment's default model. |
system_tools | No | A filter that chooses which of Autoheal's own tools the agent can call. If you do not set this, the agent can call every system tool, write tools included. See Tools and integrations. |
integration_tools | No | A filter that chooses which integration tools the agent can call. If you do not set this, the agent can call every tool of every connected integration. See Tools and integrations. |
skills | No | Skills the agent can load. See Skills. |
subagents | No | Other agents this agent can call. See Subagents. |
artifacts | No | Artifact templates the agent can create: ./artifact-templates:<id> for the agent's own template, artifact-templates:<id> (or only <id>) for a project template. Each template gives the agent a create_artifact_<id> tool. The agent can use it only if system_tools keeps create_artifact. See Artifact Templates. |
returns | No | A structured result shape. If you do not set this, the agent returns a text answer. See Structured results. |
evals | No | Evals that score the agent's runs. See Evals. |
Instructions
Write short instructions inline:
instructions: |
You triage new alert groups. Decide whether the group is a real
incident or noise, and say who should look at it.
For longer instructions, put the prompt in a Markdown file next to agent.yaml:
instructions: ./instructions.md
agents/
alert-triage/
agent.yaml
instructions.md
The path must start with ./. The file must be inside the agent's folder. Instructions can change with the agent's inputs. See Values that change with the inputs.
Model
A model name on its own:
model: claude-sonnet-5
Or a model with options:
model:
name: claude-sonnet-5
max_tokens: 8192 # max output tokens per response
thinking: medium # true | false | minimal | low | medium | high | xhigh
Use a model from your organization's approved list. Common models:
claude-haiku-4-5: fast and cheapclaude-sonnet-5: most agentsclaude-opus-5: hard reasoning tasks
The automatic prompt input
A single-LLM agent always has a prompt input. You do not need to declare it. When you run the agent, the prompt becomes the model's first message. Each other input you send becomes one name: value line.
For example, an agent with these inputs:
inputs:
service:
type: string
required: true
lookback_minutes:
type: integer
default: 60
When run with:
prompt: "Investigate high latency on checkout-api"
service: "checkout-api"
lookback_minutes: 30
The model receives:
Investigate high latency on checkout-api
service: checkout-api
lookback_minutes: 30
You can declare prompt to add a description or mark it optional:
inputs:
prompt:
type: string
description: The question to investigate
dry_run: {type: boolean, default: false}
The input already has type: string, required: true. You can only refine it.
Optional inputs with no value do not get a line. If the caller does not send lookback_minutes and it has no default, the model sees no lookback_minutes: line. The model does not see lookback_minutes: null.
Expressions
Use ${{ }} to read values. You can read inputs, step outputs, and event data. The agent replaces the expression with the value when it runs.
An expression in a step's with, when, if, while, code or env, or in the agent's outputs, is filled in while the run goes on. An expression anywhere else is filled in once, before the run starts, and reads only inputs. See Values that change with the inputs.
Triggers use the same expression language. A trigger can read event data with ${{ event.data.field }}. An agent can read inputs with ${{ inputs.field }} and step outputs with ${{ steps.step_id.output }}.
Read step outputs
You can get the result from a step that ran before:
steps:
fetch:
tool: builtin.tool.datadog_query_logs@1
with:
query: "error"
analyze:
instructions: Find the cause of these errors
with:
logs: ${{ steps.fetch.output }}
steps.<step-id>.output gives you the full result from that step. For structured results, use dot notation:
steps:
check:
instructions: Check the severity
returns:
level: string
count: integer
notify:
tool: builtin.tool.slack_post_message@1
with:
text: "Found ${{ steps.check.output.count }} errors at level ${{ steps.check.output.level }}"
Read inputs
You can get a value that was passed to the agent:
inputs:
service: string
time_range: string
steps:
fetch:
tool: builtin.tool.datadog_query_metrics@1
with:
service: ${{ inputs.service }}
time_range: ${{ inputs.time_range }}
Read the run link
${{ run.url }} is the link to this run's page in Autoheal. Use it to tell people outside Autoheal where to see the run, for example in a ticket:
inputs:
incident: string
steps:
started:
tool: builtin.tool.servicenow_update_incident@1
with:
incident: ${{ inputs.incident }}
work_note: "Autoheal started an investigation: ${{ run.url }}"
investigate:
instructions: Find the root cause of incident ${{ inputs.incident }}
after: [started]
returns:
root_cause: string
summary: string
finished:
tool: builtin.tool.servicenow_update_incident@1
after: [investigate]
with:
incident: ${{ inputs.incident }}
work_note: "Root cause: ${{ steps.investigate.output.root_cause }}\n\n${{ steps.investigate.output.summary }}\n\nDetails: ${{ run.url }}"
The link always goes to the run that a person or a trigger started. When this agent runs as a subagent of another agent, the link goes to the other agent's run. An agent step gets the same link in its instructions, so the agent can put it in a message or a ticket.
run.url is empty when the top-level run is not an agent run, or when Autoheal cannot read the run. On a self-hosted install, set APP_BASE_URL: when it is not set, the link points at localhost.
To let people rate an artifact from the link, add the artifact's id, its version and a vote to run.url:
${{ run.url }}&artifact=<artifact_id>&version=<version>&feedback=thumbs_up
${{ run.url }}&artifact=<artifact_id>&version=<version>&feedback=thumbs_down
run.url already has a query string, so each parameter starts with &. Inside an HTML href, write each & as &. The agent gets the id and the version from the artifact tools: create_artifact, update_artifact and get_artifact return them as artifact_id and version. A create_artifact_<template> tool returns only the id; a new artifact is version 1.
When a person opens the link, Autoheal asks them to sign in if they need to, saves their vote on that version, and opens the artifact on the run's page. A link saves each person's vote once: opening it again saves nothing, so a vote the person changed since stays as it is. After a thumbs down, Autoheal asks the person for a note. Voting needs registry:run on the project, which the Member and Project Admin roles have; a Read-only person's vote is refused (403). See Roles & Permissions.
Compare values
Use ==, !=, >, <, >=, <= to compare:
steps:
check:
instructions: Count the errors
returns: {count: integer}
alert:
if: ${{ steps.check.output.count > 10 }}
then:
page:
tool: builtin.tool.pagerduty_create_incident@1
Comparison operators:
| Operator | Meaning | Example |
|---|---|---|
== | Equal to | ${{ steps.check.output.status == "ready" }} |
!= | Not equal to | ${{ steps.check.output.status != "ready" }} |
> | Greater than | ${{ steps.count.output > 100 }} |
< | Less than | ${{ steps.count.output < 10 }} |
>= | Greater than or equal | ${{ steps.severity.output >= 3 }} |
<= | Less than or equal | ${{ steps.severity.output <= 1 }} |
Combine conditions
You can combine conditions. Use && (and) and || (or):
# Both conditions must be true
if: ${{ steps.check.output.status == "failed" && steps.check.output.retry_count < 3 }}
# At least one condition must be true
if: ${{ steps.check.output.severity == "critical" || steps.check.output.error_count > 100 }}
Pass whole objects
You can reference an object without selecting a field. The whole object passes through:
steps:
get_pr:
tool: builtin.tool.github_get_pull_request@1
with:
pr_number: ${{ inputs.pr_number }}
analyze:
instructions: Review this pull request
with:
pull_request: ${{ steps.get_pr.output }} # passes the whole PR object
Use in text
You can put expressions in text. This builds messages:
with:
prompt: |
Investigate high latency on ${{ inputs.service }}.
Error count: ${{ steps.fetch.output.count }}
Time range: ${{ inputs.time_range }}
Values that change with the inputs
One agent can have more than one mode. For example, it can run Fast for low-priority incidents and Deep for high-priority ones. Declare the mode as an input, and write each value that changes as an expression on it:
inputs:
mode:
type: string
enum: [fast, deep]
default: fast
timeout: "${{ inputs.mode == 'deep' ? '45m' : '15m' }}"
model:
name: claude-sonnet-5
thinking: "${{ inputs.mode == 'deep' ? 'high' : 'low' }}"
limits:
model_requests: "${{ inputs.mode == 'deep' ? 400 : 100 }}"
instructions: ./instructions.md
skills:
- skills:incident-triage
- "${{ inputs.mode == 'deep' ? 'skills:change-correlation' : nil }}"
subagents:
verifier: "${{ inputs.mode == 'deep' ? {'agent': './agents:verifier', 'description': 'Checks the root cause.'} : nil }}"
Before the run starts, the platform fills in every expression, then checks the result as it checks any agent.yaml.
-
A value that is one expression keeps its type.
"${{ inputs.mode == 'deep' ? 400 : 100 }}"gives the number 400. An expression inside longer text fills in text:"skills:${{ inputs.team }}-runbook". -
nilremoves the entry. A list entry, a setting or a whole block that givesnilis removed. When every setting in a block is removed, the block is removed too. A removed setting takes its default: a removedmemoryleaves memory on. -
An emptied list stays empty. If every entry in
skillsgivesnil,skillsis[], and the agent gets no skills. -
A tool filter that gives
nilis an error. A removed filter would mean every tool, so the platform does not remove it. To allow every tool of the group in one mode, give the texttrue:YAMLsystem_tools: >-
${{ inputs.mode == 'deep' ? 'true' : 'operation_type == "read"' }} -
Only inputs with a fixed set of values can change the agent. These expressions can read an input with an
enum, abooleaninput, or a number input. They cannot read a text input such as the prompt. Text reaches the model in its first message, never in the instructions, a tool filter or a skill name. -
Some fields never change.
apiVersion,name,description,icon,labelsandinputsstay as written, and a key is never an expression. -
A step can depend on the mode too. A step whose expression gives
nilis not part of the run. A step that comesafterit must exist in every mode. -
More than two values. Use a ternary inside a ternary, or a map used as a lookup:
"${{ {'fast': 100, 'medium': 200, 'deep': 400}[inputs.mode] }}". A value that is not in the map givesnil, so the setting takes its default.
Choose the mode for a run
The mode is an ordinary input, so everything that starts a run can set it:
-
The run form. An input with an
enumshows as a choice beside the prompt. It starts at its default. -
The CLI.
autoheal run investigation "Investigate INC0012345" --arg mode='"deep"'. The value is JSON, so a text value has its own quotes. -
A trigger. The trigger's
withcan compute the mode from the event:YAMLrun:
agent: agents:investigation
with:
prompt: "Investigate ServiceNow incident ${{ event.data.incident.number.value }}"
mode: "${{ event.data.incident.priority.value in ['1', '2'] ? 'deep' : 'fast' }}" -
A parent agent's step. An agent step passes the mode in its
with:mode: "${{ inputs.mode }}".
A value that is not in the enum stops the run before it starts.
Instructions that change with the inputs
Instruction text, inline or in an instructions file, can hold expressions. It can also hold blocks that only some modes see:
## How far to go
${{ if inputs.mode == 'deep' }}
This is a deep investigation. Rule out at least two other causes before you commit to one.
${{ else }}
This is a fast investigation. Stop at the first cause that the evidence confirms.
${{ end }}
A block starts with ${{ if … }}, can have ${{ else if … }} and ${{ else }} parts, and ends with ${{ end }}. Blocks can be inside other blocks. A line that holds only a block tag is removed, so a block leaves no blank lines. To write ${{ itself, write ${{ '${{' }}.
The instructions can also come from a different file in each mode: instructions: "${{ inputs.mode == 'deep' ? './deep.md' : './fast.md' }}".
A conversation keeps its mode
Follow-up messages, resumed runs and inline subagents use the inputs of the run that started the conversation. A Deep investigation stays Deep when you send it a follow-up. A follow-up sends only its message, so it cannot change the mode. To run in another mode, start a new run.
An inline subagent is defined in its caller's agent.yaml, so it runs in its caller's mode. A subagent that is another agent fills in its own file with the inputs its caller passes.
See what a run ran
The run page shows each run's agent as that run ran it: its own commit, filled in with the inputs that started its conversation. A step that only another mode has is not shown.
The Limits card in the run's details shows each limit beside what the run used, subagents included:
| Row | Shows |
|---|---|
| Time limit | The run's timeout, or Default |
| Model requests | Requests used, of model_requests or of the default |
| New tokens | New tokens used, of the tokens target |
| Cost | Spend, of the cost_usd target |
If the commit now fills in differently than it did when the run started, the card says so.
The agent's Overview shows only its description. Its model, limits, steps and instructions can change with each run's inputs, so the run page shows them for each run.
Every mode is checked when you push
When you push a new version, the platform fills in the file once for each mode: each combination of the enum and boolean inputs that the expressions read. An error names the mode, for example With mode=deep: model "claude-opsu-5" is not one of the models this deployment offers. Until you fix it, the agent cannot run. A warning does not stop runs. You get a warning when a tool filter keeps no tool in a mode, when instructions are empty in a mode, and when returns has a different shape in different modes.
The editor in the app checks each value as written. It can mark an expression in a field that takes a number or a fixed word, such as model_requests or thinking, as an error. Push or autoheal agents validate fill in every mode first and give the result that counts.
Errors in what the agent uses also stop new runs
An error in anything the agent uses also stops a new run: a skill, subagent, eval or artifact template with an error, or a reference that names nothing. This applies to runs from the app, the CLI, the API, triggers and benchmarks. The error names the file and the reason, for example The Agent cannot run: agents/oncall/evals/smoke.yaml: not valid YAML: …. A run that already started, and a paused run that resumes, keep going. An agent shared from another project is checked each time a running agent calls it, so an error in that agent refuses the call. autoheal agents show <agent> lists each of these errors.
Inputs
You can declare inputs. A trigger or caller can pass structured values. The trigger or caller does not need to pass only a single prompt:
inputs:
service:
type: string
description: The service the alert fired on
required: true
lookback_minutes:
type: integer
default: 60
dry_run:
type: boolean
default: false
mode:
type: string
enum: [fast, deep]
default: fast
Supported types: string, number, integer, boolean, object, array. An input is optional. To make it required, set required: true.
To allow only some values, list them in enum. Each value must have the input's type. The default must be one of the values. A run with a different value fails before it starts. When you start a run in the UI, two or three values show side by side, and four or more show as a menu.
In the UI, an optional input that you type (text, a number, a list or an object) is under N more options.
When an agent has several inputs, or takes an object or list, choose Paste inputs to fill the form from one JSON or YAML object. The values appear in the usual typed controls so you can review or adjust them before you choose Start run.
An enum, boolean or number input can also change how the agent is set up: its model, limits, instructions, skills and subagents. See Values that change with the inputs. A text input reaches the model in its first message, and the step-time fields (with, when, if, while, code, env, outputs) can read it.
Structured results
By default, an agent answers in text. Add returns when something downstream needs fields it can read.
returns shapes the run's result. A follow-up message in the run's chat (autoheal runs send, or the chat box on the run page) answers in text, even when the step it continues has returns.
You can use returns in two ways:
- A single type:
returns: string[]orreturns: number - A field map:
returns: {verdict: string, confidence: number}
Single-value returns
When an agent returns a simple value, use the type directly:
returns: string[] # an array of strings
returns: number # a single number
Supported types: string, number, integer, boolean, object. Add [] for arrays.
Field map
When the result has multiple fields:
returns:
verdict:
type: string
enum: [incident, noise, needs_human]
required: true
confidence: {type: number, minimum: 0, maximum: 1, required: true}
summary: string
affected_services: string[] # [] makes it an array
Each field can be a type shorthand or a JSON Schema fragment:
- Shorthand:
string,number,integer,boolean,object. Add[]for an array (string[]). Shorthand fields are optional by default. - Explicit (fragment): A JSON Schema object. You can set
enum,minimum,description, and more. Addrequired: trueto make the field required. Without that flag, the field is optional.
Field names must be snake_case.
Nested objects and arrays
Nested fields follow the same rule. Each field sets its own required: true. Do not use JSON Schema's required: [a, b] list. Validation rejects it.
returns:
owner:
type: object
required: true
properties:
team: {type: string, required: true}
oncall: string # optional
risks:
type: array
items:
type: object
properties:
risk: {type: string, required: true}
evidence: string # optional
For an array, mark the array field itself (risks above). Do not mark the items. Validation rejects an items field with a required flag.
Timeout and limits
Timeout
timeout sets the time limit for the agent or a step. The run stops when it reaches the timeout.
apiVersion: agents.autoheal.ai/v1
name: Alert Triage
timeout: 10m # agent timeout, at most 1h
instructions: ...
For multi-step agents, you can give each step its own timeout:
timeout: 15m # whole agent timeout
steps:
probe:
runtime: python
code: ...
timeout: 30s # this step must finish in 30s
triage:
instructions: Analyze the results
timeout: 5m # this step must finish in 5m
An LLM step without a timeout uses the agent's timeout. A tool or agent step without a timeout uses the default of that tool or agent. A code step without a timeout stops after 3 minutes. A step's timeout cannot be longer than the agent's timeout.
Default: 10m. Maximum: 1h.
Limits (LLM steps only)
The limits block sets cost and request limits. You can use it only for LLM steps. Before each request, the model sees what it has used, with or without limits.
# Single-LLM agent
apiVersion: agents.autoheal.ai/v1
name: Triage
timeout: 10m
limits:
cost_usd: 2 # advisory: a target of $2, does not stop the run
tokens: 200000 # advisory: a target of 200k tokens, does not stop the run
model_requests: 50 # hard stop: fail at the 51st request
instructions: ...
# LLM step in a multi-step agent
steps:
triage:
instructions: Analyze and triage
timeout: 5m
limits:
cost_usd: 1
model_requests: 30
| Field | Type | Meaning |
|---|---|---|
cost_usd | Advisory | Target spend in USD at list price. This includes subagents. The model sees what it has used. The limit does not stop the run. |
tokens | Advisory | Target tokens (input minus cache reads, plus output). This includes subagents. The model sees what it has used. The limit does not stop the run. |
model_requests | Hard stop | Number of model requests the step can make. The run fails when the next request would exceed this limit. Range: 1–1000. Default: 300. |
A turn that reports finished work: when work that a tool call started finishes, for example a run_benchmark execution, Autoheal continues the agent's chat with a turn that says so. That turn's budget carries on from the turns before it, back to the last message a person sent or the run's first turn. Their cost and tokens count toward cost_usd and tokens, and so does the cost of the finished work they report, but not its tokens.
Time target: The model sees a time target before its hard timeout. The hard timeout of the model's run is the step's timeout. It is never more than the time the agent has left minus 60s, which the agent keeps to finish after the step. The platform computes the time target as hard timeout − buffer. The buffer is 10% of the hard timeout (at least 30s). The time target is never less than half the hard timeout. This gives the model room to finish before the hard timeout.
For a single-LLM agent with timeout: 10m, the hard timeout is about 9m and the time target is about 8m6s. For timeout: 2m, the hard timeout is about 1m and the time target is 30s.
timeout and each key of limits can change with the inputs, so a Fast run can have less time and fewer model requests than a Deep one. See Values that change with the inputs. timeout and model_requests are the hard bounds in each mode: tokens and cost_usd only pace the model. The run page shows each limit beside what the run used.
Tools and integrations
Two fields decide which tools the agent can call:
| Field | Chooses among |
|---|---|
system_tools | Autoheal's own tools, such as get_alert_group, list_alert_groups, create_artifact, git_commit and ask_user_input |
integration_tools | The tools of the project's connected integrations, such as datadog_search_logs |
Each field is one filter: an expression that the platform checks once for each tool of its group. The agent keeps a tool when the expression is true for it.
# Reads, plus saving findings as an artifact. Never stops to ask a person.
system_tools: |
(operation_type == "read" || name == "create_artifact")
&& name != "ask_user_input"
# Read-only, on Datadog and GitHub only.
integration_tools: |
integration_type in ["datadog", "github"]
&& operation_type == "read"
Context compaction
On a long run the model's context keeps growing, because every tool result stays in it. Once a request's input passes 60% of the model's context window (at most 600,000 tokens, and 172,000 on GPT models with a 400,000-token window, which take at most 272,000 tokens of input), the model summarizes the conversation so far and carries on from the summary. The transcript keeps every message, and a Context compacted divider marks the point. For Claude you can open the summary there.
Compaction is on by default for Claude 4.6 and later, and for GPT through OpenAI or Azure OpenAI. Nothing else compacts yet: not Claude Sonnet 4.5, Opus 4.5 or Haiku 4.5, not GPT on Amazon Bedrock, and no model on an installation that sends its model traffic through a gateway.
compaction:
token_threshold: 100000 # compact sooner; at least 50000
compaction: false # never compact this agent
compaction works at the top of an agent and on an LLM step.
Write a tool filter
A filter can test these properties of a tool:
| Property | In system_tools | In integration_tools | Values |
|---|---|---|---|
name | Yes | Yes | The tool's name, for example create_artifact or datadog_search_logs |
operation_type | Yes | Yes | read or write |
integration_type | No | Yes | The integration, for example github, datadog, pagerduty, slack |
integration_type and operation_type describe the tool's own integration only. A few tools also call a second one, for example Okta's okta_temp_password_slack_dm also sends a Slack DM, and a filter does not see that second integration: integration_type != "slack" still keeps the tool. To leave such a tool out, name it (name != "okta_temp_password_slack_dm"). Governance policies do check every integration a call uses.
A filter is written in the same language as ${{ }} expressions, without the ${{ }}. Every operator works: ==, !=, in, not in, startsWith, contains, matches, &&, ||, ! and the rest, and so do the built-in functions and let.
- The result must be true or false.
namealone is an error. nowis not available. A filter keeps the same tools every time it is checked.- Write
"false"with quotes for no tools. Without quotes, YAML readsfalseas a boolean, and the push fails."true"is the same as leaving the field out. - Use a block (
|) for a long filter, and for a filter that starts with!.
In the agent.yaml editor, a filter gets suggestions as you type (the properties its field can test, the operators, and after name ==, name in [, operation_type == or integration_type ==, the values that property takes in the project), and Insert → Set system_tools or Set integration_tools adds a ready-made filter to the step at the cursor.
Common patterns:
# Read anything, write nothing
system_tools: operation_type == "read"
integration_tools: operation_type == "read"
# Read Datadog and GitHub, and post to Slack
integration_tools: |
(integration_type in ["datadog", "github"] && operation_type == "read")
|| (integration_type == "slack" && operation_type == "write")
# Every Datadog tool except muting and unmuting monitors
integration_tools: |
integration_type == "datadog"
&& name not in ["datadog_mute_monitor", "datadog_unmute_monitor"]
# No integration tools at all
integration_tools: "false"
Settings → Tools lists every tool an agent in the project can use: system tools, the tools of each integration, active or not, and the core tools such as search_memory, read_instructions and load_skill. Sort the table by tool or category, and open a tool to see what it does, its parameters and, where it declares it, what it returns. In the agent.yaml editor, See all tools in the status bar opens the page. Use the names of system and integration tools in your filters. The core tools are always available, and a filter cannot name them.
What the agent can call
- A field you leave out allows every tool of its group. That includes tools that Autoheal adds later. An agent with neither field can call every system tool, write tools such as
git_commit,update_artifact,delete_artifactandcreate_oncall_page(which pages people) included, and every tool of every connected integration. For an agent that only reads, writesystem_tools: operation_type == "read"andintegration_tools: operation_type == "read". - An agent that a trigger starts may have nobody to answer it. A question from
ask_user_inputpauses the run until someone answers it. To stop such an agent from asking, wrapsystem_toolsin parentheses and add&& name != "ask_user_input", as in(operation_type == "read" || name == "create_artifact") && name != "ask_user_input". Without the parentheses,&&binds tighter than||, so a filter with||still keepsask_user_input. - The filter is final. No other field adds back a tool that a filter removes. For example,
artifactsgives the agent a tool for each template, but the agent can create an artifact only ifsystem_toolskeepscreate_artifact. - The agent sees only the tools its filters keep. The platform refuses a call to any other tool.
- A subagent is also limited by its caller. It can use a tool only if its own filters and the filters of the agent that calls it keep the tool. This limits the tools a subagent's model chooses. A tool step written in a subagent's
stepsis not limited by the caller's filters. - Your organization decides which system tools exist. For example, the on-call tools exist only when On-Call is enabled for your organization. An integration tool exists only when its integration is connected in the agent's project.
- Some tools have no filter. The shell, skills, memory, the to-do list and the current time are always available. The
skillsfield chooses the skills, andsubagentschooses the agents the agent can call. - Tool names are snake_case, like Python functions. Tools had dashed names before October 2026, such as
create-artifactanddatadog-search-logs. Atoolstep, or a filter written with the old dashed names, keeps working however it writes them. Push warns about each dash in a filter, so you can write the new name, such ascreate_artifact. The dash of a regex range, as in[a-z], is not part of a name, and push does not warn about it.
A filter chooses tools by integration type (like github), not by connection. The run can use every active connection of that type in its project.
The shell is not limited by tool filters
The agent runs in a sandbox with the credentials of every active integration in the project. Its shell (bash) uses these CLI connections, and tool filters do not limit it. A filter such as integration_tools: operation_type == "read" does not stop a shell command from writing to a system that one of these credentials reaches. Say in the agent's instructions what it must never change.
A new sandbox starts with no repositories. The agent clones every repository with git_clone, into /workspace/git-repos/<host>__<owner>__<repo>@<agent> (each agent gets its own clone, and the tool returns the folder), and brings it up to date with git_pull. It names a repository by its full name or its https URL. A repository that is not in the project's catalog yet is cloned with your integration for its host, so a new private repository works before the next import; one on a host none of your integrations serves must be public. Tool filters do not limit these two tools either. git stays signed in for your connected GitHub, GitLab, Bitbucket and Azure DevOps integrations, so the agent can push. Autoheal manages the sandbox's image, CPU, memory and network.
Governance policies can require a person's approval before matching calls run, for example every write to PagerDuty. A policy applies to every agent, whatever its tool filters say. Policies match on the integration that a call touches, so they do not apply to system tools.
Checks when you push
When you push, the platform checks each filter in every mode:
| What you wrote | Result |
|---|---|
A property that does not exist, such as categry, or integration_type in system_tools | Error. The message lists the properties the field can test. |
A tool name, compared with ==, !=, in or not in, that no tool of the group has | Error |
An operation_type or integration_type value that does not exist, such as readonly | Error |
A name inside startsWith, contains or matches | Not checked |
| A filter that keeps no tool | Warning. Write "false" if that is what you mean. |
artifacts with templates, and a system_tools filter that removes create_artifact | Warning. The agent cannot create the templates. |
false without quotes, "", or a list | Error |
tools | Error. See Move from tools. |
The name check uses every tool that Autoheal has, so a tool that is turned off for your organization, or whose integration is not connected in the project, passes the check. autoheal agents tools shows it as not available, with the reason.
See the tools an agent gets
autoheal agents tools <agent> shows the tools a run of one version of the agent gets, and the reason for each tool it does not get:
$ autoheal agents tools checkout-triage
checkout-triage @ 4f2a9c1
SYSTEM TOOLS system_tools: (operation_type == "read" || name == "create_artifact") && name != "ask_user_input"
STATUS TOOL ACCESS WHY
available create_artifact write
available get_alert_group read
not available ask_user_input read Removed by system_tools in agent.yaml
not available update_artifact write Removed by system_tools in agent.yaml
INTEGRATION TOOLS integration_tools: integration_type in ["datadog", "github"] && operation_type == "read"
STATUS TOOL ACCESS WHY
available datadog_search_logs read
not available github_create_issue write Removed by integration_tools in agent.yaml
... 87 more with no connection in this project: confluence, gitlab, sentry (--all lists them)
Always available: shell (uses this project's CLI connections; tool filters do not limit it), skills, memory, to-do list, current time
With a code repository integration connected: git_clone and git_pull, beside the shell (tool filters do not limit them either)
The sample is shortened. Each group lists its available tools first, then the others with the reason. Tools whose integration has no connection in the project are counted on one line that names those integrations: --all lists them, and --json prints the whole answer. In the agent editor, Agent's tools at the bottom, beside See all tools, opens the same list for the version committed on the branch: it folds them the same way, and its search box finds a folded tool by name. autoheal agents push prints the tools that the new version adds or removes.
Context Graph tools
The Context Graph tools are system tools. system_tools gives them to the agent:
| Tool | Kind | What it does |
|---|---|---|
context_graph_list_blueprints | read | Lists the entity types, with their properties and relations |
context_graph_get_blueprint | read | Gets one entity type in full |
context_graph_get_entity | read | Gets one entity: properties, labels, relations and sources |
context_graph_list_entities | read | Finds entities by type, text, labels, property values and relations |
context_graph_get_neighborhood | read | Gets the resources around an entity, such as the skills labelled with it |
context_graph_write | write | Creates or updates entities |
context_graph_delete_entities | write | Deletes entities. The agent must list the blueprints in writable_blueprints |
context_graph_write changes only what you send. Properties are merged, and null removes a property. Labels are merged per key, and [] removes a key. Each relation key that you send gets exactly the targets that you send. You can write properties that the blueprint does not declare, such as maturity_score, and filter on them.
The optional context_graph field narrows what the agent can read and write:
system_tools: operation_type == "read" || name == "context_graph_write"
context_graph:
blueprints: [service, team] # The agent can read only these. Omit for all.
relation_keys: [owner] # The agent can see and follow only these relations. Omit for all.
writable_blueprints: [service] # The agent can write only these. Omit for none.
context_graph: {}lets the agent read everything and write nothing.- Each writable blueprint must also be readable.
- A run that a person starts can write only what that person can write.
- A run that a trigger, Slack or a benchmark starts can write only the blueprints in
writable_blueprints. If the agent has nocontext_graphfield, the run cannot write.
Move from tools
The tools field was removed. An agent.yaml that has it fails the push with the error tools was removed. Write system_tools and integration_tools instead; the agent docs list the filter for each old rule. A version that was pushed earlier with tools does not run. Write these filters instead:
| Written before | Write now |
|---|---|
tools: [{operation_type: read}] | system_tools: operation_type == "read" and integration_tools: operation_type == "read". This also keeps four artifact read tools the old rule did not reach: list_artifacts, get_artifact, get_artifact_url and list_artifact_versions. To keep the exact old set, add && name not in ["list_artifacts", "get_artifact", "get_artifact_url", "list_artifact_versions"] |
tools: [] | system_tools: operation_type == "read" and integration_tools: "false" |
A rule {integration_type: X, operation_type: Y} | (integration_type == "X" && operation_type == "Y") in integration_tools, with the rules joined with || |
A rule {name: N} or {source: builtin, name: N} | || name == "N" in the field for the group that N belongs to |
A rule with category: platform | The names of the system tools it matched, such as name in ["get_alert_group", "list_alert_groups"] |
A rule with an integration or resource key | Nothing. These rules matched no tool, so the agent never had those tools. Drop the rule. Do not rewrite integration as integration_type: that gives the agent tools it did not have |
| Any other rule that matches no tool | Nothing. Drop the rule |
artifacts | Add || name in ["create_artifact", "update_artifact"] to system_tools |
enterprise_context | Rename the field to context_graph. If it has writable_blueprints, add || name in ["context_graph_write", "context_graph_delete_entities"] to system_tools |
A rule with one key becomes one comparison, such as integration_type == "github". For example:
# Before
tools:
- operation_type: read
- {integration_type: pagerduty, operation_type: write}
artifacts: [report]
# Now
system_tools: operation_type == "read" || name in ["create_artifact", "update_artifact"]
integration_tools: |
operation_type == "read"
|| (integration_type == "pagerduty" && operation_type == "write")
artifacts: [report]
An agent that had no tools field now gets every system tool, write tools included. To keep it to reading, write system_tools: operation_type == "read".
Skills
A skill is a Markdown playbook. The agent loads it only when the agent decides it is relevant. This keeps long runbooks out of the prompt until the agent needs them. See Skills.
skills:
- skills:co-firing-correlation # loads skills/co-firing-correlation/SKILL.md
- ./skills:local-runbook # a skills/ folder inside this agent's folder
What the agent is offered depends on how you write skills:
skills | The agent is offered |
|---|---|
| Left out | Every skill in the project's skills/ folder, plus every skill in this agent's own skills/ folder. A skill with errors is left out; if it's one of the agent's own, the agent shows a warning naming it. |
[] | No skills. |
| A list | Exactly the skills listed. A listed skill with errors is still offered; when the agent loads it, it also sees the problems. |
Skills are read at the commit the run uses, so a run on a branch sees that branch's skill edits. An agent that leaves skills out depends on every project skill, so editing any of them gives the agent a new version.
In an agent with several LLM steps, each step has its own skills, with the same rules. Its own skills folder is the agent's skills/ folder.
If a project skill and one of this agent's own skills have the same name, the agent is offered both: skills:triage and ./skills:triage.
A skill is a SKILL.md file with name and description front matter. To write one in the agent's folder and push it with the agent, see Write a skill as a file.
The agent sees each skill it is offered as one line: the skill's reference, its labels and its description. Labels help the agent tell similar skills apart, such as two teams' runbooks for the same alert. Set them in the skill's SKILL.md:
---
name: Alert triage
description: How to triage a new alert
labels:
- team: payments
- env: prod
- env: staging
---
For skills/triage/SKILL.md, the agent then sees - skills:triage [env: prod, staging, team: payments]: How to triage a new alert, with label keys in alphabetical order. Each label is one - key: value item, and a key can repeat. Keys and values are lowercased. A label that is not valid is left out with a warning, and the skill keeps its other labels. A skill without labels has no brackets. Every offered skill is listed with its whole description, so keep descriptions short. To add a label from a skill's page, click Add labels: the editor opens its SKILL.md with a new - item under the labels (adding labels: if there is none) and suggests the label keys. The line goes into your draft like any edit; commit it when you're done, or discard the draft. An empty labels: counts as no labels.
A skill can be in some modes only, and a skill name can come from an enum input. A run is offered the skills its list names in that run's mode:
skills:
- skills:incident-triage
- "${{ inputs.mode == 'deep' ? 'skills:change-correlation' : nil }}" # Deep only
- "skills:${{ inputs.service }}-runbook" # one per service
When you push, the platform checks the skills of every mode. A skill that does not exist is reported with its mode.
Subagents
An agent can call other agents as tools. Each key becomes a tool. The tool is named invoke_<key>.
Referencing existing agents
subagents:
investigate_hypothesis:
agent: ./agents:hypothesis-investigator
description: Investigates one candidate cause and returns evidence
summarizer:
agent: agents:incident-summarizer
description: Summarizes findings into a brief report
Agent references come in three forms:
| Reference | Points to |
|---|---|
agents:incident-summarizer | agents/incident-summarizer/ at the project root |
./agents:hypothesis-investigator | A private child inside this agent's folder: agents/<this-agent>/agents/hypothesis-investigator/ |
../agents:verifier | A sibling of this agent |
Add a description when the model needs it. The description helps the model decide when to call the subagent. Keys must be snake_case.
The tool takes the inputs the referenced agent declares in its own agent.yaml, with their types, descriptions and allowed values, and a prompt when that agent is one LLM step. The model must pass each input that is required and has no default. An agent that declares no inputs takes only a prompt.
Inline subagents
You can also define a subagent directly in the parent's agent.yaml:
subagents:
formatter:
description: Formats the incident summary for posting to Slack
instructions: |
Format the incident summary as a Slack message with:
- Severity emoji (🔴 sev1, 🟡 sev2, 🟢 sev3)
- Root cause in bold
- Proposed mitigation as a bulleted list
model: claude-haiku-4-5
returns: string
Inline subagents must have description and instructions. They can have model, system_tools, integration_tools, skills, artifacts, returns. They cannot have their own subagents (no nesting). A subagent can use only the tools that both its own filters and its caller's filters keep. A tool step written in a subagent's steps is not limited by the caller's filters.
Inline subagents resolve instruction files and skills relative to the parent's agent.yaml. They run at the parent's Git version, in the parent's mode.
To have a subagent in some modes only, write the whole entry as one expression that gives nil in the other modes:
subagents:
checker: "${{ inputs.mode == 'deep' ? {'description': 'Checks a draft answer.', 'instructions': 'Reply VERIFIED, or say what is wrong.'} : nil }}"
When every entry gives nil, subagents is removed and the agent has no subagents.
Concurrent subagent calls
One run can have at most 4 subagent calls in progress at the same time. The platform refuses a fifth call immediately with SubagentConcurrencyError. The refused call costs nothing, and the model can send it again after an earlier call returns. You cannot change this limit in agent.yaml.
If your instructions tell the model to call a subagent once per item, also tell it to send at most 4 calls at a time, and to send a refused call again.
Evals
An eval scores the agent's runs. Attach evals with the evals field:
evals:
- builtin/evals:user-follow-up # a platform eval
- evals:evidence-quality # the project's evals/evidence-quality.yaml
- ./evals:fix-accuracy # evals/fix-accuracy.yaml in this agent's folder
- {eval: evals:tone, auto: false} # score runs only by hand
Use builtin/evals:<id> for a published platform eval. Each score uses the content
deployed now and records its digest, with no eval commit. Re-scoring, reuse and
benchmarks select current builtin content; a prepared request keeps its definition
through retries. Project commits do not pin builtins. A project agent extending a
builtin also carries its private evals. Copy a root builtin eval into your project
to customize it as an ordinary project eval.
References use the same form as skills. evals:<slug> points to evals/<slug>.yaml at the project root. ./evals:<slug> points to evals/<slug>.yaml inside the agent's folder. The platform scores a run automatically after the run goes quiet. With auto: false, it scores a run only when a person asks for it.
An eval can be in some modes only, written as for a skill ("${{ inputs.mode == 'deep' ? 'evals:evidence-depth' : nil }}"). A run is scored by the evals of its own mode.
Evals in an agent with steps
Each LLM step runs in its own conversation, and each step's evals score that step only. A workflow agent cannot have a top-level evals field: put evals on each LLM step that needs them.
steps:
draft:
instructions: Draft the incident summary.
evals: [evals:evidence-quality]
polish:
instructions: Tighten the summary.
with:
prompt: ${{ steps.draft.output }}
evals: [evals:evidence-quality, ./evals:tone]
Here a run gets three scores: evidence-quality for draft, and evidence-quality and tone for polish. Each step is scored on its own, 10 minutes after its conversation goes quiet, so the first steps of a long run can be scored before the run ends. A step that succeeded is scored even when a later step fails. A step inside a while loop is scored once per iteration: the Scores table lists every iteration, and the Evals page's cards count each run's last iteration. In a loop inside a loop, iterations are numbered within the inner loop, so the results keep only the last outer pass. The agent's Evals page groups the scores by step, under each step's name.
An agent that a step calls (agent:), or a subagent, is not scored with its own evals as part of this run.
Score on a run page, and benchmarks, score one conversation, so they work only for a single-LLM agent (top-level instructions), or an agent whose steps has exactly one step, which is an LLM step.
Eval file
An eval is a YAML file. The file name is the identifier: evidence-quality.yaml is evals:evidence-quality. Put the file in the agent's evals/ folder and push it with the agent:
agents/
dependency-ranker/
agent.yaml
evals/
evidence-quality.yaml
name: Evidence quality
description: Checks that each ranked fix is backed by the scan.
type: llm_judge
sampling:
rate: 1 # 0 scores no runs automatically, 1 scores every run
rubrics:
- name: cites_advisory
prompt: Does every ranked package name an advisory ID from the scan?
scoring:
type: boolean
- name: fix_accuracy
prompt: What share of the fix versions match the advisories, from 0 to 1?
scoring:
type: numeric
- name: overall
prompt: How would a security reviewer rate the ranking?
scoring:
type: categorical
labels: [poor, acceptable, good]
| Field | Required | Description |
|---|---|---|
name | Yes | Display name. You can change it without changing the identifier. |
type | Yes | llm_judge: an LLM answers each rubric question about the run and writes its reasoning. decision_judge: a decision model answers each boolean or categorical rubric with a label and no reasoning; it is faster and cheaper, takes no model, and never reads the run's artifacts. See Who evaluates. The other value, script, runs code that Autoheal provides. You cannot write your own script evals. judge and decision, the old names of llm_judge and decision_judge, still work, with a warning. |
description | No | What the eval checks. |
looks_for | No | Judge only runs that contain these actions. tools lists tool names. bash lists text that a bash command contains. A run with none of them scores not_applicable, and no model is asked. |
sampling | No | For llm_judge and decision_judge evals only. rate is the share of runs to score automatically, from 0 to 1. Use rate: 1 while you test the eval. Scoring by hand ignores it, and a script eval scores every run whatever sampling says. To stop a script eval from scoring automatically, attach it with auto: false. |
model | No | llm_judge only. The judge model, written the same way as an agent's model, for example claude-sonnet-5. If your deployment doesn't offer that model, the push shows an error that lists the models it does offer. If you do not set model, your deployment's default judge model is used. A self-hosted deployment has no default until its operator sets one, so set model there. If it offers no model names, write a <provider>:<model-id> reference, such as bedrock:us.anthropic.claude-sonnet-4-6. |
applies_to | No | An artifact template slug. A run without a matching artifact scores not_applicable. |
rubrics | Yes | At least one question. Each rubric has name, prompt and scoring. |
Each rubric:
namemust be a valid Python identifier (for examplecites_advisory), unique in the eval.promptis the question the judge answers about the run.scoring.typeis one of:boolean: true or false. Write the question so that true is the good answer (cites_sources, notmissing_sources).numeric: a score from 0 to 1.categorical: one value fromlabels.
An inline subagent has its own skills list, with the same rules as above. Its own skills folder is the parent's skills/ folder. It does not get the skills that the parent lists.
How references work
You have now seen agents, skills, subagents and evals. Here is how they reference each other:
your-project/
├── agents/
│ ├── pr-summarizer/
│ │ └── agent.yaml
│ ├── incident-triage/
│ │ └── agent.yaml
│ └── deployment-analyzer/
│ └── agent.yaml
└── skills/
├── kubernetes-debug/
│ └── SKILL.md
└── database-queries/
└ ── SKILL.md
The folder name becomes the identifier:
agents/pr-summarizer/→agents:pr-summarizerskills/kubernetes-debug/→skills:kubernetes-debug
Where you use them:
- Triggers:
run.agent: agents:pr-summarizer - Steps:
agent: agents:incident-triage - Subagents:
agent: agents:deployment-analyzer - Skills:
skills: [skills:kubernetes-debug] - Evals:
evals: [evals:evidence-quality](the fileevals/evidence-quality.yaml)
Rules:
- Use the folder name (for an eval, the file name). Do not use the
namefield in the YAML. - Always use the prefix
agents:,skills:orevals:. - Paths are relative to your Git repository root.
Trigger reference
A trigger starts an agent run when an event occurs. Triggers are separate from agents. One agent can have many triggers.
apiVersion: triggers.autoheal.ai/v1 # required
name: Investigate critical alert groups # required
on: # required: one event, plus filters
alertgroup.created:
- status: firing
- severity: critical
run: # required: which agent to start
agent: agents:alert-triage
branch: main # optional, defaults to the project's default branch
with: # the agent's inputs
prompt: "Triage ${{ event.data.title }}"
limits: # optional
max_con: 2
rate_per_min: 10
Create triggers on the Triggers page or use the Autoheal CLI.
Trigger fields
| Field | Required | What it does |
|---|---|---|
apiVersion | yes | Always triggers.autoheal.ai/v1. |
name | yes | Display name for the trigger. Shown in trigger lists and run history. |
on | yes | Which event fires the trigger and what filters must match. Exactly one event type, with a list of filters. See Events and Filters. |
run | yes | Which agent to start, and which Git branch or commit to load it from. See Which agent to run. |
with | yes | The inputs to pass to the agent. Must include prompt. Can reference event data with ${{ event.data.<path> }} expressions. See Passing event data to the agent. |
limits | no | Rate limiting: max_con (max concurrent runs) and rate_per_min (max new runs per minute). Events over limit are dropped, not queued. See Limits. |
Events
on names exactly one event type.
| Event | When it fires |
|---|---|
alertgroup.created | A new alert group is created from your alert sources |
github.<event> | A webhook from a connected GitHub integration, for example github.pull_request, github.push, github.release, github.issues, github.check_run, github.workflow_run, github.security_advisory. Any GitHub webhook event name works. |
servicenow.incident_created, servicenow.incident_updated | An incident is created or changed in a connected ServiceNow instance |
slack.app_mention | A message @-mentions the Autoheal Slack app, in a channel or a thread |
slack.message | A message is posted in a channel, private channel or direct message that the Autoheal Slack app can read, including other bots' posts such as alerts |
The Triggers page lists every available event with their fields.
Useful fields on alertgroup.created:
| Field | Example |
|---|---|
status | firing, resolved |
severity | critical, high, medium, low |
title | High error rate on checkout-api |
alert_count | 4 |
group_labels | {alertname: HighErrorRate, service: checkout-api} |
alert_payload.common | Labels and annotations every alert in the group shares |
alert_payload.members | Each alert in the group |
GitHub events carry the standard GitHub webhook payload, for example action, repository.full_name, pull_request.number and pull_request.base.ref.
Set up the GitHub webhook
A github.<event> trigger fires only when a repository or organization webhook sends that event to your GitHub integration. GitHub's default for a new webhook is the push event alone, so a trigger on github.dependabot_alert or github.pull_request stays silent until the webhook sends that event too.
autoheal triggers show <trigger> (and create and update) prints what the webhook needs, for each GitHub integration the trigger can receive events from:
| Setting | Value |
|---|---|
| Payload URL | The integration's webhook URL. You need integration:read on the project to see it. |
| Content type | application/json |
| Secret | The integration's webhook signing secret, on the integration's page |
| Events | The trigger's event, for example dependabot_alert for github.dependabot_alert |
It also warns about an integration the event has never arrived on. The trigger's Overview page shows the same as a GitHub webhook card.
To create the webhook from the CLI with the integration's own token, run the command triggers show prints:
autoheal integrations webhook install <integration-id> -f repo=acme/payments -f 'events=["dependabot_alert"]'
Use -f org=acme instead of repo for an organization webhook. If a webhook with that Payload URL is already there, the events are added to it. The token must be able to manage webhooks: admin:repo_hook or admin:org_hook for a personal access token, or the Webhooks permission with write access for the GitHub App.
Each delivery updates the integration's Last event time and appears on the connection's Events tab, with the GitHub event name and delivery ID.
Filters
Each event has a list of filters. All filters must match. Paths are read from the event's data. Use dots for nesting.
on:
github.pull_request:
- integration_name: github-engineering # only this GitHub connection
- repository.full_name: acme/payments # equals
- pull_request.base.ref: main
- anyOf: # at least one must match
- action: opened
- action: synchronize
| Filter | Meaning |
|---|---|
path: value | Equals |
path: {equals: value} / {not_equals: value} | Equals / does not equal |
path: {matches: "regex"} / {not_matches: "regex"} | Matches a regular expression (up to 1,024 characters) |
path: {contains: value} | The text or list contains the value |
path: {exists: true} / {exists: false} | The field is present / absent |
path: {greater_than: n}, greater_than_or_equals, less_than, less_than_or_equals | Number comparisons |
anyOf: [filter, filter, ...] | At least one of two or more filters matches. Allowed once per trigger, and cannot be nested. |
integration_name: name | Only events from this integration connection, which must be installed and enabled in the project. Allowed once, and only for integration events such as GitHub. |
path[*].field: value | Matches if any item in a list matches, for example pull_request.labels[*].name: hotfix |
A filter on a field the event does not have counts as not matching. Exception: {exists: false}.
Which agent to run
The run field says which agent to start:
run:
agent: agents:alert-triage # required
branch: main # optional
| Field | Required | What it does |
|---|---|---|
agent | yes | Which agent to run. Use agent references like agents:alert-triage. See How references work. |
branch | no | Which Git branch to load the agent from. Defaults to the project's default branch (usually main). Each run uses the branch's latest version. |
commit | no | Which commit to load the agent from, as a full or short SHA (at least 7 characters). Cannot be used with branch. |
Keeping a trigger on a known-good version
With branch or the default branch, every push to that branch changes what the trigger runs. To keep iterating on an agent while a live trigger keeps running a version you trust, pin the trigger in one of two ways:
-
A release branch. Point
branchat a branch such asrelease, and push to it only when you want the trigger to pick up a change. Keep working onmainor a feature branch. -
A commit. Set
committo the commit you want, such as the oneautoheal agents pushprinted, in quotes:commit: "3f9c2e1". Every run uses the agent exactly as it was at that commit, whatever is pushed later. A short SHA is expanded to the full SHA when you save the trigger; if it matches more than one commit, use more characters. Saving fails, namingrun.commit, if the agent isn't at that commit or the commit isn't in the project's repository. To move the trigger to a newer version, updatecommit.The commit must stay on a branch. If the branch that holds it is deleted or rewritten, for example a feature branch deleted after a squash merge, every firing fails until you point
commitat a commit that is still on a branch. Pin a commit from the default branch or a branch you keep.
Passing event data to the agent
with becomes the agent's inputs. Values can include ${{ }} expressions (the same expression language as agents use). Expressions can read:
| Expression | Value |
|---|---|
event.data.<path> | The event payload, for example event.data.pull_request.number |
event.type | For example github.pull_request |
event.id, event.time | The event's ID and timestamp |
event.integration_name | The integration connection that sent the event |
trigger.id, trigger.revision | The trigger that fired |
with:
prompt: |
Review pull request #${{ event.data.pull_request.number }}
in ${{ event.data.repository.full_name }}.
Title: ${{ event.data.pull_request.title }}
pull_request: ${{ event.data.pull_request }} # whole objects pass through as objects
promptis required. Other keys must match the agent's declared inputs.- Missing paths render as empty. This does not cause an error.
Limits
You can control how many runs a trigger can start:
| Field | Meaning |
|---|---|
max_con | Maximum concurrent runs from this trigger |
rate_per_min | Maximum new runs per minute |
Events over a limit are dropped. They are not queued. Dropped events appear in run history as rate_limited.
Trigger run history
Failed trigger runs show the stage they stopped at:
| Stage | What went wrong |
|---|---|
rate_limited | Over max_con or rate_per_min |
input_rendering | A with expression could not be rendered |
target_validation | The agent or branch no longer exists. Or the inputs do not match the agent. |
dispatch | The agent run could not be started |
You can replay or manually fire triggers for testing.
End-to-end examples
Triage critical alerts and page the owner
agents/alert-triage/agent.yaml:
apiVersion: agents.autoheal.ai/v1
name: Alert Triage
icon: bell-ringing
description: Decides whether a new alert group is a real incident and who owns it.
model:
name: claude-sonnet-5
thinking: medium
instructions: ./instructions.md
system_tools: operation_type == "read" && name != "ask_user_input"
integration_tools: |
operation_type == "read"
|| (integration_type == "pagerduty" && operation_type == "write")
skills:
- skills:co-firing-correlation
returns:
verdict:
type: string
enum: [incident, noise, needs_human]
required: true
cause_service: {type: string, required: true}
routed_to: string
summary: {type: string, required: true}
agents/alert-triage/instructions.md:
You triage new alert groups for the on-call engineer.
1. Find which service is the cause and which alerts are symptoms.
2. Check recent deploys and config changes for the cause service.
3. If it is a real incident, page the owning team once in PagerDuty.
4. If it is noise, say which monitor is noisy and why.
Never page more than one team. If you are not sure, return needs_human.
The trigger:
apiVersion: triggers.autoheal.ai/v1
name: Triage critical and high alert groups
on:
alertgroup.created:
- status: firing
- anyOf:
- severity: critical
- severity: high
run:
agent: agents:alert-triage
with:
prompt: >-
${{ event.data.title }} (${{ event.data.severity }},
${{ event.data.alert_count }} alerts). Labels: ${{ event.data.group_labels }}.
Find out what happened and who should look at it.
limits:
max_con: 3
rate_per_min: 10
To page through PagerDuty only after a person approves, add a governance policy on PagerDuty writes. You do not need to change the agent.
Review pull requests to main
agents/code-reviewer/agent.yaml:
apiVersion: agents.autoheal.ai/v1
name: Code Reviewer
icon: git-pull-request
model: claude-sonnet-5
instructions: |
You review pull requests for correctness and operational risk.
Read the diff in the repository: call git_clone for it, and work in the
folder it returns. Comment only on real problems:
bugs, missing error handling, unsafe migrations, secrets, risky config.
Post one review comment on the pull request with your findings,
or "No blocking issues" if there are none.
inputs:
prompt: {type: string, required: true}
repository: {type: string, required: true}
pr_number: {type: integer, required: true}
system_tools: operation_type == "read" && name != "ask_user_input"
integration_tools: integration_type == "github"
The trigger:
apiVersion: triggers.autoheal.ai/v1
name: Review payments pull requests
on:
github.pull_request:
- integration_name: github-engineering
- repository.full_name: acme/payments
- pull_request.base.ref: main
- pull_request.draft: false
- anyOf:
- action: opened
- action: synchronize
run:
agent: agents:code-reviewer
with:
prompt: >-
Review pull request #${{ event.data.pull_request.number }}
in ${{ event.data.repository.full_name }}:
${{ event.data.pull_request.title }}
repository: ${{ event.data.repository.full_name }}
pr_number: ${{ event.data.pull_request.number }}
limits:
max_con: 2
rate_per_min: 20
The agent calls git_clone for acme/payments, which clones it into /workspace/git-repos/github.com__acme__payments@<agent> and returns that folder. git and gh are signed in for your GitHub integration.
Write release notes for pre-releases
apiVersion: agents.autoheal.ai/v1
name: Release Notes
icon: megaphone
model: claude-haiku-4-5
instructions: |
Write release notes for the release in the prompt. Group merged pull
requests into Features, Fixes and Internal. Post the notes to the
#releases Slack channel.
system_tools: operation_type == "read" && name != "ask_user_input"
integration_tools: |
(integration_type == "github" && operation_type == "read")
|| (integration_type == "slack" && operation_type == "write")
apiVersion: triggers.autoheal.ai/v1
name: Release notes for pre-releases
on:
github.release:
- action: published
- release.prerelease: true
run:
agent: agents:release-notes
with:
prompt: >-
Write notes for ${{ event.data.release.tag_name }}
in ${{ event.data.repository.full_name }}.
Escalate critical security advisories
apiVersion: triggers.autoheal.ai/v1
name: Critical security advisories
on:
github.security_advisory:
- security_advisory.severity: critical
run:
agent: agents:vulnerability-triage
with:
prompt: >-
New critical advisory ${{ event.data.security_advisory.ghsa_id }}:
${{ event.data.security_advisory.summary }}.
Find which of our repositories use the affected package.
An agent with subagents
agents/
incident-response/
agent.yaml
instructions.md
agents/
hypothesis-investigator/agent.yaml
adversarial-verifier/agent.yaml
apiVersion: agents.autoheal.ai/v1
name: Incident Response
icon: siren
model:
name: claude-opus-5
thinking: high
instructions: ./instructions.md
system_tools: operation_type == "read"
integration_tools: operation_type == "read"
subagents:
investigate_hypothesis:
agent: ./agents:hypothesis-investigator
description: Investigates one candidate cause. Call once per hypothesis, in parallel.
adversarial_verifier:
agent: ./agents:adversarial-verifier
description: Argues against the leading explanation and returns a verdict.
returns:
root_cause: {type: string, required: true}
confidence: {type: number, minimum: 0, maximum: 1, required: true}
severity: {type: string, enum: [sev1, sev2, sev3, sev4], required: true}
proposed_mitigation: string
The child agents are ordinary agent.yaml files. Use a cheaper model for them, such as claude-sonnet-5. The expensive model is then used only for the final judgment.