Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

Introduction to Harness Engineering — The 2026 Paradigm for Integrating AI Agents into Business Operations

Table of contents · 7 items

What is harness engineering?

2025 was the foundational year for AI agents. In 2026, the engineering focus is shifting from AI models themselves to their surrounding operational control environments.

Harness engineering is the discipline of designing "everything outside the AI agent model"—constraints, tool connectivity, feedback loops, and verification systems. Deriving its name from equestrian harnesses, it refers to environmental design that steers powerful yet unpredictable AI agent outputs in intended directions.

Martin Fowler codified this concept in 2026, proposing two primary axes of control:

  • Guides (proactive controls): Steer agent behavior using documentation, architectural guidelines, AGENTS.md, and similar mechanisms
  • Sensors (reactive controls): Verify and adjust agent outputs using linters, automated tests, and AI reviews

The 4-layer harness architecture

A practical harness consists of the following four layers.

Constraint layer

Explicitly defines what the agent is permitted to do and what it is forbidden from doing.

<!-- AGENTS.md の例 -->
## 禁止事項
- 本番データベースへの直接クエリ
- force push
- .env ファイルの読み取り・変更

## 権限
- テストの実行: 許可
- ファイルの作成・編集: 許可(src/ 配下のみ)

Information layer

Provides structured context that the agent needs to know. This includes files such as CLAUDE.md, AGENTS.md, and system design specifications.

Verification layer

Mechanisms that automatically validate agent outputs, including linting, type-checking, test suites, and automated AI code reviews.

Recovery layer

Designs rollbacks, retry logic, and iteration caps when agents encounter failures. Preventing infinite loops is especially critical.

Harness implementation in Claude Code

Claude Code has evolved into a platform providing six extension points tailored for harness engineering.

Extension pointRoleLayer
HooksEvent-driven shell commands (PreToolUse / PostToolUse)Verification
SkillsDefining reusable workflows in MarkdownInformation
PluginsBundled distribution of commands, skills, hooks, and MCP serversAll layers
Sub-agentsParallel collaborative execution across multiple sessionsConstraints / Information
CLAUDE.mdDefining project-specific constraints and conventionsConstraints / Information
MCPProtocols for connecting with external servicesInformation

Hooks in practice

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Write",
        "command": "python3 scripts/security_check.py"
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Write",
        "command": "npx eslint --fix $FILE"
      }
    ]
  }
}

Running security audits before file writes and automatically executing linters afterward ensures agent output quality without manual human intervention.

Pinterest's MCP adoption: Saving 7,000 hours per month

Pinterest serves as a high-profile case study for large-scale production adoption of harness engineering.

Architecture

  • Operating domain-specific MCP servers (integrating infrastructure tools such as Presto, Spark, and Airflow)
  • Centralizing server discovery and authorization validation through a unified registry
  • Ensuring security via dual authentication with JWT and mesh IDs

Results

  • Approximately 66,000 invocations per month
  • 844 active users (representing roughly 30% of their engineering organization)
  • Estimated 7,000 hours of development time saved monthly

Architectural considerations

High-risk operations (such as database writes and production environment modifications) require human-in-the-loop approval. Safety is maintained through workflows where the agent proposes changes and a human confirms them.

Ralph Loop: An autonomous agent iteration pattern

The Ralph Loop (formally the Ralph Wiggum Loop) is a technique that runs AI agents iteratively and autonomously within a bash loop.

# 基本形
while :; do
  cat PROMPT.md | claude-code
  # テストが通ったら終了
  npm test && break
done

While it relies on a simple approach of repeating execution until mechanical completion criteria (such as passing tests) are met, running it without an appropriate harness (constraint, verification, and recovery layers) risks uncontrolled execution.

Keys to success

  • Keep scope small: Assign one loop per individual issue
  • Evaluate completion using test-driven criteria: Determine success via passing test suites rather than subjective completion checks
  • Limit maximum iterations: Put guardrails in place to prevent infinite loops
  • Manage context freshness: Mitigate stale context degradation during extended loop executions

Getting started: A 3-step adoption guide

Step 1: Author CLAUDE.md / AGENTS.md

Place constraint and information definition files in your project root. Starting with explicit "prohibited actions" and "coding standards" is highly effective.

Step 2: Automate verification with Hooks

Inject automated checks before and after agent operations using PreToolUse and PostToolUse hooks. Existing tools for security audits, linting, and type-checking can be integrated directly.

Step 3: Connect external tooling via MCP

Expose workplace tools—such as databases, GitHub, and Slack—to agents via MCP servers. Restrict permissions explicitly through server manifests.

Conclusion

Harness engineering is the discipline answering the pivotal question of 2026: "How do we steer and control AI agents?"

  • Model performance is already sufficiently advanced; the real bottleneck lies in the design of the surrounding control environment
  • Design your harness around a 4-layer architecture (constraints, information, verification, recovery)
  • Start small: Roll out iteratively in sequence: CLAUDE.md creation → Hooks → MCP
  • Focus human oversight on requirements definition and approvals

As AI agents evolve from "handy utilities" into full-fledged "team members," harness engineering has become an indispensable competency for every engineering team.

For teams embarking on business AI adoption, we recommend establishing a foundation by first reading our ChatGPT Business Adoption Guide.

Share this articleXFacebook
Rui Teruya

Former corporate league baseball player and founder of an IT venture. Founded the company with the drive to ride the fast-moving waves of the world and deliver truly valuable services to society.

Turn this article's theme into your company's next step

Concrete steps forward for your organization.

We organize your desired architecture, legacy systems, and operational requirements to formulate your next steps toward execution.

  • Desired architecture
  • Integration with existing environments
  • Operational requirements
Consult on development & operations initiatives

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles by email