<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lei Ma</title>
    <description>The latest articles on DEV Community by Lei Ma (@nirvana_andy).</description>
    <link>https://dev.to/nirvana_andy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3921880%2F0eebe08f-6ea5-4578-93af-4cd0920472d4.png</url>
      <title>DEV Community: Lei Ma</title>
      <link>https://dev.to/nirvana_andy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nirvana_andy"/>
    <language>en</language>
    <item>
      <title>What does “Harness” mean to AI Agents?</title>
      <dc:creator>Lei Ma</dc:creator>
      <pubDate>Mon, 01 Jun 2026 13:03:36 +0000</pubDate>
      <link>https://dev.to/nirvana_andy/what-does-harness-mean-to-ai-agents-p7o</link>
      <guid>https://dev.to/nirvana_andy/what-does-harness-mean-to-ai-agents-p7o</guid>
      <description>&lt;p&gt;The term “Harness” originally refers to the gear strapped to a horse to control and guide it.&lt;br&gt;
As the name implies, a Harness serves as both the "equestrian gear" and the "control tower" for an AI Agent. This concept is a precise metaphor for the core of next-generation AI engineering: what we need is not an untamed, uncontrollable wild horse (a raw foundation model), but a complete system of reins, saddles, wheels, and navigation to transform it into a "smart chariot" that can arrive at its destination safely and accurately. From a technical perspective, the Harness architecture encompasses every component within an Agent except for the core LLM itself. It is a systemic engineering framework designed to constrain, guide, and enhance the model's capabilities, enabling it to complete real-world tasks stably and reliably.&lt;br&gt;
The core formula of a Harness is so simple it sticks with you at first glance:&lt;/p&gt;

&lt;p&gt;Agent = Model + Harness。&lt;/p&gt;

&lt;p&gt;While the Model is the LLM itself—responsible for comprehension, reasoning, and generation as the "brain" of the AI—the Harness is the runtime control system wrapping around the periphery. It manages scheduling, constraints, recovery, and auditing, serving as the "workbench + command center" that keeps the brain working stably.&lt;br&gt;
In the field of AI engineering, a Harness is defined as the infrastructure wrapping around an AI model, specifically designed as a runtime control system to manage long-running tasks and complex executions. If the Large Language Model (LLM) is the "brain" of AI, then the Harness is its "body" and "nervous system."&lt;/p&gt;

&lt;p&gt;The Core Metaphor: The Horse Harness&lt;/p&gt;

&lt;p&gt;• The Model is a powerful but untamed stallion (providing raw power and intelligence).&lt;br&gt;
• The Harness consists of the reins, saddle, and wheels (providing direction, constraints, and structural support).&lt;br&gt;
• Therefore, the core formula holds true: &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agent = Model (Brain) + Harness (Body/OS)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The Six Core Modules of a Harness Architecture&lt;/p&gt;

&lt;p&gt;Based on the blueprints of representative projects like DeerFlow 2.0, a complete, fully engineered Harness Agent is built upon six core components. Leaving out even one means it falls short of true production-ready engineering. These six core modules collectively construct the AI’s "execution closed-loop":&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Planning &amp;amp; Orchestration Engine
Acting as the "cerebellum" of the Harness, this engine is responsible for task decomposition and workflow control.
• Function: Breaks down vague, complex objectives (e.g., "build a website") into an ordered sequence of sub-steps.
• Key Capabilities:
o   Task Decomposition: Automatically breaks a monolithic task into granular sub-tasks.
o   State Machine Management: Leverages technologies like LangGraph to govern task state transitions (e.g., Planning -&amp;gt; Execution -&amp;gt; Evaluation -&amp;gt; Refinement).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;o   Breakpoint Resumption: Utilizes checkpointing mechanisms to ensure that if a task is interrupted, it can resume precisely from where it left off, rather than restarting from scratch.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sandbox / Execution Environment&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These are the "hands" of the Harness, granting the AI the tangible capability to operate a computer rather than just text-chat.&lt;br&gt;
• Function: Provides an isolated, secure environment for code execution and file manipulations.&lt;br&gt;
• Key Capabilities:&lt;br&gt;
o   File I/O operations: Empowers the AI to create, modify, and persist files (e.g., within /mnt/workspace/).&lt;br&gt;
o   Code Execution: Runs Python or Bash commands inside Docker or local secure containers.&lt;br&gt;
o   Security Isolation: Enforces network access restrictions and CPU/memory quotas to prevent accidental AI operations from compromising the host system.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Skills &amp;amp; Tools System&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is the "arsenal" of the Harness, defining the boundaries of what the AI is capable of doing.&lt;/p&gt;

