Akshay Parkhi's Weblog

From Prompt Engineering to Harness Engineering: Building Infrastructure for Autonomous Agents

18th March 2026

2025 was the year of agents. 2026 is the year of harnesses. A harness is the persistent infrastructure that gives a foundation model hands, feet, and senses. The shift is fundamental: from prompt engineering to harness engineering. Prompt engineering optimizes single interactions. Harness engineering builds the systems that control long-running, autonomous agents.

What Is a Harness?

A harness is the software layer that wraps a foundation model. It manages tool access, tracks progress, and recovers when the model fails. Standard chat models are “question to answer.” Agents are “goal to result.” The harness makes that difference possible.

+-------------------------------------------------------+
|                  THE HARNESS LAYER                     |
|                                                        |
|   +-------------+    +-------------+    +-----------+  |
|   |   Context    |    |    Tool     |    |  Memory   |  |
|   |  Management  |    |   Access    |    |  System   |  |
|   +------+------+    +------+------+    +-----+-----+  |
|          |                  |                  |        |
|   +------v------------------v------------------v-----+  |
|   |              ORCHESTRATION LOOP                   |  |
|   |   reason -> act -> observe -> reason -> ...      |  |
|   +---------------------------+-----------------------+  |
|                               |                        |
|   +---------------------------v-----------------------+  |
|   |              FOUNDATION MODEL (LLM)               |  |
|   +---------------------------------------------------+  |
+-------------------------------------------------------+

Intelligence increasingly resides in the scaffolding rather than in the raw power of the LLM. The scaffolding is the reasoning, memory systems, and tool optimization.

Context Management: The Hardest Problem

Managing the context window is the most difficult engineering challenge in creating reliable agents. Even models with million-token windows lose performance as the window fills. Performance starts to rot once a window is roughly 40% full. The result is lost signal and poor instruction following.

The Playbook: Reduce, Offload, Isolate

+-------------------+-------------------------------------------+
|    Strategy       |    How It Works                           |
+-------------------+-------------------------------------------+
|                   |                                           |
|    REDUCE         |    Prune old tool results, summarize      |
|                   |    conversation trajectories, keep        |
|                   |    context lean                           |
|                   |                                           |
+-------------------+-------------------------------------------+
|                   |                                           |
|    OFFLOAD        |    Use file system or database as         |
|                   |    external long-term memory instead      |
|                   |    of cramming into the prompt            |
|                   |                                           |
+-------------------+-------------------------------------------+
|                   |                                           |
|    ISOLATE        |    Use sub-agents for token-heavy         |
|                   |    tasks (research, debugging) to         |
|                   |    keep orchestrator context clean        |
|                   |                                           |
+-------------------+-------------------------------------------+

This is why every serious coding agent (Claude Code, OpenCode, Pi) uses sub-agents. It’s not just about parallelism. It’s about protecting the main context window.

The Initializer-Coder Pattern

This is the industry standard for multi-hour or multi-day tasks. Never ask an agent to build an entire complex application in one shot. That leads to implementation failures and context amnesia.

PHASE 1: THE INITIALIZER (runs once)
  |
  |-- Reads the specification
  |-- Creates machine-readable feature list (JSON)
  |-- Every task marked "failed" by default
  |-- Sets up environment (init.sh)
  |
  v
PHASE 2: THE TASK AGENT (iterates)
  |
  |-- Picks one feature at a time
  |-- Implements it
  |-- Verifies it (tests pass?)
  |-- Commits progress
  |-- Updates feature status to "passed"
  |-- Picks next feature
  |-- Repeats until done

The Four Artifacts

Four core artifacts maintain continuity across discrete sessions:

  1. features.json — machine-readable task list with pass/fail status
  2. init.sh — environment initialization script
  3. progress.md — narrative progress log
  4. Git history — descriptive commits as a narrative timeline

Bash Is All You Need

Vercel, Anthropic, and independent builders share a major insight: models perform better with generic, code-native tools than with bespoke, complex tool schemas.

Instead of building 100 specialized tools, give the agent access to a Bash tool and a file system. The model writes its own scripts to solve problems. That expands its action space a lot, without bloating the system prompt.

ApproachToolsAccuracySpeed
Specialized tools (100+)Custom schema per task80%Baseline
Bash + filesystem2 generic tools100%3.5x faster

Vercel saw this exact result with a text-to-SQL agent. Vercel removed 80% of the specialized tools and replaced them with a Bash terminal. Accuracy jumped from 80% to 100%, and the agent ran 3.5x faster.

Skills as SOPs for AI

Skills are folders of scripts and instructions that an agent loads only when needed. They reduce cognitive load and prevent context pollution. The agent doesn’t carry knowledge about deploying to AWS until it actually needs to deploy.

Verification and Reliability

Reliability in agentic systems drops exponentially with steps. A 95% success rate on single steps becomes only 36% over a 20-step task.

Step success rate: 95%

 1 step:  95.0%
 5 steps: 77.4%
10 steps: 59.9%
20 steps: 35.8%   <-- this is where most real tasks live
50 steps: 7.7%

The fix is deterministic feedback built into the harness:

  • Automated tests — unit tests, linting, type checking after every change
  • Eyes — Puppeteer or Chrome DevTools to verify UI changes the model can’t see in code alone
  • Human-in-the-loop — strategic checkpoints for high-risk operations (ad budgets, production merges)
  • Self-correction — let models read their own error logs and iterate until tests pass

Agentic DevOps

A new discipline is emerging that applies DevOps principles to autonomous agents:

+-----------------+------------------------------------------+
|   Principle     |   Applied to Agents                      |
+-----------------+------------------------------------------+
|   Guardrails    |   Permission scoping, restricted tools   |
|   Golden paths  |   CLAUDE.md, agents.md, coding standards |
|   Safety nets   |   Git commits, rollback, test suites     |
|   Manual review |   HITL checkpoints at critical steps     |
+-----------------+------------------------------------------+

The Builder’s Checklist

  1. Start simple. Don’t jump to agents if a structured workflow or a single prompt will suffice.
  2. Onboard your agent. Treat it like a new employee. Create an agents.md or CLAUDE.md file. It is the source of truth for roles, business context, and coding standards.
  3. Implement a memory loop. Tell the agent to update a memory.md file whenever it learns a new preference or fixes a mistake.
  4. Embrace the bitter lesson. As models improve, remove the crutches. Simpler systems that scale with compute eventually win.
  5. Use Git for state. Always require the agent to commit with descriptive messages. The Git log is a narrative history that future agents can read.
  6. Leverage MCP. Use the Model Context Protocol to connect your agent to external data sources (Google Drive, Slack, GitHub) in a standardized way.

The Bottom Line

2025: "How smart is the model?"
2026: "How good is the harness?"

The model is the engine.
The harness is the car.

Nobody wins a race with just an engine.

The intelligence ceiling keeps rising. The bottleneck is no longer the model. It’s the infrastructure around it: context management, tool design, verification loops, and session continuity. That’s where the real engineering happens now.

More recent articles

This is From Prompt Engineering to Harness Engineering: Building Infrastructure for Autonomous Agents by Akshay Parkhi, posted on 18th March 2026.

Next: 7 Mental Models for Building Agent Skills (From Anthropic's Internal Playbook)

Previous: The Agent Loop Iceberg — 10 Hard Problems Hiding Beneath the Simple Loop