<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Software Delivery on RockB</title><link>https://baeseokjae.github.io/tags/software-delivery/</link><description>Recent content in Software Delivery on RockB</description><image><title>RockB</title><url>https://baeseokjae.github.io/images/og-default.png</url><link>https://baeseokjae.github.io/images/og-default.png</link></image><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 15 Jun 2026 15:12:58 +0000</lastBuildDate><atom:link href="https://baeseokjae.github.io/tags/software-delivery/index.xml" rel="self" type="application/rss+xml"/><item><title>AI Harness Engineering: Structured Workflows for Deterministic AI-Assisted Development</title><link>https://baeseokjae.github.io/posts/ai-harness-engineering-guide-2026/</link><pubDate>Mon, 15 Jun 2026 15:12:58 +0000</pubDate><guid>https://baeseokjae.github.io/posts/ai-harness-engineering-guide-2026/</guid><description>A practical guide to AI harness engineering for deterministic AI-assisted development workflows.</description><content:encoded><![CDATA[<p>AI harness engineering is the practice of wrapping AI coding agents in structured workflows, constraints, state, and verification so their output becomes repeatable enough for production software delivery. The useful shift is not better prompting. It is turning AI assistance into an engineered system with typed inputs, tool limits, tests, and review gates.</p>
<h2 id="what-is-ai-harness-engineering">What Is AI Harness Engineering?</h2>
<p>AI harness engineering is the design of the system around an AI coding model: the intake format, repository context, tool permissions, execution state, verification checks, and escalation rules that determine how work moves from request to merged code. OpenAI described an internal agent-first beta product in 2026 that produced roughly one million lines and about 1,500 merged pull requests over five months, which shows the scale this pattern targets. A harness does not make a model deterministic in the mathematical sense. It makes the surrounding workflow deterministic enough that the same class of request follows the same route, gathers the same evidence, hits the same checks, and leaves the same artifacts. In practice, the harness becomes the operating system for AI-assisted development. The takeaway: reliable AI coding comes from engineered boundaries, not from trusting a chat transcript.</p>
<h3 id="what-does-a-harness-include">What does a harness include?</h3>
<p>An AI harness includes the repeatable parts a senior engineer would otherwise hold in their head: repo maps, ownership rules, coding standards, sandbox permissions, test commands, PR templates, review criteria, and failure policies. The model still writes and edits code, but the harness defines where it can work, what it must prove, and when it must stop.</p>
<h2 id="why-prompting-alone-does-not-make-ai-development-deterministic">Why Prompting Alone Does Not Make AI Development Deterministic?</h2>
<p>Prompting alone does not make AI development deterministic because a prompt is advisory text, while a harness is an enforceable workflow with state, constraints, and checks. Stack Overflow&rsquo;s 2025 Developer Survey found that 84% of respondents use or plan to use AI tools in development, yet 66% cite &ldquo;almost right, but not quite&rdquo; answers as a frustration. That gap is the prompt-only failure mode: the model can sound precise while choosing the wrong module, inventing an API, missing a migration, or skipping a security constraint. A strong prompt may improve one session, but it rarely guarantees that the next session will inspect the same files, run the same tests, or preserve the same architecture boundary. Deterministic AI-assisted development requires repeatable inputs and observable outputs. The takeaway: prompts can guide behavior, but harnesses make behavior inspectable and enforceable.</p>
<h3 id="where-do-prompts-still-help">Where do prompts still help?</h3>
<p>Prompts still help when they are treated as one feedforward control inside a larger system. A good repo instruction file can define naming conventions, preferred libraries, and review expectations. The difference is that the harness backs those words with file scopes, command allowlists, automated checks, and human approval points.</p>
<h2 id="what-is-the-harness-formula-model-context-tools-state-and-verification">What Is the Harness Formula: Model, Context, Tools, State, and Verification?</h2>
<p>The harness formula is model plus context plus tools plus state plus verification, arranged as a workflow instead of a conversation. Google Cloud&rsquo;s 2025 DORA report announcement said 90% of respondents use AI at work and more than 80% believe it increased productivity, but 30% report little or no trust in AI-generated code. That trust gap appears when one element of the formula is weak. A capable model without repository context guesses. Context without tools cannot make changes. Tools without state lose continuity across sessions. State without verification preserves mistakes. Verification without routing creates review bottlenecks. A useful harness explicitly names each part: which model handles planning, which files define context, which commands are allowed, where progress is recorded, and which checks decide completion. The takeaway: AI development becomes dependable when every agent action has context, capability, memory, and proof.</p>
<h3 id="how-should-teams-split-planning-and-coding">How should teams split planning and coding?</h3>
<p>Teams should split planning and coding when the change has meaningful blast radius. A planning pass can produce a repository impact map with touched files, symbols, risks, and tests. A coding pass then receives a narrower contract. That separation catches wrong assumptions before the agent starts editing production code.</p>
<h2 id="how-does-harness-engineering-differ-from-prompt-engineering-and-context-engineering">How Does Harness Engineering Differ From Prompt Engineering and Context Engineering?</h2>
<p>Harness engineering differs from prompt engineering and context engineering by controlling the whole delivery path, not just the model&rsquo;s input text. Prompt engineering tunes instructions; context engineering selects the evidence the model sees; AI harness engineering defines the workflow that turns an intent into reviewed, tested, mergeable work. The distinction matters in 2026 because AI coding is no longer a single developer asking for a helper function. It is agents modifying multi-repository systems, generating tests, calling CLIs, opening pull requests, and continuing work across context windows. Prompt engineering can say &ldquo;follow the architecture.&rdquo; Context engineering can provide the architecture document. Harness engineering can block edits outside owned modules, require an impact map, run architecture fitness tests, and route exceptions to a human. The takeaway: prompts and context are components; the harness is the production system.</p>
<table>
  <thead>
      <tr>
          <th>Discipline</th>
          <th>Primary object</th>
          <th>Failure it reduces</th>
          <th>Enforcement level</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Prompt engineering</td>
          <td>Instructions</td>
          <td>Vague model behavior</td>
          <td>Low</td>
      </tr>
      <tr>
          <td>Context engineering</td>
          <td>Retrieved evidence</td>
          <td>Missing or stale knowledge</td>
          <td>Medium</td>
      </tr>
      <tr>
          <td>Harness engineering</td>
          <td>Workflow and controls</td>
          <td>Unreviewed, unstable delivery</td>
          <td>High</td>
      </tr>
  </tbody>