&lt;p&gt;• Function: Standardizes and encapsulates external APIs, libraries, and operational workflows.&lt;br&gt;
• Key Capabilities:&lt;br&gt;
o   Progressive Loading: Modeled after DeerFlow’s Skills system, it dynamically loads relevant capabilities (e.g., a "Video Generation" skill) only when the task demands it, preventing the context window from being flooded.&lt;br&gt;
o   Standardized Tool Calling: Uniformly encapsulates interfaces like web search, code interpreters, and third-party APIs while systematically handling parameter validation and exceptions.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Memory &amp;amp; Context Engineering&lt;br&gt;
Serving as the "hippocampus" of the Harness, this module mitigates the model's inherent challenges with short-term memory rot and context window overflow.&lt;br&gt;
• Function: Manages short-term working memory and long-term knowledge bases.&lt;br&gt;
• Key Capabilities:&lt;br&gt;
o   Context Compression: Automatically condenses over-extended conversation histories through algorithmic summarization, preserving only the vital core information.&lt;br&gt;
o   Cross-Session Memory: Persistently stores user preferences and project backgrounds, ensuring the AI "remembers" its prior configurations upon the next initialization.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;System Prompts &amp;amp; Guardrails&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This acts as the "constitution" of the Harness, drawing the hard behavioral boundaries for the AI.&lt;/p&gt;

&lt;p&gt;• Function: Constraints AI behavior through a matrix of preset prompt templates and hard-coded rules.&lt;br&gt;
• Key Capabilities:&lt;br&gt;
o   Persona Alignment: Explicitly defines whether the AI acts as a "Senior Software Engineer" or a "Rigorous Financial Analyst."&lt;br&gt;
o   Hard Constraints: Enforces absolute mandates, such as "Never execute rm -rf commands" or "Always validate factual claims using the search tool before answering." These rules are strictly executed via programmatic hooks and do not rely on the model’s self-discipline.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Observability &amp;amp; Feedback Loop&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is the "control tower" of the Harness, bringing absolute transparency to what would otherwise be a black-box AI execution process.&lt;/p&gt;

&lt;p&gt;• Function: Records the entire lineage of the AI’s chain-of-thought, tool invocations, and execution outcomes.&lt;br&gt;
• Key Capabilities:&lt;br&gt;
o   Full-Lineage Logging: Captures the exact inputs and outputs of every single transactional step.&lt;br&gt;
o   Automated Error Correction: When a tool call fails or code throws an exception, the Harness intercepts the error log and feeds it back to the AI for self-healing (e.g., Code throws runtime error $\rightarrow$ Harness injects error logs back into context $\rightarrow$ AI rewrites the code).&lt;/p&gt;




&lt;p&gt;Summary&lt;br&gt;
Fundamentally, these six components exist to force a non-deterministic Large Language Model to run stably within a deterministic framework—this is the foundational logic of AI engineering.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>architecture</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Why AI Claimed Software Developers First: The Counterintuitive Reality</title>
      <dc:creator>Lei Ma</dc:creator>
      <pubDate>Sat, 09 May 2026 13:50:24 +0000</pubDate>
      <link>https://dev.to/nirvana_andy/why-ai-claimed-software-developers-first-the-counterintuitive-reality-4ad2</link>
      <guid>https://dev.to/nirvana_andy/why-ai-claimed-software-developers-first-the-counterintuitive-reality-4ad2</guid>
      <description>&lt;p&gt;*&lt;em&gt;Reason 1: Programming is the "Cleanest" Form of Language *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;What makes a language "clean"? Natural languages (like Chinese or English) are inherently ambiguous: &lt;/p&gt;

&lt;p&gt;• "I almost didn't make it" — Did I succeed or fail? &lt;br&gt;
• "Wear as much as you can" — Is it freezing winter or a scorching summer? &lt;/p&gt;

&lt;p&gt;Programming languages operate on an entirely different logic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# This statement has only one possible meaning
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;span class="c1"&gt;# Inputting 2 and 3 will always, without exception, output 5. 
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Code is devoid of metaphors, cultural subtext, or hidden nuances. While Large Language Models (LLMs) are essentially "probability machines," predicting the next most likely token , programming languages serve as their "native tongue"—rigid in syntax, transparent in logic, and precise in feedback. &lt;/p&gt;

