Building Harness Engineering to Regulate AI Agent Behavior

Original Title: SE Radio 730: Birgitta Boeckeler on Harness Engineering for AI Agents

The hidden architecture of AI-assisted development: Why prompting is only half the battle

Software engineering is changing, but the industry is focused on the wrong layer. While teams obsess over prompt engineering, they ignore the instability created by AI agents that lack operational guardrails. The real competitive advantage in the AI era is not just generating code faster. It is building the harnesses, or the specialized guides and sensors, that turn probabilistic models into reliable engineering partners. For technical leaders and senior engineers, the danger lies in assuming that AI-generated code is safe because it passes a test. Without explicit, automated, and maintainable constraints, AI agents create technical debt at a compounding rate. Those who master harness engineering will maintain velocity without sacrificing the long-term integrity of their systems.

The illusion of prompting and the reality of regulation

We have spent years treating AI as a black box that requires the perfect prompt to function. Birgitta Boeckeler, a Distinguished Engineer at Thoughtworks, argues that this focus is outdated. As models grow more powerful, the specific syntax of a prompt matters less than the environment in which the agent operates.

Boeckeler introduces the concept of harness engineering, which is the skeleton of guides and sensors that sit atop a language model to orchestrate its behavior. This is not just about instructions. It is about cybernetic regulation.

I really like it like a system that you try to regulate that it does not get too much or too little. I really liked that image to think about harnesses.

-- Birgitta Boeckeler

The shift here is from instruction, or telling the AI what to do, to regulation, or creating a system that forces the AI to stay within architectural bounds. When you rely solely on prompts, you hope for a good outcome. When you build a harness, you engineer the probability of success.

Why obvious fixes create downstream fragility

A common trap for teams adopting AI agents is the noise overload of static analysis. Historically, developers ignored linters because they generated too much friction. Boeckeler suggests that AI agents change this dynamic. Instead of suppressing a linting error because it is tedious, you can now instruct the agent to make a judgment call: Is this function too long because it is complex, or because it is a simple test helper?

This transforms static analysis from a passive reporting tool into an active, self-correcting loop. The hidden consequence of this approach is that it makes technical debt explicit. When an agent attempts to bypass a rule, it forces a decision that a human can review. This creates a clean slate effect, where the codebase remains maintainable not because the AI is perfect, but because the harness forces the AI to justify its deviations.

However, this creates a new class of risk: ping-ponging. If you set up sensors for cyclomatic complexity and modularity that contradict each other, the agent may oscillate between conflicting instructions. The systems-thinking challenge is not just to add more sensors, but to balance them.

The 18-month payoff: Why humans must stay accountable

The most dangerous assumption in modern software delivery is that AI-generated code is done once it passes a test. Boeckeler warns that tests generated by the same AI that wrote the code are often circular. They confirm the logic, but not the intent.

There is a school of thought that the language models will just get better and better and better until they are just perfect at coding and the code will always be perfect, right? But yeah, I do not think that is realistic.

-- Birgitta Boeckeler

The long-term advantage goes to those who treat AI agents as junior team members who need rigorous oversight. This requires a shift in the T-shaped engineer skillset. We must stop viewing quality assurance as a separate phase and start viewing it as a core component of the agent harness. If you measure your team solely by PR volume, you incentivize the creation of brittle code that will compound into an operational nightmare 18 months down the line. The organizations that win will be those that prioritize the observability of the agent session, tracking how often sensors trigger and how that correlates with long-term system stability.

Key action items

  • Audit your vanilla baseline (Immediate): Before building custom agents, use the base harness, such as Cloud Code or Cursor, without custom instructions. You cannot identify what needs regulating until you understand the agent default failure modes.
  • Implement judgment-based sensors (Next 30 days): Move beyond simple linters. Configure static analysis tools to trigger prompts that ask the agent to justify violations. This turns passive noise into an active, human-reviewable dialogue.
  • Build an agent trace history (Next quarter): Start logging agent interactions and sensor triggers. If your sensors are always green, your safety net is likely ineffective. You need to see the red to know the system is actually regulating behavior.
  • Shift from prompting to architectural fitness (6 to 12 months): Stop focusing on prompt syntax. Focus on building computational sensors, such as coupling analysis or modularity checks, that run automatically during the agent session.
  • Establish garbage collection cycles (12 to 18 months): Adopt the practice of running scheduled, systemic reviews of your codebase, not just for bugs, but for dependency freshness and modularity rot. This prevents the slow accumulation of technical debt that even the best agents will eventually cause.
  • Redefine team accountability (Ongoing): Ensure that human engineers remain the final authority on risk assessment. An agent can generate code, but it cannot assess the business impact of a database schema change. That remains the human moat.

---
Handpicked links, AI-assisted summaries. Human judgment, machine efficiency.
This content is a personally curated review and synopsis derived from the original podcast episode.