Imagine asking an AI assistant to write one blog post and schedule it for tomorrow morning. The writing is good, but the assistant publishes the same post twice—or clicks the scheduling button and announces success without checking the result. There is a gap between producing a useful answer and finishing a task reliably.
Harness engineering, loop engineering, and graphs are ways of thinking about that gap. Start with three practical questions: What can the AI use? How does it check its work? What should it do next? The scheduling assistant in this article is a fictional example, not a report of a tested implementation.
A harness gives the AI a working environment
A harness is the execution environment around an AI model. The term is used with slightly different scopes. Here, it means the tools, permitted actions, checks, and work records that support the task. Harness engineering means designing and improving that environment.
Our scheduling assistant needs more than a writing tool. It needs a way to read existing reservations, a place to save the draft, and a screen that shows whether scheduling actually succeeded. It also needs a clearly defined account, destination blog, and limit on how many posts it may schedule.
A long instruction saying “Do not make mistakes” does not provide those controls. If the assistant may only prepare drafts, it should not have publishing permission. If it may schedule posts, the permitted time and post count should be checked as part of execution. Written rules need corresponding controls in the tools and workflow.
A harness cannot eliminate every mistaken judgment. A checking tool might read the wrong screen, or the definition of success might be too weak. That is why our example checks for the title and scheduled time in the management list, rather than accepting the assistant’s own claim that scheduling is complete.
A loop means trying, checking, and making a useful correction
A loop repeats work. For an AI task, a useful version is try → check → revise → check again. Designing the checks and stopping conditions is sometimes called loop engineering. Repeating the same request without useful feedback is not enough.
Suppose a draft repeats the same explanation three times. Instead of saying “Write it better,” identify the overlapping paragraphs and ask the assistant to combine them. Then read the revision to see whether the repetition is gone. The reason for the previous failure needs to inform the next attempt.
Not every action is safe to repeat. Revising a draft again is usually straightforward. Sending a scheduling request again because the page froze could create a duplicate. At that point, the repeated action should be checking the result, not submitting again. Find out whether the post was registered before choosing the next step.
The loop also needs an exit. Our fictional assistant might move to scheduling after the draft passes review, ask a person for help after two unsuccessful revisions, and stop resubmitting when the result of a scheduling request is uncertain. Two revisions is an illustrative limit; a real task needs its own limits.
Running a loop does not automatically train the underlying model, and each round is not guaranteed to improve the result. A poor evaluation can lead the assistant to damage an already useful draft. Keep the changes and check results so that successive attempts can be compared.
A graph is a map of the possible next steps
A graph represents steps and the connections between them. Think of each box as a task such as checking existing reservations or reviewing a draft. An arrow indicates where work can go next. The map can include branches and routes back to an earlier step.
If there is no conflicting reservation, the assistant writes a draft. If the same topic is already scheduled, it stops. A draft that passes review moves to scheduling; a repetitive draft goes back for revision. An uncertain submission result leads to a pause for confirmation. The next step depends on the current situation.
The graph does not create sound judgment by itself. A rule such as “stop if the reservation already exists” can be implemented in ordinary code. A judgment about whether a paragraph reads naturally may be assigned to an AI or a person. The important questions are who chooses the next step and what evidence they use.
A chain usually means a sequence such as A → B → C. It can be viewed as a simple kind of graph, and it can still include intermediate checks and stopping conditions. Chains are not automatically outdated, nor are branching graphs always better. A task that always follows the same order may need only a simple sequence.
To resume work, record where you actually got to
What happens if the assistant stops and starts again? Instead of assuming it will remember the whole conversation, record the draft location, check results, and submission status. These values describing the current situation are called state.
A record that says “draft complete / duplicate check passed / scheduling request sent / result unconfirmed” tells the next run to inspect the scheduling list before writing another post. To survive a restart, the record needs storage that persists, such as a file or database.
These records matter when several AI workers are involved, too. One worker could review the wording while another checks image descriptions. That does not mean both should click the scheduling button. Independent reviews can run separately while one designated step handles submission. A small task may need only one assistant; dividing work also adds handoffs and result collection.
Start with a five-part task brief
You do not need to install a particular framework first. Choose one task and write down the following five items. Here is a brief for our fictional scheduling assistant.
- Goal: Schedule one nonduplicate post at the specified time.
- Tools and permissions: Read existing posts, save a draft, and schedule one post on the permitted blog.
- Success check: Confirm the title, scheduled status, date, and time in the management list.
- Stopping conditions: Pause and record the issue if login fails, the revision limit is reached, or a submission result cannot be confirmed.
- Handoff record: Save the draft location, check results, submission status, and confirmed post URL.
This makes it easier to see whether the missing piece is a tool, a check, or a rule for choosing the next action. When an AI keeps going in circles, first separate the last fact you actually confirmed from the next fact you need to establish. Designing the work between those two points is a practical place to start with harnesses and loops.
Add your perspective.
Share a question, another approach, or something you have tried.
Checking sign-in…
Loading comments…