The four layers of an agent system are loop, graph, harness, and meta-harness. When an agent burns tokens, declares the task complete, and then fails the tests, that is usually an architecture problem, not a prompting problem. The loop verifies work against external evidence. The graph decides where execution goes next. The harness is the model's operating environment — tools, permissions, memory, context, logging. The meta-harness governs many harnesses so context and policy can move between agents. Mercury Core is built as the harness and the meta-harness. This loop is not Mercury Loop, the managed service.
Agent architecture, verification loops, workflow graphs, agent harnesses, meta-harness governance, human-agent operating systems, prompt engineering limits, Mercury Core, Booster Packs, OpenClaw memory
Mercury Technology Solutions, Mercury Core, Mercury Flux, Mercury Loop, OpenClaw, Booster Pack, Unified Bus, Agent-native infrastructure
[ SYS: MERCURY_CORE // FIELD_NOTES ]
Field notes on agentic systemsThe Four Layers of an
Agent System
An agent burns tokens, declares the task complete, and then fails the tests. That is usually an architecture problem, not a prompting problem. Here is the stack — and how to find which layer failed.
Four runtime layers. Build from the loop up.
What the four layers of an agent system are
- AI agents usually fail from architecture, not prompting: a better prompt cannot create a missing tool, gate, route, or policy.
- The four runtime layers are loop (verify work), graph (route work), harness (expose capability), and meta-harness (govern many harnesses).
- A reliable loop stops on external evidence — a passing test, a green build, a validated output — never on the model's self-assessment.
- Mercury Core is the operating system built as the harness and the meta-harness: one memory, one interface, one policy layer.
- The loop on this page is a runtime pattern. Mercury Loop is a different product: a managed service that keeps the OS from drifting.
Four layers at a glance
| Layer | Job | Failure | Fix first |
|---|---|---|---|
| Loop | Verify work until evidence says stop | Agent “completes” without a test, build, or validation gate | Add a measurable stop condition |
| Graph | Decide where execution goes next | Wrong route, no fallback, improvised handoffs | Make branches, retries, and specialists explicit |
| Harness | Expose tools, memory, permissions, context, logging | The model understands the task but cannot touch what it needs | Expose the missing capability — a Booster Pack on Mercury Core |
| Meta-harness | Govern many harnesses; move context under one policy | Claude Code, Codex, and internal agents as uncoordinated silos | Shared policy, isolation, and portable context — the Core substrate |
What is an agent loop?
An agent loop is the smallest unit of agency: act, check the result, then stop or try again.
A reliable agent never stops because the model believes the work looks correct. It stops on external evidence — a passing test, a green build, a validated output.
Act → check → (fix) → done
Watch the agent attempt the task twice. The first pass feels done — the check disagrees. Only the second pass passes the gate.
Loop idle. Run it to watch a failed check, then a passing gate.
The rule
Stop on measurable conditions: tests pass, build succeeds, output validates — never on the model's self-assessment.
Without verification, an agent confidently declares success while the task is still incomplete.
What is an agent graph?
An agent graph decides where execution goes next: branches, retries, specialist handoffs, fallback paths, and shared state.
A loop decides whether execution continues. A graph decides where it goes. Once a workflow has multiple routes, the graph makes them explicit, inspectable, and controllable.
Graph idle. Route a task to watch a standard path fail over to a specialist.
What is an agent harness?
An agent harness is the model's operating environment — tools, APIs, files, memory, permissions, context, and logging.
The model provides reasoning; the harness determines what that reasoning can actually do. Model capability and agent capability are not the same thing.
The model may understand exactly how to solve a task. But if the required tool, data source, or permission is not exposed through the harness, the agent still cannot complete it.
Five capabilities make the model operational. One gap makes the whole run fail — no matter how good the prompt is.
What is a meta-harness?
A meta-harness is the common layer above multiple agent harnesses: orchestration, governance, isolation, shared policy, and portable context.
Real teams run Claude Code, Codex, internal agents, and domain specialists side by side — each with its own tools, sessions, policies, and execution environment. Without a meta-harness, humans become the copy-paste layer between walled gardens.
The moving point is context: a validated result or shared state crossing from one harness to another under one policy layer — instead of being copy-pasted between walled gardens.
The one-line diagnostic
A better prompt cannot compensate for a missing capability.
— triage heuristic, agent architecture
The heuristic is about ordering, not dismissal. Prompt engineering is real and valuable — it shapes how well the model uses what the harness exposes. It just cannot create what the harness never exposed.
The right sequence: fix the layer first (add the tool, the gate, the route, the policy), then tune the prompt to use that capability well. Prompting on top of a broken stack is polish on a cracked foundation.
Four questions before you rewrite the prompt
Loop failure
Graph failure
Harness failure
Meta-harness failure
The diagnosis. Then the substrate.
These four runtime layers are why a better prompt still fails when the harness is missing. Mercury Core is the operating system built as that harness and the meta-harness above it — one memory, one interface, one policy layer.
The five memory layers on Core are how the OS stores truth. OpenClaw is that fabric. The four layers on this page are how work is allowed to run.
A Booster Pack is how Core exposes a tool, a view, and a memory schema together — the harness, snapped in.
The loop on this page is the runtime gate: act, check, stop on evidence. Mercury Loop the product is a different thing: a managed service that keeps the OS from drifting away from the business.
When the gate is a model pass, Mercury Flux routes the cheapest capable model and stops on tests before anything ships.
Next step
Install the layers. Do not polish the prompt.
If the failure is missing tools, shared memory, or fleet policy, the next page is the operating system — not another prompt pack.
Agent architecture FAQ
What are the four layers of an agent system?
- Loop, graph, harness, and meta-harness. The loop verifies work against external evidence. The graph decides where execution goes next. The harness is the model's operating environment — tools, permissions, memory, context, logging. The meta-harness governs many harnesses so context and policy can move between agents instead of being copy-pasted.
Why do AI agents fail even with a good prompt?
- Because prompting cannot create what the harness never exposed. If the stop condition, route, tool, or shared policy is missing, the model can still reason correctly and the run still fails. Diagnose the layer first, then tune the prompt.
Is an agent loop the same as Mercury Loop?
- No. An agent loop is a runtime pattern: act, check, stop on evidence. Mercury Loop is a managed service that deploys Entry, Analyst, and Implementer agents to find and close infrastructure drift. Same word, different product.
How does this relate to Mercury Core and OpenClaw?
- OpenClaw is Mercury Core's five-layer hierarchical memory — how the OS stores truth. These four runtime layers are how work is allowed to run. Core is built as the harness and the meta-harness: humans and agents share memory, interface, and policy. A Booster Pack snaps a tool, a dashboard, and a memory schema into that harness.
Why can't a better prompt fix a missing tool?
- Prompting shapes how well the model uses what the harness exposes. It cannot create a tool, permission, data source, or policy the environment never offered. Fix the layer first, then tune the prompt.
What is a meta-harness?
- The common layer above multiple agent environments. Teams already run Claude Code, Codex, internal agents, and specialists side by side. Without a meta-harness, each is a walled garden. With one, they share policy, isolation, and portable context. That is the Mercury Core thesis: stop using humans as the integration layer.
How do you diagnose which agent layer failed?
- Ask four questions before rewriting the prompt. Loop: is there a test that gates completion? Graph: are branches and handoffs explicit? Harness: does the environment expose the tool, data, or permission the task needs? Meta-harness: can agents share policy and context, or are they N uncoordinated silos?
Agent architecture terms used on this page
- Agent loop
- Act, check, stop on external evidence. Not Mercury Loop, the managed service.
- Agent graph
- Explicit routes, retries, specialist handoffs, fallbacks, and shared state.
- Agent harness
- The model's operating environment: tools, permissions, memory, context, logging.
- Meta-harness
- Governance across many harnesses — shared policy and portable context. Mercury Core's job.
Published 2 September 2026. Concept distilled from public discussion on agent architecture (Rishi, @RishiUvaach). Frame and implementation: Mercury Technology Solutions.
Related insights
The Thinking Forge: The AI Usage I Personally Admire
Explore how AI can transform your thinking patterns, moving beyond simple answers to deeper understanding and cognitive engagement.
GEOThe 1% Click Problem: Why GEO Isn't About Traffic Anymore
Explore the 1% Click Problem and how AI is reshaping the way brands are discovered. Shift your focus from traffic to influence for future success.
Digital MarketingThe Superuser Shift: Why Your SEO Budget Is Now an AI Tax
Explore the shift in marketing as AI superusers redefine decision-making. Is your SEO budget still relevant in this new landscape?