<?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: Ted Kim</title>
    <description>The latest articles on DEV Community by Ted Kim (@tedkim81).</description>
    <link>https://dev.to/tedkim81</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4062809%2Fd2953fcc-0f26-4312-87bb-2ecf3724f88c.jpg</url>
      <title>DEV Community: Ted Kim</title>
      <link>https://dev.to/tedkim81</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tedkim81"/>
    <language>en</language>
    <item>
      <title>Harness Engineering — Building the Environment Your Coding Agent Works In</title>
      <dc:creator>Ted Kim</dc:creator>
      <pubDate>Wed, 12 Aug 2026 16:50:11 +0000</pubDate>
      <link>https://dev.to/tedkim81/harness-engineering-building-the-environment-your-coding-agent-works-in-4acn</link>
      <guid>https://dev.to/tedkim81/harness-engineering-building-the-environment-your-coding-agent-works-in-4acn</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8zpgt419jnklngubv6hy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8zpgt419jnklngubv6hy.png" alt="Harness Engineering" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Wrote This
&lt;/h2&gt;

&lt;p&gt;I actively use AI agents (Cursor, Claude Code, etc.) across multiple projects. At first, having an agent write code was impressive enough on its own. But as I integrated them more deeply into real projects, I kept running into recurring problems.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every time I open a new session, the agent forgets the project conventions&lt;/li&gt;
&lt;li&gt;It repeats the same mistakes today that we already solved yesterday&lt;/li&gt;
&lt;li&gt;The quality of agent-generated code fluctuates wildly between sessions&lt;/li&gt;
&lt;li&gt;When managing multiple projects, I have to repeat the same setup for each one&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The root cause of these problems wasn't a lack of agent intelligence — it was that the &lt;strong&gt;environment surrounding the agent was not properly set up&lt;/strong&gt;. As 2026 arrived, this concern spread across the industry and began to be systematized under the name "harness engineering."&lt;/p&gt;

&lt;p&gt;After first applying harness engineering to a company project, I experienced its effectiveness firsthand and decided to apply the same structure to my personal projects. During this process, I felt the need for a "reference document that can quickly turn any project into a harness structure," which led me to write this guide.&lt;/p&gt;

&lt;p&gt;This guide goes beyond explaining the concept of harness engineering — it covers &lt;strong&gt;what to apply based on your project type&lt;/strong&gt;. From personal blogs to multi-agent automation systems, it's structured to help you design a harness that matches your project's scale and complexity.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. What Is Harness Engineering?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Definition
&lt;/h3&gt;

&lt;p&gt;Harness engineering is an &lt;strong&gt;infrastructure design discipline&lt;/strong&gt; for operating AI agents safely and reliably. The term "harness" derives from horse tack that controls a horse's power, referring to a system that guides the powerful but unpredictable force of AI agents in the right direction.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The model is a commodity. The harness is the moat."&lt;br&gt;
— harness-engineering.ai&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Analogy
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Element&lt;/th&gt;
&lt;th&gt;Analogy&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Horse&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;AI Model&lt;/td&gt;
&lt;td&gt;Powerful and fast, but doesn't know where to go on its own&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Harness&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Infrastructure&lt;/td&gt;
&lt;td&gt;Constraints, guardrails, and feedback loops that let the model's power be used productively&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Rider&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Human Engineer&lt;/td&gt;
&lt;td&gt;Doesn't run directly — provides direction&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Why Harness Engineering Now?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;2025&lt;/strong&gt; was the year that proved AI agents can write code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2026&lt;/strong&gt; is the year we realized the key isn't the agent itself, but the harness&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;LangChain improved their Terminal Bench 2.0 score from 52.8% to 66.5% by changing only the harness, without modifying the model at all. The OpenAI Codex team built production applications exceeding 1 million lines without manually writing a single line of code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Comparison with Related Concepts
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Concept&lt;/th&gt;
&lt;th&gt;Scope&lt;/th&gt;
&lt;th&gt;Focus&lt;/th&gt;
&lt;th&gt;Reliability Improvement&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Prompt Engineering&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Single interaction&lt;/td&gt;
&lt;td&gt;Crafting effective prompts&lt;/td&gt;
&lt;td&gt;5-15%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Context Engineering&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Model context window&lt;/td&gt;
&lt;td&gt;Optimizing information the model sees&lt;/td&gt;
&lt;td&gt;15-30%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Harness Engineering&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Entire agent system&lt;/td&gt;
&lt;td&gt;Environment, constraints, feedback, lifecycle&lt;/td&gt;
&lt;td&gt;50-80%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  2. Core Components of Harness Engineering
&lt;/h2&gt;

&lt;h3&gt;
  
  
  2-1. Context Engineering
&lt;/h3&gt;

