Brain-Hands Decoupling

concept
ai-agentsarchitecturedecouplingseparation-of-concerns

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:

ComponentRoleKey interfaceFailure mode
BrainClaude + harness loopwake(sessionId)Reboot, replay from session log
HandsSandboxes, tools, MCP serversexecute(name, input) → stringCatch error, provision new sandbox
SessionAppend-only event logemitEvent(), 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