The Advent of Harnesses — Part 1 of 7 (Dec 1)
Every operating system was shaped by its user. Unix was built for programmers on teletypes, so it gave them text streams, pipes, and tiny composable tools. macOS and Windows were built for humans with mice, so they gave us windows, menus, and click-through dialogs.
Now we have a new kind of user. An LLM lives natively in text, has finite working RAM, never touches a mouse, and chokes on UI chrome and schema bloat. Building an OS where the LLM is the user means re-bending the core operating-system primitives around those constraints. That is the thread running through The Advent of Harnesses, a seven-part engineering notebook drawn from building ansi in Rust. Today we’re starting with tools!
Coding agent harnesses have split into two camps.
On one side, batteries-included harnesses (like Claude Code and OpenCode) expose a rich native tool surface and then bolt on the Model Context Protocol (MCP) for external services, bespoke subagent RPCs for delegation, interactive permission modals for safety, and a separate WebSocket or JSON-RPC daemon protocol for frontends. Pretty soon, the system prompt is hauling 30 to 60 JSON tool schemas and 180 KB API responses dump straight into the conversation window.
On the other side, minimalist harnesses (like Pi) push back aggressively: shrink the system prompt under a thousand tokens and give the model a few primitives.
The growing number of tools, however, is only a symptom of a broader fragmentation: without a unified interface for how an agent interacts with the world around it, every new capability (external services, subagents, permissions, frontends) invents its own tool or protocol. Operating systems researchers ran into the same problem thirty-five years ago.
Back to 1992: Plan 9
In the late 1980s, Unix had a problem that should feel eerily familiar to anyone building agent harnesses today.
Unix had been designed for a single time-shared minicomputer. Its elegance came from one unifying idea: everything is a file. But once computing shifted to networks of workstations, file servers, and compute servers, Unix didn’t extend the file abstraction across the network. Instead, everyone bolted on a pile of incompatible protocols (BSD sockets, SunRPC, NFS, X11, bespoke ioctls, etc.) until every resource spoke its own dialect and required its own glue code.
So the original Unix authors at Bell Labs (Ken Thompson, Rob Pike, Dave Presotto, and Howard Trickey) started over. They built Plan 9, resting the entire operating system on three interlocking ideas:
- Every resource is a synthetic filesystem over one wire protocol (
9P). Bytes on disk, of course, but also network connections (/net/tcp/clone), running processes (/proc/<pid>), window managers, and later even your email inbox (upas/fs) were virtual directory trees driven exclusively byopen,read,write, andclose. - Per-process private namespaces. There was no single global root visible to everyone. Each process got its own composed
/tree and later editions pushed the same principle to credentials withfactotum, a secret-holding fileserver that kept keys outside applications entirely. If something wasn’t mounted in your namespace, it didn’t exist to you. - Location transparency. Because
9Pwas a network protocol from day one, mounting a remote machine’s network stack, disk, or service into your local tree (import) looked identical to reading a local file.
Plan 9 was technically gorgeous, but as is often the case, the better technical solution did not win.
With hindsight, it probably lost for a simple reason: humans didn’t want to pipe awk over /net/tcp/clone or /mail/fs to check email. Graphical apps and web browsers were taking over, and people got hooked on clicking around (Rob Pike actually tried to bridge that gap with Acme, a mouse-driven interface built entirely around text and 9P). There was no incentive to improve the foundations; the industry kept the messy protocol stack and hid it behind pixels.
All is not lost. Thirty-five years later we invented a new kind of user, the AI agent, that lives natively in text, already speaks Unix pipelines fluently, and gets measurably worse every time you stuff 60 bespoke JSON-RPC schemas or OAuth popups in front of it. I had the idea that LLMs have the potential to be very good Plan 9 citizens.
So when I started building ansi, an experimental agent harness written in Rust, I wanted to test what happens if you take that claim literally and push minimalism past “4 to 7 tools” all the way to its logical extreme:
Give the model literally one tool:
bash. Make everything else in the runtime a Plan 9 (9P2000.L) virtual filesystem.
I just wanted to run an experiment: in a simple bash-only world, how much of a modern agent harness collapses into one small primitive? The idea of a bash-only agent is hardly new, and I have seen the idea of Plan 9 for agents floating around, but to my knowledge this is the first attempt at trying to bring this all the way to its logical conclusion.
One Tool Inside a Zero-Network VM
If you inspect the exact HTTP request ansi sends to a model on any turn (ansi show request SESSION --turn 1), the tools array contains a single entry:
[
{
"type": "function",
"function": {
"name": "bash",
"description": "Execute a shell command.",
"parameters": {
"type": "object",
"additionalProperties": false,
"properties": {
"command": { "type": "string" },
"timeout": {
"type": "number",
"minimum": 1,
"maximum": 600.0,
"description": "Seconds before the command is killed (default 120)."
}
},
"required": ["command"]
}
}
}
]Every session gets a persistent Bash process inside a Bubblewrap namespace inside a lightweight Linux VM. The VM has no network interface, no host environment variables, and a curated read-only /bin (bash, git, rg, fd, jq, ast-grep, and a small shell helper called call — we’ll come back to this later). Your project is mounted at /workspace (via VirtioFS on macOS or QEMU virtfs on Linux).
The Linux kernel mounts 9P2000.L natively inside the guest (mount -t 9p) over the host’s private channel. Mounted beside /workspace over that channel is the session’s entire universe:
/
├── workspace/ # Your project (read/write via VirtioFS / virtfs)
├── help # Prose map of the namespace for the model
├── now # Host UTC clock (RFC 3339), computed on open
├── self # This actor's unguessable credential name (p-<uuid>)
├── context/ # Last prepared prompt & harness pins (Part 4)
├── skills/ # On-demand SKILL.md docs, read only when needed
├── tools/ # Mounted MCP servers & host-brokered services
├── events/ # Triggering event & transactional publish/wait (Part 5)
└── agents/ # This session (self/) and any delegated children

