# Exo: Harnesses should see their own code and logs — Alex Krentsel <!-- ref: @content/youtube/latent-space/2026-08-15-exo-harnesses-should-see-their-own-code-and-logs-alex-krentsel version: 3 updated_at: 2026-10-31T19:23:51.158Z --> Alex Krentsel (Latent Space, 2026-08-15): Krentsel argues that agent improvement has shifted from model weights to the harness. Because the harness is a few thousand lines of code, and LLMs write code, an agent can now inspect and rewrite its own machinery at runtime. **[Watch on YouTube](https://www.youtube.com/watch?v=5lFD-34dhqE)** *Synthesized from Alex Krentsel on Latent Space, 2026-08-15.* Alex Krentsel is a UC Berkeley PhD student advised by Sylvia Ratnasamy, who works with Scott Shenker and Ion Stoica. They have a background in core networking, SDN controllers, and formal verification, and co-built Exo with Martin Casado and Ankur Goyal of Braintrust. ## Core Thesis Krentsel argues that agent improvement has shifted from model weights to the harness. Because the harness is a few thousand lines of code, and LLMs write code, an agent can now inspect and rewrite its own machinery at runtime. Exo "collapses the loop": instead of an outer optimizer tuning an inner system, the running agent improves itself. This is made safe by an architecture that splits an agent into a stateless executor, a protected stateful harness, and an isolated sandbox. ## Key Insights - **Origin in AI-driven discovery.** Krentsel spent about a year on discovery systems at Berkeley's Sky Lab, including the Sky Discover project, which runs an outer loop that optimizes an inner system. If you also want to optimize the optimizer, you need an outer-outer loop, and the recursion never ends. Krentsel's way out is to make the system responsible for improving itself. - **OpenClaw is extensible only in narrow ways.** OpenClaw took off in February. Its one truly dynamic surface is memory, which is literally a memory markdown file injected into context on every call. Its other extension points are plugins (memory, tools, skills), usually installed because a human asks. Exo's goal is to make *everything* changeable by the agent, including the components and the connections between them, not just the plugin slots. - **An agent is mostly "policy."** Krentsel defines an agent as an LLM call wrapped in machinery that builds context and executes actions. Everything in that machinery is policy. Examples include whether to include the last 10 messages or the last 100, and whether to keep 10 messages plus a summary of the previous 90 (compaction). Prompts, tools, skills, and how they are injected also count. In OpenClaw, Pi, and Claude Code, all of this is fixed in source code. Exo makes it self-editable. - **Three-layer decomposition:** - **Executor:** fully stateless. Holds all policy: context assembly, prompts, compaction, tools, skills, and the LLM call. - **Exo harness:** holds protected state. This includes conversation history, the secret store (e.g., API keys), artifacts such as memories, and snapshots of environments. - **Sandbox:** the isolated environment where actions like bash commands actually run. It is separate from the process running the policy. - Under this split, an "agent" is the combination of history stored in the harness, the policy running in the executor, and the sandbox it acts on. - **What makes Exo self-improving.** Exo mounts the executor's own source code into its sandbox, so the LLM can decide to edit its own harness at runtime. A guardian process in the exo harness rebuilds the executor mid-step and then "soaks" it by letting it run one step. If the new build breaks, it is rolled back to the previous state automatically. With this mechanism the agent can build tools, write skills, change context assembly, and modify adapters. - **Self-inspection beats an outer loop.** While Exo was playing Pokémon, it decided on its own to inspect the game's RAM. It mapped memory locations (world position, active Pokémon, in-battle booleans), much as humans had previously reverse-engineered by hand. It then modified its own game integration to feed that data into its system message. An outer loop would need a full cycle of design, launch, observe, and reflect to do the same. - **You trust a machine either way.** The host described running a separate external bot (Devin) to modify an internal bot. Krentsel replied that this still depends on trusting a machine to make the changes. The real difference is whether an external system inspects the agent, or the running system inspects itself. - **Architecture can enforce what alignment can't.** Krentsel argues that properties like "never delete history" belong in the harness architecture, not in a prompt asking the model to behave, because models can be tricked. - **Secrets stay in the harness.** If an agent runs in the same environment as an API key, the key can be exfiltrated. Exo keeps a secret store on the host and injects secrets into the executor without exposing them inside the container where tools run. The host suggested adding access logs and monitoring for unusual access patterns, such as a routine task requesting AWS keys. - **Teleportation matters for scale, not laptops.** Consider an agent sandbox per user, reasoning over each user's event stream. About 100 containers fit on one machine. At 50,000 users you run out of local space, so sandboxes can be started on, or moved to, providers like Daytona or E2B. You only need a few policy processes awake at a time. Krentsel also uses `actually.dev`. - **Separate how from what.** Sub-agents, memory strategy, and similar choices are policy that lives in the executor as code. The resulting state, such as the actual memories, lives in the harness as artifacts. The host summarized this as separating compute from storage. - **Adapters and voice.** Exo ships adapters for Discord, IRC, and WhatsApp. Voice mode exists in the Discord adapter as a cascaded pipeline, not a real-time interactive model. - **Interruptibility is unsolved.** In OpenClaw, a thread that is busy working can't be interrupted, and you can't see what it is doing. Krentsel expects an OS-style fix: background tasks (like tmux panes) that are exposed to the agent, with signals or a pub/sub bus to wake it. - **Cost-annotated logs enable cost self-optimization.** The exo harness stores a cost annotation on every message, so the executor can reason about what each part of a conversation cost. One Discord message cost 16 cents. Asked to fix that, Exo rearchitected its own Discord adapter at runtime to scope context to specific conversations and threads instead of pulling messages across threads. This cut cost by about 96%, and the change was later committed upstream. - **Self-improvement needs an evaluator.** Without an evaluator there is no signal to optimize against, or the agent finds a signal of its own that doesn't match your goals. Under cost pressure, the cheapest move is to stop doing the task, which is a reward hack. Discord quality is nearly binary and easy to check. Something like an insurance agent needs a held-out eval set, either supplied to the agent or built with it as internal tooling. Krentsel and Ion Stoica have a paper forthcoming on this. - **Why RSI is possible now.** Improving a model used to mean changing weights through backprop. You can't feed a trillion-parameter model's weights back into its own context. A harness is a couple thousand lines of code, the same medium LLMs produce. Krentsel calls this truly self-recursive, as opposed to "autocatalytic" improvement such as computers helping design chips. The host compared it to Lisp and Smalltalk. - **Credits and status.** Ankur Goyal drafted the first layered architecture. The three co-builders spent the first 3–4 weeks hardening the harness, after which Krentsel shifted the focus to self-improvement. Martin Casado commits code. The Exo harness and agents built on it run in production at Braintrust. Zed's ACP protocol is not yet implemented. ## Actionable Takeaways 1. Split your agent into three layers: - A stateless executor for all policy. - A protected harness for history, secrets, artifacts, and snapshots. - A separate sandbox for running tool actions. 2. Keep API keys in a host-side secret store and inject them into the executor. Never put them in the container where tools execute. Log and monitor secret access. 3. Enforce invariants like "never delete conversation history" in the harness architecture, not in prompts. 4. To enable self-modification, mount the executor's source into the sandbox. Add a guardian that rebuilds the executor mid-run, soaks it for one step, and auto-rolls back on failure. 5. Annotate every logged message with its inference cost so the agent can find and reduce expensive context. One example is scoping Discord context to a single thread, which cut cost by ~96% from a 16-cent message. 6. Before asking an agent to optimize cost, give it an evaluator, such as a held-out eval set or self-built check tools, so it can't "save money" by skipping the work. 7. Design for scale-out: when local container capacity (~100) runs out, move or start sandboxes on remote providers (Daytona, E2B) while keeping only a few policy processes active. 8. For long-running work, background tasks and wake the agent via signals or pub/sub so threads stay interruptible. 9. Try Exo: one-line install script at github.com/exoharness/exo, with docs, tutorials, and a contributor Discord linked from the repo. ## Notable Quotes > "I want the system to be able to change itself at runtime." — Alex Krentsel > "I'm not an ML person kind of coming down into agents. I'm a systems person coming up." — Alex Krentsel > "You are still trusting a machine when you have an outer separate agent modifying the inner agent." — Alex Krentsel > "The executive is fully stateless." — Alex Krentsel > "That's actually crazy. Like go work on driving that down." — Alex Krentsel, on a 16-cent Discord message > "The agent harness is a couple thousand lines of code. And our LLMs are producing output tokens in that same space." — Alex Krentsel --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*