The AI Engineering Vocabulary Stack: Prompt, Context, Loop, Harness

When an AI-powered feature misbehaves, the reflex is almost always the same: rewrite the prompt. Add another instruction, another example, another "please be careful about." Sometimes that fixes it. Often it does not, because the actual fault sits somewhere the prompt cannot reach. Anthropic's own engineering guidance draws a sharper distinction most product teams have not adopted yet: prompt engineering, context engineering, agent loop design as covered in Building Effective Agents, and what Anthropic calls harnesses for long-running agents are four separate layers of one stack, and each fails in a different way.

This applies to any product team shipping an AI feature, whether the workflow drafts a clinical summary, screens a fintech application, or triages a support ticket. The split is not academic. It changes where you look first when something breaks, and what fixing it actually means.

AI agent engineering has four layers, and most teams debug only one

Most teams collapse everything into "prompting." That collapse wastes debugging time. A workflow that hallucinates a fact, loops forever, or quietly does the wrong thing has a fault somewhere specific, and it is rarely the wording of the system prompt. Separating the layers turns debugging into elimination instead of guesswork.

Layer one: prompt engineering, the instructions

This is the layer everyone knows: the system prompt, task instructions, examples, formatting rules. Anthropic's own prompt engineering documentation frames this as getting the model to reliably do the right thing when it already has everything it needs. Its failure mode is narrow: ambiguous instructions, missing examples, or a task description that underspecifies the actual decision. If the model had the right information and still got the task wrong, this is often, though not always, the layer to fix.

Layer two: context engineering, what the model can see

Context engineering is a distinct discipline from prompting. Anthropic's guide to effective context engineering defines it as curating the optimal set of tokens, retrieved documents, tool outputs, and conversation history the model actually sees during a task. Its failure mode differs from a prompt failure: the model was never wrong about the instructions, it simply never had the fact it needed, or so much irrelevant retrieved content buried the one relevant fact. No amount of prompt rewriting fixes this, because the prompt was never the problem. This layer breaks first as workflows scale past a single call and start pulling from multiple documents or tools.

Layer three: loop engineering, how the agent iterates

An agent that calls tools, checks results, and decides whether to continue or stop is running a loop. Anthropic's framework for building effective agents is largely a guide to designing that loop well: when to chain steps, when to branch, when to hand control back to a human, when to stop. Loop failures look distinct from prompt or context failures. The agent has the right instructions and information, but it re-does a completed step, stops too early, or keeps calling the same tool because its stopping criteria are vague. Fixing this means redesigning the control flow, not the wording anywhere in it.

Layer four: harness engineering, the scaffolding around the model

The harness is everything that is not the model: the execution environment, permission boundaries, retry and timeout logic, how tool outputs feed back in, the mechanism for a human to interrupt or approve. Anthropic's guidance on effective harnesses for long-running agents argues this layer becomes the dominant source of reliability, or unreliability, as tasks stretch toward an hour of autonomous work. A harness failure often looks identical to a model failure from the outside: the agent seems to forget something, or takes an action nobody approved. The actual cause is usually a missing checkpoint, an unbounded retry loop, or an approval gate that was never wired up, the piece we covered in agentic products live or die at the approval step.

A worked example: the AI workflow that just needed a better prompt

A professional services firm builds an agent to draft client status reports from project data, email threads, and time-tracking exports. Two weeks in, reports start citing budget figures that are weeks stale, and the team's response is more emphatic prompt language: "Always use the most current budget figure." Nothing changes, because the prompt was never the fault. The retrieval step was pulling a cached export instead of the live feed, a context failure, and the harness had no freshness check on retrieved data, a harness failure. Once the team traced the failure to the right layer, the fix took an afternoon: a timestamp check in the harness and a query fix in the retrieval pipeline. The same misdiagnosis pattern shows up in biotech literature-review agents, fintech underwriting assistants, and media research tools. The domain changes. The four layers and their failure modes do not.

Aero's diagnostic lens: which layer is actually broken?

This is Aero's working framework for triaging a misbehaving AI workflow, not an established industry standard. Before touching the prompt, we ask five questions:

  • Did the model have the right instructions and still choose wrong? That points to the prompt layer.
  • Did the model have the right instructions but was missing a fact, document, or tool result it needed? That points to the context layer.
  • Did individual steps look correct, but the agent looped, stopped early, or repeated work? That points to the loop layer.
  • Did the failure only show up on longer or multi-step runs, and would a checkpoint or approval gate have caught it? That points to the harness layer.
  • Have you actually isolated which layer changed since the workflow last worked, or is the team re-editing the same prompt because it is the easiest thing to open?

Most teams stop at question one. The workflows that get fixed are the ones where someone answers all five before changing anything, the same discipline we described in scaling AI from pilot to production: the failure modes that surface at scale are rarely the ones a demo exposed.

FAQ

Is this taxonomy an official industry standard?

No. Prompt, context, and harness engineering are terms used in Anthropic's own engineering guidance, linked above. The four-layer diagnostic framing here is Aero's practical lens for applying that vocabulary, not a published standard.

Which layer should a small product team invest in first?

Context and harness engineering tend to be underinvested relative to prompt engineering, because prompt tweaks are fastest to try and easiest to demo. Teams running agents past a single exchange usually get more reliability improvement from a harness fix, such as a checkpoint or approval gate, than another round of prompt edits.

Does a better model make these four layers less important?

No. A stronger model can mask a weak harness or a messy context pipeline for a while, but the failure modes are structural, not a function of model capability. They resurface as the task gets longer, the data gets messier, or the stakes go up.

Sources

Diagnosing where your AI workflow is actually breaking, not just where it is easiest to look? Talk to Aero.

From the journal

The AI Engineering Vocabulary Stack: Prompt, Context, Loop, Harness

Aero Interactive
August 26, 2026
6 min read

The AI Engineering Vocabulary Stack: Prompt, Context, Loop, Harness

When an AI workflow misbehaves, most teams rewrite the prompt. A cleaner diagnostic separates four distinct layers, prompt, context, loop, and harness, each with its own failure mode.

You Shipped the AI Feature. Nobody Is Using It.

Aero Interactive
August 24, 2026
5 min read

You Shipped the AI Feature. Nobody Is Using It.

Building an AI feature is the easy part. Getting people to actually use it is a behavior change problem, and most product teams still treat it like a rollout instead of a habit to build.

The Design System Engineer Is the Human AI Can't Replace

Aero Interactive
August 22, 2026
5 min read

The Design System Engineer Is the Human AI Can't Replace

AI coding tools are excellent at generating components and terrible at everything that makes a design system a system. Why token architecture, accessibility, and architectural judgment keep design system engineering a human role.

Let's build what's next

Shape your next product, platform, or brand experience with us.

Icon
Discuss Project
Discuss Project