Fig 1A — Today’s bespoke middleware stack (40 MCP tool schemas, 180 KB inline blobs, and three separate RPC protocols) vs. ansi’s single bash tool and unified 9P tree.
Once that / tree is mounted, Plan 9’s three bets start knocking down modern harness problems one after another.
I - Synthetic Files Collapse Tool, Subagent, and IPC Sprawl
The first bet of Plan 9 is that a service shouldn’t invent a custom RPC surface when a directory of synthetic files will do. In ansi, that one idea absorbs three separate subsystems that most harnesses build from scratch: MCP tools, subagent orchestration, and frontend IPC.
1. Taming MCP Token Bloat With Files (/tools/)
MCP solved connectivity, but created a context-engineering headache:
- Every connected server dumps its tool schemas into the prompt upfront (although we have found ways around it).
- When a tool returns 250 Linear issues or 50 Gmail threads, the entire JSON blob is shoved straight into the model’s conversation history, burning thousands of tokens just to extract four fields.
In ansi, an MCP server (packaged as a small plugin YAML like plugins/linear/plugin.yaml) never adds a single tool to the LLM’s tools array. Instead, the host holds the OAuth credentials, maintains the shared MCP connection, filters exposed tools by the agent’s policy grants (linear: [read]), and projects each allowed tool as a directory under /tools/:
/tools/linear/list_issues/
├── help # Short prose description of the tool
├── input.schema.json # Draft 2020-12 JSON Schema
└── call # Control file: write {id, input}, read invocation path
This is directly borrowed from Plan 9’s /net/tcp/clone idiom: you open a factory control file (call), write your request, and get back a fresh invocation directory (/tools/linear/list_issues/<inv>/{status, result, ctl}).
Inside Bash, a ~240-line Bash + jq wrapper called call handles the file-descriptor boilerplate (open SERVICE/call, write {id, input}, read the invocation path, and block on <invocation>/result):
# Discover what is mounted (zero schemas were in the system prompt!)
call --list
# /tools/linear/list_issues
# /tools/linear/get_issue
# /tools/web/search
# Read the schema only when about to call it
call /tools/linear/list_issues --schema
# Save a huge 250-issue payload to /tmp WITHOUT putting it in the LLM context,
# then extract just the fields we care about with jq:
call -o /tmp/issues.json /tools/linear/list_issues \
'{"fields":["id","title","status","assignee","priority","updatedAt","url"],"state":"In Progress","limit":250}'
jq -r '.[] | select(.priority <= 2) | "\(.id)\t\(.title)"' /tmp/issues.jsonLook at what happened to the context window: 250 JSON objects (~180 KB) stayed on disk in /tmp/issues.json, and only the 5 matching lines (~400 bytes) ever entered the model’s history.
And because every invocation is a real 9P directory with an explicit idempotency --key, long-running calls decompose into standard async shell primitives for free:
inv=$(call --no-wait --key q1 /tools/web/search '{"query":"9P2000.L flush semantics"}')
call status "$inv"
call wait "$inv" -o /tmp/search.jsonIf call wait is interrupted with Ctrl-C, it stops waiting locally without cancelling the remote work and retrying with the same --key and input recovers the exact same invocation instead of double-executing.
2. Subagent Delegation Without a Delegation Tool (/agents/)
Once external APIs are just directories with call, status, and result, a natural question follows: why should delegating to another agent require four new tools (spawn_agent, check_agent, wait_agent, cancel_agent) and a bespoke polling state machine?
Plan 9 already showed how to represent live processes in a filesystem: /proc/<pid>/{status, ctl, mem}, where you inspected state with cat and stopped a process by writing to ctl.
In ansi, /agents/ is /proc for sessions. A session is just a directory, /agents/new is its clone file, and waiting for an answer is literally cat.
Here is what the raw 9P protocol looks like straight from Bash to launch two parallel investigations and collect their answers:
# 1. Admit two child sessions by writing one JSON line each to /agents/new.
# Each child gets its own Bubblewrap shell and snapshot of the workspace.
exec 3<> /agents/new
printf '{"name":"parser","objective":"Find why escaped delimiters fail in lexer.rs"}\n' >&3
child1=$(cat <&3)
exec 3<&-
exec 4<> /agents/new
printf '{"name":"tests","objective":"Audit delimiter regression tests in tests/"}\n' >&4
child2=$(cat <&4)
exec 4<&-
# 2. Both children are now running in parallel. Inspect status anytime:
cat "$child1/status"
cat "$child2/status"
# 3. Blocking until a child finishes is literally reading its answer file.
# The 9P server parks the read until turn 1 commits a terminal answer.
cat "$child1/turns/1/answer"
cat "$child2/turns/1/answer"Steering a child into a second turn, or cancelling it, is just writing a line to ctl, exactly like Plan 9’s /proc/<pid>/ctl does:
printf '{"op":"send","message":"Also check UTF-8 boundaries in the same loop"}\n' > "$child1/ctl"
cat "$child1/turns/2/answer"
# Or cancel:
printf '{"op":"cancel"}\n' > "$child2/ctl"Notice that we didn’t need:
- A polling loop. A 9P
streamfile (turns/1/answer) simply parks the reader until the answer commits in the journal. - A separate permission layer. Writing to
/agents/newenforces the exact same tree limits (jobs.max_executing: 8), lineage rules, and slot-yielding (waiting parents release their execution slot while children run) as the CLI. - Special UI plumbing. Every child directory has the exact same shape as
agents/self/:status,config.json,events,progress,ctl,turns/N/{input,status,progress,answer}.
3. “One Door”
Originally, ansi had two protocols:
9Pfor the model inside the VM.- A custom JSON-over-Unix-socket RPC protocol (
ipc-v0) for the CLI (ansi attach,ansi ls,ansi status,ansi stop) to talk to the background runtime daemon.
Halfway through building it, the Plan 9 logic caught up with me: why were we maintaining a second protocol to observe and steer the exact same session directories?
So we deleted ipc-v0. Now there is only one door:
- The model inside the VM opens
/agents/self/ctland writes a line. ansi attachopens the runtime socket, attaches by session ID, writes a prompt toctl, and parks a read oneventsstarting at the cursor it last saw.ansi statusandansi stopattach at the trusted root, readstatus, and write{"op":"shutdown"}toctl.- Even a human’s local shell holding a plugin lease attaches to the private socket using the lease token as its actor name and runs the exact same
callscript against/tools/....
There is no pub/sub subscription handshake to race, no missed-event gap between snapshot and stream (reading events at cursor N streams everything after N and parks at EOF), and any client in any language that can pack little-endian integers can drive the runtime.
II - Private Namespaces Replace Permission Modals
Handing an LLM bash on your laptop is normally a security nightmare, which is why most harnesses trap you between clicking [Allow / Deny] forty times a session or giving up with --dangerously-skip-permissions.
Plan 9’s second bet, per-process private namespaces paired with factotum-style secret isolation, turns security from an interactive dialog into a structural property of the filesystem.
In Plan 9, factotum held your passwords and keys in a separate process so applications never saw raw secrets in memory. In ansi, the host plays that role: the VM has no network interface and no host credentials, so the 9P socket over vsock is the only bridge out of the sandbox. OAuth tokens and API keys never enter the guest; the agent only ever sees the specific /tools/ endpoints its policy grants.
There is still one issue: when Session A and Session B share a single Linux VM for speed, how do you keep Session A from snooping on Session B’s files, tools, or children?
Plan 9’s answer is almost embarrassingly simple: unlisted roots + unguessable names. On the private VM socket, the root directory refuses readdir. Each Bubblewrap session is handed only its own p-<uuid> actor name and bind-mounted inside that subtree. A guest cannot list sibling actors, cannot climb out via .., and cannot reach host mounts.
III - Attaching Remote Resources for Free
Plan 9’s third idea is the one that may look most futuristic: location transparency.
Think about what just happened when the agent ran call /tools/linear/list_issues: the Bash process sat inside an offline Linux VM with no TCP stack and no credentials, yet it talked to a remote SaaS API by reading and writing a local path. The 9P server on the host bridged the boundary transparently.
Because 9P is transport-agnostic, location transparency works in both directions without teaching the model a single new concept.
In Plan 9, import mounted a directory from another machine straight into your local tree (import gpubox /dev/cuda /dev/cuda). In a bash-only agent harness, that same mechanism means attaching external compute or remote resources never requires installing SDKs inside the sandbox, punching holes in the VM firewall, copying API keys, or bloating the system prompt with new tool schemas:
- Need a beefy remote GPU box? Mount its
/tools/cuda/into the session’s namespace; the agent runs the samecallcommand it uses for local tools. - Need a subagent running on a cloud microVM or CI cluster? Mount it under
/agents/; waiting for its answer is stillcat. - Need a human’s local shell to borrow an agent’s authenticated plugin without exporting tokens? Attach to the same 9P socket with a scoped lease.
Every credential stays pinned to the host that owns each service, and the model’s interface never changes: one tool (bash), one / tree. (When you combine this with content-addressed context from Part 3, your laptop, GPU server, and cloud runners collapse into a single federated operating system. We’ll unpack how far that goes in Part 7.)
Limitations
9P is obviously not the solution to everything. Here’s where “one tool, everything is a file” showed its limits in practice:
- Filtered queries don’t fit directories. You can represent
journal/events/<id>as a file andjournal/streamas a tailing file, but a directory tree cannot naturally express “give me the last 20 events for session X matching type Y.” Soansikept one escape hatch at the trusted root:journal/query, a control file that accepts a JSON filter line and streams matching events back on the same open handle. - Immediate file writes vs. transactional intent. When an event-driven agent writes a downstream event to
/events/publish, the syscall returns0immediately, so it looks like the event fired. In reality, it only staged a proposal in memory that commits atomically if both the turn and workspace landing succeed (more on that in Part 5). Control files blur “this happened” and “this is staged to happen” unless thehelptext and/events/pendingmake it unmistakable. - Raw 9P control files are ergonomic for machines, verbose for models. Typing
exec 3<> ...; printf ... >&3; cat <&3repeatedly wastes tokens and invites Bash quoting mistakes. That’s why thin, stateless shell wrappers likecall(andcontextin Part 4) still earn their keep on top of the pure 9P layer. - The RL-training trade-off (
bashvs. nativeedit). Frontier coding models are heavily RL-trained on structuredread/edit/greptool schemas, so forcing all file edits throughbash(sed,python3, heredocs) trades a bit of RL-tuned edit ergonomics for zero schema bloat, universal Unix composability, and rock-solid KV cache stability. However, (1) more recent models seem to naturally use heredocs and python to edit files (2) models are extensively trained on Unix pipelines (rg,jq,git,ast-grep), so the gap is narrower than you’d expect. Thin shell helpers close most of the rest.
Takeaway
Looking back at the whole stack side-by-side, almost every “feature” of ansi turned out to be a side effect of three Plan 9 ideas:
| Plan 9 Principle | Modern Harness Problem | What Collapsed in ansi |
|---|---|---|
Synthetic files over 9P | Tool/MCP bloat, giant API blobs, subagent polling, duplicate CLI/daemon IPC. | One tool (bash). /tools/ + jq keeps 180 KB on disk; /agents/ makes waiting cat; ipc-v0 deleted. |
Private namespaces (factotum) | Per-command [Allow / Deny] modals vs. --dangerously-skip-permissions. | Zero-network VM + host-only secrets + non-listable 9P root (p-<uuid> capability mount). |
Location transparency (import) | Brittle SDKs, sandbox firewall holes, and credential sprawl across machines. | Remote SaaS, GPU boxes, or cloud agents mount into / over 9P with zero new model tools. |
No one will be surprised that you can do plenty with bash. Other harnesses have taken that path. But I was surprised by what happened to the harness itself: once you treat an agent as a native citizen of Plan 9 and use a virtual filesystem as the single boundary, tool discovery, MCP output filtering, subagent orchestration, secret isolation, remote mounting, and frontend IPC all collapse into one small abstraction.
Part 2 will be a tad lighter. We will look at what happens to the human interface once safety lives at that zero-network VM boundary.
I am Rémi Louf, CEO of dottxt. Follow @remilouf / @dottxtai for our work on reliable agent systems.