Flows category icon
Harness Engineering
Intermediate

Verification Loops: Never Trust an Unrun Edit

Wire verification into your agent so every edit is checked by machines - syntax, tests, behavior - before it counts as done.

4 steps12 verify checks60-100 minutesWorks with: emergent · chatgpt · claude · cursor
Start Guided Walkthrough

The Route

0/4 verified

Context Pack

Paste this first. It briefs the AI on requirements, constraints, and the Definition of Done before your first build prompt.

Context Pack
PROJECT CONTEXT:
My agent edits code, declares success, and the code is broken. The harness-engineering literature treats this as THE core lesson: model claims are hypotheses, and the harness must verify every edit with real execution before accepting it.

GOAL:
Build a layered verification pipeline into the agent loop: syntax checks on write, targeted tests after change, and evidence-based completion.

REQUIREMENTS:
- Automatic syntax/lint verification on every file write, with revert on failure
- A verify step after each logical change: run the relevant tests or a behavioral check
- Completion gating: 'done' requires machine evidence, not model assertion
- Verification results fed back to the model verbatim
- An evidence record per task: what was checked and what it showed

CONSTRAINTS:
- Verification runs in the harness, not at the model's discretion
- A failed verification can never be papered over by re-describing the change

DEFINITION OF DONE:
- A syntactically broken edit is auto-reverted with the error shown to the model
- A behavior-breaking edit is caught by the post-change test run
- Task completion output includes the evidence record
- The agent cannot mark work complete while verification is red

COMMON FAILURES TO AVOID:
- Trusting 'I have fixed the issue' without a single command being run
- Lint-only verification that misses behavioral breakage
- Verification output hidden from the model, so it cannot self-correct
- Tests skipped 'for speed' exactly on the changes that needed them

Paste this into your AI builder first. It teaches the AI what you want before you give it the build prompt.

Related routes

More Harness Engineering flows that share ground with this one.

Flows category icon
Harness Engineering

Assemble Tool Prompts Dynamically per Environment

Stop shipping one static mega-prompt: generate tool prompts from environment conditions, inject blocks only when features are on, and dedupe config to save tokens.

01Identify conditional blocks
02Build the prompt generator
03Dedupe and budget every block

+1 more steps to Done

Best forproduction-grade builds with strict verification

4 steps90-120 minutesAdvanced
Flows category icon
Harness Engineering

Design Layered Tool Prompts with Preference Chains

Structure your tool prompts the way the leading harness does: preference chains up front, usage constraints in the middle, NEVER-guarded safety protocols at the end.

01Audit the current tool prompt
02Write the preference chain
03Write usage constraints and safety protocols

+1 more steps to Done

Best forbuilders who have shipped a basic app before

4 steps60-90 minutesIntermediate
Flows category icon
Harness Engineering

Design the Permission Approval UX

Design approval prompts users actually read: diffs, risk framing, scoped grants, and pacing that prevents approval fatigue.

01Audit the current approval moments
02Rebuild the prompt content
03Make friction proportional to risk

+1 more steps to Done

Best forbuilders who have shipped a basic app before

4 steps60-90 minutesIntermediate

Made with Emergent