</table>
<h2 id="what-is-the-structured-workflow-pattern-for-ai-assisted-development">What Is the Structured Workflow Pattern for AI-Assisted Development?</h2>
<p>The structured workflow pattern for AI-assisted development is intake, impact map, task contract, execution, verification, and review. Red Hat&rsquo;s 2026 discussion of harness engineering emphasizes moving from free-form tickets to explicit files, symbols, acceptance criteria, and test expectations before implementation begins. That sequence mirrors how strong human teams work: define the problem, identify the affected surface area, narrow the implementation scope, make the change, prove the behavior, and then review the evidence. The AI-specific benefit is that every handoff becomes machine-readable enough for an agent to resume or for a reviewer to audit. A vague request like &ldquo;fix billing retries&rdquo; becomes a contract naming the retry scheduler, idempotency key path, database migration risk, expected tests, and rollback concern. The takeaway: structure in produces structure out.</p>
<h3 id="what-should-an-impact-map-contain">What should an impact map contain?</h3>
<p>An impact map should list likely files, symbols, routes, database tables, feature flags, owners, risks, and required checks. It is not a design essay. It is a routing artifact that tells the coding agent where to look and tells the reviewer whether the agent edited the correct part of the system.</p>
<h2 id="how-do-you-build-a-deterministic-ai-assisted-development-harness">How Do You Build a Deterministic AI-Assisted Development Harness?</h2>
<p>You build a deterministic AI-assisted development harness by converting implicit engineering judgment into explicit workflow rules that agents must follow before, during, and after code changes. A practical first version can be built in two weeks for one repository: define an intake schema, require an impact map, constrain file access by task, run a known test matrix, emit a review summary, and block completion when checks fail. The important decision is to start with one high-volume workflow, such as bug fixes or dependency updates, instead of trying to harness every engineering activity at once. Determinism comes from narrowing degrees of freedom: the same request type uses the same planner, the same artifacts, the same sandbox, and the same exit criteria. The takeaway: start with the smallest workflow where repeatability matters and make every step observable.</p>
<h3 id="what-is-a-good-first-workflow-to-harness">What is a good first workflow to harness?</h3>
<p>A good first workflow is a repetitive change with known verification, such as small bug fixes, test repairs, API client updates, or dependency bumps. Avoid starting with ambiguous architecture work. The harness should prove value on tasks where success can be checked with tests, diff review, and clear acceptance criteria.</p>
<h2 id="what-guides-and-feedforward-controls-should-a-harness-use">What Guides and Feedforward Controls Should a Harness Use?</h2>
<p>Guides and feedforward controls are the up-front artifacts that steer an AI agent before it makes a change, including repo rules, architecture maps, AGENTS.md files, ownership boundaries, and tool permissions. Martin Fowler&rsquo;s harness framing separates these feedforward guides from feedback sensors because they solve different problems: guides reduce wrong first moves, while sensors catch bad outcomes. In a real repository, feedforward controls should answer basic questions without requiring the model to infer them from thousands of files. Which package owns authentication? Which migration pattern is allowed? Which test runner covers frontend components? Which directories are off-limits without approval? The strongest guides are short, local, and enforceable. A 300-line architecture manifesto is less useful than a directory-level rule backed by CI. The takeaway: give agents the same guardrails you expect new senior engineers to learn quickly.</p>
<h3 id="how-should-agentsmd-be-written">How should AGENTS.md be written?</h3>
<p>AGENTS.md should be specific, local, and operational. Include build commands, test commands, forbidden patterns, naming rules, dependency policy, and review expectations. Keep strategic context elsewhere. The file should help an agent choose the next command or reject a risky edit, not teach the full company history.</p>
<h2 id="what-sensors-and-feedback-loops-make-ai-coding-reliable">What Sensors and Feedback Loops Make AI Coding Reliable?</h2>
<p>Sensors and feedback loops make AI coding reliable by turning generated code into measured evidence through tests, linters, type checks, evals, logs, review agents, and CI gates. Apiiro reported that by June 2025, AI-generated code introduced more than 10,000 new security findings per month across studied repositories, even while trivial syntax errors dropped sharply. That pattern is exactly why syntax-level checks are not enough. A harness needs layered sensors: fast local checks for immediate correction, deeper CI checks for integration confidence, security scans for abuse paths, and review summaries that highlight risky assumptions. Feedback loops should be automatic where possible and explicit where judgment is needed. If a test fails, the agent can retry inside a limit. If a permission boundary changes, a human should approve. The takeaway: reliable AI delivery depends on sensors that detect the failures models are least likely to notice.</p>
<h3 id="what-checks-belong-in-the-fast-loop">What checks belong in the fast loop?</h3>
<p>The fast loop should include formatting, type checks, focused unit tests, generated artifact checks, and static analysis that runs in minutes. Slow end-to-end suites can run later, but the agent needs quick evidence while the change is still fresh enough to repair without guessing.</p>
<h2 id="how-do-you-manage-long-running-agents-across-context-windows">How Do You Manage Long-Running Agents Across Context Windows?</h2>
<p>Managing long-running agents across context windows means treating continuity as a first-class harness concern, not as a hope that the next session will remember the previous one. Anthropic&rsquo;s engineering guidance on long-running agents highlights the problem directly: each new coding session may start without full prior working memory, so durable artifacts must carry the work forward. In practice, that means every agent run should leave a compact state file or issue comment with the objective, completed steps, changed files, commands run, failing checks, unresolved decisions, and exact next action. The harness should distinguish durable state from conversational noise. A future agent should not need to reread a 200-message transcript to know whether a migration was applied. The takeaway: if the workflow can span context windows, the handoff artifact is part of the product.</p>
<h3 id="what-should-a-continuation-note-include">What should a continuation note include?</h3>
<p>A continuation note should include the goal, current status, files touched, commands run, test results, blockers, decisions made, and the next concrete command or edit. Avoid vague notes like &ldquo;continue debugging.&rdquo; The next session needs a restart point, not a memory test.</p>
<h2 id="what-security-and-governance-controls-does-ai-generated-code-need">What Security and Governance Controls Does AI-Generated Code Need?</h2>
<p>AI-generated code needs security and governance controls that focus on authorization, data access, dependency changes, secrets, compliance boundaries, and architectural drift. Apiiro reported that privilege escalation paths increased 322% and architectural design flaws rose 153% in studied AI-written code, even as syntax errors and many logic bugs decreased. That mix should change how teams review AI output. The easy defects may be caught by compilers and tests, while the dangerous defects hide in permission checks, trust boundaries, and cross-service assumptions. A harness should require threat-aware review for auth changes, block secret exposure, flag new dependencies, require owners for sensitive directories, and record why an agent needed elevated tool access. Governance is not bureaucracy when agents can change many files quickly. The takeaway: AI code review must prioritize systemic risk, not just whether the diff runs.</p>
<h3 id="where-should-human-approval-be-mandatory">Where should human approval be mandatory?</h3>
<p>Human approval should be mandatory for authentication, authorization, payments, migrations, public APIs, cryptography, production infrastructure, compliance logic, and dependency additions. These areas encode business and risk decisions that tests rarely cover completely. The harness can prepare evidence, but it should not silently approve these changes.</p>
<h2 id="what-metrics-should-engineering-teams-track-for-ai-harnesses">What Metrics Should Engineering Teams Track for AI Harnesses?</h2>
<p>Engineering teams should track AI harness metrics that show whether agent-assisted work is becoming faster, safer, and easier to review, including first-pass success, review toil, pull request size, rework rate, escaped defects, delivery stability, and time to green CI. The 2025 DORA findings say AI adoption has a positive relationship with throughput and product performance, but a negative relationship with software delivery stability unless teams have strong testing, version control, feedback loops, and platform practices. That is the measurement warning. Counting generated lines or accepted suggestions is shallow because it rewards volume. A better dashboard compares agent work to human baselines: how often the first patch passes checks, how many reviewer comments are about basic mistakes, how often changes are reverted, and whether incidents rise. The takeaway: measure the whole delivery system, not the model&rsquo;s apparent speed.</p>
<table>
  <thead>
      <tr>
          <th>Metric</th>
          <th>What it reveals</th>
          <th>Bad signal</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>First-pass success</td>
          <td>Harness quality and context fit</td>
          <td>Frequent basic failures</td>
      </tr>
      <tr>
          <td>Review toil</td>
          <td>Human load</td>
          <td>Repeated comments on same issue</td>
      </tr>
      <tr>
          <td>PR size</td>
          <td>Scope control</td>
          <td>Large mixed-purpose diffs</td>
      </tr>
      <tr>
          <td>Rework rate</td>
          <td>Planning accuracy</td>
          <td>Multiple rewrites after review</td>
      </tr>
      <tr>
          <td>Escaped defects</td>
          <td>Production safety</td>
          <td>Faster merges with more incidents</td>
      </tr>
  </tbody>
