Harness: composing the patterns

LLM / environmentagent pattern
Agent loopWorkflowsTools ยท MCPSkillsContextMemorySubagentsGuardrailsLLM
  1. The LLM alone: no tools, no state, no environment.
  2. Each agent pattern is one piece.
  3. Composed around the LLM, they form the harness.
  4. The harness is the environment: any task in, grounded result out.
Notes & references

Use when

Any agent beyond a single call: choose the pieces the task needs.

Avoid

Assembling every piece by default: each adds latency, tokens and failure modes.

harness = compose(
    llm,
    loop       = agent_loop(max_turns),
    workflows  = [chain, route, evaluate],
    tools      = [*native, *mcp],
    skills     = discover("skills/"),
    context    = [cache_prefix, compaction],
    memory     = [working, semantic, episodic],
    subagents  = orchestrator(workers),
    guardrails = [input, hitl, output],
)
result = harness.run(task)