# Harness-Level Continual Learning: Traces, Loops and Self-Edits (2026)
<!--
ref: @knowledge/syntheses/harness-level-continual-learning-2026
type: framework
tags: [continual learning, harness, traces, skills, eval loops, self-improving agents]
version: 1
updated_at: 2026-11-01T03:06:09.765Z
-->

Task-shaped synthesis for making an agent improve from its own production use by changing the harness, not the weights. Five 2026 accounts: an audit for whether your stack can learn from usage at all, a trace-to-skill-on-cron loop, LangChain's four loops, Bridgewater's red-first teach button, and a self-modifying executor with a guardian rollback. For the model/harness/memory split that decides where a fix belongs, start at `@knowledge/frameworks/three-layer-agent-improvement`.

### Continual-Learning Readiness Audit

> Most agent products throw away the experience that could make them better, so before you try to learn from production use, check whether your stack can actually record, replay and grade it.

*Synthesized from Arjun Karanam (co-founder, Trajectory), "Continual Learning: How AI Agents Get Better With Every Use," Sequoia Capital.*

Arjun Karanam describes a gap between how smart models are and how much experience they have. Frontier models keep gaining raw capability, but each conversation still feels like their first day on the job. The traces agents produce in production are the obvious material for closing that gap, and most teams discard them. Trajectory starts customer engagements with an audit across four areas. Karanam says most companies have a lot of work to do before learning from usage is possible at all.

#### When to use

- Before investing in RL, fine-tuning or any "learn from usage" project for an agent product.
- When an agent's quality has stalled even though usage is high.
- When choosing which infrastructure to build next on an agent platform.

#### The audit

**1. Traceability: can you see the whole run?**
- Log the full execution tree, including every tool call and every sub-agent invocation, not just the top-level action. A run you only partly logged can't be learned from in full.
- Collect corrections, not ratings. Karanam says thumbs up/down is very noisy. Coding-agent users accept almost everything and only notice the damage "five commits later." Edits, undos and retries are much stronger signals.
- Design the UX so users show you what the right answer was. Recording what they do passively isn't enough.

**2. Evals: does your test environment match production?**
- Ideally the product, the eval environment and the training environment are the same thing.
- Build eval sets from real traffic. Include what users do today and the requests at the edge of capability that the product currently fails.
- Make every task "rollout-able," meaning you can replay any user's task from start to finish. Karanam calls this the hardest infrastructure item and also the one with the biggest payoff.
- Grade through the exact harness used in production, not a simplified copy.

**3. Harness: is it built for current models?**
- Many harnesses were designed around models from 12 to 18 months ago and are mostly guardrails against breakage and malformed output. Karanam argues models are now capable enough to "let the agents cook."
- Give the agent primitives (search, data access, write tools) and let it orchestrate them, instead of forcing it through fixed flows.
- Match the agent's interface to the UI: anything a user can do in the UI, the agent can do with a tool call. This lines up what users do with what the agent can do, which makes training much simpler.
- Make tool responses informative. A tool that returns only "done" tells the agent nothing and gives training nothing to learn from. Return what was read or written and the resulting state.

**4. Models: can you own and change the weights?**
- Build the ability to run open-weight models. Karanam warns this is much more than swapping one endpoint for another. He counts roughly 50 additional concerns, including security, safety and access provisioning. Owning the weights is what lets you keep improving them.
- Experiment with model routers that send each task to a model matched to its difficulty.

#### Gotchas

- Item 2's replay infrastructure is what the other items depend on. Without it, rich traces are records you can read, not environments you can train in.
- Trajectory sells continual-learning infrastructure, so this checklist is partly a description of its own onboarding. The individual items are still sound engineering advice on their own, especially informative tool responses and full-tree tracing.
- If customer data can't be used for training, Karanam (drawing on his time at Apple) suggests sampling its distribution, generating synthetic data, and checking that the two distributions match, instead of training on raw records.

