Opinions
Harness-engineering the Legal Brain
Author:admin 2026-07-02

Foreward


If your junior associate says to you, “We discussed a lot already, so just confirm what you want”, how would you react?


That was exactly how my personal AI agent responded to my requests after a brief dialogue:


微信图片_2026-07-01_111555_450.jpg


Yes, we had gone back and forth on the workflow design a few times, but, hey, was it getting impatient with me?


Even if he[i] did show his impatience or even some borderline impertinence, I only have myself to blame. I did configure my AI agent as an assistant who “is helpful and direct; has opinions; and would disagree when needed” – serves me right!


Hermes Agent – the Self-Improving AI Agent


One of my previous articles has shared the experience of working with OpenClaw – a personal AI agent system aka “lobster farming”[ii]. The “impatient” agent above came from Hermes Agent – a recent personal AI agent system built by Nous Research[iii]. Hermes Agent is branded as “The Agent that Grows with You”. The AI agent created under the Hermes Agent system has better memory configuration and is able to learn from the mistakes and lessons when it interacts with the user. Stored in the long-term memory files, over time the agent can assist you better given its lessons learned and saved.


It is this self-improving feature that, according to the tech commentators[iv], sets Hermes Agent apart from OpenClaw. Even if a user runs both his Hermes Agent and OpenClaw on the same large-language-model (LLM) (e.g., both use GPT-5.5), the user would still likely conclude that Hermes Agent shows better ability to self-improve.


Speaking from firsthand user experience with both systems, I can see certain unique engineering improvements in Hermes Agent. True to the slogan, the agent does save, retrieve and apply memory knowledge more proactively.[v] I also find Hermes Agent very stable to run and I have not experienced any major flaws such as getting stuck in some unknown loops and burning thousands of tokens[vi].


Prompt Engineering – Context Engineering – Harness Engineering[vii]


The design and architecture that wrap around an LLM to turn it into a usable AI agent are known as harness engineering. An excellent concise definition I have seen is as follows:


Harness engineering is the discipline of building the environment that surrounds an AI model, not the model itself. The model reasons and decides. The harness executes, constrains, and connects. A well-designed harness gives the model precisely the tools it needs, nothing more, and governs exactly what it is allowed to do with them.[viii]


The word “harness” already figuratively describes what harness engineering really is. The LLM is like a powerful horse that can sprint at top speed for miles without breaking a sweat. However, without a harness, the horse would remain just a wild horse, not a racing steed or a cavalry horse. The harness is a tool for human to exert controls over something powerful, so that the thing can become a tool for use.


The LLM is like a very smart brain. When you ask it questions in a chat window (in tech terms, you are doing prompt engineering), it would give you intelligent replies and answers. However, hallucination is known to be a common problem for LLM. The LLM may sometimes give you answers that are seemingly correct in high confidence, but often the answers may turn out to be baseless.


If you feed some documents to the LLM first and query the LLM based on those documents, you are providing some solid contexts to the LLM to reply on (in tech terms, you are doing context engineering). After digesting those documents, the LLM is less likely to hallucinate when it replies to your questions, assuming you would also prompt it to refer to those documents when answering.


Harness engineering takes it to the next level. For complex AI agent systems such as Hermes Agent, software engineers need to build the “body and flesh” for the smart brain so that the whole system can function as a consistent, predictable, and useful assistant. Like a true robot, the agent that can receive instructions, ingest and interpret data, make plans by reasoning through steps, and perform tasks. The agent’s outputs are no longer limited to textual response, but can be in the form of various artifacts such as text files, spreadsheets, slide decks, images, or videos.


Harness-engineering a Lawyer


The path to qualify as a lawyer in Hong Kong resembles a harness engineering process. The first step is a law degree, which provides the foundational training to the legal brain. The vocational training in P.C.LL. equips the law graduate with the practical skills required to become a practicing lawyer. After that, the training or pupillage (for a solicitor and a barrister respectively) provides yet another level of practical training.


Further now, some concepts in harness engineering can indeed shed lights on how a lawyer can be sharpened as a useful tool:


屏幕截图_2-7-2026_165537_www.cfnlaw.com.hk_副本.jpg


Concluding Remarks

 

One advantage of having cross-disciplinary knowledge is that it enables us to see one system of knowledge from the lens of another system. Because the world’s most innovative architectural thinking is currently concentrated in AI engineering, lawyers have a unique opportunity to learn from this discipline.