&lt;p&gt;Language Type           Characteristics            AI Learning Difficulty&lt;br&gt;
Natural Language    Ambiguous, context-heavy    ⭐⭐⭐⭐⭐&lt;br&gt;
Programming Language    Precise, unambiguous, structured    ⭐⭐&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Reason 2: The "Instant Feedback" Mechanism *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The Dilemma of Fiction Writing: If you ask an AI to write a story: "As the sun set, the old man sat by the sea..." Is this good? There is no objective answer. Some might find it poetic, others may find it cliché or emotionally hollow. Quality remains entirely subjective.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;The&lt;/span&gt; &lt;span class="n"&gt;Binary&lt;/span&gt; &lt;span class="n"&gt;Nature&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;Code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;factorial&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;factorial&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# Test: factorial(5) should output 120 [cite: 28, 29, 30, 31, 33]
&lt;/span&gt;&lt;span class="n"&gt;The&lt;/span&gt; &lt;span class="n"&gt;execution&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="n"&gt;objective&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
&lt;span class="err"&gt;•&lt;/span&gt; &lt;span class="err"&gt;✅&lt;/span&gt; &lt;span class="n"&gt;Output&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;The&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="n"&gt;correct&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; 
&lt;span class="err"&gt;•&lt;/span&gt; &lt;span class="err"&gt;❌&lt;/span&gt; &lt;span class="n"&gt;Error&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;Wrong&lt;/span&gt; &lt;span class="n"&gt;Output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;The&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="n"&gt;flawed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is no gray area. Training AI in programming is like having a student with an "automated grading machine". While a creative writer must wait days for human feedback, an AI coder learns and iterates in milliseconds. &lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Reason 3: Code as a "Data Gold Mine" *&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;Content Type    Share   Quality Labeling Status&lt;br&gt;
Web Text    80% Inconsistent    Unlabeled&lt;br&gt;
Media (Img/Vid) 15% Diverse Partially Labeled&lt;br&gt;
Open Source Code &amp;lt;5%    Extremely High  Self-Labeled&lt;/p&gt;

&lt;p&gt;Why is code a "Gold Mine"?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inherently Structured: Every line serves a specific, documented function. &lt;/li&gt;
&lt;li&gt;Self-Documenting: Function names, parameters, and comments (docstrings) act as built-in "instruction manuals". &lt;/li&gt;
&lt;li&gt;Rich Version History: Platforms like GitHub provide a complete record of "Problem → Solution" (Commit History), allowing AI to learn the evolution from buggy code to a final fix. &lt;/li&gt;
&lt;li&gt;Colossal Scale: With over 100 million repositories on GitHub, AI has billions of lines of high-quality material to study across every domain. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;*&lt;em&gt;Reason 4: The Pragmatic Paradigm of Developers *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The way a developer uses AI differs fundamentally from a casual user: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Casual User: Requests a "stunning poem about spring". If it’s not "breathtaking," they discard it. &lt;/li&gt;
&lt;li&gt;Developer: Requests a "Python function to convert CSV to JSON". They copy, run, and test.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Developers don't demand "stunning" code; they demand functional code. &lt;/p&gt;

&lt;p&gt;Scenario  Success Metric    Tolerance for Error&lt;br&gt;
Poetry    Aesthetic, evocative  Extremely Low (Subjective)&lt;br&gt;
Coding    Successful execution  Higher (Iterative/Debuggable)&lt;/p&gt;

&lt;p&gt;Programmers treat AI as a high-leverage tool, not a human replacement. &lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Reason 5: The Modular Nature of Programming *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Complex vs. Decomposable Tasks: Writing a novel is a deeply interconnected task where plot, character, and dialogue are inseparable. AI often loses the thread over long distances. &lt;br&gt;
Programming, however, is naturally modular. A login system can be broken down into discrete steps: &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Receive input → Validate format → Query database → Compare hash → Generate Token → Return result. 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Each step is independent and verifiable. AI excels at this type of "short-range" pattern matching and modular logic. &lt;/p&gt;

&lt;p&gt;The Law of AI Adoption &lt;br&gt;
The fields AI "conquers" first invariably possess: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;✅ Explicit rules and syntax. &lt;/li&gt;
&lt;li&gt;✅ Instantly verifiable results. &lt;/li&gt;
&lt;li&gt;✅ Massive volumes of high-quality training data. &lt;/li&gt;
&lt;li&gt;✅ Modular and decomposable tasks. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Deeper Implications &lt;br&gt;
For Developers: The era of 100% manual coding is ending. Future developers will spend 20% of their time writing code and 80% on architectural design, system debugging, and AI orchestration. Architecture and system-level thinking are the new "moats". &lt;br&gt;
For Other Industries: To gauge your risk of displacement, ask if your work is: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Governed by clear rules? &lt;/li&gt;
&lt;li&gt;Instantly verifiable? &lt;/li&gt;
&lt;li&gt;Back-logged by massive historical data? &lt;/li&gt;
&lt;li&gt;Easily decomposed into sub-tasks? &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the Future of AI: The roadmap is clear: AI will move from "Structured &amp;amp; Verifiable" to "Ambiguous &amp;amp; Creative". &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stage 1: Coding, Data Analysis, Mathematical Proofs. &lt;/li&gt;
&lt;li&gt;Stage 2: Documentation, Translation, Customer Support. &lt;/li&gt;
&lt;li&gt;Stage 3: Creative Writing, High-end Design, Artistic Creation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*&lt;em&gt;Conclusion *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Why did AI conquer programmers first? Not because they were the "low-hanging fruit," but because programming is the most compatible playground for AI's strengths. &lt;/p&gt;

&lt;p&gt;Just as cars first replaced horse carriages on paved, fixed routes before tackling off-road terrain, AI targets domains with clear rules before expanding into the fog of human creativity. For developers, this is not just a challenge—it is the ultimate efficiency upgrade. &lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
