Give AI Work / builder guide / 14 progressive labs

Harness Engineering

Do not ask the model to remember your project. Engineer the environment so a fresh agent can enter, work, verify, hand off and continue.

Give AI WorkHarness EngineeringBuilder guide
Hands-on engineering track
What you'll learn

Operationalise persistent instructions, context delivery, tools, environment, durable state, verification and deterministic controls around a delegated AI responsibility.

Bring / required

One Git repository, an AI coding/task agent, shell access and one bounded task that can be checked objectively.

What you'll do

Run the task once with prompt-only instructions, then improve the system one harness layer at a time.

Take away

A minimal harness pack you can reuse in other repositories, plus evidence showing which parts actually improved reliability.

Use the shared Field Guide Lab Method. Harness structures should be earned by observed failures and measured against the weaker baseline.

Start with the failure, not the file

You may be thinking: “My agent keeps missing things, so I need a better prompt or a bigger AGENTS.md.” Sometimes that helps. Very often it only makes the instructions longer while the underlying system stays fragile.

Aha

The harness is not the prompt. It is the system around the model that makes the work understandable, bounded, resumable and testable. If a human must repeatedly retell context, decide what “done” means or reconstruct the previous session, the harness is still depending on the human.

Try this before building anything

  1. Give a fresh agent one bounded real task with only a normal prompt.
  2. Do not rescue it immediately.
  3. Write down every place where you had to supply missing context, correct scope, explain state or verify a claim manually.
  4. Use those interventions as your first harness backlog.

Common traps

  • Instruction debt: every failure becomes another paragraph in AGENTS.md until the important rules are buried.
  • Context duplication: copying the same project knowledge into prompts, agent files and working notes until nobody knows which copy is authoritative.
  • Chat-state dependency: decisions and progress live only in conversation history, so the next session starts from amnesia.
  • Self-certification: the same agent that changed the system also decides whether the change is correct.
  • Fake determinism: writing “always run tests” in prose and treating that as equivalent to a real verification gate or hook.

Look out for

  • You keep repeating the same project explanation to new sessions.
  • Your root instruction file keeps growing faster than the project map around it.
  • The same rule exists in prompts, docs and scripts with slightly different wording.
  • “Done” is a chat statement rather than a state transition backed by evidence.
  • Failed runs produce no new evidence, so the next attempt is mostly guesswork.

Prove the first lesson

Open a completely fresh session with no chat history. It should be able to explain the project, locate the relevant code, name the hard constraints, identify the current task and run the correct verification path using repository artifacts only. Anything you still need to explain manually is evidence of the next harness gap.

The harness is a system, not a file

SubsystemWhat it answersTypical artifact
InstructionsWhat matters, what is forbidden, where should the agent look?AGENTS.md + linked docs
Context deliveryHow does the delegated agent reliably find the right context every run?context-delivery map
ToolsWhat can the agent inspect, run and change?capability registry
EnvironmentCan a fresh session start from a known state?bootstrap/init script
StateWhat is done, active, blocked and next?feature list + progress/handoff
FeedbackHow does the agent know whether work is correct?tests + evaluators + evidence
ControlsWhich critical rules should not depend on model memory?hooks / gates / protected commands
MaintenanceWhich harness pieces still earn their complexity?pruning + ablation log

A harness does not replace Prompt or Context Engineering. Those belong to Work With AI. The harness operationalises them so a delegated agent can reliably discover instructions and context, act with bounded tools, preserve state and verify work without a human rebuilding the setup every session.

01 / Progressive labs

BUILD ONE LAYER AT A TIME.

Each lab starts from a failure, changes one structural element and asks you to prove that the change mattered.

H01BASELINE

Let the prompt-only run expose the gaps

Aha: repeated human rescue is system evidence.

Trap: immediately rewriting the prompt before recording the failure.

Prove: classify at least three interventions.

Keep: harness-audit.md

H02MAP

Make the repo agent-readable

Aha: root instructions should point, not explain everything.

Trap: giant AGENTS.md.

Prove: fresh session finds project, constraints and verification alone.

Keep: AGENTS.md

H03DELIVER CONTEXT

Operationalise context delivery

Prerequisite: Context Engineering in Work With AI decides what context matters and which source wins.

Aha: a delegated agent should find the right context without a human rebuilding the context pack every run.

Trap: duplicate/stale copies of the same source.

Prove: a fresh run finds the correct context and source precedence alone.

Keep: context-delivery map

H04START

Make startup deterministic

Aha: unknown starting state wastes intelligence on plumbing.

Trap: every agent rediscovers setup.

Prove: one command reports readiness.

Keep: scripts/agent-init.sh

H05SCOPE

Move scope out of chat — and make one item active

Aha: a backlog is not a work plan. Default to WIP=1 unless parallel work is intentional and isolated.

Trap: every nearby task becomes eligible.

Prove: fresh session identifies the active responsibility, exclusions and required evidence without guessing.

Keep: feature-list.json + active-work contract

H06CONTINUITY

Survive the next session

Aha: a handoff is operational state.

Trap: chat summary as the only record.

Prove: a fresh session resumes without reconstruction.

Keep: progress + NEXT.md

H07TERMINATE

