About three years ago, I started building apps and features with large language models. Back then, nobody gave the pieces names. We just built the app and fixed whatever broke.
Then the names showed up. Prompt engineering. Context engineering. Loop engineering. Harness engineering.
They sound like four separate jobs. In practice, one feature uses all four. That is why people mix them up. I’ve seen it often, and I can see why.
Here is my promise. By the end of this article, you will know what each term means. And when an AI feature breaks, you will know which one to fix.
We’ll learn by building a meeting follow-up email. The app reads meeting notes, then sends the team a summary of decisions and action items.
We’ll begin with the simplest version, run it, and follow the failures. Each one will reveal one of the four terms.
Prompt engineering
Version one is a single request: “Write a follow-up email for this meeting.” We send it to the model, along with the notes.
The email comes back. It has everything, but it is long, it rambles, and it sounds like a press release.
The model had the facts. It didn’t know what we wanted.
So we write better instructions. We say who the email is for, how long it should be, and what it should include. We ask for one bullet per action, and for a friendly tone.
That is prompt engineering. It is writing and improving the instructions you give the model.
Try it
Write the prompt
The first draft was long and rambling. Fill the gaps to tell the model what you want.
Context engineering
The format is better. Now we notice something worse.
The team voted to move the launch date. The email doesn’t mention it.
The vote is in the notes. But the notes are long, and our app only sent the first half. The model can’t write about something it never saw.
No prompt can fix that. The instructions are fine. The model needs different information.
So we decide what goes in. We find the part of the notes that matches the task, and we send that.
That is context engineering. It is deciding which information the model receives for this particular task.
Try it
Fill the model’s window
The model only knows what you put in its window. Give it what the email needs—not too little, not too much.
Two common ways to do it:
- RAG. Retrieval-augmented generation. The app searches the notes, finds the passages that match, and adds them to the request.
- Routing. A small model like Jev reads the question and picks a topic. The app then loads only the notes for that topic.
Loop engineering
Now the email has the right facts and a good format. But it says the review is on the 14th. The notes say the 12th.
One try is a guess. A loop makes it a result.
The model writes a draft. A check tests it. If it fails, the model tries again, this time with the reason. If it passes, we stop.
Loop engineering is deciding three things:
- What gets checked. The date is in the notes. The email is short. Every recipient attended.
- What feedback goes back. The failed draft and the checker’s message. Not just “try again.”
- When to stop. A pass, a try limit, or a budget. At the limit, hand it to a human.
Try it
Build the workflow
Connect the steps that write, check, and improve a draft.
A workflow is steps in a line. It becomes a loop when a failed result sends work back.
Harness engineering
Last problem. The draft is fixed, and then it goes out to someone who wasn’t in the meeting.
The model reads text and writes text. That’s all it does.
Something else has to fetch the notes, save the draft, run the checks, and block the send until a human says yes. That is the harness.
The harness is the software around the model that makes the job possible. It has four main jobs:
- Tools. The model can only ask. The harness runs the tool and returns the result.
- Context. Long runs fill up the window. The harness trims, summarizes, and loads what matters.
- Rules. A prompt is a request. The harness is a wall. It blocks emails to people outside the meeting.
- Records. It stores state and logs every step, so you can debug a bad run.
Rules aren’t only brakes. Clear limits are what let you give an agent more freedom.
Same model, different harness, very different results. When an agent fails, the model is often not the problem. It lacked a tool, or its context was full of junk, or nothing checked its work.
One note on the name. “Harness engineering” is new, from early 2026, and people draw its edges differently. Some count prompts and context as parts of the harness. Here we treat it as the layer around them. It also isn’t a test harness, which is a different thing.
Why the terms blur
The lines between them are real, but they touch.
Prompt and context. “Include only agreed dates” is an instruction. “The team agreed on Tuesday” is a fact. Both end up in the model’s input, so they feel like one thing.
Loop and harness. The loop decides the checks, the feedback, and the stop rules. The harness runs them.
Instructions and enforcement. The prompt asks the model to wait for approval. The harness makes sure it does.
Which one do I fix?
When an AI feature breaks, ask what is actually wrong.
| What you see | The problem | Fix it with |
|---|---|---|
| The facts are right, but the format or tone is wrong | The model didn’t know what you wanted | Prompt |
| A fact is missing or made up, and it was never in the input | The model never saw it | Context |
| The same mistake keeps happening on every retry | Nothing checks the work, or the retry gets no feedback | Loop |
| It ignored a rule, took a risky action, or you can’t tell what happened | Nothing enforces rules or records the run | Harness |
Ask in this order: prompt, context, loop, harness. Each layer assumes the one before it works.
The whole email, end to end
You ask for a follow-up to today’s standup. This simplified overview shows how the four layers contribute. A real implementation can have more steps and safeguards, and the harness runs throughout the process rather than only at the end.
In one line each:
- Prompt: what you ask for.
- Context: what the model gets to see.
- Loop: how the work is checked and retried.
- Harness: everything around the model that runs it safely.
Quiz
Question 1 of 8
The team voted to move the launch date. The vote is in the meeting notes, but the app never sent that part to the model, so the email leaves it out. What do you fix?
Pick the first thing you would change.



