Failure Gallery
By the Syncfusion DevTutorials team · Last updated
The one formula of this course, Agent = Model + Harness. Watch six real ways coding agents fail, tag each one as a guide gap or a sensor gap, and pick the harness part that fixes it for good.
What the Failure Gallery Shows
A harness = everything around the model that steers it and checks it.
In this lesson, you will watch six real agent failures. Then you will learn which part of the harness fixes each one.
For example, the agent:
- breaks the code
- says "Fixed!"
- never runs a single test
The model is not stupid. Nothing around it said "check before you say done".
A Real-World Example
Think about a new cook in a busy kitchen.
Before cooking, recipe cards hang on the wall. They say how this kitchen makes each dish.
After cooking, the head chef tastes every plate. A salty soup goes back to the cook.
Without them, a fine cook still sends out bad plates.
A coding agent works the same way:
- The model is the cook.
- Guides are the recipe cards: rules files and skills.
- Sensors are the tasting: tests, lint and hooks.
"Done" with a red build
Click the button to run it in the Harness Lab.
- The last step: the agent says "Fixed!".
- The Terminal tab: type the test command yourself. The tests fail.
Simple lesson: a capable model with nothing around it still ships broken work.
What You Will Learn
In this lesson, you will learn:
- What "Agent = Model + Harness" means.
- The difference between the vendor's harness and yours.
- What guides and sensors are.
- Six common ways coding agents fail.
- How to tell a guide gap from a sensor gap.
- How to pick the cheapest fix that stops a mistake for good.
Agent = Model + Harness
The Formula
A horse's harness does not make the horse stronger. It points its strength in a useful direction.
- Model = the part that thinks. You choose it, but you cannot change how it works.
- Harness = the part that decides what the model sees, what it may do, and what gets checked.
A better result often needs a better harness, not a better model.
Vendor Harness vs Your Harness
There are two layers of harness.
Vendor harness = the part that ships with the tool. Claude Code, Codex and Cursor each have one. It holds the system prompt, the built-in tools and the agent loop. You cannot change it.
User harness = the part you own. It is the files in your repo:
- rules files and skills
- hooks and permissions
- MCP servers (connections to other tools, covered later)
- tests and CI (checks that run on every push, see Tests and Linters)
The same parts exist in all three tools. Only the file names change.
The model sits inside the vendor's harness. Your harness is the outer ring. It lives in your repo, so it works for every person and every session.
Simple lesson: you cannot change the cook or the kitchen. You can write the recipe cards and taste the food.
Guides and Sensors
Two Jobs
Every part of your harness does one of two jobs.
Guide = a part that tells the agent something before it acts. It is also called feedforward.
Examples of guides:
- A rules file that says "run
pnpm testbefore you say done". - A skill that lists the three steps for adding a status.
- A progress file that says what yesterday's session finished.
Sensor = a part that checks the result after the agent acts. It is also called feedback.
A good sensor does more than say "wrong". It says what went wrong, so the agent can fix itself.
Examples of sensors:
- Tests and type checks.
- Lint (a tool that checks code style and patterns) with a clear message.
- Hooks that block a bad change.
- Permissions that deny a risky action.
Guides steer before the agent acts. Sensors check after, and send what they found back to the agent.
Simple lesson: guides work before the agent acts. Sensors check after. One question tells you which one is missing.
Guide Gap or Sensor Gap?
When an agent makes a mistake, ask one question:
Did the agent not know something before it acted? Or did nothing check the result after?
- Not know = a guide gap. Add a guide.
- Nothing checked = a sensor gap. Add a sensor.
The Failure Gallery
Watch Three Failures
Here are three failures from the gallery.
Each one runs the real agent on the starter project. The red line is the step where it goes wrong.
Step through all six frames.
- The first frame of each pair: the full run. The last line sounds fine.
- The second frame: the red line marks the step that went wrong, and why.
A green test run is not proof.
- Look for the word skipped in the output.
- A skipped test did not run at all.
- So it cannot catch anything.
All Six Failures
Each failure has its own lab card. The Gallery tab replays all six.
| Failure | What went wrong | Gap | Fix | Taught in |
|---|---|---|---|---|
| F1 The wrong command | Ran npm test in a pnpm project | Guide | Rules line | Rules Files |
| F2 A job done halfway | Changed 1 of the 3 files the team always changes | Guide | Skill | Agent Skills |
| F3 "Done" with a red build | Said "Fixed!" without running the tests | Sensor | Tests before done | Tests and Linters |
| F4 Hiding a failing test | Skipped the failing test to get green | Sensor | Hook | Hooks and Permissions |
| F5 Touching a protected file | Edited the production settings file | Sensor | Permissions | Hooks and Permissions |
| F6 The next session starts blind | Redid yesterday's fix and broke it | Guide | Progress file | Incremental Sessions |
F1 · The wrong command
F2 · A job done halfway
F4 · Hiding a failing test
F5 · Touching a protected file
F6 · The next session starts blind
Click any button and find the step where "done" stopped being true.
Sort the Six: Guide or Sensor?
Now ask the one question about all six cards.
Step through the four frames.
- Frames 2 and 3: the guide gaps, then the sensor gaps.
- Frame 4: the fix layer for each card.
Tag all six failures
Click the button to open the Gallery tab. Tag each card with its gap and its fix.
- Check the gallery: the lab names any wrong card and gives a hint.
Simple lesson: "Done" is a claim. Three failures are guide gaps, three are sensor gaps, and each gap has its own fix.
The Harness Map
Here is the whole course on one table. Each harness part fixes one kind of failure.
| Harness part | Guide or sensor | The failure it fixes | Lesson |
|---|---|---|---|
Rules file as a map + docs/ | Guide | Wrong command. A 600-line rules file half ignored | Rules Files |
Skills (SKILL.md) | Guide | Jobs with many steps done differently each time | Agent Skills |
| Tests, lint, type checks | Sensor | "Done" with a failing build | Tests and Linters |
| Hooks and permissions | Sensor + enforcement | Skipped tests, protected files, risky commands | Hooks and Permissions |
| Progress file + feature list | Guide (state) | The next session starts blind | Incremental Sessions, Feature Lists |
| End-to-end checks | Sensor | Unit tests pass, but users see a broken feature | End-to-End Testing |
| A separate evaluator | Sensor | The agent praises its own weak work | Evaluator Agents |
| Subagents and MCP | Guide + tools | Long tasks forget the rules. The agent guesses APIs | Subagents and MCP |
| Structural tests, cleanup | Sensor + enforcement | Patterns drift over time | Architecture Tests |
Prompts and context are neighbouring skills. The Prompt Engineering and Context Engineering courses cover them.
Simple lesson: each later lesson builds one part of this map.
Every Mistake Is a Permanent Signal
Fix It Once, in the Harness
When the agent makes a mistake, do not just fix it in the chat. Why?
- A fix in the chat is gone in the next session.
- A fix in the harness stays, for everyone.
Each mistake becomes one change to the harness. The next run starts with that change in place.
The habit: after every mistake, ask "which harness part would have stopped this?" Then add that part to the repo.
Choose the Cheapest Layer
Some fixes cost more than others. Pick the cheapest one that stops the mistake for good.
- Rules line. The agent did not know a fact. Write it down.
- Skill. The job is a recipe with several steps. Write the recipe.
- Test. Nobody checked the result. Add a check.
- Hook. It must never happen. Block it.
Step through the five frames.
- Frame 1: the four layers, cheapest first, each with its question.
- Frames 2 to 5: one incident per layer. It stops at the first "yes".
The Gallery tab has eight incident cards. Pick the cheapest layer for each one, then press Check the incidents.
Simple lesson: climb the ladder. Stop at the first layer that answers "yes".
TL;DR
- Agent = model + harness.
- Harness = rules, skills, tests, hooks and permissions around the model.
- User harness = the files in your repo. You own them.
- Guide = a part that steers the agent before it acts.
- Sensor = a part that checks the result after it acts.
- Guide gap = the agent did not know something.
- Sensor gap = nothing checked the result.
- Cheapest layer = rules, then skill, then test, then hook.
Common mistakes
| Mistake | Wrong idea | Correct idea | What goes wrong |
|---|---|---|---|
| Blaming the model | "A bigger model would not do this." | Most failures are a missing guide or sensor. | You wait for a new model while the bug repeats. |
| Fixing it in the chat | "I told it once. It will remember." | Sessions start with no memory. Put the fix in the repo. | The mistake comes back tomorrow. |
| Mixing up the gaps | "It ran the wrong command, so add a test." | Wrong knowledge is a guide gap. Add a rules line. | The test still runs with the wrong command. |
| Rules for "never" | "My rules file says never edit production settings." | Rules can be ignored. Use a permission or a hook. | One day the agent edits the file anyway. |
| Too much harness | "Add a hook for everything." | Use the cheapest layer that works. | The harness gets slow and hard to change. |
| Trusting green | "All tests pass." | Check for skipped tests. | A hidden failing test ships the bug. |
Check Your Understanding
Exercises
Press Check when you are ready. Use Show Hint if you get stuck.
What to Remember
- Agent = Model + Harness. The model thinks. The harness steers and checks.
- You own the outer harness: the files in your repo.
- A guide works before the agent acts. A sensor checks after.
- Ask: did the agent not know, or did nothing check? That tells you the gap.
- Pick the cheapest layer that works: rules, then skill, then test, then hook.
- Every mistake is a permanent signal. Fix it once, in the harness.
Further Reading
- Harness engineering for coding agent users, on martinfowler.com: the builder's harness vs the user's harness, and guides vs sensors.
- Agent Harness Engineering, by Addy Osmani: Agent = Model + Harness, and mistakes as permanent signals.
- awesome-harness-engineering, by walkinglabs: a map of the whole field.
- The Prompt Engineering and Context Engineering courses on this site cover the two neighbouring skills.
Next: Rules Files. You will fix failure F1 and learn why a long rules file gets half ignored.