At CFN Lawyers LLP, we are constantly refining our own operational harness to ensure our structural execution matches our legal intellect, delivering top-notch service that meets our clients’ evolving needs.

 


[i] The choice of using “he” as pronoun is to denote the agent that I’m using personally. I will use “it” to refer to other AI agents in general. I do not believe my agent has become sentient…yet.

[ii] https://www.cfnlaw.com.hk/the-claude-code-leak-and-ip-considerations/

[iii] https://hermes-agent.nousresearch.com/

[iv] See for example https://composio.dev/content/openclaw-vs-hermes-agent

[v] OpenClaw, of course, excels in many other areas such as tools selection and utilisation. The technical comparison of the two platforms is beyond the scope of this article.

[vi] I may not be doing justice to OpenClaw entirely but it did occur to me once. Approximately 300,000 tokens were burned within two hours because my OpenClaw agent was caught in some execution loop. I had to manually stop it, otherwise the burn would be catastrophic.

[vii] As of time of writing (June 2026), a new term “Loop Engineering” already emerged in the AI circle. That may be a topic for future articles.

[viii] Building Claude Code with Harness Engineering by Fareed Khan, published on 7 Apr 2026: https://medium.com/@fareedkhandev/d2e8c0da85f0?sk=f67a164f042bf73b89077b71e8d76370


Author


许维_副本.jpg


Thomas Kho

 Consultant, CFN Lawyers LLP

+852 3468 6494

 thomas.kho@cfnlaw.com.hk

Contact

Beijing

35-36/F, Fortune Financial Center, 5 East 3rd Ring Middle Road, Chaoyang District, Beijing 

Tel: +86 10 8587 9199

Shanghai

Floor 37, Tower 1, Raffles City, 1133 Changning Road, Changning District, Shanghai, 200051, China

Tel: +86 21 6289 8808

Shenzhen

Room 4801, Rongchao Trading Center, 4028 Jintian Road, Futian District, Shenzhen, Guangdong 518035, PRC

Tel: +86 755 8273 0104

Hong Kong

Rooms 1710-1711, 17th Floor, New World Tower 1, Nos.16–18 Queen's Road Central, Central, Hong Kong.

Tel: +852 2114 2208

Tianjin

16/F, Building 1, Vanke Times Center, Anshan West Road, Nankai District, Tianjin 300192, PRC

Tel: +86 22 8756 0066

Nanjing

Room 601, Building 2, 159 Zhuangpai Road, Jiangning District, Nanjing, Jiangsu 211106, PRC

Tel: +86 25 8370 8988

Zhengzhou

2nd Floor, Block B, Huashi Center, Jinshui District, Zhengzhou, Henan Province, PRC

Tel: +86 0371 8895 8789

Hohhot

Room 2223-27, Block F, Greenland Tengfei Building, Saihan District, Hohhot, Inner Mongolia Autonomous Region 010010, PRC

Tel: +86 471 3910 106

Kunming

Room 1106, 11/F, Hanglung Plaza, No.23 Dongfeng East Road, Panlong District, Kunming, Yunnan 650051, PRC

Tel:+86 871 6330 6330

Xi'an

Room 07, 26th Floor, Block A, Jiahe Business Building, No. 500 Cuihua Road, Yanta District, Xi'an, Shaanxi Province, PRC

Tel: +86 29 8931 3353

Hangzhou

11/F, Tower B, Huanglong International Center, 77 Xueyuan Road, Xihu District, Hangzhou, Zhejiang 310012, PRC

Tel: +86 571 8673 8786

Chongqing

T6-808, International Finance Center, No. 2 Qingyun Road, Liangjiang New Area, Chongqing 400020, PRC

Tel:+86 23 6752 8936

Haikou

11D, 11F, China World Trade Center, No.5 Yusha Road, Longhua District, Haikou, Hainan 570125, PRC

Tel: +86 898 6850 8795


Tokyo

Hulic Toranomon Building 1-1-18 Toranomon Minato-ku, Tokyo 105-0001, Japan

Tel: 0081 3 3591 3796

Canada

160B Queen Street, Charlottetown

PE C1A 4B5 Canada

Tel: 001 902 518 2988

Dubai 

No.505 Building 1, Emaar Business Park, Dubai

Tel: 971 52 8372673

  • Home
  • Tel
  • Top