</table>
<h2 id="what-are-common-failure-modes-and-the-harness-fix-for-each">What Are Common Failure Modes and the Harness Fix for Each?</h2>
<p>Common AI coding failure modes include vague context, wrong-file edits, invented APIs, architecture drift, long-running context loss, security regressions, review overload, and merge instability. Stack Overflow&rsquo;s 2025 survey found that 45.2% of developers cite time-consuming debugging of AI-generated code, which is often the cost of discovering these failures late. A harness fixes them by moving discovery earlier and making correction mechanical. Vague context gets an intake schema. Wrong files get an impact map and ownership rules. Invented APIs get compile checks and repository search requirements. Architecture drift gets fitness tests and directory policies. Context loss gets durable handoff notes. Security regressions get targeted scanners and human gates. Review overload gets smaller task contracts and generated evidence summaries. Merge instability gets branch discipline and CI queues. The takeaway: every repeated AI failure should become a harness rule, not a reviewer reminder.</p>
<table>
  <thead>
      <tr>
          <th>Failure mode</th>
          <th>Harness fix</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Vague request</td>
          <td>Required intake fields and acceptance criteria</td>
      </tr>
      <tr>
          <td>Wrong module</td>
          <td>Repository impact map before edits</td>
      </tr>
      <tr>
          <td>Invented API</td>
          <td>Search-before-use rule and type checks</td>
      </tr>
      <tr>
          <td>Context loss</td>
          <td>Durable continuation artifact</td>
      </tr>
      <tr>
          <td>Security regression</td>
          <td>Sensitive-path gates and security scans</td>
      </tr>
      <tr>
          <td>Review overload</td>
          <td>PR size limits and evidence summary</td>
      </tr>
  </tbody>