&lt;p&gt;Ensuring the agent has the right information at the right time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Static Context:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repository-local documents (architecture specs, API specs, style guides)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CLAUDE.md&lt;/code&gt; files encoding project-specific rules (or &lt;code&gt;AGENTS.md&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Interlinked design documents (linters automatically verify link validity and document freshness)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Dynamic Context:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Observational data accessible to the agent (logs, metrics, traces)&lt;/li&gt;
&lt;li&gt;Directory structure mapping at agent startup&lt;/li&gt;
&lt;li&gt;CI/CD pipeline status and test results&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Core rule: From the agent's perspective, anything not accessible within the context doesn't exist. Knowledge in Google Docs, Slack threads, or people's heads is invisible to the system. The repository must be the single source of truth. — OpenAI&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  2-2. Architectural Constraints
&lt;/h3&gt;

&lt;p&gt;Instead of telling the agent "write good code," mechanically enforce what good code looks like.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dependency Layering:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Types → Config → Repo → Service → Runtime → UI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each layer can only import from layers to its left, enforced through structural tests and CI verification.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Constraint Enforcement Tools:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deterministic linters — custom rules that automatically flag violations&lt;/li&gt;
&lt;li&gt;LLM-based auditors — agents that review other agents' code&lt;/li&gt;
&lt;li&gt;Structural tests — architecture tests for AI-generated code&lt;/li&gt;
&lt;li&gt;Pre-commit hooks — automatic checks before code is committed&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Paradoxically, constraining the solution space improves agent productivity. When agents can generate anything, they waste tokens exploring dead ends. When the harness defines clear boundaries, agents reach correct solutions faster. — NxCode&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  2-3. Guardrails
&lt;/h3&gt;

&lt;p&gt;Technically controlling both inputs and outputs of AI agents to preemptively block behavior outside the designed purpose scope.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Input stage&lt;/strong&gt;: Detect / block prompt injection or confidential information leakage&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Output stage&lt;/strong&gt;: Automatically filter harmful content or hallucinations&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2-4. Verification Loops
&lt;/h3&gt;

&lt;p&gt;A structure that verifies the agent's work at each step before allowing progression. This is the component with the &lt;strong&gt;highest ROI&lt;/strong&gt; in a harness.&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;# Verification loop pattern (pseudocode)
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run_agent_with_verification&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cost_ceiling&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;assemble_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;total_cost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;is_complete&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
        &lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;execute_tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;verification&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;verify_output&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;expected_schema&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;verification&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;passed&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;verification&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;retry_recommended&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;retry_with_backoff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max_retries&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;TaskResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;failed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;verification&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;total_cost&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tokens_used&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;total_cost&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;cost_ceiling&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;TaskResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;budget_exceeded&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;partial&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;update_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;TaskResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;complete&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;final_output&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;"Highest ROI" means the &lt;strong&gt;greatest effect relative to effort invested&lt;/strong&gt;. Among all harness components, verification loops deliver the largest quality improvement with the least effort.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Implementation cost: 50-150ms additional latency per step, a few dozen lines of code&lt;/li&gt;
&lt;li&gt;Effect: Task completion rate 83% → 96% (without changing model or prompts)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're building a harness for the first time and wondering "what should I build first?" — &lt;strong&gt;start with verification loops for the best cost-effectiveness&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2-5. Cost Envelope Management
&lt;/h3&gt;

&lt;p&gt;Setting per-task budget ceilings that the harness enforces regardless of the agent's intent.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cost envelopes are not just financial controls — they're &lt;strong&gt;reliability signals&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;A task hitting its budget ceiling means it's operating abnormally (bad upstream response, context drift, tool integration error, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2-6. Entropy Management
&lt;/h3&gt;

&lt;p&gt;Regularly cleaning up entropy that accumulates in AI-generated codebases over time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Document consistency agent — verifies documents match current code&lt;/li&gt;
&lt;li&gt;Constraint violation scanner — re-scans code that passed previous checks&lt;/li&gt;
&lt;li&gt;Pattern enforcement agent — identifies / fixes deviations from established patterns&lt;/li&gt;
&lt;li&gt;Dependency auditor — tracks / resolves circular or unnecessary dependencies&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2-7. Agent Memory
&lt;/h3&gt;

&lt;p&gt;A structure for &lt;strong&gt;persistently accumulating&lt;/strong&gt; knowledge, discovered patterns, and ongoing decisions that agents learn across sessions within the repository. Since agents are fundamentally stateless, all context disappears when a session ends. The harness compensates for this "amnesia."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three time axes of context:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Time Axis&lt;/th&gt;
&lt;th&gt;Nature&lt;/th&gt;
&lt;th&gt;Examples&lt;/th&gt;
&lt;th&gt;Change Frequency&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Static Context&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Pre-written documents&lt;/td&gt;
&lt;td&gt;ARCHITECTURE.md, API specs&lt;/td&gt;
&lt;td&gt;Rarely changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Accumulated Context&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Knowledge discovered / learned during work&lt;/td&gt;
&lt;td&gt;Design decision records, failure pattern notes, ongoing interests&lt;/td&gt;
&lt;td&gt;Grows per session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Dynamic Context&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Data generated at runtime&lt;/td&gt;
&lt;td&gt;Logs, metrics, CI status&lt;/td&gt;
&lt;td&gt;Changes every time&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Static context is written at project inception, and dynamic context is automatically generated at runtime. &lt;strong&gt;Accumulated context&lt;/strong&gt; sits between them — a knowledge layer that grows incrementally as agent work accumulates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implementation pattern for accumulated context:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;project root&amp;gt;/
├── docs/
│   └── decisions/                    # Architecture Decision Records (ADR)
│       ├── 001-static-site-generator-choice.md
│       └── 002-deployment-strategy.md
├── .memory/                          # Agent memory
│   ├── learnings.md                  # Patterns, failure causes, know-how
│   ├── current-focus.md              # Current interests, priorities
│   └── session-notes/                # Per-session summaries (optional)
│       └── 2026-04-04.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Native memory support by tool:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Memory Mechanism&lt;/th&gt;
&lt;th&gt;Storage Location&lt;/th&gt;
&lt;th&gt;Auto / Manual&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code&lt;/td&gt;
&lt;td&gt;Auto Memory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.claude/projects/&amp;lt;project&amp;gt;/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Auto-accumulate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code&lt;/td&gt;
&lt;td&gt;CLAUDE.md&lt;/td&gt;
&lt;td&gt;Project root&lt;/td&gt;
&lt;td&gt;Manual&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cursor&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.cursor/rules/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.cursor/rules/*.mdc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Manual&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cursor&lt;/td&gt;
&lt;td&gt;Notepads&lt;/td&gt;
&lt;td&gt;Cursor sidebar&lt;/td&gt;
&lt;td&gt;Manual (inject via &lt;code&gt;@notepad&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Claude Code has an Auto Memory feature that automatically saves patterns discovered during sessions, but Cursor requires manual knowledge management through &lt;code&gt;.cursor/rules/&lt;/code&gt; and Notepads. Using &lt;strong&gt;repository-based memory&lt;/strong&gt; (the &lt;code&gt;.memory/&lt;/code&gt; pattern above) that doesn't depend on any specific tool makes it accessible from any tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core principles:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Record failure causes and solutions so the agent "doesn't repeat the same mistakes"&lt;/li&gt;
&lt;li&gt;Build a habit of committing "what I learned this session" to the repository before ending the session&lt;/li&gt;
&lt;li&gt;Accumulated context is also subject to entropy management — regularly clean up outdated or invalidated notes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2-8. Observability &amp;amp; Evaluation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Observability&lt;/strong&gt;: Structurally tracking what the agent did, why it did it, and what occurred at each step&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evaluation&lt;/strong&gt;: An automated pipeline that continuously measures agent performance against defined criteria&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Harness Engineering Application Levels
&lt;/h2&gt;

&lt;p&gt;Harness engineering application depth varies based on project scale and complexity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Level 1: Basic Harness (Individual Developer)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;CLAUDE.md&lt;/code&gt; file containing project conventions (Cursor references via &lt;code&gt;.cursor/rules/&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Pre-commit hooks for linting and formatting&lt;/li&gt;
&lt;li&gt;Test suite the agent can run for self-verification&lt;/li&gt;
&lt;li&gt;Clear directory structure with consistent naming conventions&lt;/li&gt;
&lt;li&gt;Agent memory (&lt;code&gt;.memory/&lt;/code&gt;) for cross-session knowledge accumulation&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Suitable for personal blogs, documentation sites, personal tools, and side projects where a single agent is directly instructed by the user.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Level 2: Team Harness (Small Team)
&lt;/h3&gt;

&lt;p&gt;Level 1 plus:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Architectural constraints enforced by CI&lt;/li&gt;
&lt;li&gt;Shared prompt templates for common tasks&lt;/li&gt;
&lt;li&gt;Documentation-as-code verified by linters&lt;/li&gt;
&lt;li&gt;Code review checklists specifically for agent-generated PRs&lt;/li&gt;
&lt;li&gt;Agent role boundaries and change scope limits&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Suitable for environments where multiple developers use agents on the same repository. The focus is on preventing inter-agent conflicts and minimizing code quality variance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Level 3: Production Harness (Engineering Organization)
&lt;/h3&gt;

&lt;p&gt;Level 2 plus:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Custom middleware layers (loop detection, reasoning optimization)&lt;/li&gt;
&lt;li&gt;Observability integration (agents read logs and metrics)&lt;/li&gt;
&lt;li&gt;Entropy management agents running on schedule&lt;/li&gt;
&lt;li&gt;Harness version control and A/B testing&lt;/li&gt;
&lt;li&gt;Agent performance monitoring dashboards&lt;/li&gt;
&lt;li&gt;Escalation policies for agent deadlocks&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Suitable for systems where agents autonomously execute pipelines, integrate with external APIs at scale, and where agent judgment errors directly cause financial / operational losses.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  4. Applying Harness Engineering to Your Project
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4-1. Service Characteristics Analysis
&lt;/h3&gt;

&lt;p&gt;Before designing a harness, first identify the target project's core characteristics through these questions:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Analysis Item&lt;/th&gt;
&lt;th&gt;Key Question&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Agent Structure&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Single agent or multi-agent pipeline?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data Processing&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;What data sources are involved? Is parallel processing needed?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Human Involvement&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Is Human-in-the-Loop needed? At which stages is approval required?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Automation Level&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Is there autonomous scheduling / automatic execution?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;External Integration&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;What external APIs or services are integrated?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Risk Level&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;What impact does an agent's wrong judgment have? (financial, operational, security)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Based on these answers, classify your project into one of these types to determine which Phases to apply:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Project Type&lt;/th&gt;
&lt;th&gt;Agents&lt;/th&gt;
&lt;th&gt;Automation&lt;/th&gt;
&lt;th&gt;External Integration&lt;/th&gt;
&lt;th&gt;Risk&lt;/th&gt;
&lt;th&gt;Recommended Phases&lt;/th&gt;
&lt;th&gt;Examples&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;A. Personal / Static&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Single (IDE-based)&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;None or minimal&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1~2&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Blogs, doc sites, personal tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;B. Team / Web App&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Single or few&lt;/td&gt;
&lt;td&gt;CI/CD&lt;/td&gt;
&lt;td&gt;Some APIs&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1~3&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Web apps, SaaS backends&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;C. Multi-Agent / Automation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Multiple, pipeline&lt;/td&gt;
&lt;td&gt;Schedule / trigger&lt;/td&gt;
&lt;td&gt;Many APIs&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1~5&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Ad automation, data pipelines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;D. Production / Enterprise&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Multiple, large-scale&lt;/td&gt;
&lt;td&gt;Fully automated&lt;/td&gt;
&lt;td&gt;Large-scale&lt;/td&gt;
&lt;td&gt;Very high&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1~7&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Financial systems, infra automation&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  4-2. Risk Identification
&lt;/h3&gt;

&lt;p&gt;Identify risks that can occur when operating without a harness based on project characteristics:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Risk Type&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Applicable Types&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Financial malfunction&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Agent's wrong judgment directly leads to monetary losses&lt;/td&gt;
&lt;td&gt;C, D&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Hallucination-based decisions&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;False analysis results lead to wrong follow-up actions&lt;/td&gt;
&lt;td&gt;All types&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Cost runaway&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Repeated external API calls, LLM token accumulation cause cost control failure&lt;/td&gt;
&lt;td&gt;B, C, D&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Data contamination&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Data from different contexts mixes during parallel execution&lt;/td&gt;
&lt;td&gt;C, D&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Agent doom loops&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Same task repeatedly detected / processed in multi-agent pipelines&lt;/td&gt;
&lt;td&gt;C, D&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Duplicate execution&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Periodic triggers cause the same task to execute redundantly&lt;/td&gt;
&lt;td&gt;C, D&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Quality drift&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Agent-generated content / code quality fluctuates between sessions&lt;/td&gt;
&lt;td&gt;All types&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Context loss&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Knowledge learned between sessions isn't carried over, repeating the same mistakes&lt;/td&gt;
&lt;td&gt;All types&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For Type A (personal projects), risks 2, 7, and 8 are most relevant, and Phase 1~2 harnesses (rule files, pre-commit hooks, agent memory) are sufficient. As you move toward Types C~D, risks 1, 3~6 become more critical, requiring Phase 3+ harnesses.&lt;/p&gt;

&lt;h3&gt;
  
  
  4-3. Harness Engineering Design
&lt;/h3&gt;

&lt;h4&gt;
  
  
  A. Context Engineering Application
&lt;/h4&gt;

&lt;p&gt;Configure the project repository as the agent's single source of truth. Recommended directory structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;project root&amp;gt;/
├── CLAUDE.md                          # Entry point for agent behavior rules
├── ARCHITECTURE.md                    # Top-level system architecture map
├── .cursor/
│   └── rules/
│       └── general.mdc                # Connects Cursor to reference CLAUDE.md
├── docs/
│   ├── design-docs/                   # Feature design documents
│   ├── api-specs/                     # API endpoint specifications
│   ├── references/                    # SDK/framework references
│   └── quality/                       # Quality standards
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Core principles:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maintain &lt;code&gt;CLAUDE.md&lt;/code&gt; as a &lt;strong&gt;table of contents&lt;/strong&gt;, not an encyclopedia (about 100 lines)&lt;/li&gt;
&lt;li&gt;Record all design decisions as documents within the repository (no Slack / Google Docs)&lt;/li&gt;
&lt;li&gt;From the agent's perspective, information it can't search for doesn't exist&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  B. Agent Behavior Constraints
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Applicable to&lt;/strong&gt;: Project Type B and above (Team / Web App). For single-agent personal projects, glob-based rule files and pre-commit hooks are sufficient.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Clearly define agent behavior boundaries based on project characteristics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1) Role Boundaries per Agent&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Explicitly define what each agent can and cannot do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Agent Name&amp;gt; (&amp;lt;Role&amp;gt;)
  - Allowed: &amp;lt;list of tasks this agent can perform&amp;gt;
  - Forbidden: &amp;lt;list of tasks this agent must never perform&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Core principles for designing role boundaries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Least privilege&lt;/strong&gt;: Each agent has only the minimum permissions needed for its role&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Separation&lt;/strong&gt;: Separate data query / analysis agents from execution / modification agents&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Approval required&lt;/strong&gt;: High-risk actions (financial impact, data changes, external system calls) must go through an approval stage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2) Input / Output Guardrails&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Input: External data source response validation, context isolation verification&lt;/li&gt;
&lt;li&gt;Output: Change scope limits, hallucination filtering&lt;/li&gt;
&lt;li&gt;Pipeline: Inter-stage data schema validation, identifier consistency checks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3) Task Cost Envelopes&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cost ceilings by task type (define per project):
  - Simple query/analysis: baseline × 1
  - Complex analysis/diagnosis: baseline × 2
  - Full pipeline execution: baseline × 10
  - Report generation: baseline × 5
  - Tasks involving external API calls: baseline × 3

  → On ceiling breach: halt task + alert + escalate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  C. Verification Loop Application
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Application level&lt;/strong&gt;: Available for all project types, but implementation depth varies.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Type A&lt;/strong&gt; (Personal): Pre-commit hooks and build validation serve as self-verification.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Type B&lt;/strong&gt; (Team): Integrate automated tests, lints, and PR reviews into CI/CD.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Type C~D&lt;/strong&gt; (Automation / Enterprise): Dual / triple structure of agent self-verification + Human-in-the-Loop is needed.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;A &lt;strong&gt;dual structure&lt;/strong&gt; is recommended for verification loops:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1) Agent Self-Verification&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Pipeline step execution
  → Agent generates result
  → Self-verify result (data integrity, schema compliance)
  → Auto-retry on failure (max 3 attempts)
  → Pass to next step on success
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2) Human Verification (Human-in-the-Loop)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High-risk actions request approval via operations tools&lt;/li&gt;
&lt;li&gt;Operator approves / rejects&lt;/li&gt;
&lt;li&gt;On rejection, feedback is passed to the agent to suggest alternatives&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3) Output Verification Loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Apply verification loops to agent-generated outputs as well:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Agent creates draft → verification (automated or human) → auto-rewrite on rejection&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  D. Multi-Agent Harness Middleware
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Applicable to&lt;/strong&gt;: Project Type C and above (Multi-Agent / Automation). Unnecessary for projects where a user manually directs a single agent.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For multi-agent systems, apply middleware to the pipeline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Pipeline execution request
  → ContextIsolationMiddleware   (context isolation, prevent data contamination)
  → CostEnvelopeMiddleware       (cost envelope check, block on overrun)
  → LoopDetectionMiddleware      (prevent repeated task processing)
  → InputValidationMiddleware    (input data integrity validation)
  → [Agent Execution]
  → OutputValidationMiddleware   (result schema validation, change scope limits)
  → ApprovalGateMiddleware       (risk assessment, route to approval on high risk)
  → ExecutionAuditMiddleware     (execution history recording)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  E. Observability Integration
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Applicable to&lt;/strong&gt;: Project Type C and above. For manual-use projects, agent memory and Git history provide sufficient observability.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Observable Data&lt;/th&gt;
&lt;th&gt;Application&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Agent execution history&lt;/td&gt;
&lt;td&gt;Execution history dashboard, success / failure tracking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pipeline stage status&lt;/td&gt;
&lt;td&gt;Bottleneck identification, health monitoring&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Approval / rejection ratio&lt;/td&gt;
&lt;td&gt;Agent judgment accuracy evaluation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;External API call volume&lt;/td&gt;
&lt;td&gt;API quota management, call failure rate tracking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost tracking&lt;/td&gt;
&lt;td&gt;LLM token, external service cost optimization&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h4&gt;
  
  
  F. Entropy Management — Maintaining Agent Quality
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Scope&lt;/strong&gt;: Available for all project types, but scope varies.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Type A~B&lt;/strong&gt;: Periodic cleanup of &lt;code&gt;.memory/learnings.md&lt;/code&gt;, link verification is sufficient.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Type C~D&lt;/strong&gt;: Dedicated agents perform regular quality audits.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Periodic tasks — select/configure per project]
  - Prompt drift detector: Monitor consistency between system prompts and actual output
  - Data integrity checker: Verify referenced data/settings are still valid
  - Output quality audit: Verify auto-generated results are based on actual data
  - Tool function consistency check: Verify tool definitions are in sync with external service schemas
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4-4. Harness Engineering Application Roadmap
&lt;/h3&gt;

&lt;p&gt;You don't need to apply all Phases sequentially. Based on the project type classification, select and apply only the Phases you need.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Phase&lt;/th&gt;
&lt;th&gt;Timing&lt;/th&gt;
&lt;th&gt;Application Content&lt;/th&gt;
&lt;th&gt;Expected Effect&lt;/th&gt;
&lt;th&gt;Target Type&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Phase 1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Immediate&lt;/td&gt;
&lt;td&gt;Agent instruction files, directory structure documentation, pre-commit hooks&lt;/td&gt;
&lt;td&gt;Development environment quality&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;All projects&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Phase 2&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Short-term&lt;/td&gt;
&lt;td&gt;Agent memory structure (&lt;code&gt;.memory/&lt;/code&gt;, decision records)&lt;/td&gt;
&lt;td&gt;Cross-session continuity&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;All projects&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Phase 3&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Short-term&lt;/td&gt;
&lt;td&gt;Agent role boundaries, I/O guardrails, context isolation&lt;/td&gt;
&lt;td&gt;Pipeline stability&lt;/td&gt;
&lt;td&gt;B+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Phase 4&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mid-term&lt;/td&gt;
&lt;td&gt;Middleware chain, loop detection, cost envelope management&lt;/td&gt;
&lt;td&gt;Parallel processing safety&lt;/td&gt;
&lt;td&gt;C+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Phase 5&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mid-term&lt;/td&gt;
&lt;td&gt;Automated task verification, duplicate execution prevention, API quota management&lt;/td&gt;
&lt;td&gt;Automation stability&lt;/td&gt;
&lt;td&gt;C+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Phase 6&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Long-term&lt;/td&gt;
&lt;td&gt;Observability dashboard, entropy management agent, A/B testing&lt;/td&gt;
&lt;td&gt;Operations optimization&lt;/td&gt;
&lt;td&gt;D&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Phase 7&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Long-term&lt;/td&gt;
&lt;td&gt;Auto-approval threshold learning, agent benchmarks, harness version control&lt;/td&gt;
&lt;td&gt;Autonomous operations&lt;/td&gt;
&lt;td&gt;D&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h4&gt;
  
  
  Application Examples by Project Type
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Type A — Personal Blog / Documentation Site / Personal Tool&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Phase 1: CLAUDE.md (or .cursor/rules/), ARCHITECTURE.md, Pre-commit hooks
Phase 2: .memory/learnings.md, current-focus.md, docs/decisions/
         → These two phases alone complete an environment where the agent
           consistently understands the project and accumulates knowledge
           across sessions.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Type B — Team Web Application / SaaS Backend&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Phase 1~2: (Same as Type A)
Phase 3: Architecture lints enforced by CI, PR review checklists,
         change scope limits for agent-generated code
         → Reduces code quality variance between team members
           and prevents excessive agent changes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Type C — Multi-Agent Automation System&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Phase 1~3: (Apply through Type B)
Phase 4: Inter-agent data isolation middleware, cost envelope management,
         doom loop detection and auto-halt
Phase 5: Duplicate execution prevention for scheduled tasks (idempotency keys),
         external API quota management, retry policies on failure
         → Achieves "controlled autonomy."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Type D — Production Enterprise System&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Phase 1~5: (Apply through Type C)
Phase 6: Real-time dashboard, automated entropy management agent,
         agent output A/B testing
Phase 7: Auto-approval threshold learning from repeated patterns,
         agent performance benchmark suite, harness config version control and rollback
         → Builds a sustainable operations framework.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  5. Agent Instruction File Strategy
&lt;/h2&gt;

&lt;p&gt;The pattern of "placing agent behavior instructions as markdown in the repository root" has become a de facto standard. However, each tool recognizes different filenames:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Default Instruction File&lt;/th&gt;
&lt;th&gt;AGENTS.md Recognition&lt;/th&gt;
&lt;th&gt;CLAUDE.md Recognition&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;OpenAI Codex&lt;/td&gt;
&lt;td&gt;&lt;code&gt;AGENTS.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Official support&lt;/td&gt;
&lt;td&gt;Not supported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cursor&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.cursor/rules/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Recognized (lowest priority)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Not supported&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code&lt;/td&gt;
&lt;td&gt;&lt;code&gt;CLAUDE.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Not supported&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Official support&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Covering all tools with a single file is currently impossible. (As of April 2026)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recommended strategy: Main instruction file + tool-specific links&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Choose the main instruction file based on your primary AI tool, and have other tools reference it:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pattern A: Claude Code Main + Cursor Sub&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CLAUDE.md                  ← Write actual rules here
.cursor/rules/general.mdc  ← "See CLAUDE.md"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pattern B: Cursor Main + Claude Code Sub&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.cursor/rules/&amp;lt;project&amp;gt;.mdc  ← Write actual rules here (alwaysApply: true)
CLAUDE.md                     ← "See .cursor/rules/"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose the AI tool you primarily use as the main one. Write rules in the main tool's instruction file and keep the sub tool's instruction file as a lightweight reference to the main. This way, you only manage rules in one place.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Agent Memory and Context Drift
&lt;/h2&gt;

&lt;p&gt;Agent memory and context drift are two sides of the same coin.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Context drift&lt;/strong&gt; is the phenomenon where the agent deviates from its original goal as conversations grow longer. Harness strategies for addressing this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Session separation&lt;/strong&gt;: Use multiple short, purpose-specific sessions rather than one long session. Claude Code's &lt;code&gt;/compact&lt;/code&gt; command or starting a new Cursor chat serve this purpose.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Connect via memory files&lt;/strong&gt;: Record key conclusions in memory files at session end, and reference them in the next session.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Leverage rule file priority&lt;/strong&gt;: Rules recorded in &lt;code&gt;.cursor/rules/&lt;/code&gt; (alwaysApply) or &lt;code&gt;CLAUDE.md&lt;/code&gt; are injected every turn regardless of session length, so core constraints must be in rule files.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Context drift in long sessions]
  Session start → (rules + goals clear) → work progresses → ... → (context window saturated)
    → Initial rules' influence ↓ → drift occurs

[Memory-based short session strategy]
  Session 1: Work → record conclusions in memory → end session
  Session 2: Load memory → (rules + previous conclusions clear) → continue work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For &lt;strong&gt;developer-managed projects&lt;/strong&gt; (blogs, personal projects, etc.), using markdown files within the repository (&lt;code&gt;docs/decisions/&lt;/code&gt;, &lt;code&gt;.memory/&lt;/code&gt;) is more practical than heavy automated memory systems. Simply instructing the agent to "add findings to &lt;code&gt;.memory/learnings.md&lt;/code&gt;" is enough to establish cross-session knowledge continuity.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Pre-commit Hooks and Agents
&lt;/h2&gt;

&lt;p&gt;Pre-commit hooks are scripts registered at &lt;code&gt;.git/hooks/pre-commit&lt;/code&gt; that automatically run on &lt;code&gt;git commit&lt;/code&gt;, blocking the commit itself on rule violations.&lt;/p&gt;

&lt;p&gt;The core principle of harness engineering: &lt;strong&gt;"What can be mechanically enforced should be mechanically enforced."&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;th&gt;Enforcement&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Pre-commit hooks (scripts)&lt;/td&gt;
&lt;td&gt;Formatting, linting, type checks — things with clear rules&lt;/td&gt;
&lt;td&gt;100% — commit blocked on violation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Natural language instructions (CLAUDE.md, etc.)&lt;/td&gt;
&lt;td&gt;Design judgments, naming conventions — things requiring judgment&lt;/td&gt;
&lt;td&gt;Advisory level&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Indirect communication with agents:&lt;/strong&gt; Pre-commit hooks can't directly invoke agents. However, the structure where agents read and respond to hook error messages already works. The OpenAI Codex team leverages this by &lt;strong&gt;embedding fix instructions in linter error messages&lt;/strong&gt;, so the agent reads the error, fixes it, and re-commits.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Agent-friendly error message example&lt;/span&gt;
Error: line 42 - unused variable 'tempData'.
Fix: Remove the variable or use it in the fetchResult() call below.
Refer to docs/conventions/no-unused-vars.md for examples.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  8. Key Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Harness engineering&lt;/strong&gt; is the discipline of designing systems (constraints, feedback loops, documentation, lifecycle management) that make AI agents reliable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Application scope varies by project characteristics.&lt;/strong&gt; Personal projects only need Phase 1~2, multi-agent automation systems may need through Phase 5, and enterprise systems through Phase 7.&lt;/li&gt;
&lt;li&gt;You don't need a perfect harness from the start — &lt;strong&gt;build incrementally by Phase&lt;/strong&gt;, starting with basic context documents.&lt;/li&gt;
&lt;li&gt;Design &lt;strong&gt;agent memory&lt;/strong&gt; as a harness component. Since agents are fundamentally stateless, supplement cross-session learning and knowledge accumulation with repository-based memory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build flexible harnesses.&lt;/strong&gt; As models improve, over-engineering becomes a burden — maintain a rippable structure that's easy to remove.&lt;/li&gt;
&lt;li&gt;If you're building a harness for the first time and wondering what to start with — &lt;strong&gt;start with verification loops for the best ROI&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Real-World Application: Applying Harness to This Blog
&lt;/h2&gt;

&lt;p&gt;While writing this guide, I simultaneously applied a harness to this blog project (Ted Factory). As a Type A (Personal / Static) project, I only applied Phases 1~2, and here's what I actually set up:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Phase 1 — Agent Instructions + Verification Automation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.cursor/rules/ted-blog-common-rules.mdc&lt;/code&gt;: Main Cursor rules (writing style, front matter, content structure)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CLAUDE.md&lt;/code&gt;: Lightweight reference file for Claude Code&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ARCHITECTURE.md&lt;/code&gt;: Project structure documentation&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;scripts/pre-commit&lt;/code&gt;: Hugo build validation, front matter required field validation, ko / en symmetry validation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Phase 2 — Agent Memory&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.memory/learnings.md&lt;/code&gt;: Patterns and know-how discovered during work&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.memory/current-focus.md&lt;/code&gt;: Current interests and priorities&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docs/decisions/&lt;/code&gt;: Architecture Decision Records (ADR)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Changes I noticed after applying these two Phases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When opening a new session, the agent immediately understands project conventions (writing style, front matter structure, deployment method)&lt;/li&gt;
&lt;li&gt;Pre-commit hooks catch front matter omissions and build failures before commit, eliminating "mistakes discovered after deployment"&lt;/li&gt;
&lt;li&gt;Thanks to know-how accumulated in &lt;code&gt;.memory/learnings.md&lt;/code&gt;, the agent doesn't repeat the same mistakes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Applying Phase 1~2 to a personal project takes about a day. The stability and consistency improvements you get in return are substantial. If you're actively using AI agents, I believe this is the first thing worth doing.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It Right Now
&lt;/h2&gt;

&lt;p&gt;You can read through this guide and follow it step by step, but there's an even simpler way: &lt;strong&gt;give this article's URL to your AI agent and ask it to apply harness engineering to your project.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Agents like Cursor and Claude Code can read URLs, understand the content, and configure a harness for your project accordingly. When I applied a harness to this very blog, I took a similar approach — presenting a harness engineering design document to the agent and asking it to apply the structure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In Cursor:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open the project you want to harness in Cursor and type the following in the chat:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://tedfactory.com/en/notes/essays/harness-engineering-guide/
Please apply harness engineering to this project based on the document above.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;In Claude Code:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run Claude Code from the root directory of the project you want to harness, and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://tedfactory.com/en/notes/essays/harness-engineering-guide/
Please apply harness engineering to this project based on the document above.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent will read this guide, analyze your project's characteristics, and apply the appropriate Phases for your project type. Of course, you don't have to accept everything the agent suggests as-is — adjust it to fit your project's actual situation.&lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://openai.com/ko-KR/index/harness-engineering/" rel="noopener noreferrer"&gt;OpenAI — Harness Engineering: Using Codex in an Agent-First World&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.nxcode.io/ko/resources/news/harness-engineering-complete-guide-ai-agent-codex-2026" rel="noopener noreferrer"&gt;NxCode — Complete Guide to Harness Engineering (2026)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://channel.io/ko/blog/articles/what-is-harness-2611ddf1" rel="noopener noreferrer"&gt;Channel.io — What Is Harness Engineering?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://harness-engineering.ai/blog/what-is-harness-engineering/" rel="noopener noreferrer"&gt;harness-engineering.ai — What Is Harness Engineering?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents" rel="noopener noreferrer"&gt;Anthropic — Effective Harnesses for Long-running Agents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.philschmid.de/agent-harness-2026" rel="noopener noreferrer"&gt;Philipp Schmid — The Importance of Agent Harness in 2026&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://harness-engineering.ai/blog/open-source-persistent-memory-for-ai-agents-an-engram-deep-dive/" rel="noopener noreferrer"&gt;harness-engineering.ai — Open Source Persistent Memory for AI Agents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.augmentcode.com/guides/context-engineering-enhancing-agentic-swarm-coding-through-intent-environment-and-system-memory" rel="noopener noreferrer"&gt;Augment Code — Context Engineering: Enhancing Agentic Swarm Coding&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;This post was originally published on &lt;a href="https://tedfactory.com/en/notes/essays/harness-engineering-guide/" rel="noopener noreferrer"&gt;Ted Factory&lt;/a&gt;. I write there about coding agents, harness engineering, and building things with AI.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>codingagents</category>
      <category>productivity</category>
      <category>devops</category>
    </item>
    <item>
      <title>Hermes Agent — Is It the Luxury Brand of AI Agents? A First Impression</title>
      <dc:creator>Ted Kim</dc:creator>
      <pubDate>Tue, 04 Aug 2026 17:07:11 +0000</pubDate>
      <link>https://dev.to/tedkim81/hermes-agent-is-it-the-luxury-brand-of-ai-agents-a-first-impression-1044</link>
      <guid>https://dev.to/tedkim81/hermes-agent-is-it-the-luxury-brand-of-ai-agents-a-first-impression-1044</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5dhklgi1objj5hzs5nga.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5dhklgi1objj5hzs5nga.png" alt="Hermes Agent — Is it the luxury brand of AI agents?" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Lately I've been hearing a lot about &lt;strong&gt;Hermes Agent&lt;/strong&gt;. The most compelling example came directly from a teammate. They told me they had already connected Hermes to our company Slack and built an environment where the team could handle data lookups, task requests, and Q&amp;amp;A with a simple &lt;code&gt;@Hermes&lt;/code&gt; message. That was enough to make me want to understand it properly, so I spent a single day doing all three of the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Researched what Hermes Agent is and what philosophy it was built on&lt;/li&gt;
&lt;li&gt;Analyzed, at the code level, the Hermes deployment my teammate had built into our internal Pulumi project&lt;/li&gt;
&lt;li&gt;Installed it on my own MacBook and connected it to Slack as a hands-on exercise&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This essay is a record of the concepts and impressions I gathered along the way. To give the conclusion up front: Hermes is not just a coding assistant. It's something different in kind — &lt;strong&gt;"a self-improving autonomous agent you park on a server and command from anywhere via messaging."&lt;/strong&gt; As someone who uses Cursor and Claude Code daily, I felt Hermes occupies a genuinely different niche.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is Hermes Agent?
&lt;/h2&gt;

&lt;p&gt;Hermes Agent is an open-source autonomous AI agent built by &lt;a href="https://nousresearch.com/" rel="noopener noreferrer"&gt;Nous Research&lt;/a&gt;. Nous Research is a lab known for open-source LLMs (Large Language Models) like Hermes, Nomos, and Psyche, and the agent framework that shares the name is Hermes Agent. It's MIT-licensed and open-source on GitHub.&lt;/p&gt;

&lt;p&gt;The three biggest differences from existing coding tools are:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Not Tied to a Local Development Session
&lt;/h3&gt;

&lt;p&gt;Cursor is an IDE-centered coding copilot, while Claude Code started as a terminal-first coding agent and now spans IDEs, desktop, web, Slack, and more. So the real distinction is not simply whether a tool lives in an IDE. Hermes's defining trait is that &lt;strong&gt;it's a daemon-style agent you can put on a VPS, in Docker, or in a cloud sandbox (Modal, Daytona, Vercel Sandbox), then call from outside via messages.&lt;/strong&gt; It runs on anything from a $5 VPS to a GPU cluster. A single gateway process bundles 20+ messaging platforms: Slack, Telegram, Discord, WhatsApp, Signal, Email, Matrix, Feishu, DingTalk, and more.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. A Closed Learning Loop
&lt;/h3&gt;

&lt;p&gt;It's not just a chatbot wrapping an LLM API. While you use it, it automatically accumulates the following:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Capability&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Memory&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Persistent memory across sessions. FTS5 (SQLite Full-Text Search) based recall + LLM summarization&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Skills&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Builds procedural skills from work experience and self-improves them during use&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;User Modeling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Built-in user profile memory, with deeper user modeling available by connecting external memory provider plugins such as &lt;a href="https://github.com/plastic-labs/honcho" rel="noopener noreferrer"&gt;Honcho&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In plain language: &lt;strong&gt;"the work you give it today gets done better tomorrow."&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The Full Package
&lt;/h3&gt;

&lt;p&gt;It also includes roughly 70 built-in tools (web search, browser automation, vision, voice, image generation), MCP (Model Context Protocol) server integration, a natural-language cron scheduler, isolated subagents for parallelization, and 7 terminal backends (local, Docker, SSH, Singularity, Modal, Daytona, Vercel Sandbox). For models, you can freely choose OpenRouter (200+ models), Anthropic, OpenAI, Nous Portal, or any OpenAI-compatible endpoint.&lt;/p&gt;

&lt;p&gt;Official docs: &lt;a href="https://hermes-agent.nousresearch.com/docs/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://hermes-agent.nousresearch.com/docs/" rel="noopener noreferrer"&gt;https://hermes-agent.nousresearch.com/docs/&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Hermes Running In My Team — A Code-Level Look
&lt;/h2&gt;

&lt;p&gt;My teammate had deployed Hermes into our company's internal Pulumi project. Reading the code, several interesting design decisions stood out.&lt;/p&gt;

&lt;h3&gt;
  
  
  Everything on One AWS Lightsail Instance
&lt;/h3&gt;

&lt;p&gt;The company runs most workloads on container-based services (EKS, Lambda, Fargate). But for Hermes, the choice was &lt;strong&gt;a single Lightsail instance ($40/month)&lt;/strong&gt;. Pulumi creates only 5 resources total.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Resource&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;aws.lightsail.Instance&lt;/code&gt; (&lt;code&gt;hermes-server&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Ubuntu 24.04, 2 vCPU, 8GB RAM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;aws.lightsail.KeyPair&lt;/code&gt; (&lt;code&gt;hermes-key&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;SSH key pair&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;aws.lightsail.StaticIp&lt;/code&gt; (&lt;code&gt;hermes-ip&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Stable IP across reboots&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;aws.lightsail.InstancePublicPorts&lt;/code&gt; (&lt;code&gt;hermes-ports&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Only 22, 443 open&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;aws.route53.Record&lt;/code&gt; (&lt;code&gt;hermes-dns&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Internal DNS record in the form of &lt;code&gt;hermes.example.com&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The reason for not going serverless is clear. The Hermes Slack gateway needs a &lt;strong&gt;persistent WebSocket connection (Socket Mode)&lt;/strong&gt;, which means it has to be always-on. That doesn't fit a Lambda or Fargate single-shot model. Flat fee, simple setup, and one box for the whole team — those three conditions converged on Lightsail.&lt;/p&gt;

&lt;h3&gt;
  
  
  Separation: Infra (Pulumi) + Bootstrap (Script) + Runtime Config (Templates)
&lt;/h3&gt;

&lt;p&gt;What's interesting is the separation of responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pulumi&lt;/strong&gt;: Owns only the 5 AWS resources&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;scripts/setup.sh&lt;/code&gt;&lt;/strong&gt;: Installs Docker, Node.js, Hermes itself + registers a systemd service&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;hermes-config/config.yaml&lt;/code&gt;&lt;/strong&gt;: Model, terminal backend, MCP servers, tool permissions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;walnuts/&lt;/code&gt;&lt;/strong&gt;: Company-wide context (a directory of domain knowledge for the LLM to read)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;SOUL.md&lt;/code&gt;&lt;/strong&gt;: The agent's persona and behavioral rules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each layer can change independently. AWS resources change → &lt;code&gt;pulumi up&lt;/code&gt;. Settings only change → &lt;code&gt;scp&lt;/code&gt; + &lt;code&gt;systemctl restart&lt;/code&gt;. Lean and tidy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Docker Sandbox Protects the Host
&lt;/h3&gt;

&lt;p&gt;When Hermes runs commands on the server, those commands go through a &lt;strong&gt;Docker container&lt;/strong&gt;. Even with 25 teammates issuing commands freely from Slack, the risk of accidentally touching the Lightsail host's entire filesystem is greatly reduced. That said, mounted paths and forwarded tokens are still accessible inside the container, so the exposed surface should be kept intentionally small. In this setup, only the walnuts directory is volume-mounted into the container, and only one host environment variable (&lt;code&gt;GITHUB_TOKEN&lt;/code&gt;) is forwarded.&lt;/p&gt;

&lt;h3&gt;
  
  
  Walnuts + Wiki — The Vessel for Company Knowledge
&lt;/h3&gt;

&lt;p&gt;Hermes itself is the "agent engine," and company-specific knowledge lives in the &lt;strong&gt;Walnuts directory&lt;/strong&gt; as files. The structure has three layers: &lt;code&gt;_core/&lt;/code&gt; (operational context, auto-refreshed by cron) + &lt;code&gt;raw/&lt;/code&gt; (immutable sources) + &lt;code&gt;wiki/&lt;/code&gt; (LLM-curated knowledge). It's clearly inspired by &lt;a href="https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f" rel="noopener noreferrer"&gt;Karpathy's LLM Wiki&lt;/a&gt; idea. Hermes constantly reads the company's accumulated domain knowledge while simultaneously curating and extending it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Installing on My MacBook — Step by Step
&lt;/h2&gt;

&lt;p&gt;After dissecting the team's setup, I wanted to build a similar structure on my MacBook. I kept the requirements simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Docker sandboxing.&lt;/strong&gt; But with the ability to mount specific local folders when needed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Slack integration.&lt;/strong&gt; Not the team bot — a separate personal one&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The whole flow took 6 steps. Capturing it end-to-end here so the same environment is reproducible later.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1. Prerequisites — Docker + LLM API Key
&lt;/h3&gt;

&lt;p&gt;You need a Docker daemon running. I prefer the lightweight &lt;a href="https://orbstack.dev/" rel="noopener noreferrer"&gt;OrbStack&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--cask&lt;/span&gt; orbstack
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You also need at least one LLM API key — either &lt;code&gt;sk-ant-...&lt;/code&gt; from the &lt;a href="https://console.anthropic.com/settings/keys" rel="noopener noreferrer"&gt;Anthropic console&lt;/a&gt; or &lt;code&gt;sk-or-...&lt;/code&gt; from &lt;a href="https://openrouter.ai/keys" rel="noopener noreferrer"&gt;OpenRouter&lt;/a&gt; (which gives you 200+ models in one place).&lt;/p&gt;

&lt;p&gt;Pick the local folders you want to mount into the sandbox in advance. In my case, that's the blog folder and its parent project root.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2. Install Hermes
&lt;/h3&gt;

&lt;p&gt;The official installer is one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After install, open a fresh shell so PATH gets picked up. Add this to &lt;code&gt;~/.zshrc&lt;/code&gt; for permanence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.local/bin:&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run the interactive initial setup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;hermes setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It walks you through LLM provider, API key, default model, and messaging platform (choose Slack). At the end, &lt;code&gt;~/.hermes/config.yaml&lt;/code&gt; and &lt;code&gt;~/.hermes/.env&lt;/code&gt; are generated.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3. Docker Sandbox + Folder Mount Configuration
&lt;/h3&gt;

&lt;p&gt;Pre-pull the container image — same one the company's Pulumi deployment uses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker pull nikolaik/python-nodejs:python3.11-nodejs20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the &lt;code&gt;terminal:&lt;/code&gt; section of &lt;code&gt;~/.hermes/config.yaml&lt;/code&gt; and switch to the Docker backend with explicit local folder mounts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;terminal&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docker&lt;/span&gt;
  &lt;span class="na"&gt;docker_image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;nikolaik/python-nodejs:python3.11-nodejs20"&lt;/span&gt;
  &lt;span class="na"&gt;container_cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
  &lt;span class="na"&gt;container_memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4096&lt;/span&gt;
  &lt;span class="na"&gt;container_persistent&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;persistent_shell&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;cwd&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/workspace"&lt;/span&gt;
  &lt;span class="na"&gt;docker_volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/path/to/project-root:/workspace/project-root:ro"&lt;/span&gt;
  &lt;span class="na"&gt;docker_forward_env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;GITHUB_TOKEN&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;docker_volumes&lt;/code&gt; format is &lt;code&gt;host_path:container_path[:ro]&lt;/code&gt;, where &lt;code&gt;:ro&lt;/code&gt; locks the folder as read-only. &lt;strong&gt;Anything you don't mount is invisible to the container.&lt;/strong&gt; That's the heart of sandboxing — and the next section is dedicated to why this matters.&lt;/p&gt;

&lt;p&gt;If you use Docker Desktop, check that &lt;strong&gt;Settings → Resources → File sharing&lt;/strong&gt; includes &lt;code&gt;/Users&lt;/code&gt;. OrbStack doesn't need this step.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4. Create a New Slack App
&lt;/h3&gt;

&lt;p&gt;Leave any existing Slack apps you use for other bots or MCP integrations untouched. &lt;strong&gt;Create a brand new app dedicated to Hermes.&lt;/strong&gt; Reasons: permission separation, separate rate limits, avoiding conflicts between Socket Mode and existing event subscriptions, and bot name separation.&lt;/p&gt;

&lt;p&gt;The official docs recommend pasting in a manifest generated by Hermes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;hermes slack manifest &lt;span class="nt"&gt;--write&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you configure it manually, the steps are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;a href="https://api.slack.com/apps" rel="noopener noreferrer"&gt;api.slack.com/apps&lt;/a&gt; → &lt;strong&gt;Create New App&lt;/strong&gt; → &lt;strong&gt;From scratch&lt;/strong&gt; → name it &lt;code&gt;Hermes Agent (your identifier)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OAuth &amp;amp; Permissions → Bot Token Scopes&lt;/strong&gt; box (NOT User Token Scopes!) — add 11 scopes:
&lt;code&gt;chat:write&lt;/code&gt;, &lt;code&gt;app_mentions:read&lt;/code&gt;, &lt;code&gt;channels:history&lt;/code&gt;, &lt;code&gt;channels:read&lt;/code&gt;, &lt;code&gt;groups:history&lt;/code&gt;, &lt;code&gt;im:history&lt;/code&gt;, &lt;code&gt;im:read&lt;/code&gt;, &lt;code&gt;im:write&lt;/code&gt;, &lt;code&gt;users:read&lt;/code&gt;, &lt;code&gt;files:read&lt;/code&gt;, &lt;code&gt;files:write&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Settings → Socket Mode → Enable&lt;/strong&gt; → generate an App-Level Token (name &lt;code&gt;hermes-socket&lt;/code&gt;, scope &lt;code&gt;connections:write&lt;/code&gt;) → copy the &lt;code&gt;xapp-...&lt;/code&gt; token&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event Subscriptions → Enable Events → Subscribe to bot events&lt;/strong&gt;: add &lt;code&gt;app_mention&lt;/code&gt;, &lt;code&gt;message.channels&lt;/code&gt;, &lt;code&gt;message.groups&lt;/code&gt;, &lt;code&gt;message.im&lt;/code&gt; → Save&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;App Home → Show Tabs&lt;/strong&gt;: turn on Messages Tab + check "Allow users to send Slash commands and messages" (without this, DMs don't work)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Settings → Install App → Install to Workspace&lt;/strong&gt; → copy the &lt;code&gt;xoxb-...&lt;/code&gt; Bot User OAuth Token&lt;/li&gt;
&lt;li&gt;Copy your own Slack Member ID (profile → more menu → Copy member ID)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 5. Inject Tokens + Run the Gateway
&lt;/h3&gt;

&lt;p&gt;Add the two tokens and your Member ID to &lt;code&gt;~/.hermes/.env&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;SLACK_BOT_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;BOT_USER_OAUTH_TOKEN&amp;gt;
&lt;span class="nv"&gt;SLACK_APP_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;APP_LEVEL_TOKEN&amp;gt;
&lt;span class="nv"&gt;SLACK_ALLOWED_USERS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;YOUR_MEMBER_ID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With only your ID in &lt;code&gt;SLACK_ALLOWED_USERS&lt;/code&gt;, the bot ignores anyone else. Lock the file permissions for safety:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod &lt;/span&gt;600 ~/.hermes/.env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now start the gateway:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;hermes gateway
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the log shows &lt;code&gt;Connected to Slack workspace ...&lt;/code&gt;, you're connected. Keep this terminal open as long as you want the bot alive. To background it, &lt;code&gt;hermes gateway install&lt;/code&gt; registers it as a macOS LaunchAgent that auto-starts on login and auto-restarts on crash.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6. Verify
&lt;/h3&gt;

&lt;p&gt;In Slack, create a test channel and invite the bot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/invite @Hermes Agent (your identifier)
@Hermes Agent (your identifier) hi, run pwd for me
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a thread reply comes back with a path like &lt;code&gt;/workspace/ted-blog&lt;/code&gt; (the container path, not your host path), everything is working. In DMs, you don't need to mention the bot — just talk.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Pitfalls I Hit
&lt;/h2&gt;

&lt;p&gt;The setup itself is short, but a few small pitfalls are easy to trip on the first time. Collecting them here for anyone trying the same path.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pitfall 1. The prompt_toolkit Error Right After &lt;code&gt;curl ... | bash&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The install script tries to launch the &lt;code&gt;hermes&lt;/code&gt; TUI immediately after install, which produces this error:&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;File&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;.../prompt_toolkit/input/vt100.py&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="mi"&gt;165&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;_attached_input&lt;/span&gt;
    &lt;span class="n"&gt;loop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_reader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;callback_wrapper&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;OSError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Errno&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;Invalid&lt;/span&gt; &lt;span class="n"&gt;argument&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The cause is simple. A shell launched via &lt;code&gt;curl ... | bash&lt;/code&gt; has its &lt;strong&gt;stdin tied to a pipe&lt;/strong&gt; (curl's output), not a real TTY. The TUI requires stdin to be a real terminal to receive keyboard input, so it fails. &lt;strong&gt;Just open a fresh terminal and run &lt;code&gt;hermes&lt;/code&gt; again — it works fine.&lt;/strong&gt; The install itself was 100% successful.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pitfall 2. The &lt;code&gt;app_mentions:read&lt;/code&gt; Scope Doesn't Show Up
&lt;/h3&gt;

&lt;p&gt;In the Slack app's OAuth &amp;amp; Permissions page, I went looking for &lt;code&gt;app_mentions:read&lt;/code&gt; and it wasn't in the list. The reason is simple. That page has two boxes, and &lt;strong&gt;&lt;code&gt;app_mentions:read&lt;/code&gt; is exclusive to the Bot Token Scopes box&lt;/strong&gt;. It won't appear if you search inside User Token Scopes.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Box&lt;/th&gt;
&lt;th&gt;Token Type&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Bot Token Scopes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;xoxb-&lt;/code&gt; (Bot User OAuth Token)&lt;/td&gt;
&lt;td&gt;The bot's own permissions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;User Token Scopes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;xoxp-&lt;/code&gt; (User OAuth Token)&lt;/td&gt;
&lt;td&gt;The bot acts on behalf of the installing user&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All scopes Hermes needs go into the Bot Token side. You don't need to touch User Token Scopes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pitfall 3. The Difference Between SLACK_BOT_TOKEN and SLACK_APP_TOKEN
&lt;/h3&gt;

&lt;p&gt;Hermes's &lt;code&gt;.env&lt;/code&gt; requires two Slack tokens. Confusing at first, but here's the breakdown:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;&lt;code&gt;SLACK_BOT_TOKEN&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;SLACK_APP_TOKEN&lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Prefix&lt;/td&gt;
&lt;td&gt;&lt;code&gt;xoxb-&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;xapp-&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Issued When&lt;/td&gt;
&lt;td&gt;"Install to Workspace"&lt;/td&gt;
&lt;td&gt;"Socket Mode" enable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Permission Basis&lt;/td&gt;
&lt;td&gt;Bot Token Scopes&lt;/td&gt;
&lt;td&gt;App-Level Scopes (&lt;code&gt;connections:write&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Purpose&lt;/td&gt;
&lt;td&gt;Web API calls (send message, upload file, etc.)&lt;/td&gt;
&lt;td&gt;Open the Socket Mode WebSocket connection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Analogy&lt;/td&gt;
&lt;td&gt;The bot's ID + action permissions&lt;/td&gt;
&lt;td&gt;The key that opens a private phone line to Slack&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Typical Slack MCP integrations use just one token (Bot or User). They follow a "call the API when needed" pattern. Hermes, in contrast, is &lt;strong&gt;a bot that receives the event stream in real time and reacts on its own&lt;/strong&gt;, so Socket Mode is mandatory — and so both tokens are required.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Real Value of the Docker Sandbox
&lt;/h2&gt;

&lt;p&gt;I want to revisit the meaning of mounting only two folders via &lt;code&gt;docker_volumes&lt;/code&gt; in Step 3 of the install. It matters more than it looks.&lt;/p&gt;

&lt;p&gt;Coding agents that run tools locally generally operate with the permissions of the same OS user. Depending on configuration and approval settings, sensitive paths like &lt;code&gt;~/.ssh&lt;/code&gt;, &lt;code&gt;~/.aws&lt;/code&gt;, and local config files can fall within reach. The Docker setup above, by contrast, exposes &lt;strong&gt;only the two folders you explicitly named&lt;/strong&gt; to the container. The rest of the host doesn't even exist from the container's perspective. On top of that, you can lock one folder as read-only (&lt;code&gt;:ro&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;For verification I had the bot query an arbitrary host path that had not been mounted. The response was "no such directory." Correct. Whatever you didn't mount does not show up. This is the real value of a sandbox: &lt;strong&gt;the user can precisely control the agent's blast radius.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  A Luxury First Impression — and the Homework That Remains
&lt;/h2&gt;

&lt;p&gt;Right after finishing install + Slack connection, I exchanged my first hello with the bot, and an unexpected problem was waiting. I sent &lt;strong&gt;"hi,"&lt;/strong&gt; waited 5 minutes, no response. A bit later I sent another message, and only then did the response to the first message land in Slack.&lt;/p&gt;

&lt;p&gt;A search turned up several gateway issues with similar patterns. As of my May 2026 check, some of them had already been closed, but the symptom I saw looked like the same family of problems.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/NousResearch/hermes-agent/issues/4469" rel="noopener noreferrer"&gt;#4469 — Multiple rapid messages only last one processed&lt;/a&gt;: The gateway internally has two pending message queues (&lt;code&gt;GatewayRunner._pending_messages&lt;/code&gt;, &lt;code&gt;adapter._pending_messages&lt;/code&gt;) that aren't synchronized. Still open as of May 2026&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/NousResearch/hermes-agent/issues/8221" rel="noopener noreferrer"&gt;#8221 — Telegram duplicate replies when interrupted session sends stale response before processing pending message&lt;/a&gt;: Interrupted sessions used to emit a stale response first. Fixed and closed as of May 2026&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/NousResearch/hermes-agent/issues/5057" rel="noopener noreferrer"&gt;#5057 — Message handling behavior when multiple messages arrive during active agent execution&lt;/a&gt;: Covers queueing and interruption behavior when new messages arrive during active execution. Closed as of May 2026&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the time, issue #8221 looked closest to what I observed. But since it was already closed by May 2026, if the same problem reproduces, the first step should be checking the Hermes version and verbose logs. Whether the real cause is a message queue bug, a Docker container cold-start hang, or the Anthropic streaming response failing to emit a completion signal can only be confirmed from logs. I deferred that diagnosis to a later session.&lt;/p&gt;

&lt;p&gt;There was one secondary issue worth noting. I use a &lt;strong&gt;light-background terminal&lt;/strong&gt;, and Hermes's default skin uses yellow/white-heavy colors that were nearly unreadable. Two built-in skins solve this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;/&lt;span class="n"&gt;skin&lt;/span&gt; &lt;span class="n"&gt;daylight&lt;/span&gt;       &lt;span class="c"&gt;# dark text + cool blue accents
&lt;/span&gt;/&lt;span class="n"&gt;skin&lt;/span&gt; &lt;span class="n"&gt;warm&lt;/span&gt;-&lt;span class="n"&gt;lightmode&lt;/span&gt; &lt;span class="c"&gt;# warm brown / gold tones
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This same problem is even &lt;a href="https://github.com/NousResearch/hermes-agent/issues/4807" rel="noopener noreferrer"&gt;officially logged as an issue&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  In Closing — Is It the Luxury Brand of AI Agents?
&lt;/h2&gt;

&lt;p&gt;After installing it, wiring it into Slack, and tracing through a real team deployment, my first impression became fairly clear. Hermes feels less like "a tool with a lot of features" and more like &lt;strong&gt;a tool built around a strong idea of how agents should be operated&lt;/strong&gt;. It is not mainly about opening a single local work session for a few minutes at a time. It is better understood as a longer-running system that ties messaging, sandboxing, memory, and skills into one workflow.&lt;/p&gt;

&lt;p&gt;That is why the "luxury" comparison did not feel entirely exaggerated to me. Not because Hermes is flashy, but because its priorities are unusually clear. The Docker-first sandboxing model, the natural fit with messaging channels like Slack, and the idea that context and memory should accumulate over time all left a strong impression. Looking at the company's Pulumi deployment reinforced that feeling. The value of Hermes seems to lie less in any single feature than in &lt;strong&gt;the way it turns agent operation itself into a coherent system&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It is still too early for me to make a definitive judgment. At this point I have only spent a day installing and connecting it, and there are still practical issues to investigate, such as the delayed-response behavior I saw locally. Even so, it already feels clear that Hermes is aiming at a different place from the local development sessions where I usually use Cursor and Claude Code. If those tools are closer to "productivity right now," Hermes feels closer to "an environment you keep cultivating over time."&lt;/p&gt;

&lt;p&gt;For now, my next step is to diagnose the response-delay issue on my MacBook. Once that is under control, I want to use my teammate's walnuts structure as a reference and slowly build a domain knowledge container of my own. After spending more real time with it, I would like to come back with a follow-up piece based not just on first impressions, but on actual operating experience.&lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nousresearch.com/hermes-agent/" rel="noopener noreferrer"&gt;Hermes Agent official site&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hermes-agent.nousresearch.com/docs/" rel="noopener noreferrer"&gt;Hermes Agent official documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/NousResearch/hermes-agent" rel="noopener noreferrer"&gt;GitHub: NousResearch/hermes-agent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hermes-agent.nousresearch.com/docs/user-guide/messaging/slack" rel="noopener noreferrer"&gt;Slack messaging guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hermes-agent.nousresearch.com/docs/user-guide/features/skins/" rel="noopener noreferrer"&gt;Skins / theme settings&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.slack.dev/apis/events-api/using-socket-mode/" rel="noopener noreferrer"&gt;Slack Socket Mode official docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f" rel="noopener noreferrer"&gt;Karpathy's LLM Wiki idea&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;This post was originally published on &lt;a href="https://tedfactory.com/en/notes/essays/hermes-agent-first-impression/" rel="noopener noreferrer"&gt;Ted Factory&lt;/a&gt;. I write there about coding agents, harness engineering, and building things with AI.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aiagents</category>
      <category>ai</category>
      <category>devops</category>
      <category>slack</category>
    </item>
  </channel>
</rss>