### Trace-to-Skill-on-Cron

> Do a task once, well, with an agent. Have the agent turn that session into a tested skill, put the skill on a schedule, and treat every later failure as a bug fix that stays fixed.

*Synthesized from Garry Tan, "Garry Tan: New Rules for Founders" (a16z, 2026-08-12).*

Garry Tan, CEO of Y Combinator, sums up his approach as "a markdown file is an employee." He says the method applies to any repeated business process: sales, marketing, support and engineering. His open-source GStack project applied it to engineering roles: a PM skill, an engineering-manager skill that enforces unit and end-to-end test coverage, and a QA loop that runs in a browser. He also tells a story of companies reaching about $15M ARR in roughly four months with 2–3 people and a few hundred skill files. Treat that as an anecdote, not evidence.

### Four Loops of Agent Harness Engineering

> A model's intelligence is fixed. An agent's usefulness comes from the loops built around it, and each outer loop makes the inner ones work better.

*Synthesized from Sydney (LangChain open-source PM), "The Art of Loop Engineering: How to Build Agents That Improve Over Time," LangChain, 2026-07-23.*

#### The model

Sydney argues that the advantage lies less in the agent itself than in the loops wrapped around it. She describes four loops. She draws them nested like Russian dolls, but says they can be combined in any order. For example, you can put an event trigger around a bare agent loop with no verifier.

| Loop | What it is | What it automates | Where a human belongs |
|---|---|---|---|
| **1. Core agent loop** | The model receives context, calls tools, reads the results and decides for itself when it's done. | The work | Sensitive tool calls, such as sending email or booking travel |
| **2. Verification loop** | A grader scores each result against explicit rubric criteria. Failures go back into loop 1. | Reliability | Inside the grader, especially when the criteria are ambiguous |
| **3. Event-driven loop** | Scheduled or event triggers (Slack, email, GitHub) start the agent, and its output changes those systems. The changed system then prompts the next trigger. | Improvements to external systems | Reviewing artifacts, such as a PR before merge |
| **4. Hill-climbing loop** | A background analyzer reads traces to find failure modes, then edits the harness's prompts, tools, skills and memory. | Improvements to the agent itself | Approving changes to harness or agent code |

#### How to apply each level

- **Loop 1.** Choose the right tools and match model size to task difficulty to control cost. Keep rewriting tool descriptions until the model uses the tools correctly.
- **Loop 2.** Write concrete thresholds, such as "all tests pass and coverage ≥95%" or "all links resolve and CI passes." Review the generated criteria before the run starts. Sydney says verification lets cheaper models handle longer tasks, much as to-do lists once kept early models on track.
- **Loop 3.** Sydney says this is the loop that makes agents something people actually use. Put the agent where requests already happen. Her example is a `#docs-please` Slack channel: the agent drafts a docs PR, a verifier checks it, and the agent posts the review request back in Slack.
- **Loop 4.** In her words, "the story is in traces," not in code. Look for three things:
  - tools called with the wrong arguments
  - tool calls the agent missed because it lacked the needed context
  - user preferences the agent keeps ignoring
  - an inefficient tool-call trajectory, even when the outcome was correct

  Improvements come in two kinds. Procedural fixes change prompts, tool descriptions and skills. Semantic fixes add facts to memory, such as "write formally to my boss."

#### Decision rules

- **Fix information before architecture.** Sydney says most failures happen because the agent lacks the right information, not because the model is too weak. Change memory, skills and prompts first. Add deterministic code or restructure the graph only when a required step keeps getting skipped.
- **Evals gate loop 4.** Merge a harness change only if the eval suite shows no regressions. Keep two tiers of evals:
  - baseline evals that work like unit tests and catch regressions
  - hard end-to-end evals you can steadily improve against
