An AI Agent Is a Loop, Not Just a Prompt
An agent that answers a question and one that edits a repository may use similar models but very different execution harnesses.
Caminho Solo context: This practical exercise complements AI does not code by itself: the harness behind Claude Code and Codex, with the original research and fuller walkthrough.
Why this question matters
Two people give an AI the same task: "Fix my website form." One gets a code snippet to copy. The other watches a tool inspect files, locate a test, edit the component, run checks and report what changed. Why such different experiences if both use language models? One reason is the software that sits between the model and the environment: an agent harness. Microsoft's Agent Framework describes a harness as runtime scaffolding that turns a model into an agent. Martin Fowler's harness engineering analysis distinguishes guidance and context from feedback systems such as tests and logs. A harness is an architectural category, not necessarily a product you must buy. Five components explain most coding-agent experiences:
Try the smallest experiment
Step 1. Write a five-state loop: read context, propose tool call, authorize call, execute tool, inspect result.
Step 2. For a fictional repository task, mark exactly which step may read files and which would require permission to write.
Step 3. Add a maximum number of turns and a stop condition when tests are inconclusive or permissions are denied.
What to write down
Harness trace: objective / context file / requested tool / authorization / tool response / verification / stop reason.
One failure mode to watch
A harness can organize evidence but cannot guarantee that model plans or tool outputs are true.
Primary references
- Microsoft's Agent Framework
- Martin Fowler's harness engineering analysis
- Codex exposes an open harness that developers can inspect
How to judge your result
Keep the input, expected result and actual observation together. Check the failure case before using this workflow with real accounts or production data.
Editorial disclosure: Fully AI-generated adaptation of the published Caminho Solo English article. Examples are suggested exercises, not claims of tests actually run.
Continue with Caminho Solo: The original guide and references add the broader context for this focused example.
原文:https://www.a8q9.cn/en/article/an-ai-agent-is-a-loop-not-just-a-prompt-8bf978.html