Autonomy, idle scanner, and safe automation
ContextRelay has an optional automation surface: a way for agents to dispatch read-only helper agents, and a daemon-side scanner that can notice idle moments and surface (or, when fully armed, act on) opportunities. This is the part of ContextRelay where you could spend tokens or let an agent take an action on its own, so this page is deliberately conservative.
Everything described here is off by default. The recommended posture for normal work is to leave it that way. When you do want more automation, turn it up one notch at a time, watch what it surfaces, and never let it cross the human-authority boundary described at the bottom of this page.
- Backup-agent autonomy: off (
autonomy.enabled = false). - Idle scanner: off (
autonomy.idleScanner.mode = "off"). - Autonomous edits (
act:write): off, behind a separate layered gate (see Enabling act:write safely).
None of these turn the others on. Each is an independent, reversible opt-in.
If you have not yet read Read-only by default: safety and containment, start there - it explains the fail-closed model that this page builds on.
The autonomy ladder, at a glance
There are two related-but-separate switches, plus their budgets:
| Switch | Command | Default | What it unlocks |
|---|---|---|---|
| Backup-agent autonomy | ctxrelay autonomy on|off|status | off | Agents may explicitly request read-only backup analysis (ask_codex_backup / ask_claude_backup). |
| Idle scanner | ctxrelay idle-scanner off|suggest|ask|act|status | off | The daemon may surface idle opportunities; ask/act additionally require autonomy on. |
The scanner's ask and act rungs are gated by backup-agent autonomy. Turning the scanner to ask or act while autonomy is off only records suggestions - the CLI will remind you to run ctxrelay autonomy on first.
Backup-agent autonomy (read-only helpers)
Backup-agent autonomy controls one thing: whether either agent may dispatch an explicit, read-only helper agent for a second opinion. With autonomy on, Claude can call ask_codex_backup and Codex can call ask_claude_backup; either side can inspect results with backup_status.
ctxrelay autonomy status # print the full autonomy config block
ctxrelay autonomy on # allow explicit read-only backup-agent requests
ctxrelay autonomy off # block all backup-agent requests
Backup agents are intentionally limited:
-
Read-only. They run with restricted toolsets and never write files, run git, or take outward actions. The configured
backupModeis"read-only"and there is no setting that makes a backup agent writable. -
Explicit. Nothing dispatches a backup agent on its own. An agent has to ask, in-band, using the documented trigger phrases:
[IMPORTANT] ASK_CODEX_BACKUP: <read-only help request>[IMPORTANT] ASK_CLAUDE_BACKUP: <read-only help request> -
Throttled and bounded. Repeated requests for the same target are rate-limited, and each run is bounded by the read-only idle-action budgets described below.
Enable autonomy when you genuinely want a second, independent read-only pass - for example, "have the other agent sanity-check this diff before I finalize." Leave it off for routine work; a normal handoff or deliberation is usually the better tool, because it keeps both agents in the same conversation rather than spawning a throwaway helper.
The idle scanner
The idle scanner is deterministic and lives in the daemon. Agents do not run it; the daemon derives opportunities from the shared ledger and runtime state when both agents are quiescent and the scanner is armed. It dedupes by opportunity fingerprint and only re-arms on a state change, so it does not chatter.
It has four rungs:
ctxrelay idle-scanner status # show mode, full scanner config, and whether autonomy is on
ctxrelay idle-scanner off # default - the scanner does nothing
ctxrelay idle-scanner suggest # record pull-visible idle_opportunity lanes only
ctxrelay idle-scanner ask # record pull-visible idle_opportunity lanes only (behaves like suggest today)
ctxrelay idle-scanner act # may also dispatch one bounded read-only worker (requires autonomy on)
What each rung does:
off(default): nothing happens.suggest: the daemon recordsidle_opportunitytask lanes in the ledger. These are pull-visible only - no live prompt is pushed at the agents. You (or an agent, when it next reads context) can review them on your own schedule.ask: records the same pull-visible lanes assuggest; no live prompt is pushed. The rung is reserved for a future one-question escalation and behaves likesuggesttoday.act: may additionally dispatch one bounded read-only worker to gather evidence. Requires autonomy on, and the worker is constrained by the idle-action budgets and per-action env caps below. (When the separateact:writesurface is fully enabled,actis also the rung that a contained writable worker can run on - but that is a different, independently gated feature; see Enabling act:write safely.)
The opportunity kinds the scanner can raise are failed_check_no_followup, dirty_tree_finalizable, and claimed_complete_unverified. You can suppress specific kinds with autonomy.idleScanner.disabledKinds, and tune emission with autonomy.idleScanner.advisoryTrigger (owner_waiting by default, or strict for the older dual-idle gate). See the config.json reference for the full structured shape.