- **A verifier is an eval.** Sydney repeats a line she heard: a verifier is "an eval in a trench coat." Proving that it improves production results still requires both online and offline evals.
- **Put limits on every loop.**
  - Set subagent timeouts and a maximum number of cycles.
  - On retries, compress earlier attempts and keep only the current artifact, the rubric and the goal. This reduces context rot.
  - Loops add latency, so trade off strength against speed. A stronger model needs fewer grader passes. A weaker model needs more verification and therefore takes longer.

#### Speculative "loop 5"

Sydney floats a fifth level that works like reinforcement learning. The system proposes harness changes, runs the full eval suite and auto-merges a change if it beats a set threshold. She is clear that most teams should still have a human review changes to agent code today. Treat this level as a direction, not a practice.

#### Caveats

The examples come from LangChain's own tooling (Deep Agents, LangSmith Engine, Dcode). She also claims that competing coding agents don't let you inspect their rubric, and she doesn't back that claim up. The four-loop structure doesn't depend on any vendor. The comparison between products should be checked independently.

### Teach Button: Red-First Agent Improvement Loop

> Let users flag a bad agent turn. A background agent then reproduces the failure as a failing benchmark, fixes the context until that benchmark passes, checks for regressions, and opens a PR for human review.

*Synthesized from Michael Wren and Santi White, "How Bridgewater Built an AI Analyst That Does Hours of Expert Research in Minutes," LangChain, 2026-07-24.*

Bridgewater runs its PAT research agent with hundreds of expert internal users. One way it learns is that background agents review finished conversations on their own. The other is a "teach" button that users press. This protocol describes the button.

#### When to use
- Your users are domain experts who can tell when the agent did something wrong.
- The agent's behavior depends on context repositories or harness code that are under version control.
- You already have a benchmark suite to check for regressions.

#### Steps
1. **Capture.** The user presses "teach" on a conversation.
2. **Diagnose.** An agent reads the conversation and names the gap. It might be a behavioral mistake, missing context, or a correction the user had to make that the agent should have anticipated.
3. **Confirm with the user.** The user edits or approves the diagnosis. Experts usually describe the gap better than the builders could. As Santi White puts it, "Your user is better at writing context than you are."
4. **Write the benchmark red first.** A back-end agent writes a benchmark that is *expected to fail*. If it fails, the bad behavior has been reproduced. If it passes, the problem hasn't been captured yet, so return to step 2.
5. **Iterate on the fix.** The agent edits the context repositories or the harness until the new benchmark passes.
6. **Check for regressions.** Run the full suite and confirm nothing else broke.
7. **Open a PR.** Open a pull request with the change and announce it where reviewers will see it (Bridgewater posts to Slack). A human reviews and merges it.

#### Gotchas
- If you skip the red-first step, a "fix" may pass a benchmark that never captured the problem.
- The loop is only as trustworthy as the eval. It works much better when outputs are deterministic (see agentic-coding-as-a-compiler) than with LLM-as-judge scoring.
- Merged fixes apply to every user, so review the PRs for changes that suit one user's preferences but should not be imposed on everyone.

#### Related
incident-to-eval-review-autonomy · stuck-to-unstuck-knowledge-harvest · three-layer-agent-improvement

### Self-Modifying Harness with Guardian Soak-and-Rollback

> A harness is a few thousand lines of code, and code is what LLMs write. So let the running agent edit its own harness, and let a guardian decide whether the edit survives.

*Synthesized from Alex Krentsel on Latent Space, "Exo: Harnesses should see their own code and logs" (2026-08-15).*

Krentsel's argument is that agent improvement has moved from weights to the harness. A trillion-parameter model can't read its own weights, but an agent can read its harness, because the harness is in the same medium the model produces. Optimizer stacks like Berkeley's Sky Discover use an outer loop to tune an inner system. That approach recurses without end, since you then need an outer-outer loop to tune the optimizer. Krentsel's alternative is to collapse the loop so the running system improves itself.