Make completion a three-layer decision

Aha: task evidence, full-pipeline evidence and clean-state evidence are different claims.

Trap: one green unit test becomes permission to stop.

Prove: requested behavior works, the relevant end-to-end path still works, and the state is safe to hand off.

Keep: verification / termination map

H08CONTROL

Turn critical reminders into controls

Aha: “always do X” in prose is not a guardrail.

Trap: fake determinism.

Prove: one critical rule is enforced without model memory.

Keep: deterministic-control map

H09CHECK

Separate maker from checker

Aha: asking “are you sure?” is not independence.

Trap: maker controls its own evidence.

Prove: checker can reject a plausible completion claim.

Keep: evaluator rubric

H10CAPABILITY

Define tool, skill, connector and sub-agent boundaries

Aha: capability is authority.

Trap: every tool, everywhere.

Prove: each capability has purpose, boundary and failure route.

Keep: capability registry

H11OBSERVE

Start with a working contract, then make repair evidence-driven

Aha: observability is easier when the run began with explicit goal, scope, exclusions, authority and verification.

Trap: stronger prompt after every failure.

Prove: identify which contract clause failed before retry.

Keep: working contract + run record

H12EXIT

Leave explicit quality state, not merely a clean repository

Aha: dirty exits become hidden context, and hidden debt becomes the next agent’s surprise.

Trap: code compiles, so cleanup is “done.”

Prove: blockers, debt, temporary artifacts and task state are explicit; cleanup is safe to repeat where possible.

Keep: lifecycle checklist + quality / known-debt record

H13PRUNE

Delete harness that stopped earning its keep

Aha: harnesses accumulate debt too.

Trap: measuring maturity by file count.

Prove: remove one component and compare behavior.

Keep: pruning / ablation log

H14CAPSTONE

Run the harness against reality

Repeat the baseline with a fresh session, then deliberately remove a component.

Prove: keep only structures whose value you can demonstrate.

Keep: reusable harness starter pack

Three things that decide whether the agent may stop

LayerQuestionExample evidence
TaskDid the requested behavior actually appear?Acceptance test, expected output, behavior check
SystemDoes the relevant full path still work?E2E run, integration path, architectural invariant
Clean stateCan another session safely continue?Known debt recorded, temp state cleaned, active task updated, handoff written
Aha

Stopping is a harness decision, not a mood. A capable agent can be locally correct and still leave the system or the next session in a broken state.

Working contract before the run

Goal:
Scope:
Exclusions:
Authority:
Verification:
Expected evidence:
Stop when:
Escalate when:

The contract makes observability useful: after a failure you can ask which promise broke instead of staring at a pile of logs.

When NOT to add another harness component

Do not create a new file, hook, agent or rule merely because the concept sounds mature. Add structure when an observed failure justifies it.

  • If ordinary code can enforce the rule more clearly, use code.
  • If a document is never consulted, remove or relocate it.
  • If a sub-agent has no distinct responsibility or context boundary, keep one agent.
  • If a hook adds friction to low-risk work without preventing a real failure, remove it.
  • If the model/tool now handles an old workaround reliably, retest and prune the workaround.
Ablation test

A mature harness is not the one with the most structure. It is the smallest structure you can defend with observed behavior.

Minimal starter pack

Start small. Four files can already change agent behavior substantially:

AGENTS.md
feature-list.json
docs/working/progress.md
scripts/agent-init.sh

1. Root instructions are a map

# AGENTS.md

## Mission
What this repository does and who it serves.

## Start here
1. Run: ./scripts/agent-init.sh
2. Read: docs/architecture.md
3. Read current work: docs/working/NEXT.md

## Non-negotiables
- Do not change ...
- Preserve ...
- Never mark work complete without ...

## Verification
- Unit: ...
- Integration: ...
- End-to-end: ...

## Deeper docs
- Product rules: docs/product.md
- Architecture: docs/architecture.md
- Operations: docs/operations.md

2. State is machine-checkable

{
  "id": "F03",
  "behavior": "User can export the report as CSV",
  "verification": "npm test -- export-report",
  "state": "not_started",
  "evidence": null
}

3. “Done” requires evidence

For every important task, write the definition of done before implementation. The strongest completion criteria are observable behaviors and executable checks, not vague phrases such as “works correctly” or “looks good”.

Fresh-session test

Open a new agent session with no chat history. Can it explain the project, find the relevant code, identify hard constraints, run verification and state what it should do next using only repository artifacts? If not, the harness is still depending on you.

Failure → harness layer

Observed failureLikely layer to inspect first
Agent repeatedly asks what the project doesInstructions / repository map
Works in one session, forgets everything in the nextDurable state / handoff
Changes too much unrelated codeScope representation / constraints
Says “done” while UI/API behavior is brokenFeedback / definition of done
Cannot run or reproduce the appEnvironment / bootstrap
Keeps retrying the same wrong fixObservability / failure attribution / routing
Next tension

Your agent can now enter, work, verify and hand off more reliably. But if you are still manually starting every cycle and deciding what happens after success or failure, you have built a harness — not yet an autonomous loop. That is the next Give AI Work builder problem.

Next: Loop Engineering — stop being the person who presses Continue →