---
title: "agent.yml reference"
description: "Every key of the agent definition."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# agent.yml reference

One `agent.yml` per agent holds everything that is not prose. A root `agent.yml` holds shared defaults. Files deep-merge from root to leaf, and the leaf wins ([inheritance](https://docs.cloudraker.com/run/guides/repo-layout#inheritance)). Every key is optional. An unknown key fails lint with `unrecognized_keys`.

## Full example

```yaml agent.yml
name: Support desk # display name. Leaf-only.
mode: turns # zeroshot | turns | machine. Leaf-only.
idle_ttl: 24h # turns and machine only. 1m to 30d. Leaf-only.
retention: 30d # runs, events, files. 1m to 90d.

model:
  id: anthropic/claude-sonnet-5-5
  temperature: 0.2
  max_output_tokens: 8000
  reasoning: medium
  allow_override: false

llm: # optional. Absent means CloudRaker inference or your keys.
  gateway: gateway.example.com
  base_path: /v1
  headers: { Authorization: 'Bearer ${secret:LLM_GATEWAY_TOKEN}' }

triggers: # leaf-only. Web chat, phone, email, Slack and Teams go through doors/*.yml.
  http: true
  schedule: '0 * * * *'
  inbound:
    linear: { events: [issue.created], secret: '${secret:LINEAR_WEBHOOK_SECRET}' }
  paperwork: [sign.ended]

input_schema: { type: object }
output_schema: { type: object } # leaf-only

events: # leaf-only
  label_suggested:
    description: Suggest one label for the ticket.
    schema: { type: object, required: [label], properties: { label: { type: string } } }

webhooks: # leaf-only
  - url: https://ops.example.com/hooks/agents
    events: [run.completed, run.failed, event.label_suggested]

network:
  api.linear.app:
    headers: { Authorization: '${secret:LINEAR_TOKEN}' }
  api.internal.acme.com:
    oidc: { identity: user } # a Run OIDC token that names the person of the turn
  '*.slack.com': {}

connectors: [linear] # named MCP connectors of the org

secrets:
  LINEAR_TOKEN: { overridable: true }
  LLM_GATEWAY_TOKEN: {}
  LINEAR_WEBHOOK_SECRET: {}

limits:
  max_steps: 60
  max_code_calls: 40
  code_cpu_ms: 30000
  max_egress_bytes: 50MB

files:
  read_raw: false # true lets file.read return raw content

data:
  read: [lead]
  write: [lead]
  create_schemas: false

knowledge: [sales/pre-sales, legal] # folders under knowledge/

tools:
  flag: on # off removes the flag tool

runtime: durable-object
timeout: 10m
protection: token # token | public | access. Leaf-only.
work_session: false
imports: []
```

## Formats

| Format           | Shape                                                                                | Examples                       |
| ---------------- | ------------------------------------------------------------------------------------ | ------------------------------ |
| Duration         | An integer and one unit: `s`, `m`, `h`, `d`.                                         | `10s`, `10m`, `24h`, `30d`     |
| Size             | An integer and one unit: `B`, `KB`, `MB`, `GB`.                                      | `512KB`, `50MB`                |
| Secret reference | `${secret:NAME}`. `NAME` matches `[A-Z][A-Z0-9_]*`. A bare `secret:NAME` fails lint. | `Bearer ${secret:DASH0_TOKEN}` |
| Model id         | `provider/model`.                                                                    | `anthropic/claude-sonnet-5-5`  |

## Run behavior

| Key            | Type                             | Default          | Rule                                                                                                                                                                                                                                                           |
| -------------- | -------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`         | string, 1 to 80 characters       | the folder path  | Leaf-only. The display name, for example in Slack, in a handoff notice or in the phone greeting. The agent id stays the folder path.                                                                                                                           |
| `mode`         | `zeroshot`, `turns` or `machine` | `zeroshot`       | Leaf-only. `zeroshot`: one request, one run, no `ask` tool. `turns`: each turn ends in `waiting`, and the caller sends the next turn. `machine` (beta): the agent runs a compiled procedure with no model loop. Read [Machine agents](https://docs.cloudraker.com/run/guides/machine-agents). |
| `idle_ttl`     | duration, `1m` to `30d`          | `24h`            | Leaf-only. `turns` and `machine` only. A `waiting` run expires after this time without a turn. Default `7d` for `machine`.                                                                                                                                     |
| `retention`    | duration, `1m` to `90d`          | `30d`            | Runs, events and written files. Pinned when the run starts. A value of minutes gives [zero data retention](#zero-data-retention).                                                                                                                              |
| `timeout`      | duration, `10s` to `60m`         | `10m`            | One turn. The run fails with `timeout` after it. Default `60m` for `machine`.                                                                                                                                                                                  |
| `runtime`      | `durable-object`                 | `durable-object` | The only value.                                                                                                                                                                                                                                                |
| `work_session` | boolean                          | `false`          | A developer switch for the work tools. The conversation is the work session. Read [work sessions](#work-sessions).                                                                                                                                             |
| `imports`      | list of `{source}@{commit sha}`  | none             | Reserved for shared definitions from another repo. The engine does not act on it yet. A tag or a branch fails lint with `import_unpinned`.                                                                                                                     |

### Work sessions

`work_session` stays a developer switch. `true` gives the agent the work tools: `show` widgets, docs, sheets, slides and app proposals. A console conversation turns it on for its runs. A conversation on another channel turns it off.

Run has no work session object. The conversation is the work session. Its participants, mentions and delegation put many people and many agents in one place. Each turn acts with the access of the person who sent it.

### Zero data retention

Set a short `retention`, for example `1m`, to delete the run content soon after the run ends. A `turns` run does not end between turns. Each turn sets the expiry to `idle_ttl` after that turn, so a new message keeps the conversation open. The run expires when no turn comes in `idle_ttl`. The purge starts `retention` after that.

```yaml agent.yml
mode: turns
idle_ttl: 5m # the conversation stays open 5 minutes after each turn
retention: 1m # the content is deleted 1 minute after the run expires
```

The content of a `zeroshot` run is deleted `retention` after its terminal event.

The purge deletes:

- the input text and parameters, the events, the result and the conversation history
- the run trace, its span payloads and the egress audit rows
- the webhook and trigger delivery rows. A retry that is due at the purge time or later is not sent.
- the files that the run wrote and did not hand out
- the run metadata that the caller set
- the outputs and Inbox items of the run, and the text preview of its conversation. The conversation title stays.

The run stub stays for 90 days after the purge. It holds no text:

- the run id, agent, repo, deployment SHA, model, mode, status and turn count
- the times: `created_at`, `started_at`, `ended_at` and `purged_at`
- `usage`: tokens, cached and reasoning tokens, model steps, credits, `model_cost_usd`, egress counts and `duration_ms`
- the failure code (with a fixed message) or `cancelled_by`, and the parent and root run ids of an agent tree
- the metadata keys that Run sets: `source`, `surface`, `conversation_id`, `conversation_role`, `owner`, `started_by` and `preview_branch`

`GET /_run/{id}` answers `200` with the stub, `purged: true` and `purged_at`. The events, the stream replay, the messages, the trace and the files answer `410 run_purged`. A turn or an answer gets the answer of an ended run: `409 run_terminal` or `410 run_expired`. The console run list, the run page, the dashboard and the usage report show the run with its usage and cost, and the note "Content deleted (retention)". After 90 days the stub goes too, and `GET /_run/{id}` answers `404 run_not_found`.

These items also stay:

- The billed usage stays in metering. The purge waits until metering has the usage of the run. If metering is not available, the purge tries again each minute.
- A file that a `file` event, the result or a data record names follows file-store retention, not the run `retention`.
- Files sent with the input (uploads, `url` files, conversation files, the phone call recording) follow file-store retention.
- With a `retention` above `24h`, each trace span also goes to analytics without its payload. The span name, model, tool, egress host, method and URL path stay there for up to 3 months. With `24h` or less, no span goes to analytics.
- A [conversation](https://docs.cloudraker.com/run/guides/conversations) keeps its own transcript and items. The `session.retention` of its front door applies to it and to its runs, not the agent `retention`.

The model call does not send prompt or response logs to AI Gateway for CloudRaker inference. With your own keys or your own `llm.gateway`, your agreement with that provider applies.

## `model`

| Key                       | Type                              | Default                       | Rule                                                                                                                                                  |
| ------------------------- | --------------------------------- | ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model.id`                | model id                          | `anthropic/claude-sonnet-5-5` | Read [Models and BYOK](https://docs.cloudraker.com/run/guides/models).                                                                                                               |
| `model.fallback`          | list of model ids                 | none                          | Not used in the beta. Lint accepts the key, but a failed model call fails the run with `model_error`.                                                 |
| `model.temperature`       | number, 0 to 2                    | provider default              |                                                                                                                                                       |
| `model.max_output_tokens` | positive integer                  | provider default              | Per model step.                                                                                                                                       |
| `model.reasoning`         | `none`, `low`, `medium` or `high` | provider default              | How much the model reasons before it answers. `none` turns reasoning off where the model allows it. Read [Models and BYOK](https://docs.cloudraker.com/run/guides/models#reasoning). |
| `model.allow_override`    | boolean                           | `false`                       | `true` lets a run request send `model.id`. A `public` agent always refuses it.                                                                        |

## `llm`

Set `llm` to send model calls to your own OpenAI-compatible gateway. Read [Models and BYOK](https://docs.cloudraker.com/run/guides/models#your-own-gateway).

| Key             | Type                    | Rule                                                                                                       |
| --------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------- |
| `llm.gateway`   | host name               | A plain host, not a secret and not a URL. It joins the network allow list. A run request cannot change it. |
| `llm.base_path` | path                    | Default `/v1`. The base URL is `https://{gateway}{base_path}`.                                             |
| `llm.headers`   | map of header templates | For example `Authorization: "Bearer ${secret:LLM_GATEWAY_TOKEN}"`.                                         |

## `triggers`

Leaf-only. Without a `triggers` key, the HTTP trigger is on. Runs from these triggers are not conversations.

People reach an agent through web chat, phone, email, Slack or Teams by a [front door](https://docs.cloudraker.com/run/guides/front-doors), `doors/{name}.yml`, not by a key of `agent.yml`. Under `triggers`, the keys `email`, `slack`, `teams` and `phone` fail lint with `agent_yml_schema`, and the message names the door key to use.

| Key                                | Type             | Rule                                                                                                                                                        |
| ---------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `triggers.http`                    | boolean          | `POST https://{org}.cloudraker.run/{base}/{agent}`. When `triggers` is set, `http` is on only when it is `true`. A front door does not need it.             |
| `triggers.schedule`                | cron, UTC        | For example `"0 * * * *"`. Minimum interval 1 minute. A tick skips while the previous scheduled run is active.                                              |
| `triggers.inbound.{source}`        | object           | Webhook target at `POST /{base}/{agent}/_inbound/{source}`. Sources: `linear`, `workos`.                                                                    |
| `triggers.inbound.{source}.events` | list of strings  | Source event types that start a run. Other events answer 202 and start nothing.                                                                             |
| `triggers.inbound.{source}.secret` | secret reference | The source signing secret. Required.                                                                                                                        |
| `triggers.paperwork`               | list of strings  | Paperwork events that start a new run when the run that caused them ended. Events: `sign.ended`. Read [completion events](https://docs.cloudraker.com/run/guides/files#completion-events). |

## Input and output

| Key             | Type        | Rule                                                                                    |
| --------------- | ----------- | --------------------------------------------------------------------------------------- |
| `input_schema`  | JSON Schema | Validates `input` on start. A mismatch answers `422 input_schema`.                      |
| `output_schema` | JSON Schema | Leaf-only. Validates the `done` payload. A mismatch fails the run with `output_schema`. |

## `events`

Leaf-only. Each entry becomes a tool `emit_{name}`. The caller gets `event.{name}`. Read [custom events](https://docs.cloudraker.com/run/guides/events-and-webhooks#custom-events).

| Key                         | Type        | Rule                                                                                                        |
| --------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------- |
| `events.{name}`             | object      | `name` matches `[a-z][a-z0-9_]{0,31}`. It cannot start with `run`, `turn`, `message`, `question` or `file`. |
| `events.{name}.description` | string      | The tool description the model sees.                                                                        |
| `events.{name}.schema`      | JSON Schema | Required. Must be `type: object`.                                                                           |

## `webhooks`

Leaf-only. The leaf list replaces the parent list. Read [webhooks](https://docs.cloudraker.com/run/guides/events-and-webhooks#webhooks).

| Key                 | Type                | Rule                                                                                               |
| ------------------- | ------------------- | -------------------------------------------------------------------------------------------------- |
| `webhooks[].url`    | HTTPS URL           | Must pass the SSRF guard. Not a host under `cloudraker.run`. 512 characters at most. No redirects. |
| `webhooks[].events` | list of event types | For example `run.completed`, `event.label_suggested`.                                              |

CloudRaker signs each delivery with a JWT. A webhook needs no secret. Read [Verify the signature](https://docs.cloudraker.com/run/guides/events-and-webhooks#verify-the-signature).

## `network` and `secrets`

Read [Secrets and network](https://docs.cloudraker.com/run/guides/secrets-and-network).

| Key                            | Type                        | Rule                                                                                                                                                                   |
| ------------------------------ | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `network.{host}`               | object                      | Exact host, or one leading `*.` wildcard. HTTPS on port 443 only. Every host the agent reaches must be here, or be added automatically.                                |
| `network.{host}.headers`       | map of header templates     | Secret references are filled here, and only here. A wildcard host cannot carry headers (`wildcard_header`).                                                            |
| `network.{host}.oidc`          | object                      | Sends a Run OIDC token to this host on each request. Exact hosts only (`oidc_wildcard`). Read [OIDC identity](https://docs.cloudraker.com/run/guides/oidc-identity).                                  |
| `network.{host}.oidc.identity` | `agent` or `user`           | Required. `agent`: the token names the agent. `user`: the token names the person of the turn. A `protection: public` agent cannot use `user` (`user_identity_source`). |
| `network.{host}.oidc.audience` | string, 1 to 512 characters | Default `https://{host}`. With `identity: user`, the only value is `https://{host}` (`oidc_user_audience`).                                                            |
| `network.{host}.oidc.header`   | header name                 | Default `Authorization`, with `Bearer {token}`. Another header gets the bare token. `headers` cannot set the same header (`oidc_header_conflict`).                     |
| `network.{host}.oidc.scopes`   | list of scope names         | The scopes for the CloudRaker API of your org. The host and the audience must be the org host (`oidc_scopes_audience`). Read [OIDC identity](https://docs.cloudraker.com/run/guides/oidc-identity).   |
| `secrets.{NAME}`               | object                      | Declares a secret name the agent uses. A header that names an undeclared secret fails lint with `secret_undeclared`.                                                   |
| `secrets.{NAME}.overridable`   | boolean                     | `true` lets a run request send a value for one turn.                                                                                                                   |

## `connectors`

Read [Connectors](https://docs.cloudraker.com/run/guides/connectors).

| Key                     | Type                                 | Rule                                                                                                                                                                                                                                                        |
| ----------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `connectors`            | list                                 | Named MCP connectors of the org. Each one must exist, be granted to the agent and be `connected` (OAuth needs a login; a Run identity (OIDC) connector needs none), else the run fails with `connector_unavailable`. A child list replaces the parent list. |
| `connectors[]`          | name, or `{ name, tools, identity }` | A name gives every tool that the connector allows. `tools` (1 to 200 names, `*` matches any characters) narrows that list. A name that matches no allowed tool fails the run with `connector_unavailable`. A connector name can appear once.                |
| `connectors[].identity` | `agent` or `user`                    | Only for a connector with the auth type **Run identity (OIDC)**. Default `agent`. `user`: the token names the person of the turn. Read [OIDC identity](https://docs.cloudraker.com/run/guides/oidc-identity#configure-a-connector).                                                        |

## `limits`

Per run, under the plan ceiling.

| Key                       | Type             | Default | Rule                                                             |
| ------------------------- | ---------------- | ------- | ---------------------------------------------------------------- |
| `limits.max_steps`        | positive integer | 50      | Model steps over the whole run. The run fails with `step_limit`. |
| `limits.max_code_calls`   | integer          | 40      | `_code` and `execute_code` calls per run.                        |
| `limits.code_cpu_ms`      | positive integer | 30000   | CPU per code call.                                               |
| `limits.max_egress_bytes` | size             | `50MB`  | Response bytes over all outbound calls of the run.               |

## `data`

Read [Structured Memory](https://docs.cloudraker.com/run/guides/data).

| Key                   | Type                 | Rule                                                                                                                                   |
| --------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `data.read`           | list of schema names | `"*"` reads every org schema.                                                                                                          |
| `data.write`          | list of schema names | Write tools for these schemas.                                                                                                         |
| `data.create_schemas` | boolean              | Default `false`. `true` adds the `data.define_schema` tool. A `protection: public` agent cannot set it (lint `public_create_schemas`). |

The grant caps the agent. A turn that a person sends also follows the record rules of that person. Read [Who can open records](https://docs.cloudraker.com/run/guides/records-access).

## `knowledge`

Read [Knowledge](https://docs.cloudraker.com/run/guides/knowledge).

| Key         | Type                        | Rule                                                                                                                                                                   |
| ----------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `knowledge` | list of folders, or `['*']` | Folders under `knowledge/` that the agent can search, with their subfolders. Max 32. Missing or empty gives no knowledge tools. A child list replaces the parent list. |

## `tools`

Switches for built-in tools. The key is inheritable, and the leaf wins. So a leaf `flag: on` turns the tool on again under a root `flag: off`.

| Key          | Type          | Default | Rule                                                                         |
| ------------ | ------------- | ------- | ---------------------------------------------------------------------------- |
| `tools.flag` | `on` or `off` | `on`    | `on` gives the `flag` tool in every mode, also `zeroshot`. `off` removes it. |

### The `flag` tool

`flag` puts an item in the Inbox of one person or one team, and the run continues. Use it when a person must look at something, for example three documents that the agent cannot file. The tool never waits for an approval.

```json
{
  "to": "reception",
  "text": "Three referrals match no intake.",
  "records": [{ "schema": "inbound_document", "id": "doc_8f2k" }],
  "urgency": "high"
}
```

| Input     | Rule                                                                                                                       |
| --------- | -------------------------------------------------------------------------------------------------------------------------- |
| `to`      | The email address of one member of the organization, or one team slug. Another value answers `unknown_recipient`.          |
| `text`    | 1 to 500 characters. The title of the item is the text, cut at 140 characters.                                             |
| `records` | Optional. At most 20 `{ schema, id }` refs. Each one must be a record that this run read or wrote, else `record_not_read`. |
| `urgency` | `normal` (default) or `high`. A `high` item shows first in its Inbox group.                                                |

- A run sends at most 10 flags. The eleventh answers `flag_limit`.
- The item shows in **Needs you** for the named person, or for each member of the named team. It counts in the badge and ranks with approvals.
- A record ref shows its label only to a person who can open the record. Other people see "A record you cannot open".
- The named person, a member of the named team or an admin can dismiss the item.
- The item stays open after the run ends. A retention purge of the run removes the item.

## Removed keys

These keys are not in `agent.yml`. A file that sets one fails lint with `agent_yml_schema`. The message names the new place.

| Key                      | Use instead                                                              |
| ------------------------ | ------------------------------------------------------------------------ |
| `email:` block           | `channels.email` of a door, and an email alias on the **Channels** page. |
| `phone:` block           | `channels.phone` of a door. Read [Phone numbers](https://docs.cloudraker.com/run/guides/phone).         |
| `email` under `triggers` | `channels.email` of a door.                                              |
| `phone` under `triggers` | `channels.phone` of a door, and a number bound to the door.              |
| `slack` under `triggers` | `channels.slack` of a door, and the Slack workspace bound to the door.   |
| `teams` under `triggers` | `channels.teams` of a door, and the Teams tenant bound to the door.      |

A root routing file for Slack or Teams fails lint with `legacy_routing_file`. Move the routing to `doors/{name}.yml`. Read the [doors.yml reference](https://docs.cloudraker.com/run/guides/doors-yml).

## `agents`

Leaf-only. Who the agent can give a task to (`delegate`) and who it can send a message to (`message`). Targets are agents of the same repo. A delegated task runs as a child run of the lead run, on the same deployment. The target agent needs no opt-in.

```yaml
agents:
  delegate:
    - research/web
    - agent: finance/analyst
      when: Numbers, forecasts and spreadsheets
  message:
    - review/editor
  limits:
    max_depth: 2
    children_per_turn: 5
    children_per_run: 10
    messages_per_tree: 50
    tree_credits: 500
```

| Key                               | Type                        | Rule                                                                                                                                |
| --------------------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `agents.delegate`                 | list, at most 20 entries    | An entry is a full agent path, `{agent, when}` or `'*'` (every other agent of the repo, alone in the list). No agent appears twice. |
| `agents.message`                  | list, at most 20 entries    | Same entries. A target must be a `mode: turns` agent.                                                                               |
| `{agent, when}`                   | `when`: 1 to 200 characters | A routing hint that the lead model sees in its list of agents.                                                                      |
| `agents.limits.max_depth`         | integer, 1 to 3             | Default 2. Read from the root run only.                                                                                             |
| `agents.limits.children_per_turn` | integer, 1 to 10            | Default 5.                                                                                                                          |
| `agents.limits.children_per_run`  | integer, 1 to 25            | Default 10.                                                                                                                         |
| `agents.limits.messages_per_tree` | integer, 1 to 200           | Default 50. Read from the root run only.                                                                                            |
| `agents.limits.tree_credits`      | positive integer            | Optional. New children are refused when the credits of the whole tree pass it. Read from the root run only.                         |

The agent gets two tools. `delegate` starts a child run and returns its id at once. After that step, the lead ends its turn and waits with reason `children`; a waiting lead holds no concurrency slot. The lead resumes with one new turn when every child of that turn reports. A `zeroshot` child reports when it ends. A `turns` child reports when its first turn ends, then stays alive for messages. `message_agent` sends a turn to a live `turns` run of the same run tree. A message never starts a run. A lead can always message its own children, and a child its own parent.

A child is a normal run: it bills its own minutes and AI usage and counts against the daily run cap and concurrency. A child acts for the same person as the lead turn, but the `workspace_act_as` identity does not flow to it. The approvals of a child go to a person. When the lead run ends, every live child ends too.

Lint: `agents_target_unknown`, `agents_target_self` and `machine_target` (an entry names a `mode: machine` agent) are errors. `agents_delegate_cycle`, `agents_message_zeroshot` (a `message` target in `zeroshot` mode) and `agents_root_limits` (a delegate target sets a root-only limit) are warnings.

## `machine`

Leaf-only. Beta. The Machine of a `mode: machine` agent. Read [Machine agents](https://docs.cloudraker.com/run/guides/machine-agents).

| Key                       | Type             | Default              | Rule                                                                                           |
| ------------------------- | ---------------- | -------------------- | ---------------------------------------------------------------------------------------------- |
| `machine.procedure`       | path             | `machine.json`       | The `bm-procedure/2` file, relative to the agent folder. A `.yaml` or `.yml` file is accepted. |
| `machine.tools`           | path             | `machine.tools.json` | The pinned contracts of the MCP and `_code` tools that the steps call.                         |
| `machine.exception_model` | `default`, `off` | `default`            | `off` turns the `model` rung off for every step.                                               |

In mode `machine`, `model`, `llm`, `limits.max_steps` and the `AGENTS.md` prompt are not used. Lint refuses `output_schema` with `machine_output_schema`.

## `workspace_act_as`

Leaf-only, so an identity never comes from a parent. The agent acts in the Workspace mailbox and calendar of one person. The key was `delegation:` and has no alias.

| Key                                | Type                                           | Rule                                                                                                                                                    |
| ---------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `workspace_act_as.tools.calendar`  | list of `read`, `free_busy`, `write`           | At least one family is required. Each family takes one or more unique verbs.                                                                            |
| `workspace_act_as.tools.mail`      | list of `read`, `draft`, `send`, `attachments` |                                                                                                                                                         |
| `workspace_act_as.tools.directory` | list of `search`                               |                                                                                                                                                         |
| `workspace_act_as.as`              | email address                                  | A fixed person, at most 254 characters.                                                                                                                 |
| `workspace_act_as.as.from`         | `header` or `sender`                           | The person comes from the request (`header`, needs `protection: token`) or from the Slack, Teams or verified email sender of a conversation (`sender`). |
| `workspace_act_as.as.allow`        | list of domains or addresses, 1 to 100         | Optional. Only these people can be the identity.                                                                                                        |

Lint `act_as_identity_source` refuses these combinations:

- `protection: public` with `workspace_act_as`.
- `as.from: sender` when no door with `channels.slack`, `channels.teams` or `channels.email` lists the agent.
- `as.from: sender` in a door with `channels.email` and no `channels.email.allow_from`.

## `files`

Read [Files](https://docs.cloudraker.com/run/guides/files).

| Key              | Type    | Rule                                                                                                                         |
| ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `files.read_raw` | boolean | Default `false`. `file.read` then refuses with `raw_read_refused`, and the agent uses `file.parse`. `true` allows raw reads. |

## `protection`

Leaf-only. Read [Protection and previews](https://docs.cloudraker.com/run/guides/protection-and-previews).

| Value             | Who can start a run                                   |
| ----------------- | ----------------------------------------------------- |
| `token` (default) | A `crk_` key with the `run` scope.                    |
| `public`          | Anyone. The request cannot send `secrets` or `model`. |
| `access`          | A caller that passed Cloudflare Access.               |

## Leaf-only keys

`name`, `triggers`, `workspace_act_as`, `agents`, `events`, `webhooks`, `mode`, `machine`, `protection`, `output_schema` and `idle_ttl` describe one agent. Only the leaf `agent.yml` can set them. A root or middle `agent.yml` that sets one fails lint with `root_leaf_key {key}`.

## Defaults

The resolver applies these values when no level of the tree sets the key:

```yaml
mode: zeroshot
model: { id: anthropic/claude-sonnet-5-5 }
protection: token
retention: 30d
idle_ttl: 24h
timeout: 10m
limits: { max_steps: 50 }
```

A `mode: machine` agent gets `timeout: 60m` and `idle_ttl: 7d` when no level sets them.

When `limits` leaves a key out, the engine uses `max_code_calls: 40`, `code_cpu_ms: 30000` and `max_egress_bytes: 50MB`.

Source: https://docs.cloudraker.com/run/guides/agent-yml/index.mdx