> **Vocabulary.** "Harness" in the title is used loosely, as in the episode, to mean the agent's policy code. In the strict terms of `executor-harness-sandbox-split`, the agent edits the **executor**. The protected **harness** (history, secrets, guardian) is exactly what it must *not* be able to touch.

#### Prerequisite

Use a stateless executor that holds all policy, separate from a protected harness that holds history and secrets (see `executor-harness-sandbox-split`). Without that separation, a bad self-edit can corrupt state that can't be recovered.

#### Steps

1. **Mount the executor's own source into the agent's sandbox.** The agent can now read and edit its own prompts, context assembly, tools, skills, and adapters.
2. **Let the agent decide when to edit.** Don't wait for a human to request a plugin. The model chooses to change its machinery mid-task.
3. **Rebuild mid-step via a guardian.** A guardian process in the protected harness, not in the executor, rebuilds the executor from the edited source.
4. **Soak the new build for one step.** Run a single real step on the rebuilt executor.
5. **Auto-roll back on failure.** If the build or the soak step breaks, restore the previous executor automatically. History is untouched, because it never lived in the executor.
6. **Promote good changes upstream.** Edits that prove out can be committed back to the shared codebase. Exo's cost fix (below) was handled this way.

#### Worked examples from the episode

- **Self-instrumentation.** While playing Pokémon, the agent decided on its own to inspect the game's RAM. It mapped addresses for position, active Pokémon, and battle state, then rewrote its game integration to put that data in its system message. An outer-loop optimizer would need a full design-launch-observe-reflect cycle to reach the same change.
- **Cost self-optimization.** The harness tags every logged message with its inference cost. When shown that one Discord message cost 16 cents, the agent rewrote its own Discord adapter to scope context to the relevant thread instead of pulling messages across threads. Krentsel reports a roughly 96% cost reduction.

#### Gotchas

- **No evaluator, no safe optimization.** Self-improvement needs an evaluator. Without one, the agent either has no signal or invents its own. Under cost pressure the cheapest "fix" is to stop doing the task, which is a reward hack (see `coding-agent-eval-integrity`). Some domains, like Discord chat, are nearly binary and easy to check. Domains like insurance need a held-out eval set, either supplied to the agent or built with it, before any optimization pressure is applied. See `verifiable-continual-learning`.
- **A one-step soak catches crashes, not regressions.** It proves the build runs. It does not prove the build is better. Pair it with the evaluator above.
- **The "external agent is safer" intuition is weaker than it looks.** If a separate bot edits your agent, you are still trusting a machine. The real choice is between external inspection and self-inspection, not between machine and no machine.

Related: `executor-harness-sandbox-split`, `three-layer-agent-improvement`, `capability-overhang-unhobbling`, `verifiable-continual-learning`, `coding-agent-eval-integrity`.

Exo is open source at github.com/exoharness/exo. Krentsel says it runs in production at Braintrust.

## Sources

- `@content/youtube/sequoia/2026-08-13-continual-learning-how-ai-agents-get-better-with-every-use-a`
- `@content/youtube/a16z/2026-08-12-garry-tan-new-rules-for-founders`
- `@content/youtube/langchain/2026-07-23-the-art-of-loop-engineering-how-to-build-agents-that-improve-over-time`
- `@content/youtube/langchain/2026-07-24-how-bridgewater-built-an-ai-analyst-that-does-hours-of-expert-research`
- `@content/youtube/latent-space/2026-08-15-exo-harnesses-should-see-their-own-code-and-logs-alex-krentsel`

---

*Related: `@content/web/huggingface/2026-11-23-acap-async-coding-agents-robot` · `@content/web/github/2026-11-25-claude-code-v2-1-332` · `@content/web/github/2026-11-20-opencomputer` · `@content/web/github/2026-11-24-builtin-ship-shadows-user-skill` · `@content/web/github/2026-11-17-open-artifact`*

---

*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).*