Domain Responsible Agents
A DRA (Domain Responsible Agent) owns responsibility for one domain of a project — authentication, the engine, performance. It is woken by events in its domain, reads what happened, and creates or updates tracker tasks. It never changes code and never stops or deletes runs.
DRAs are new and still settling. Zero DRAs is the default and changes nothing. The DRA image needs the saga binary on the build host, and a DRA cannot yet mark its own tasks ready for the loop — a person promotes them.
Layout
.cloche/dras/<name>/
charter.md # required: the domain, what it may do, the skills it uses
notes.md # the DRA's memory; created empty if missing
The directory name is the domain. It follows the same rule as a label: lowercase letters, digits, and -. cloche validate reports a DRA with no charter.md or an invalid name.
Cloche never commits notes.md. Whether notes are tracked in git or ignored (e.g. .cloche/dras/*/notes.md in .gitignore) is your choice.
Domains are labels
A task whose labels include a DRA’s name belongs to that DRA. A task has one owner: with two matching labels the first is used and the daemon logs the ones it ignored.
Triggers
A DRA is woken by events, never kept running.
| Trigger | Fires when |
|---|---|
| Task result | A task in the DRA’s domain finishes, fails, or parks. A task stopped on request is not a result. |
| Signal | A signal arrives with domain naming the DRA. The wake-up is sent after handle-notification ran, so the task it created already exists. |
| Ruling | cloche dra ruling <name> --question <id> --message <text> — a ruling arrived on a question the DRA asked. |
| Heartbeat | cloche dra heartbeat <name> — wakes the DRA if it has not been woken, for any reason, for the heartbeat interval. |
Batching. An event never starts a run by itself. It joins the DRA’s inbox, and the daemon delivers the whole inbox as one wake-up message: events wait while the DRA is awake and while the budget gate is closed, then go out together. Nothing is dropped. If a wake-up itself fails its events are not replayed; the next heartbeat covers it.
Heartbeat. There is no time trigger in the DSL yet, so drive the heartbeat from a host workflow with a poll step whose script runs cloche dra heartbeat <name>. Calling it more often than the interval is harmless — the daemon decides whether a wake-up is due. Set the interval per project (default 4 hours; "off" disables):
# .cloche/config.toml
[dras]
heartbeat = "4h"
No self-wake. Signals whose source is dra:<name> do not wake the DRA that sent them.
Wake-ups
A wake-up is an ordinary recorded run (dra-wake-<name>, with token usage like any other). The message saying what happened is written to .cloche/runs/<run-id>/wake-message.md.
- Session. Each DRA has a named Claude Code session. The first wake-up starts it; later ones resume it. If resuming fails, the run falls back to a fresh session rebuilt from
charter.mdandnotes.md— the notes are the memory. - Notes. The agent is told to read
notes.mdfirst and update it before stopping.notes.mdis copied back to.cloche/dras/<name>/notes.mdwhen the container is cleaned up, whether the run succeeded or failed. Nothing else is extracted. - One at a time. A second wake-up of a DRA that already has one running is refused, not queued.
- Budget. Automatic wake-ups are not started while the daily budget cap is exceeded.
cloche dra wakeis hand-started, so it still runs, with a warning.
What a DRA may do
Inside its container a DRA reaches the daemon only through a per-wake-up credential that stops working the moment the run ends. With it, cloche tasks [create|update|find|close], cloche list, cloche status <run>, and cloche logs <run> --step <s> work; every other command is refused.
- A task it creates always carries the DRA’s domain label.
- Update and close are refused for a task that lacks that label, and
findnever reveals another domain’s task. A DRA cannot remove its own domain label. - Everything else is refused: stop, delete, resume, shutdown, loop control, project purge, signal tokens, other projects.
These limits are enforced on the HTTP API and the CLI. The daemon’s gRPC port is still unauthenticated, so they hold today only for a DRA that uses the CLI it is given.
The locked-down container
A DRA runs under tighter limits than a workflow run. A workflow (or a single step) selects the profile in its container {} block; unknown profile names fail the step rather than falling back to an unrestricted container.
workflow "dra-wakeup" {
container {
profile = "dra"
// optional:
// image = "cloche-dra:latest" // default for this profile
// notes = ".cloche/dras/performance/notes.md" // default .cloche/dras/<workflow>/notes.md
}
...
}
| Limit | Detail |
|---|---|
| Own image | cloche-dra:latest holds cloche-agent, cloche, clo, saga, and the model CLI. No compilers, make, git, tracker CLI, push credentials, or tracker data. |
| Read-only project | Everything under /workspace is root-owned and not writable by the agent, except the DRA’s own notes.md. |
| Enforced network allowlist | The container joins a Docker --internal network with no route out. An egress sidecar relays only the model API (api.anthropic.com:443), the daemon port, and the Saga port (CLOCHE_SAGA_ADDR=host:port in the daemon’s environment). Anything else gets 403 egress denied or no route. |
| No extras | CLOCHE_EXTRA_MOUNTS and CLOCHE_EXTRA_ENV are not applied. No --privileged, no added capabilities, no-new-privileges. |
| Fails closed | If any lock-down step fails, the container exits without starting the agent and the run fails. |
make install builds the image next to the agent image when saga is on the build host’s PATH (override with SAGA_BIN=/path/to/saga); make docker-dra builds it alone. Without saga the image is skipped and DRA runs fail until it is built — cloche doctor reports a missing image when a workflow uses the profile.
Commands
cloche dra list [--project <dir>]
cloche dra wake <name> --message <text> [--project <dir>]
cloche dra ruling <name> --question <id> --message <text> [--project <dir>]
cloche dra heartbeat <name> [--project <dir>]
list prints each DRA’s name, its session id (- until the first wake-up), its last wake-up, and the first heading of its charter. See the CLI reference.