</table>
<h2 id="what-is-a-reference-ai-harness-blueprint-for-engineering-teams">What Is a Reference AI Harness Blueprint for Engineering Teams?</h2>
<p>A reference AI harness blueprint is a small set of workflow components that turn AI coding from ad hoc assistance into a controlled delivery lane. A solid 2026 blueprint has nine parts: intake schema, repository impact map, task contract, context pack, tool permission policy, execution sandbox, automated verification, review checklist, and retry or escalation policy. Each part should be versioned near the code so it evolves with the system. For example, a bug-fix lane might accept a ticket, generate a scoped impact map, ask a human to approve the plan, grant edit access only to named directories, run focused tests, produce a PR summary with risk notes, and stop after two failed repair attempts. The blueprint is intentionally boring because boring workflows are inspectable. The takeaway: the best harness is the one your team can audit under pressure.</p>
<h3 id="what-should-be-versioned">What should be versioned?</h3>
<p>Version the intake schema, prompt templates, repo rules, tool policies, test matrices, review checklists, and escalation rules. If a harness decision affects production code, it should be reviewable like production code. Hidden dashboard settings and private prompts create behavior that the team cannot debug.</p>
<h2 id="what-is-the-2026-outlook-for-engineers-as-harness-designers">What Is the 2026 Outlook for Engineers as Harness Designers?</h2>
<p>The 2026 outlook is that senior engineers will spend more time designing harnesses, reviewing system behavior, and improving feedback loops while agents perform more routine implementation work. OpenAI estimated its agent-first internal experiment took about one tenth the time it would have taken to write the code by hand, but that result depended on humans steering architecture, process, and review rather than disappearing from the loop. This is the realistic future: engineers become responsible for shaping the environment where AI work happens. The valuable skill is not typing every line or writing clever one-off prompts. It is encoding architectural intent, narrowing ambiguity, defining quality gates, and turning repeated review comments into automated controls. Teams that build this capability will get compounding benefits because every harness improvement helps future work. The takeaway: AI does not remove engineering judgment; it moves judgment into the system.</p>
<h3 id="how-should-teams-change-roles">How should teams change roles?</h3>
<p>Teams should make ownership explicit. Staff engineers can own architecture guides and risk gates. Platform teams can own execution sandboxes and CI feedback. Product engineers can own acceptance criteria and domain examples. Security can own sensitive-path policies. The harness works when every control has a maintainer.</p>
<h2 id="faq">FAQ</h2>
<p>AI harness engineering FAQs usually center on scope, determinism, and adoption because teams are moving from individual AI coding experiments to production workflows. Stack Overflow&rsquo;s 2025 survey found 51% of professional developers use AI tools daily, but the same teams still face debugging burden, trust gaps, and review risk. The practical questions are not whether AI can generate code, but how a team should constrain that generation, prove the result, and decide when humans must intervene. Treat these answers as operating guidance for engineering leaders and senior developers building a repeatable AI-assisted development lane. A useful harness starts small, measures delivery outcomes, and turns recurring review pain into explicit workflow controls. The takeaway: the FAQ for AI harness engineering is really about making AI work auditable enough for normal software ownership.</p>
<h3 id="what-is-ai-harness-engineering-in-simple-terms">What is AI harness engineering in simple terms?</h3>
<p>AI harness engineering is the practice of putting structured workflow, context, tool limits, tests, and review gates around AI coding agents. Instead of asking a model to &ldquo;be careful,&rdquo; the harness defines what it may edit, what evidence it must gather, and what checks must pass.</p>
<h3 id="is-ai-harness-engineering-the-same-as-prompt-engineering">Is AI harness engineering the same as prompt engineering?</h3>
<p>AI harness engineering is broader than prompt engineering. Prompt engineering improves instructions given to the model, while harness engineering controls the full path from request intake to verified code. A harness may use prompts, but it also includes permissions, state, tests, CI, and escalation policies.</p>
<h3 id="can-ai-assisted-development-be-truly-deterministic">Can AI-assisted development be truly deterministic?</h3>
<p>AI-assisted development is not deterministic at the model-output level, but it can be deterministic at the workflow level. The same request type can follow the same intake, planning, execution, verification, and review sequence. That makes outcomes more repeatable and failures easier to diagnose.</p>
<h3 id="what-is-the-best-first-ai-harness-to-build">What is the best first AI harness to build?</h3>
<p>The best first AI harness is a narrow, high-volume workflow with clear tests, such as bug fixes, test repairs, dependency updates, or API client changes. Start where verification is strong. Avoid ambiguous redesign work until the team has reliable planning and review loops.</p>
<h3 id="how-do-you-know-an-ai-harness-is-working">How do you know an AI harness is working?</h3>
<p>An AI harness is working when first-pass success rises, review comments become less repetitive, PRs stay smaller, rework falls, CI failures become easier to diagnose, and production defects do not increase. The goal is not more generated code. The goal is faster delivery with stable quality.</p>
]]></content:encoded></item></channel></rss>