# Launch decisions CAO routes normal delegations to installed profiles through `model.route` when the caller omits a model. Local and remote assign, elastic assign, handoff and CLI handoff use it. Every decision point (see [Points and states](#points-and-states)) is **off by default**, so normal launches keep their existing behavior until an operator enables routing. An ephemeral agent is routed only when its spec set `model_tier: "auto"`; see [Ephemeral agents](ephemeral-agents.md#model-tier-auto). Plain terminal creates and older clients that do not send the original task message are not routed. An empty task message is also not routed: local and remote assign, elastic assign, handoff and CLI handoff launch it unrouted rather than refusing it, the same as when no message is sent at all. The CLI still refuses an empty `--message-file` before it launches anything. Reusing a terminal and replaying a workflow step launch nothing, so neither runs a decision. A script workflow's own step is out of scope for deciders; in shadow or on it gets an `out_of_scope` record. An agent's assign or handoff from inside that step remains an ordinary delegation. ## Points and states | Point | Ordered options | Purpose | | --- | --- | --- | | `model.route` | `small`, `medium`, `large` | Choose a model size | | `effort.route` | `low`, `medium`, `high` | Choose reasoning effort for an ephemeral `effort: "auto"` spec | | `provider.route` | CAO provider IDs, narrowed for each launch | Choose the CLI for an ephemeral `provider: "auto"` spec | | `task.long_context`, `task.deep_reasoning`, `task.read_only`, `task.needs_network` | `yes`, `no` | Describe an ephemeral task so CAO can match it to a model; one switch, `task.features`, turns all four off, to shadow or on (see [Matching helpers to models](#matching-helpers-to-models)) | Each point also accepts `unsure`. `off` asks nothing and writes no record. `shadow` records what the decider would choose without waiting for it or changing the launch model. `on` waits up to the configured timeout, then uses a confident answer or a deterministic fallback. An explicit caller value skips the decider. The installed profile model is a fallback and may be overridden in on mode. `provider.route` has no order, ceiling, floor or default. CAO computes its options for each launch, always including the fallback, and sends them as the request's `options`, with `facts.provider` set to the fallback. An answer outside them, even another known provider ID, falls back as `invalid_answer`. A launch with one option asks nothing and records `single_option`. Its fallback is the creator's provider (`fallback_source: creator`). It is asked before any other point of the same launch, and every ask of that launch shares one request and one `request_id`; the later points see the provider it resolved to in `facts.provider`, its tier table and whether it honors the model and effort. The fallback order is the installed profile default, the policy default, then the provider default. A required policy tier must map to a model; otherwise the launch is refused. Policy checks run before scope and decider calls. An explicit value above a policy ceiling is refused; a decider answer above it is capped. A policy may also carry a model tier floor or an effort floor. An explicit value below it is refused, and a decider answer below it is raised to the floor and recorded as `capped`. A floor needs a default at or above it and must not exceed the ceiling. With a tier floor and a ceiling, every tier from the floor to the ceiling must be mapped. The launch-time policy check covers every checked provider in the envelope, including providers other than the target. A missing mapping anywhere in that set refuses the launch and names `model_tiers..`. ## Delegation results An eligible delegation in on mode adds a note to the assign, handoff or elastic assign tool result. CLI handoff includes it when returning early with `--no-wait` and when waiting on the terminal it just created. | Result | Example note | | --- | --- | | Applied | `ran on model-small (auto: small 0.91)` | | Capped by policy | `ran on model-medium (auto: large 0.91, capped to medium)` | | Fallback | `ran on model-default (auto: fallback, unsure)` | | Model cannot be vouched for | `ran on provider default (auto: fallback, not_honored)` | | Matched, tier raised | `ran on claude-opus-5-5 (auto: medium 0.90, matched long_context -> large)` | | Matched to another CLI | `ran on gpt-5.5-pro (auto: medium 0.90, matched long_context+read_only -> codex large)` | | Matched at the decider's size | `ran on gpt-5.5 (auto: medium 0.90, matched read_only)` | | Network hint added | `...; the task may need network access, and this helper has no web_fetch` | A matched note has an arrow only when the match changed something: ` -> ` when the tier rose, ` -> ` when the helper moved to another CLI. A need covered at the decider's size on the same CLI adds just `, matched `. The note comes from the launch's `model.route` record, so it needs `model.route` on. With `provider.route` bound to `match` and `model.route` off, in shadow or given an explicit tier, a match that moves the helper to another CLI adds no note: the creator isn't told about the move. The helper's `provider.route` record shows it (`outcome` `applied`, `match_pick`). The note names a model only when the bound terminal records it and the provider honors it. Otherwise it says `provider default`. Fallback reasons are fixed values, including timeout, error, unsure and an unmapped tier. Normal delegation has no policy envelope, so capping is reserved for callers that supply one. The server carries the note in the optional `X-CAO-Decision` response header, not in the response body. Model characters outside the model-ID alphabet are percent-encoded once, including spaces, non-ASCII and control characters. The client displays the header verbatim and does not decode it. A header-building error cannot fail a launch that has already succeeded. Off, shadow, explicit-model calls, excluded profiles and older clients show no note. Rejected launches return an error. A terminal-creation idempotent retry launches nothing and shows no note. Terminal and sibling responses gain no decision fields. A decided Kiro model that fails the capability probe is retried with the model that would have been used without routing. That fallback is probed before any allocation, recorded as `fallback` / `not_honored`, and reflected in the note. An unsupported explicit model still returns the existing error. ## Settings Settings are read fresh for each call, except the shadow limits `shadow.max_concurrent` and `shadow.max_pending`, which the server reads once at startup. Point-state precedence is: 1. `CAO_DECISION_MODEL_ROUTE`, `CAO_DECISION_EFFORT_ROUTE`, `CAO_DECISION_PROVIDER_ROUTE` and `CAO_DECISION_TASK_FEATURES` in the server's environment. A repeatable `cao-server --decision model.route=shadow` flag sets the matching variable for that server process, replacing an inherited value. 2. `decisions.points..state` in `settings.json`. 3. `off`. `--decision` refuses an unknown point or state at startup. An invalid state in a variable or in `settings.json` means off at that layer; it does not fall through. An unreadable settings file makes every point off. `cao decisions status` describes the CLI's environment and cannot see a running server's flags; the server logs its effective settings at startup and when they change (see [Diagnostics](#diagnostics)). The server captures these overrides at startup and keeps them until it restarts. While one is set, `cao decisions set off` and `decisions_set_point` change only `settings.json`: the running server keeps using the override for that point. `cao decisions off` turns every point off on a running server, overrides included: its halt marker is checked above the flag and environment layers (see External deciders). ```json { "decisions": { "points": { "model.route": {"state": "off", "decider": "fixed_table", "exclude_profiles": []}, "effort.route": {"state": "off", "decider": "fixed_table"} }, "on_timeout_ms": 1000, "confidence_threshold": 0.7, "retention_days": 90, "shadow": {"max_concurrent": 4, "max_pending": 64, "timeout_ms": 10000}, "deciders": { "fixed_table": { "model.route": {"profiles": {"developer": "small"}, "roles": {"reviewer": "medium"}} } } }, "model_tiers": { "codex": {"small": "model-small", "medium": "model-medium", "large": "model-large"} } } ``` `model_tiers` is top level so explicit spec tiers can use it with all decisions off. Keys are CAO provider IDs, options are the three model tiers, and values are model IDs. Invalid mappings are ignored with a warning. Providers with no table are not checked by configuration validation unless listed in `allowed_providers`; the launch check still refuses an unmapped required default on the target. `exclude_profiles` pins installed profiles to their existing model resolution: no `model.route` question and no `model.route` record for launches that pass policy. It changes no other point; no installed launch asks `effort.route` in this version. Refused launches still write a rejected record in shadow or on. Names not installed are retained but have no effect. There is no profile-frontmatter switch for decisions. `cao decisions tune` accepts an on timeout of 50–5000 ms, a threshold of 0–1 and a retention of 1–36500 days, and refuses anything else. A retention of `0` is refused; it does not mean unlimited. Values outside these ranges in `settings.json` or in the scalar overrides `CAO_DECISION_ON_TIMEOUT_MS` and `CAO_DECISION_CONFIDENCE_THRESHOLD` are clamped, with a warning. The fixed table looks up profile first, then role, and returns probability 1.0; a miss gives no answer. It is a decider, never part of fallback resolution. A claimed ephemeral `effort: "auto"` launch reads the `effort.route` table this way too, but its request carries no profile or role fact, so a profile- or role-keyed entry never matches it; every other launch leaves those entries unread. The same holds for `provider.route` entries: only a claimed ephemeral launch asks that point, so a table entry for it never matches and the table records `no_answer`. Shadow defaults to four concurrent and 64 pending tasks, with a 10000 ms decider timeout. These have no CLI setter; values in `settings.json` are clamped, with a warning, to 1–1024 concurrent, 0–100000 pending and 50–60000 ms. Overflow is recorded as `shadow_dropped`; shutdown and crash recovery mark unfinished decisions interrupted. ## Operator controls ```bash cao decisions status cao decisions off cao decisions enable cao decisions disable cao decisions show cao decisions set model.route shadow --decider fixed_table cao decisions tier codex small model-small cao decisions tier codex large --unset cao decisions table model.route --profile developer small cao decisions table effort.route --role developer medium cao decisions exclude --add reviewer cao decisions exclude --remove reviewer cao decisions tune --on-timeout-ms 1000 --threshold 0.7 --retention-days 90 cao decisions list --point model.route --since 2026-01-01 --limit 100 cao decisions purge --before 2026-01-01 cao decisions purge --all --rotate-key cao decisions set task.features shadow --decider cao decisions set provider.route on --decider match cao decisions match show [--json] cao decisions match check cao decisions match explain --needs long_context --size medium --tier-auto --fallback claude_code ``` The operations stdio MCP server offers `decisions_status`, `decisions_off`, `decisions_set_point`, `decisions_set_tier`, `decisions_set_exclusions`, `decisions_list` and `decisions_purge`. These run locally in-process; there are no decision HTTP routes. The agent-facing MCP server has no tools to read, change or ask for decisions. Every tool on that surface is gated on the calling terminal's allowlist (its resolved `allowedTools`), which must carry `@cao-ops-mcp-server` (or `*`, or a glob that covers it) (#1062). `CAO_TERMINAL_ID` is forwarded into every server in a profile's `mcpServers` map, so the server knows which terminal is calling and reads that terminal's recorded list. **Whether listing the server grants these controls depends on the profile's allowlist, so check which case a profile is in:** - A profile with **no explicit `allowedTools:`** (and no `--allowed-tools` at launch) gets `@` appended for each server it declares itself (the #772 rule, see [Tool Restrictions](tool-restrictions.md#how-overrides-work)). Declaring the server under the key `cao-ops-mcp-server` therefore **does** grant it, for every role default including `supervisor` and `reviewer`. Listing the server only to reach `decisions_off` hands that profile every other control here except lifting a halt. The Kiro `tools:` field is not this list: setting it alone withholds nothing. - A profile that **pins `allowedTools:`** holds the grant only if the list names it. To declare the server and withhold its controls, pin `allowedTools:` without `@cao-ops-mcp-server`; `decisions_off` stays reachable regardless. - The grant is the fixed selector, not the key. A profile that declares the server itself under another key is appended `@`, which this gate does not accept. A server an agent plugin provides (`cao-ops` in the operator agent-plugin) is never appended at all; the operator names it. In both cases add `@cao-ops-mcp-server` beside the key's own entry. A bound terminal without the grant is refused on every ops tool, with two deliberate rules: - `decisions_off` stays reachable without the grant. It is argument-free and off-only — the operator's kill switch — and a fail-safe that needs a grant is not a fail-safe. A bound terminal that calls it is named, by the `CAO_TERMINAL_ID` it claims, in a WARNING on the operations server's log, so an operator who finds the node halted can see which terminal pulled it. See [Tool Restrictions](tool-restrictions.md). - Lifting a halt is refused for any bound terminal, grant or not: `decisions_set_point` to `shadow` or `on` removes the halt marker, so allowing it over MCP would let a caller undo an operator's `cao decisions off`. It takes an operator context — `cao decisions set ` on the CLI, or an MCP host running this server with no `CAO_TERMINAL_ID`. The refusal is enforced inside the mutation, not only in the middleware: `set_point` takes the exclusive egress lock, re-reads the marker under it, refuses before writing anything, and removes the marker only if it observed it under that lock — so a halt published beside a call already in flight survives. `decisions_off` publishes its marker *without* waiting for that lock, because the shared side is held for the whole of an outstanding decision request and a kill switch that waits on one is not a kill switch; an operator setter that finds the lock busy proceeds with a logged warning rather than losing the only way to lift a halt, while a bound caller is refused. An operator context — an MCP host with no `CAO_TERMINAL_ID`, which includes `cao-ops` in the operator agent-plugin when a client runs it outside CAO — is unchanged and may do all of the above. The same agent plugin delivered to an agent that CAO launches runs in a bound terminal and is gated like any other (see [Agent Plugins](agent-plugins.md)). “Operator only” therefore means an operator context: over the operations MCP server a bound CAO terminal needs the `@cao-ops-mcp-server` grant, and lifting a halt is refused there even with it. It is a same-user local control, not a privilege boundary: `settings.json` can be edited by the same user, including an agent with shell access. The same user can also install a decider package. Concurrent settings writers can lose updates because the existing settings writer is not atomic. ## Matching helpers to models ### Why A decider can size an ephemeral helper: with `model_tier: "auto"`, `model.route` answers small, medium or large. It can't tell which of *your* models suits the task, though. When we tested the hosted Jev decider, it ignored model names, model mappings and hints naming a model entirely; it judged every task on its complexity alone, and it did that well. So CAO splits the job. The decider answers four fixed yes/no questions about **the task**, and CAO matches the answers to **your models** locally, from facts you declare in `settings.json`. Your model list, costs and windows never leave the machine, and the decider sees the same task text it already sees for `model.route`. | Feature point | Asks | What CAO does with a confident `yes` | | --- | --- | --- | | `task.long_context` | Must a very large amount of text be held at once? | Prefer a model whose declared window is at least `long_context_tokens` | | `task.deep_reasoning` | Does it need long chains of careful reasoning? | Prefer a model declared `good_for` it | | `task.read_only` | Will it only read and report? | Prefer a model declared `good_for` it | | `task.needs_network` | Does it need the internet? | Nothing to routing. It adds a hint to the delegation note when the helper has no `web_fetch`; tools never change | It's **off by default**, and every doubt means today's behaviour: no feature flagged, no answer, a timeout, a bad catalog or `cao decisions off` all run the helper on the creator's CLI at the decider's size. ### Quick start 1. **Declare your models** in `settings.json`, next to the `model_tiers` that map them, and set `ephemeral.max_tier`: it's the highest tier a match may raise a helper to. There is no CLI to write the catalog yet; edit the file. ```json { "model_tiers": { "claude_code": {"medium": "claude-sonnet-5-5", "large": "claude-opus-5-5"} }, "ephemeral": {"min_tier": "medium", "default_tier": "medium", "max_tier": "large"}, "decisions": { "match": { "version": 1, "long_context_tokens": 500000, "models": { "claude_code": { "claude-sonnet-5-5": {"context_tokens": 200000, "cost": "medium"}, "claude-opus-5-5": {"context_tokens": 1000000, "cost": "high", "good_for": ["deep_reasoning"]} } } } } } ``` The windows and costs are your declarations; CAO doesn't verify them. Without `ephemeral.max_tier` the tier never rises, so a need only the large model covers gets `no_cover`. A helper with `model_tier: "auto"` needs `ephemeral.min_tier` and `max_tier`, and `default_tier` must be set with `max_tier`; every tier from `min_tier` to `max_tier` must be in `model_tiers`. To see what a launch would get, without asking a decider: `cao decisions match explain --needs long_context --size medium --options claude_code --tier-auto` picks `claude_code/large` (`rule: covered`). 2. **Check the declarations:** `cao decisions match check`. It names any declaration that `model_tiers` doesn't map, mapped models you haven't declared, and what covers `long_context`. 3. **Start in shadow.** Bind the features to a decider package that declares all four feature points, and keep `model.route` on: ```bash cao decisions set model.route on --decider cao decisions set task.features shadow --decider ``` Helpers launch exactly as before. Each launch records the four answers (`cao decisions list --point task.long_context`) and the match it *would* have made, on its `model.route` record (`match_rule`, `match_pick`). 4. **Turn it on** when the shadow records look right: `cao decisions set task.features on --decider `. ### An example with Claude Code and Codex A Claude Code supervisor creates a helper with `provider: "auto"`, `model_tier: "auto"` and `tools: ["fs_read", "fs_list"]`. Its task: *"Read the whole payments service and map every external caller of the charge API. Report only."* The decider answers `long_context` yes 0.88, `read_only` yes 0.97, the other two no, and `model.route` medium 0.90. **With Claude Code alone** (today's realistic case), the match picks the tier on the creator's CLI. Medium's model has a 200,000-token window and large's has 1,000,000, so `long_context` is covered only at `large`. The tier rises from medium to large, within `max_tier`: ```text ran on claude-opus-5-5 (auto: medium 0.90, matched long_context -> large) ``` **With Codex as a second option**, the match can also move the helper between CLIs, but only within an `ephemeral.provider_route.equivalent` set you declared. On today's capability table Claude Code is `hard` and Codex `advisory`, so a set naming both is refused, and the CLI half of the match routes nothing yet. It applies once a second `hard` or `sandboxed` CLI can be routed to, such as the contained Codex launch, or Kiro once CAO can route to it (Kiro helpers are already `hard`, but `provider.route` can't choose Kiro yet). Then, with `provider.route` bound to the built-in matcher (`cao decisions set provider.route on --decider match`) and these declarations: ```json "codex": { "gpt-5.5": {"context_tokens": 256000, "cost": "low", "good_for": ["read_only"]}, "gpt-5.5-pro": {"context_tokens": 2000000, "cost": "medium", "good_for": ["read_only"]} } ``` Once Codex is `sandboxed`, `cao decisions match explain` prints: ```text $ cao decisions match explain --needs long_context,read_only --size medium --tier-auto --options claude_code,codex catalog v1 · hash hmac:9f2c… · long_context_tokens 500000 options: claude_code (hard), codex (sandboxed) · tiers: medium..large (size medium, ceiling large) · fallback claude_code candidate model context cost long_context read_only claude_code/medium claude-sonnet-5-5 200000 medium - - claude_code/large claude-opus-5-5 1000000 high yes - codex/medium gpt-5.5 256000 low - yes codex/large gpt-5.5-pro 2000000 medium yes yes ◄ pick rule: covered (long_context, read_only) · tie-break: only · pick: codex/large ``` The helper then runs `codex --model gpt-5.5-pro` inside Codex's sandbox class (read-only or workspace-write, no network), where tool atoms are advisory and Codex always has a confined shell; the note says `ran on gpt-5.5-pro (auto: medium 0.90, matched long_context+read_only -> codex large)`. **Today** the same command prints `codex (advisory)` and `rule: rejected · runs the default: claude_code/medium`, because Codex is `advisory` and the match never pairs an advisory CLI with a hard one. ### The catalog: `decisions.match` | Key | Meaning | Rules | | --- | --- | --- | | `version` | the schema version | must be `1` | | `long_context_tokens` | what "very large" means to you | an integer from 1,000 to 100,000,000; default 500,000 | | `ignore_features` | routing features the match won't use (they're still asked and recorded) | a list of distinct `long_context`, `deep_reasoning`, `read_only`; default `[]` | | `models..` | one model you run on that CLI | the provider is a CAO provider ID; the model ID follows the model-ID rules | | `context_tokens` | its window | required; an integer from 1 to 100,000,000 | | `cost` | your relative cost | required; `low`, `medium` or `high` | | `good_for` | the features it suits | optional; distinct `deep_reasoning` and `read_only`. `long_context` comes from `context_tokens`, and `needs_network` never routes, so neither is accepted | No other key is accepted, and no field takes free text. A declaration never adds a model: a model ID that no `model_tiers` tier maps is **unreachable**. It's kept and warned about, and never used. | Problem | Effect | | --- | --- | | The block is absent | An empty catalog: nothing covers any need, so every helper runs as today | | Not an object; `version` missing or not 1; `models` not an object; an unknown top-level key; a bad `long_context_tokens` or `ignore_features` | **Matching is off for every launch** (`match_rule: catalog_invalid`), and helpers run as today | | An unknown provider; a bad model ID; a declaration with a bad value, a missing key or an unknown key | **That entry is dropped**, with a warning that names its key path | ### How the match picks 1. **Needs.** The routing features answered `yes` at or above `confidence_threshold`, minus `ignore_features`. With none, the helper runs as today (`none_needed`). 2. **Candidates.** Every CLI in the launch's options, at every tier in the band, that `model_tiers` maps. The options are `provider.route`'s (#1099): the creator's CLI plus the members of its equivalence set that pass every policy rule. The band runs from the decider's size (never below it) up to `max_tier`, but only when `model.route` is on and its answer was applied or capped. Otherwise the band is the helper's own tier, and only the CLI can change. 3. **Best cover.** The candidates covering the most important need first (`long_context`, then `deep_reasoning`, then `read_only`). If none covers any need, the helper runs as today (`no_cover`). 4. **Ties.** The lower declared cost, then the lower tier, then the creator's CLI, then the capability table's order. The record names the step that decided. The match never widens anything: no CLI outside the options, no tier outside the band, no model outside `model_tiers`, and the tools are never read or changed. A defensive check refuses a pick that would pair an `advisory` CLI with a `hard` or `sandboxed` one (`rejected`). **What may rise (#810).** #810's rule is amended for the match, and only for the tier. A decider still can never raise a helper's tier, providers or tools. CAO's own local match may raise a helper's tier, but only to a model you declared in `decisions.match` and only up to `ephemeral.max_tier`. It never raises providers or tools. | `task.features` | `provider.route` | `model.route` | What happens | | --- | --- | --- | --- | | off | bound to `match` | any | Exactly today. The `provider.route` record says `no_features`. | | shadow | any | any | The features are asked in the background. The would-be match is recorded, and nothing is applied. | | on | on, bound to `match` | on | The match picks the CLI and the tier | | on | on, bound to `match` | off, shadow or an explicit tier | The match picks the CLI at the helper's tier. No raise. | | on | off, shadow, one option or another decider | on | The CLI is decided as before; the match picks the tier on it, which can rise | | on | off | off | Nothing is matched, but each launch still makes one feature call and records the four answers. Only the network hint can come of it. | ### Records of a match Each feature point gets an ordinary record: `point` (`task.long_context` and so on), the decider, `answer`, `probabilities`, `confidence`, and `outcome` `applied`, `fallback` with a reason (`unsure`, `low_confidence`, `timeout`, `error`, `invalid_answer`, `no_answer`, `decider_unavailable`) or `shadow`. The `provider.route` and `model.route` records a match touches get these columns. They're null everywhere else, and an upgrade doesn't backfill them. | Column | Value | | --- | --- | | `match_rule` | `none_needed`, `covered`, `no_cover`, `no_features`, `catalog_invalid` or `rejected` | | `match_needs`, `match_covered` | JSON lists of feature names: the needs, and the needs the pick covers | | `match_tiebreak` | `only`, `cost`, `tier`, `fallback` or `order` | | `match_from` | on `model.route` records, the size before the match; `applied_value` holds the tier that ran | | `match_pick` | `/`; in shadow, what `on` would have run | | `catalog_version`, `catalog_hash` | `1`, and an HMAC of the validated catalog under `decision-hash.key` | A `provider.route` record answered by the matcher names `decider: match` and `decider_version: match-1`. When applied, its `answer` and `applied_value` are the chosen CLI, with `probabilities` `{CLI: 1.0}`. Otherwise its outcome is `fallback` with the reason `no_match`. Records never hold the catalog itself, and telemetry gains only a `cao.decision.match_rule` label. ### What can go wrong | Symptom | Likely cause | Fix | | --- | --- | --- | | Every feature record says `decider_unavailable` | The decider bound to `task.features` doesn't declare all four feature points | Install a package release that declares them, or bind another decider | | `match_rule: no_features` | The features are off, or the feature request timed out or failed (see the feature records' `reason`) | JevK5 answers the four questions one after another, so raise `on_timeout_ms` or keep `task.features` in shadow | | `match_rule: none_needed` | No feature was answered `yes` at or above `confidence_threshold` | Usually correct. Check the feature records' `confidence`, or tune the threshold for your decider | | `match_rule: no_cover` | No reachable, declared model in the options and band covers the need | `cao decisions match check`; declare the model; map it in `model_tiers`; check `max_tier` | | `match_rule: catalog_invalid` | A structural error in `decisions.match` | `cao decisions match show` names it | | The tier never rises | `model.route` isn't on, its answer was unsure or low-confidence, or the size is already `max_tier` | Turn `model.route` on, or raise `max_tier` | | The CLI never changes | The launch has one option: no valid equivalence set, or `provider.route` isn't bound to `match` | Expected on today's capability table; see the example above | | The note ends with the network hint | The decider said the task needs the network, and the helper has no `web_fetch` | Grant `web_fetch` in the spec if it really needs it. The hint never changes tools | ### FAQ **Does my model list leave the machine?** No. The decider gets the same task text and description as `model.route`'s request, with four fixed questions. The request is checked by a test that compares it with `model.route`'s. **Can the match run a model I haven't mapped?** No. The model always comes from `model_tiers`; a declaration only describes it. **Can task text steer it?** Yes, as it can steer `model.route`. The effect is bounded by your options, `max_tier` and the decider's own size answer. The worst case is the costliest allowed model on an allowed CLI. Use shadow first. **Why never below the decider's size?** The size is the decider's judgement of the task's complexity, which it's good at. The match only adds a capability the size can't express. **Jev or JevK5?** CAO's side is identical: the same questions, request, matching and records. Tune `confidence_threshold` and `on_timeout_ms` for the decider you bind. One of them answering a feature poorly is what `ignore_features` is for. Bind `task.features` only to a decider package that declares all four `task.*` feature points; with one that doesn't, every feature record says `decider_unavailable`. Check the package's own README for the points it declares. **How do I see why a helper ran where it did?** Its `model.route` and `provider.route` records, and `cao decisions match explain` with the recorded `match_needs`, the size (`match_from`), the `options` and the creator's CLI. It prints the same pick, rule, tie-break and hash. **Installed (non-ephemeral) launches?** Not in this version. Only ephemeral helpers ask the features. ## Records and telemetry The node's SQLite `decision_records` table holds one record per point per launch in shadow or on. Records include `state`, `decider` and `decider_version`, `fallback_value` and `fallback_source`, `answer`, `probabilities` and `confidence`, the capped candidate (`candidate_value`, `candidate_model`), `applied_value`, `outcome`, `latency_ms`, `reason`, `terminal_id`, `launched_model` and whether it was honored (`model_honored`). They also hold `message_hash`, `hash_key_id` and `message_bytes`. A `provider.route` record also holds `options`, the launch's options as a JSON list, and the enforcement labels of the fallback (`fallback_enforcement`) and of the applied provider (`applied_enforcement`); these three columns are null on every other record. On a `provider.route` record, `provider` is the provider the launch runs on and `fallback_value` is the creator's; the same launch's `model.route` and `effort.route` records name the provider it runs on. The upgrade adds the three columns and does not backfill them. The local matcher adds eight more nullable columns to the `provider.route` and `model.route` records it touches; see [Records of a match](#records-of-a-match). `cao decisions list` prints every column as JSON. `target_kind` is `installed`, `ephemeral` or `workflow`; `workflow` marks a script workflow's own step. Records written before the column existed keep `target_kind` null: the upgrade adds the column and does not backfill it. A policy model fallback records the tier as `fallback_value`; the mapped model appears in `launched_model` only when bound. An on-mode effort answer, applied or capped, is carried in the launch plan; only an ephemeral `effort: "auto"` launch applies it, through that plan. Like every record of a launch, an effort record also gets the launch's `launched_model` and `model_honored` at bind. A provider that declares no effort support records `effort.route` as `not_honored` without asking; only Claude Code (outside a native agent), Codex and Kiro helpers declare it. A launch is recorded as launched when the provider has been built and its start has completed or been scheduled. A deferred startup failure updates the record to `launch_failed` without emitting a second decision span. A cancelled deferred start also moves a previously launched row to `launch_failed`, with no second emission. `not_launched` and `launch_failed` mark different points of failure. `not_launched` means the launch was refused or abandoned before a create attempt ran: a refusal by the creator's delegation ceiling binds it directly, and every create route (`POST /sessions`, `POST /sessions/{name}/terminals`, `POST /terminals/run-step`) also re-binds any record still `pending` to `not_launched` in a `finally` block once its handler returns. That `finally` bind is how the per-node terminal cap refusal (`CAO_MAX_TERMINALS`/ `server.max_terminals` already reached) ends up `not_launched` too, even though it is raised earlier than, and independently of, the ceiling check. `launch_failed` instead means a create attempt was actually made and did not complete: once that attempt has started, any other exception is bound `launch_failed`, and the same status applies when a deferred startup failure or a cancelled deferred start moves a previously launched row back, in both cases without a second decision span. The attempt starts right after the terminal cap check, so any other validation refusal raised after that point — an unavailable ephemeral profile, a v3 (`kas`) request, an engine given for a provider other than Kiro, or a `caller_ceiling` conflict — is bound `launch_failed`, even though nothing was actually allocated yet. Records never hold task messages, descriptions, prompts or working directories. They hold no purpose either, except inside an ephemeral agent's name: `agent_profile` records that name, and ephemeral names include the purpose. Messages, descriptions and purposes are redacted before every decider call, including the fixed table. Installed profile names and roles are bounded and redacted facts; ephemeral targets send no profile name or role. Instead, an ephemeral target sends its redacted purpose and, when the creator wrote one, its redacted description in `profile_description`; it never sends the creator brief. A decider whose consent binds the fields it receives needs fresh operator consent before it sees an ephemeral description. The message hash is a keyed HMAC of the redacted canonical message, with a key identifier; the hash is never sent to deciders. The HMAC key is `decision-hash.key` in the database directory, mode 0600. Creation publishes a fully written temporary file with a link that cannot replace an existing key. A key file found with group or other access is restricted to 0600 when it is read; if that fails, the key is not used, no record is written and a warning names the file. Restrict or remove the file to recover; removing it starts a new key, as rotation does. Rotation removes the key; the next writer creates a new one and live writers use it without restarting. Purged records are deleted. Rotation breaks linkage to future records; it cannot revoke keys already copied elsewhere. Rotate with no launches in flight: a record written while the purge runs keeps a hash from the old key and is not purged. An exported record set without the key cannot confirm guessed messages. The same user can read the key and database. Retention defaults to 90 days, independent of terminal retention. A startup sweep marks pending decision work interrupted and pending launches unknown; rejected rows remain done/not-launched. Store errors are logged and do not fail a launch. Rejected launches emit telemetry at insertion, shadow tasks emit after deciding, and other records emit at the first bind. Each record emits once. A shadow decision that finishes before its launch is bound emits without the launched model or the honored flag; its record still gets both at bind. Spans use `cao.decision`; metrics use `cao.decision.requests` and `cao.decision.latency`. No message, description, hash or probability vector is exported, and metric labels never contain terminal IDs. Without the OpenTelemetry packages (the `[otel]` extra), decision telemetry is a no-op. ## Diagnostics The server logs one line of resolved settings at startup: the confidence threshold, the on and shadow timeouts, and each point's state and decider. It logs the line again when any of these change: within a few seconds of a save to `settings.json` or a change to the halt marker, and otherwise at the next launch. Decider configuration and excluded profiles are not logged. When a decider gives no usable answer, the server logs one warning that names the decider, the point and the reason: ```text Decision decider failing: decider=external point=model.route reason=timeout ``` The reasons that count as failures are `timeout`, `error`, `invalid_answer`, `no_answer` and `decider_unavailable`. The built-in `fixed_table`'s `no_answer` is the exception: it's how the table abstains for a profile or role, or an ephemeral target, that has no entry, not a failure. Other deciders' `no_answer` still counts as a failure, since it can also mean a swallowed error. The same reason again logs nothing more, however long it lasts. A change to another reason warns again, at most once a minute for each decider, point and reason; a failure that is still there after that minute is warned about then. The next answer logs one `Decision decider recovered` line, if a warning was logged. `unsure`, `low_confidence` and `tier_unmapped` are answers, so they end a failure. `not_honored` and `single_option` never ask the decider and change nothing. These lines hold labels only: never the task message, description, purpose, profile, decider configuration or exception text. A decider name with characters other than letters, digits, `_`, `.` and `-` is logged as ``. An error while logging never changes a decision or a launch. `cao decisions status` and the operations MCP `decisions_status` also return `decider_status`: ```json { "decider_status": { "window_hours": 24, "since": "2026-10-19T12:00:00+00:00", "available": true, "deciders": { "external": { "last": { "point": "model.route", "outcome": "fallback", "reason": "timeout", "decision_status": "done", "created_at": "2026-10-20T11:58:02.114203" }, "counts": {"timeout": 31, "answer": 4} }, "fixed_table": {"last": null, "counts": {}} } } } ``` For each decider with records, `last` is its newest record and `counts` counts its records created since `since`, by reason. A record with no reason counts as `answer`, or as `pending` or `interrupted` while its shadow decision is unfinished — `last.decision_status` carries this distinction too, so a pending or interrupted shadow record is never mistaken for an answer. Record times are UTC. The counts match `cao decisions list --since --limit ` for the same records, with `--limit` large enough to include every record in the window (at most 10000; `list`'s default `--limit` is 100). Installed deciders with no records are listed with `last: null` and no counts. Records without a decider are not counted, such as policy refusals and `decider_unavailable` or `out_of_scope` records; `cao decisions list` shows them. Status opens the database read-only. It never creates, initializes or migrates it, and reports `available: false` when the database is missing or cannot be read. `cao decisions set` prints settings only. ## Decider packages An installed package registers a class under `cao.deciders`. Its entry-point name must equal its declared name; the class declares a version and supported points. CAO discovers names at startup and constructs a decider only when an active point needs it. A decider package is trusted code, like any other installed dependency: CAO imports and constructs its class before checking what it declares. With every point off, no decider code runs. Failures are cached until restart. `async decide` must not block the event loop; every call has a timeout. External deciders must not expose decision access through agent-tool registration hooks. Core bundles only `fixed_table`; external deciders are optional installed packages. To install and enable one step by step, see [the setup runbook](ephemeral-agents-agent-setup.md). ## External deciders An external decider sends nothing until it has its own consent. Consent, endpoint disclosure and key handling belong to the decider package. Core redacts messages, descriptions and purposes before every call; redaction removes common credential shapes using patterns and is not a guarantee. Decision records hold no task content. Review the package's disclosure to learn exactly what it sends and where it sends it. The request also carries `options`. It is null except on a `provider.route` ask, so a decider that sends the whole request now sends one more `"options": null` key on model and effort asks. `CONTRACT_VERSION` is unchanged. A decider that declares every point, such as `frozenset(POINTS)`, is now also asked `provider.route` where that point is on; an answer outside the options falls back as `invalid_answer`. CAO asks a decider once per eligible delegation request, before the server's own launch checks. A request the server then refuses, for example because it exceeds the creator's delegation ceiling, has still been sent; its records read `not_launched`. External deciders must send only while holding `cli_agent_orchestrator.decisions.egress.egress_permit(point, decider)`: ```python async with egress_permit("model.route", "external") as permitted: if not permitted: return None # Check this package's consent before reading its key or sending a request. return await send_request() ``` The permit takes a non-blocking shared lock, then freshly checks the halt marker, the effective point state and the decider binding. In the running server it uses the same startup environment snapshot as the engine. It refuses if the lock cannot be opened or acquired. Keep the permit until the request finishes or is cancelled; never block the event loop. The lock file must not be removed or replaced while requests may be running. `cao decisions off` creates `decisions.halt`, writes every point off, then waits for in-flight permit holders to finish. The wait is the configured shadow timeout plus five seconds. A successful return requires the drain to finish, the halt marker to remain present, and every returned point to be off. Every external decider that follows the permit rule has then drained and cannot start another request while the halt remains active. If a concurrent explicit change re-enables decisions during off, the CLI exits 1 and operations MCP reports failure, asking the operator to re-run `cao decisions off`. The command does not recreate the marker over that newer action. A timeout produces a non-zero CLI exit code, and the halt remains active. If settings cannot be read or saved, the marker still switches every point off and the result reports `settings_saved: false`. Fix the settings before re-enabling decisions. The marker overrides settings, environment and startup flags. Setting any point to `shadow` or `on` removes it; `cao decisions set` then prints effective local states. The ops MCP `decisions_set_point` tool calls the identical operator `set_point` path, so it lifts the marker the same way on the same condition, returning the new effective state instead of printing it. This may also re-enable other points whose environment or startup flags select `shadow` or `on`; neither the CLI nor the ops MCP tool can see a running server's startup flags. `cao decisions status` shows `halted` and installed deciders' names, distribution versions and `builtin` or `external` classification without importing them. External entries carry the label “sends data off this machine only after its own consent”. A distribution providing the `cao.deciders` entry `` can also provide the console script `cao-decider-`, targeting `main(argv: Sequence[str] | None = None) -> int`. Core calls that function in-process: `enable ` passes `["consent", *extra]`, `disable ` passes `["revoke", *extra]`, and `show ` passes `["status", *extra]`. Additional arguments are forwarded, and the script's returned exit code becomes the CLI exit code. Use `-- --help` after the name to request the package's help. A decider with no script, including `fixed_table`, reports “no operator commands for ” and exits with code 2. Granting consent requires the package's interactive TTY command; operations MCP can read status and turn everything off, but cannot grant consent. Consent is a same-user local control, not a privilege boundary. CAO runs as you and verifies nothing about who granted consent; a package's record of who granted it is a provenance note, not an identity claim. Any process running as you, including an agent with shell access, can edit `settings.json` or a package's consent file and can read any key or endpoint the package stores. What keeps agents out of the *tool* surfaces is each profile's tool restrictions, now including the operations server: `@cao-mcp-server` gates every agent-facing CAO tool except the four callback-protocol exemptions (`send_message`, `complete_assignment`, `workflow_return`, `answer_user_prompt`) and the two `discovery`-granted tools, and `@cao-ops-mcp-server` gates every operations tool but `decisions_off` (#671, #972, #1062). See [Tool Restrictions](tool-restrictions.md) for both gates, the exemptions and the glob spellings that satisfy a grant. Two rules a package must follow do the rest: no agent-facing tool may grant consent, and its consent command must need an interactive terminal. CAO's own agent-facing tools offer no consent. None of this constrains an agent that already has a shell — it runs as you. ## Known limitations - Deferred assignment reports placement and the scheduled model before provider initialization finishes. A startup failure can occur afterward; after abrupt server loss, restart recovery can record a terminal-side failure while the decision record retains its last launch status as launched. - YAML workflow launches do not appear in decision records. - Elastic decision records stay on the remote node and are lost with it. - Effort routing has no normal delegation consumer: installed launches never ask `effort.route`, and only an ephemeral `effort: "auto"` launch applies a decided effort. - A decider that blocks the event loop cannot be preempted by an asynchronous timeout. - The task features are asked only for ephemeral helpers. With today's capability table no equivalence set validates, so the local match can raise a helper's tier on the creator's CLI but can't move it to another CLI. `cao decisions match` has no `declare` or `forget` verbs yet; edit `decisions.match` in `settings.json`. - The match meets the most important need first, not the most needs. With all three routing needs, a model covering only `long_context` beats one covering `deep_reasoning` and `read_only`; `match_covered` names what the pick covers. A rule that covers the most needs is a follow-up. - Terminal records expose the launched model and whether it was honored, independently of decision state; decision fields stay in operator records. - If a policy tightens between a launch and `create_terminal`'s own idempotent retry, the retry can be refused before replaying the existing terminal. This does not occur with an identity policy. Each replayed delegation create writes its own `not_launched` row; in shadow or on the decider is asked again. - A direct API delegation to a reserved ephemeral name without a claim, carrying a per-call model, is refused at the delegation site with HTTP 400 "set the tier in the spec instead of a per-call model". The response names no reason code and no decision record is written. The ephemeral launch policy never sees the request, so it does not log the refusal either. Assign and handoff refuse reserved names before sending any request. A claimed launch with a per-call model asks no decider and is refused, and logged, by the ephemeral policy itself. - A claimed ephemeral launch asks `model.route` only when its stored spec declared `model_tier: "auto"` (see [Ephemeral agents](ephemeral-agents.md#model-tier-auto)). Explicit and omitted tiers, and launches without a claim, ask nothing and write no record. The decided model applies through the launch plan only; the ephemeral archive stores the record ids. `effort.route` is asked the same way, only when the stored spec declared `effort: "auto"`, after `model.route` when both are declared; the decided effort applies through the launch plan only, like the decided model, and the live profile keeps the stored effort (see [Effort `auto`](ephemeral-agents.md#effort-auto)). `provider.route` is asked only when the stored spec declared `provider: "auto"`, before every other point; the decided provider applies through the launch plan only, and the registry row and live profile keep the creator's provider (see [Provider `auto`](ephemeral-agents.md#provider-auto)). - A delegation is decided before the server applies the creator's delegation ceiling. A launch the ceiling refuses (403) has still been decided: in shadow or on, the decider was asked once with the redacted message, and in on mode the refusal waits for that answer. Its records are `not_launched` with no terminal ID. Local assign and handoff check the ceiling before sending, so this affects direct API calls, remote placement and installed-policy refusals.