← All courses

EDGE FDE

Intermediate

Agent Harness: Build and Improve the Loop

Ship agents that stay safe and get better from real runs, not from model hype.

Define a harness, name its six layers, sketch a small harness, and run an improve loop using traces + golden checks.

The model gets the hype. The harness gets the results.

What you'll learn

Notes that shaped this framing: Mark Ajzenstadt (@mardehaym) on harnesses. The rest of the course stays on a small harness you can improve from real runs.

Lessons

  1. The harness is not the model
  2. Six layers of a working harness
  3. Sketch a tiny harness
  4. The loop that improves the harness
  5. Write what good looks like

Exercises

  1. Evolve your agent's prompt with GEPA

Key concepts

Takeaways

Agent briefs

FAQ

What is an agent harness?

The harness is everything wrapped around the model. An agent is a controlled workflow: trusted context, bounded tools, evaluation, human judgment, and ops ownership. The model is the smallest, swappable part.

What are the six harness layers?

Trigger, Orchestration, Tools, Trusted context, Control, and Runtime. Trusted context does about 80% of the success. Model choice is config in the runtime layer.

What is in a tiny harness?

Recipe instructions, a scoped context pack, fixed tools such as calc_kpi, a verifier, guardrails, and a MAX_STEPS loop limit. A missing metric stops the loop.

When do I fine-tune the model?

After the suite already encodes the miss. The loop is production, bad outcome, traces, golden case, harness change, eval. Change the harness before you fine-tune.

Who writes what good looks like?

A human. The control layer holds the golden set, guardrails, and approvals. A named owner decides, and the agent stops and asks when evidence is missing or confidence is low.

Run an agent with a state machine · Test AI behavior before you ship · Trace every step of an AI call · Stop prompt attacks and leaks · Build a context packer for on-device AI · AI Full-Stack Operator · Reliable Local Agents (llama.cpp + Ollama)