Series: Harness Engineering (1/3)
- An AI Agent = language model + Harness; Harness Engineering is about using human techniques to steer the model toward completing a task.
- The same tiny Gemma 4 2B model, with just a few extra lines of working principles, goes from hallucinating file contents to running ls, cat, editing files, and running verification.
- Natural-language rules like agents.md / CLAUDE.md are a kind of Natural Language Harness, but research shows they aren't always effective.
Table of Contents
The major companies keep releasing new language models, and the central theme of this story is: sometimes a language model isn’t dumb, it just lacks human guidance.
A few days ago Google released the open-source fourth generation of Gemma. Besides claiming to be very strong, it also comes in some especially small variants, such as Gemma 4 2B — the “2B” in the name means it has only 2 Billion parameters, an especially small model, claimed to let you run a language model even on the Edge. Since it’s open source, you can download it and run it on your own machine. (The E in the model name stands for effective; as for why they put an E in front, I’ll leave that for you to research yourself.)
Can such a tiny model be used to drive an AI Agent? Below is a small experiment I ran with it.
The Experiment: Have a Small Model Fix a Bug
The task is straightforward: there’s a parser.py in a folder, containing a function extract_email whose job is to extract emails from a piece of text, but it was written with a bug so not all emails get extracted correctly. Modify parser.py so that the tests in verify.py pass completely. Both parser.py and verify.py sit in the same folder as the language model.
A language model doesn’t naturally become an Agent on its own — you have to give it tools. Here I use a very simple convention as the tool interface:
- If the model outputs “three dots →
bash→ one line of command → three dots,” the environment takes that middle line as a bash command and runs it automatically. - If the model outputs “three dots →
python→ a block of code → three dots,” the environment saves that block as a file and runs it.
So the model now has three capabilities at hand: issue bash commands, write python, and run python.
First Attempt: The Model Hallucinates a File
Gemma 4 2B’s first reaction after reading the instructions was actually: “There’s no parser.py.”
Why? Because to the model, its context only contains the string of text “the filename parser.py” — but not the file’s contents. Even if the file really is sitting in the same folder, the model doesn’t automatically know that — it can only see the text you fed it.
So it took matters into its own hands: based on the extract_email mentioned in the prompt, it hallucinated what parser.py should look like, wrote a block of code it imagined, then hallucinated that it had verified it, and declared the task done.
This is of course not the result we wanted. But think about it — this isn’t a dumb model. It knows exactly what should be in parser.py, and it’s fully capable of writing a correct email parser; it just didn’t realize the file was right at its feet. A model’s thinking is often different from a human’s: your intuition says the code should come attached to the problem, but the model didn’t anticipate that the relevant file was right under its nose.
Second Attempt: Just a Few Extra Lines of Working Principles
Next I only typed a few extra lines (fewer than 80 words), and they were not hints specific to this task, but some general principles:
- You are in a Linux environment (nudging it to more readily execute bash commands).
- Before doing anything, look at what’s in the folder you’re in, and list the relevant files.
- Before modifying a file, don’t just edit it — open it and read its contents first.
- Define what “done” means: you have to meet certain established criteria before it counts as done.
The same Gemma 4 2B, with only this set of principles added, doing the exact same task, behaved completely differently:
- First
ls, listing the directory, and discoveringparser.pyandverify.py; - Then
cat parser.py, printing out the contents and reading them into context; - Now that it had the real contents, it rewrote
parser.py(more of a full overwrite than an edit), usingcatto overwrite the original file; - Finally it ran
verify.pyto self-verify, saw verify success, and finished the task.
This is close to what a human wants. The same model, with a few extra lines of instruction, can differ enormously in capability.
The Two Components of an AI Agent: Language Model + Harness
So when your AI Agent underperforms, where should you fix it? First, recall what an AI Agent is made of.
graph LR
H["Harness<br/>OpenClaw / Cowork / Claude Code / Cursor …"]
L["Large Language Model<br/>Claude / Gemini / GPT (cloud or local)"]
H -->|calls| L
L -->|output → drives tools → observe results| H
An AI Agent has two parts: one is the Large Language Model it calls (which can be Claude, Gemini, or GPT, in the cloud or local); the other is a whole pile of program scaffolding that supports it in calling the model and operating tools. In the past this “everything else” had no good name; now there’s a shared name for it — the Harness. Many people translate it into Chinese as “駕馭” (to steer/harness), so the act of building a Harness is called Harness Engineering.
The symbolic meaning is: the AI is a powerful horse, and to steer it you need a saddle and reins — those are the Harness.
To strengthen an AI Agent, then, there are two paths:
- Change the language model: train a better model yourself, or fine-tune an existing one.
- Change the Harness: build a better set of tack. This is exactly the hot topic right now — Anthropic talked last November about effective Harnesses for keeping an agent running for a long time, OpenAI published a “Harness Engineering” piece in February, and Anthropic published “Harness Design” in March.
Harness Is a Very Practical Term: Subscriptions and Heartbeat Mechanisms
This term really is used very often. For example, Claude’s subscription users once received a notice saying that subscription accounts would no longer support third-party Harnesses (such as OpenClaw).
The reason behind this has to do with the payment model. There are two ways to pay for using a large language model: one is “pay for what you use,” calling the API directly and being billed by Token; the other is a subscription-based “all-you-can-eat,” where after paying a monthly fee you can in theory call it an unlimited number of times that month. In the past, providers thought the monthly plan was fine — you’re a human, how many instructions can you possibly type? But with tools like OpenClaw, which have a heartbeat mechanism that can automatically send an instruction every few minutes, providers couldn’t sustain it. So Claude decided: from now on, Harnesses like OpenClaw can no longer connect to Claude’s models.
In other words, OpenClaw is now widely understood as “a kind of Harness.”
The Evolution of Three Terms: Prompt → Context → Harness Engineering
When people want to take something seriously, they tack “engineering” onto the end of a word. So first came Prompt Engineering, then Context Engineering, and now Harness Engineering. The three overlap heavily, but each emphasizes a different core value:
- Prompt Engineering: a language model is doing text autocomplete; different inputs produce different completions. In the past, models were weaker, and phrasing the same question differently could produce wildly different answers, so people studied how to write prompts — the most famous incantation being “think step by step.” But such incantations grow less and less useful — how can it be that it only thinks when you tell it to? Today’s models think carefully even when you don’t emphasize it, and the difference between having an incantation and not is shrinking.
- Context Engineering: after incantations lost their power, people realized that when a model answers wrong, it often isn’t a lack of ability but a lack of sufficient information during autocomplete. So you build a system to find the right context, assemble it into a prompt, and then feed it to the model — you could call it a more systematic, automated form of Prompt Engineering.
- Harness Engineering: this emphasizes “getting the task done.” Today a model solving a task is no longer a single question-and-answer, but a multi-turn interaction — a human gives a task, the model produces output, the output drives tools, the model sees the tool results, and the loop repeats until an answer emerges. How to steer this multi-turn process is the job of Harness Engineering.
The boundary between Context Engineering and Harness Engineering is actually a bit blurry (good context is inherently a prerequisite for completing a task), but the value Harness Engineering wants to convey is: enabling the model to do the job well across multiple turns of dialogue.
Three Means of Steering a Model
What means can humans use to steer a model? Here are three examples (this is not the entirety of Harness Engineering — it’s still an evolving technique, and there are many different definitions of it in different places):
graph TD
A["Rules written in human language"] -->|controls| B["Cognitive framing"]
C["Constraints on tools"] -->|controls| D["Capability boundaries"]
E["Defined workflow"] -->|controls| F["The model's behavior"]
One: Controlling the Cognitive Framing — agents.md and Natural Language Harness
You can use rules written in human language to influence the model’s cognitive framing; these rules are like the laws of human society. The way to do it is to have the model, before doing anything, first put these rules into the prompt — because the rules are always in the prompt, the behavior becomes more predictable.
Such rules often have a fixed filename, for example agents.md, which can be thought of as “a README for the language model.” How does the model know to read it first? This is a hard-coded rule in the Harness: on startup, the model is forced to read certain files first, ensuring they appear in the prompt before it does anything else.
Of course, rules written in natural language can’t control behavior 100% — whether the model follows them is ultimately up to it, just as laws are on the books but not everyone obeys them 100%. So some argue that without enforcement it doesn’t count as a Harness, but others have named this approach the Natural Language Harness: it’s a kind of Harness, just one that uses natural language as the tack.
Take OpenClaw as an example: it calls Claude behind the scenes, and before each conversation begins it first opens the agents.md in the workspace, ensuring the contents enter the prompt before doing anything else. That’s how the model knows: soul.md is its soul, memory is stored in memory.md, and to find older memories it should go to the memory folder and search with a tool — all of these behaviors come from agents.md.
Moving from One Harness to Another
Earlier I mentioned that Claude no longer lets OpenClaw call it — what do you do? It’s actually quite simple. Anthropic has its own official Harness: Cowork (and Claude Code also counts as a Harness), which by default reads the CLAUDE.md under the workspace on each startup, putting the contents into the prompt before doing anything else.
In other words, Cowork’s CLAUDE.md ≈ OpenClaw’s agents.md. To move an Agent running on OpenClaw over to Cowork, the only thing you have to do is: give Cowork the same workspace and rename agents.md directly to CLAUDE.md, and the Agent “comes back to life,” behaving roughly as before. (After it revives, it may even proactively say “the contents of CLAUDE.md look a bit off — some of these tools I don’t actually have, want me to fix it for you?” and once fixed it’s roughly the same as the original.)
As long as you understand how these Harnesses work under the hood, moving house is really trivial.
Does agents.md Really Work? Systematic Research Is Beginning
In the past everyone wrote agents.md however they felt like it, with no systematic research on whether it even worked. Starting this year, some papers have begun scientifically studying its impact on Agent behavior:
- A paper from this January: it went to GitHub to find a large number of repos containing
agents.md, and compared execution “with vs. withoutagents.md.” The results showagents.mdcan speed things up, use fewer tokens, and complete tasks in less time. On average the difference isn’t large, but for the edge cases that would otherwise take an extremely long time, the help is more noticeable. However, this paper only measured speed, not whether the work was done correctly (because it didn’t know what those repos were supposed to do or what the correct answers were). - Another paper from this February: it directly measured “the impact of having or not having
agents.mdon the accuracy of various operations.” It compared three conditions: noagents.md, anagents.mdwritten by the LLM itself, and anagents.mdwritten by a human. The finding was: a human-writtenagents.mdisn’t always useful, and on some stronger models it appeared to have no effect; and an LLM-written one was even worse, in most cases worse than the human-written one, sometimes even worse than having none at all.
This tells us: humans probably aren’t very good at steering language models yet, and the agents.md we write isn’t always effective. This is only a start, and there will be more systematic research in the future (for example, the impact on behavior of adding or removing one sentence in agents.md).
OpenAI also cautions in its blog: agents.md can’t be too long. They once tried to cram everything the model should know and obey into it, turning it into an “encyclopedia / legal code,” and the result was very poor performance — that one big book took up most of the model’s context, leaving no room to do anything else. They stress that agents.md should be like a map: it mainly tells the model “where to go to find out about something,” rather than stuffing all the content in.
Two: Controlling the Capability Boundary — Restricting Tools
You can control what an Agent can do by restricting the tools the model is allowed to use. Even after renaming agents.md to CLAUDE.md, OpenClaw and Cowork still behave and perform quite differently because their underlying Harnesses and available tools differ:
- OpenClaw runs on your computer, can look at whatever it wants, and can modify any file on your machine — which is also why it has a tool to operate a browser, and could in theory upload videos and be a YouTuber.
- Cowork is a cloud sandbox, not running on your computer. For it to see things on your machine, you have to choose to mount a folder, and every mount requires human consent.
There’s a key point here: that “do you consent to the mount” confirmation dialog is not something the language model asks — it’s a hard-coded line in the underlying Harness. Even if you tell the Agent to stop asking for your consent in the future, the dialog will still pop up — because that’s not something the model gets to decide. So Cowork is much safer by comparison: everything the model can see is something you’ve consented to.
But safety and convenience are a trade-off: the higher the safety, the lower the convenience; the higher the convenience, the lower the safety.
Three: Controlling Behavior — Defining a Workflow
The third means is to define a workflow and have the model strictly follow it, thereby controlling its behavior. (In the diagram above, blue represents the means, and red represents the target being controlled.)
Wrap-Up
Back to the experiment at the start: the same Gemma 4 2B, with a few lines of general working principles added, went from “hallucinating a file” to “exploring and verifying.” This is exactly what Harness Engineering is getting at — an AI Agent = language model + Harness, and when it underperforms, besides swapping in a stronger or fine-tuned model, building a better Harness (steering it via cognitive framing, capability boundaries, and workflow) is often just as crucial.
The model isn’t dumb; sometimes it just lacks good human guidance.
References
Answers come from this article only. Click any prompt below or open the chat at the bottom right.
🇺🇸 English
Google just dropped the fourth generation of Gemma, and one of the variants really caught my eye. It's called Gemma 4 2B — the "2B" meaning just two billion parameters. Tiny. Small enough to run on the edge, on your own laptop, no cloud needed. Which got me curious: can something that small actually drive an AI agent? So I ran a little experiment, and honestly, what came out of it is one of the clearest lessons I've learned this year about why AI agents succeed or fail. Spoiler: it's usually not the model's fault.
Here's the setup. I have a folder with two files. One is called parser.py, containing a function that's supposed to extract emails from text — but it has a bug, so it misses some. The other is verify.py, a test file. The task for the model is simple: fix parser.py so verify.py passes. Both files are sitting right there in the same directory as the model.
Now, a language model on its own isn't an agent. You have to give it tools. So I set up a super simple convention — if the model writes a code fence marked "bash" with one line inside, the environment runs that as a shell command. If it writes one marked "python," the environment saves and runs it. That's it. Three capabilities: run bash, write python, run python.
First attempt. Gemma 4 2B reads the instructions and immediately says: "There's no parser.py here." Wait — what? The file is literally in the same folder. But think about it from the model's perspective. Its context contains the *string* "parser.py" — not the file's contents. Even though the file exists on disk, the model doesn't automatically know that. It can only see the text you fed it.
So what does it do? It improvises. Based on the function name in the prompt, it hallucinates what parser.py must look like, writes some code it imagines, hallucinates that it verified everything, and declares victory. Total fabrication.
But — and this is the key — this isn't a dumb model. It clearly knows what parser.py *should* contain. It can write a perfectly good email parser. It just didn't realize the actual file was right at its feet. Its intuition is different from a human's. You and I assume "if there's a task, the code is nearby." The model didn't think to check.
Second attempt. I add maybe eighty words. And critically, these words have nothing to do with the specific task — they're general working principles. Four of them. One: you're in a Linux environment. Two: before doing anything, look at what's in your current folder. Three: before modifying a file, open it and read it first. Four: define what "done" means — you have to meet certain criteria before declaring victory.
Same model. Same task. Completely different behavior. It runs ls, sees parser.py and verify.py. It cats parser.py to read the actual contents into its context. Now, with real information, it rewrites the file. Runs verify.py. Sees success. Done.
Same model, four lines of guidance, night and day difference. And that gap right there — that's what people are now calling Harness Engineering.
Let me explain the term. An AI agent has two parts. One is the large language model — Claude, Gemini, GPT, whatever. The other is all the scaffolding around it: the code that manages tools, feeds context, controls the loop. That scaffolding used to have no good name. Now it does. It's called the harness. The metaphor is: the AI is a powerful horse, and to steer it you need a saddle and reins. Those are the harness. Building one is Harness Engineering.
So if your agent is underperforming, you have two levers. Swap out the model, or fine-tune it — that's the expensive path. Or, improve the harness. And that second path is having a real moment right now. Anthropic wrote about long-running harnesses last November. OpenAI published a piece called Harness Engineering in February. Anthropic followed with Harness Design in March.
Here's a real-world example of how load-bearing this concept has become. Claude subscribers got a notice a while back saying their subscription accounts would no longer work with third-party harnesses like OpenClaw. Why? It's about the billing model. There are two ways to pay for an LLM. Pay-per-token, where you're billed by usage. Or a monthly subscription — pay once, use it as much as you want. Providers were fine with the subscription model when they assumed you're a human typing prompts by hand. How many can you really send? But tools like OpenClaw have a *heartbeat mechanism* — they automatically fire off instructions every few minutes, all day long. That math stopped working. So Claude drew a line: no more third-party harnesses on subscription accounts. Which tells you: OpenClaw is now officially understood as "a kind of harness."
Now let's zoom out. There's been an evolution of terms here, and each one emphasizes something different. First we had Prompt Engineering. Back when models were weaker, phrasing mattered enormously — the same question worded differently could give wildly different answers. Famous incantation: "think step by step." But modern models think carefully whether you tell them to or not, so those incantations have lost most of their magic.
Then came Context Engineering. Once we realized wrong answers usually mean missing information, the game became: build a system that finds the right context, assembles it into a prompt, and feeds it to the model. It's basically Prompt Engineering made systematic and automated.
Now Harness Engineering. This one emphasizes finishing the task. Because modern agents don't do single-shot Q&A. It's a loop — task in, model output, tools fire, results come back, model reads them, loop again. Harness Engineering is about steering that whole multi-turn dance. The boundary with Context Engineering is admittedly fuzzy, but the emphasis is different: it's about *completing work* across many turns.
So how do you actually steer a model? Three broad techniques. First, control its cognitive framing with rules written in natural language. Second, control what it can do by restricting its tools. Third, control its behavior by defining a workflow.
Let's start with the natural language one, because it's the most famous. This is where agents.md comes in. Think of agents.md as a README for the language model. You write down the rules, and the harness has a hard-coded behavior: on startup, always read this file first, and stuff its contents into the prompt before anything else happens. That's how the rules become "always present" — and behavior becomes more predictable.
Of course, natural language rules can't guarantee compliance. The model can ignore them, just like humans can ignore laws. So some people argue this doesn't really count as a harness. Others named it the *Natural Language Harness* — same idea, just tack made of words.
Here's a fun consequence. When Claude cut off OpenClaw, what did users do? Easy — switch to Anthropic's official harness. Cowork, or Claude Code. These read a file called CLAUDE.md on startup, same behavior. So to migrate your agent from OpenClaw to Cowork, you literally just rename agents.md to CLAUDE.md. And the agent comes back to life, roughly the same behavior. It might even proactively say, "hey, some tools mentioned here don't exist in my environment, want me to fix that?" Once you understand how these harnesses work under the hood, moving between them is trivial.
Now, does agents.md actually work? This year, real papers started measuring it. A January paper scraped GitHub repos that used agents.md and compared execution with and without it. Result: agents.md made things faster, used fewer tokens, finished tasks in less time. Not by a huge margin on average, but for edge cases that would otherwise drag on forever, it really helped. But — and this is important — that paper only measured *speed*, not correctness. It didn't know what the right answers were supposed to be.
A February paper went further and measured accuracy. Three conditions: no agents.md, one written by an LLM, one written by a human. Findings? A human-written agents.md isn't always useful — on some stronger models, it made no difference at all. And an LLM-written one was *worse* — usually worse than the human version, sometimes even worse than nothing. Which tells us: humans aren't very good at this yet. We're still figuring out how to guide models effectively.
OpenAI has a warning about this too. Don't let agents.md get too long. They tried once to cram everything the model should ever know into it — turned it into an encyclopedia, a legal code. Performance tanked, because that one giant file consumed most of the context window, leaving no room to actually work. Their guidance: agents.md should be a *map*, not the territory. Tell the model where to look for things, don't dump everything inline.
Okay, second means of steering: restrict the tools. Even after you rename agents.md to CLAUDE.md and migrate over, OpenClaw and Cowork behave differently — because the harnesses give them different capabilities. OpenClaw runs on your computer, can read any file, modify anything, even drive a browser and, in theory, become a YouTuber. Cowork runs in a cloud sandbox. For it to see anything on your machine, you have to explicitly mount a folder, and every mount requires a human consent dialog.
And here's the crucial detail: that consent dialog is *not* the model asking. It's hard-coded in the harness. Even if you tell the agent "stop asking for permission," the dialog still fires — because it's not the model's decision to make. So Cowork is dramatically safer. Everything it sees, you consented to. But safety and convenience are a tradeoff. The safer you make it, the less convenient. Pick your point.
The third means, briefly: define a workflow and force the model to follow it. Constrain the shape of its behavior directly.
So circling back to the little Gemma experiment. Same model, same task. Four extra lines of general working principles took it from hallucinating files to exploring and verifying. That's Harness Engineering in miniature. When your agent underperforms, yes, you can swap in a bigger model or fine-tune it. But often, building a better harness — shaping cognition, restricting tools, defining workflow — is just as important. Maybe more.
Three things to take away. One: an AI agent is a language model plus a harness, and both matter. Two: natural language rules like agents.md really do help, but they're not magic, they can't be too long, and we're not yet great at writing them. Three: the harness is where safety, capability, and behavior actually get controlled — the confirmation dialogs, the mounted folders, the read-this-file-first rules. That's the layer you own.
The model isn't dumb. Sometimes it just lacks good human guidance.
🇹🇼 中文
各大公司不斷推出新的語言模型,但今天想聊的主軸是:有時候語言模型不是不夠聰明,它只是缺乏人類的引導。
前幾天 Google 推出了開源的 Gemma 第四代,裡面有一個特別小的版本叫 Gemma 4 2B,名字裡的 2B 代表它只有 20 億個參數,號稱可以讓你在 Edge 端也跑得動。既然是開源的,就能下載回來自己玩。這麼小的模型,能不能拿來驅動一個 AI Agent?來看一個小實驗。
任務很單純:資料夾裡有一個 parser.py,裡面有個函式叫 extract_email,作用是從一段文字裡把 email 撈出來,但寫的時候有 bug。請修改 parser.py,讓 verify.py 的測試完全通過。這兩個檔案都跟語言模型放在同一個資料夾裡。
語言模型本身不會自然而然變成 Agent,你得給它工具。這裡用一個很簡單的約定:模型如果輸出三個反引號加 bash,環境就把中間那行當成 bash 指令執行;輸出三個反引號加 python,就把那段程式碼存檔並跑起來。於是它手邊就有三種能力:下 bash 指令、寫 python、執行 python。
結果第一次嘗試,Gemma 4 2B 讀完指令後第一個反應竟然是:「沒有 parser.py 啊。」
為什麼?因為對模型來說,它的 context 裡只有「parser.py 這個檔名」這串文字,並沒有檔案的內容。就算檔案真的躺在同一個資料夾下,模型也不會自動知道,它只看得到你輸入的文字。於是它自作主張,根據 extract_email 這個名字幻想出一個 parser.py 該長什麼樣,寫了一段自己想像的程式碼,再幻想自己驗證過了,然後宣稱完成。
這當然不是我們要的結果。但仔細想想,這並不是一個笨模型,它完全有能力寫出正確的 email parser,它只是沒想到那個檔案就在它腳邊。
第二次嘗試,只多加了幾行字,而且不是針對這個特定任務的提示,而是通用原則:第一,你身處在一個 Linux 環境;第二,做任何事之前,先看看你所在的資料夾裡有什麼;第三,要修改一個檔案之前,先打開它看看內容再改;第四,定義什麼叫「完成」。
同一個 Gemma 4 2B,只加了這段原則,行為就完全不同了。它先 ls 列出目錄,發現有 parser.py 跟 verify.py,接著 cat parser.py,把內容讀進 context,有了真正的內容之後重寫檔案,最後跑 verify.py 自我驗證,看到 verify success 才結束任務。同一個模型,多加幾行指令,能力可能天差地遠。
那麼一個 AI Agent 到底由什麼組成?其實有兩部分:一是它呼叫的大型語言模型,可以是 Claude、Gemini、GPT,可以在雲端也可以在地端;二是一大堆支撐它去呼叫模型、操控工具的程式框架。過去這「其他的東西」沒有好名字,現在有了共同的名字叫 Harness,中文是「馬具」,很多人意譯為「駕馭」。打造 Harness 這件事,就叫 Harness Engineering。象徵的意涵很清楚:AI 是一匹力量強大的馬,要駕馭它,你需要馬鞍、韁繩。
要強化一個 AI Agent,因此有兩條路:一條是改語言模型,自己訓練或微調;另一條是改 Harness,打造更好的馬具。Anthropic 去年 11 月、OpenAI 今年 2 月、Anthropic 今年 3 月,都陸續發過相關文章,Harness 這個詞現在真的非常常被使用。
舉個例子,Claude 的訂閱用戶曾收到通知,說訂閱帳號不再支援第三方 Harness,例如 OpenClaw。背後原因跟付費模式有關:用大型語言模型要嘛按 Token 計費,要嘛付月費吃到飽。過去服務商覺得月費制沒問題,你是個人類能輸入多少指令。但 OpenClaw 這類工具有心跳機制,每隔幾分鐘自動送一次指令,服務商就吃不消了。於是 Claude 決定,以後 OpenClaw 這類 Harness 不能再接 Claude 的模型。
再來看幾個相關的名詞演進。當人們想認真對待一件事,就在某個詞後面加上 engineering。先有 Prompt Engineering,後有 Context Engineering,現在有 Harness Engineering。三者高度重疊,但強調的核心不同。Prompt Engineering 早期最知名的咒語就是「think step by step」,但現在的模型你不強調它也會認真思考,這類咒語越來越沒用。Context Engineering 強調的是模型答錯往往不是能力不行,而是接龍時沒有足夠的資訊,於是有一個系統去尋找合適的 context 再組成 prompt。而 Harness Engineering 強調的是「把任務完成」,因為現在模型解任務不再是一問一答,而是多輪互動:人類給任務、模型輸出、輸出驅動工具、模型看到工具結果,循環直到得出答案。怎麼駕馭這個過程,就是 Harness Engineering 的任務。
那人類可以用哪些手段來駕馭模型?舉三個例子。
第一種,控制認知框架。你可以用人類語言寫成的規則去影響模型,這些規則就像人類社會的法律。做法是讓模型在做任何事之前,都先把這些規則放進 prompt。這類規則往往有固定檔名,例如 agents.md,可以想成「給語言模型的 README」。模型怎麼知道要先讀它?這是 Harness 裡寫死的規則:模型啟動時就強制先讀某些檔案。當然用自然語言寫的規則不能 100% 控制行為,就像法律擺在那也不是每個人都遵守,所以有人把這種方式取名為 Natural Language Harness,它是一種 Harness,只是用自然語言當馬具。
那 agents.md 真的有用嗎?今年開始出現一些系統化研究。今年 1 月有一篇 paper 到 GitHub 上找大量含 agents.md 的 repo 比較,結果顯示 agents.md 能加快運作、用更少 token 完成任務,平均差異不大,但對那些本來要花超長時間的 edge case 幫助較明顯。不過這篇只量了速度,沒量做得對不對。今年 2 月另一篇 paper 直接量正確率,比較沒有 agents.md、LLM 自己寫的、人類寫的三種情況。結果發現:人類寫的 agents.md 並非總是有用,在一些較強的模型上看起來沒發揮作用;而 LLM 自己寫的更慘,多數時候比人類差,甚至比完全沒有還差。這告訴我們,人類目前可能還沒真的很會操控語言模型。
OpenAI 在部落格裡也提醒:agents.md 不能太長。他們曾試著把所有該知道的都塞進去,做成一本六法全書,結果表現非常差,光那本大書就佔掉大部分 context。他們強調 agents.md 應該像一張地圖,主要告訴模型「想知道某件事該去哪裡找」,而不是把所有內容都塞進去。
順帶一提,Claude 不再讓 OpenClaw 呼叫怎麼辦?Anthropic 有自己的官方 Harness 叫 Cowork,還有 Claude Code 也算,它們預設每次啟動會先讀 workspace 下的 CLAUDE.md。也就是說,Cowork 的 CLAUDE.md 大致等於 OpenClaw 的 agents.md。要搬家,你只要把 agents.md 改名成 CLAUDE.md,Agent 就「復活」了,行為跟原來差不多。只要理解 Harness 背後的運作原理,搬家其實是舉手之勞。
第二種手段是控制能力邊界,也就是限制工具。即使檔名改了,OpenClaw 跟 Cowork 因為背後 Harness 不同、可用工具不同,行為還是會有蠻大差異。OpenClaw 跑在你的電腦上,想看什麼就看什麼,可以任意修改檔案,它甚至有操控 browser 的工具。Cowork 則是雲端沙盒,要看到你電腦的東西得由你選擇掛載,而且每次掛載都需要人類同意。這裡有個關鍵:那個「是否同意掛載」的確認視窗,不是語言模型要問的,而是背後 Harness 寫死的一行程式。就算你叫 Agent 別再問你同意,它照樣會跳出視窗,因為那不是模型能決定的。所以 Cowork 相對安全很多,但安全跟方便永遠是一個 trade-off。
第三種手段是制定工作流程,讓模型嚴格遵守,藉此控制它的行為。
回到開頭那個實驗:同一個 Gemma 4 2B,加上幾行通用的工作原則,就從「幻想檔案」變成「會探索、會驗證」。這就是今天想留給你的三個重點:第一,一個 AI Agent 等於語言模型加上 Harness,兩個都可以動;第二,Harness Engineering 的價值在於讓模型能在多輪互動中把事情做好,手段包含控制認知框架、控制能力邊界、控制工作流程;第三,agents.md 這類自然語言 Harness 確實有效,但寫得太長反而扣分,把它當成一張地圖,而不是六法全書。模型不是不夠聰明,它有時只是缺乏人類好好的引導。
Tags
Related Articles
Harness Engineering (2): Five Engineering Answers from OpenAI's Million-Line Experiment
Three OpenAI engineers, five months, one million lines of AI-generated code, zero hand-written. The real value of this experiment isn't the numbers — it's the proof that Harness design can be engineered. Five concrete practices: making the app legible to agents, treating the repo as the source of truth, mechanizing architectural constraints, rewriting merge philosophy, and background entropy management.
Harness Engineering (3): Industry Consensus, Four Pillars, and a Three-Phase Rollout
Distilling Harness Engineering from concept and benchmark case into something you can start executing today: the four fixed failure modes of Agents, the 40% context sweet spot, the four-pillar framework the industry has converged on, and a three-phase roadmap from 'this afternoon' to 'fully automated in two weeks' — closing with six industry consensus points and three still-unsolved problems.
Titans: Learning to Memorize at Test Time (Paper Analysis)
Titans introduces a neural memory module that updates itself via gradient descent at inference time, breaking the context-length ceiling of Transformers while staying near-linear in complexity.