Brain-Hands Decoupling
An architectural pattern for agent systems that separates reasoning (the “brain”) from execution (the “hands”) and state (the “session”) into independently replaceable components behind stable interfaces.
The pattern
Three components, each behind a minimal interface:
| Component | Role | Key interface | Failure mode |
|---|---|---|---|
| Brain | Claude + harness loop | wake(sessionId) | Reboot, replay from session log |
| Hands | Sandboxes, tools, MCP servers | execute(name, input) → string | Catch error, provision new sandbox |
| Session | Append-only event log | emitEvent(), getEvents() | Durable storage, survives both |
The brain calls the hands the way it calls any other tool — through a uniform interface. It does not know whether the sandbox is a container, a remote VPC, a phone, or any other execution environment. The session sits outside both, providing durability and recoverability.
Why decouple
Coupled systems create “pets” — named, hand-tended individuals that can’t be lost. When the brain and hands share a container: if the container fails, the session is lost; if it’s unresponsive, operators must debug inside a container holding user data; and connecting to new infrastructure (e.g., a customer’s VPC) requires network peering because the harness assumes co-location.
After decoupling, every component is “cattle” — interchangeable and replaceable. The brain is stateless (session lives elsewhere). The hands are provisioned on demand. The session persists independently.
Relationship to OS design
The analogy is explicit in the source: operating systems virtualized hardware (disk, memory, CPU) into abstractions (file, process) general enough for programs that didn’t exist yet. The read() system call is agnostic to whether it’s reading a 1970s disk pack or a modern SSD. Brain-hands decoupling virtualizes agent components the same way — the execute() call is agnostic to what runs behind it.
Connections
- Managed Agents Architecture: the system that implements this pattern
- Meta-harness: the design philosophy that motivates decoupling
- Hermes Agent takes the opposite approach — a single process with 6 terminal backends. This works for a developer tool but limits infrastructure flexibility
- Capsules: isolated environments for agents — the “hands” in this pattern
- The user notes that the boundary between software and hardware is an implementation detail — brain-hands decoupling embodies this: the brain’s interface abstracts away whether the hands are software containers or physical devices