Artificial Intelligence14 min read

Harness engineering: what holds up trustworthy autonomous hacking

In an autonomous hacking system, the engine proposes candidate signals; the harness decides what is real, unique, and defensible. The harness does not just receive what the engine produces: it also hands the engine the tools it perceives and acts through, and that surface defines its ceiling of capability, its security, and its reproducibility.

Architecture diagram showing the engine (agent) and the toolset inside the harness, connected to a post-processing block that produces defensible findings

In autonomous hacking systems (scanners, SAST/DAST engines, or agents that simulate an attacker) almost all the attention goes to the engine: the techniques it knows, the model that drives it, the raw detection rate against a toy target. It is the part you can demo.

But the jump from “finds the bug on my laptop” to “a security team trusts this to audit production” is not made by the engine. It is made by the harness: the engineering around the engine that governs how targets are prepared, how execution is orchestrated, how signals are captured and persisted, how findings are deduplicated and verified, and how regression is measured between versions.

This post is about that layer, the patterns that work, and the trade-offs each decision hides.

The mental model: engine vs. harness

It is worth separating responsibilities explicitly:

  • The engine proposes. It generates candidate signals: “this looks like an injection”, “this endpoint exists”, “this dependency is vulnerable”.
  • The harness decides. It determines what of that is real, unique, defensible, and reproducible, and what state the system is left in when something fails.

“Engine” here is not a synonym for language model. It can be an LLM that reasons and decides what to do next, but it can just as well be a fuzzer with its own heuristics, an adaptive exploration algorithm for SAST, or any logic that explores a search space non-deterministically. What defines it is the role: the piece that decides the next step and proposes candidates, whether it is a model or not.

This separation is not cosmetic. It is what lets you raise the quality bar (verification, deduplication, evidence) without touching the engine, and keeps the engine swappable behind a stable contract. If product quality is coupled to the engine’s mood on any given run, you don’t have a product: you have a demo that got lucky.

But there is a third face that usually gets left out of the conversation. The harness does not just receive what the engine produces: it also hands the engine what it has to work with. And that is where a good chunk of quality is won or lost.

The harness as the engine’s tool provider

When the engine is an agent (a model that reasons and decides what to do next), its only way of acting on the world is the tools the harness exposes to it. The agent does not “know” how to scan ports or fuzz routes or read a dependency tree; it invokes a tool the harness put at its disposal. This has a direct and not-so-intuitive consequence:

The toolset defines the engine’s capability ceiling. A brilliant model with three poor tools performs worse than a mediocre model with a well-designed toolset. The agent’s intelligence does not compensate for a missing capability; it only decides what it works with.

Designing that toolset is, in itself, one of the harness’s highest responsibilities. What you gain by doing it well:

Determinism injected at the edges

Raw tools (a CLI binary, an HTTP response, a JSON dump from a scanner) are noisy, change format between versions, and sometimes aren’t deterministic. If the agent consumes that raw output, it inherits all that noise into its reasoning.

The pattern: wrap each tool in a deterministic adapter that normalises its output to the system’s canonical schema (the same one discussed under artifact identity, below). The agent no longer sees “whatever nmap spat out”; it sees “a list of services with this stable shape”. This turns the system’s most chaotic edge, the boundary with external tools, into the point where order gets imposed, instead of where chaos gets in.

The toolset as where scope and safety get enforced

A well-designed tool is also an authorisation boundary. If the scope limit (what the engine is allowed to touch) lives inside the tool, the agent physically cannot step outside it: it is not that it “chooses” to respect scope, it is that the tool rejects an out-of-range target before executing anything.

This is far more robust than trusting the engine to “behave”. In security, a non-deterministic engine that you ask to respect limits on good faith is an incident waiting to happen. Move the boundary to the harness, to the tool’s edge, where it is an invariant and not a hope.

Reproducibility: pinned tools

If the toolset changes between runs (a different scanner version, a different default behaviour), you lose the ability to compare runs, and your entire statistical evaluation loses meaning. Pinning tool versions (and, where it applies, base images by digest) is what makes “this version finds 12% more” mean something: you are comparing the engine, not the noise of a dependency that got updated behind your back.

Structured, bounded output

Two opposite traps in toolset design:

  • Too many tools, or overlapping ones. This inflates the agent’s decision space, raises the per-run cost and, worse, makes it pick badly between equivalent tools. More tools is not more capability; past a certain point it is more confusion.
  • Tools that return everything. A tool that dumps megabytes of raw output drowns the agent’s context and buries the signal. Tools should return what is relevant, structured and bounded: curation, not a dump.

The balance: a small, orthogonal toolset with predictable output. Each tool does one thing, doesn’t overlap with another, and answers in a shape both the agent and the rest of the harness can consume without guessing.

Every invocation is an observability point

Since every action the engine takes goes through a tool, the toolset is the natural place to audit. Every call (which tool, with what arguments, what it returned, how much it cost) is a log entry and a metric. This gives you the full trace of why the agent concluded what it concluded, which is exactly the reproducible evidence the client needs and what lets you debug a strange behaviour months later.

In short: offering tools to the engine is not “wiring up utilities”. It is designing the surface through which the engine perceives and acts on the world. That surface determines its capability, its security, its reproducibility, and its auditability: four product properties, decided in a layer the engine never even sees.

The full model, with the engine inside the harness and the tools as its only surface for action, looks like this:

Flowchart: inside the harness, target preparation feeds the engine (agent), which invokes tools from the deterministic-adapter toolset; the toolset acts on the external target with scope enforced at the edge, returns normalised output to the engine, and candidate signals move to a post-processing step of capture, dedup, verification and evidence that produces defensible findings and feeds a continuous evaluation loop with ground truth
The engine lives inside the harness, not above it, and all of its interaction with the target goes through the toolset

What the diagram makes evident: the engine sits inside the harness, not above it, and all of its interaction with the target goes through the toolset. The target never touches the engine directly, and the user never sees the raw signals: the two boundaries where the harness imposes order.

Why the harness dominates in this domain

Three properties make the harness weigh more here than in your average CRUD app.

Asymmetric, bidirectional cost of error. A false negative is a latent breach, made worse by the false sense of coverage. A false positive consumes the system’s most expensive resource (the analyst’s attention) and, accumulated, destroys the signal-to-noise ratio until every alert gets ignored, including the real ones. The harness is the only layer that attacks both at once: it widens coverage (fewer FNs) and adds verification (fewer FPs).

Results have to be defensible. “There’s a SQLi” is useless. “There’s a SQLi on this endpoint, with this payload, which produced this response, reproducible with these steps” is actionable. The evidence chain is a harness artifact, captured the instant the signal exists, because afterwards it stops existing.

First-class non-determinism. Modern engines, AI-driven or using adaptive exploration, are not pure functions. The same target takes different paths across two runs. That invalidates “I tried it once and it worked” as evidence and forces you to treat evaluation statistically, not as a single data point.

Harness patterns, with their trade-offs

For each pattern: the cause that makes it necessary, the effect if it’s ignored, and the concrete recommendation.

1. Normalisation and artifact identity

Cause. The same artifact arrives described in different ways depending on the source: a full URL from an external scan, a relative path from code analysis, different capitalisation, an explicit port in one case and not in another.

Effect. If each form generates a different identity, the system ends up creating duplicate entities where there should be one. It doesn’t crash: it just doesn’t group, and you discover it months later while looking at real data that doesn’t add up.

Recommendation. Define a canonical form (same capitalisation, same path format, same defaults for port and scheme) before computing any identifier or hash. The identifier inherits every flaw from the normalisation step, so that step deserves the most care in the pipeline, not an afterthought. When two different sources observe the same artifact, they should update the same record and accumulate where each observation came from, instead of creating parallel rows.

2. Deduplication: the finding’s identity key

Cause. The same security finding often arrives from more than one angle: different tools, different runs, different moments of the same analysis.

Effect. Both possible mistakes are equally costly. A key that’s too loose groups findings that are actually distinct (for example, instances of the same rule in different files), hiding real work. A key that’s too strict multiplies the same finding into several entries, inflating the noise a person later has to review.

Recommendation. There’s no universal key: a finding’s identity depends on its nature. A static-analysis finding is well identified by combining the rule that fired, the file, and the line; a network-surface finding needs a different combination, host and attack vector. Choose the key based on the finding type, don’t force a single formula onto all of them.

3. Idempotency and phased ingestion

Cause. Any run can be retried, triggered more than once by a duplicate event, or feed several independent subsystems of the product at once.

Effect. Without a mechanism to prevent it, a retry counts the same result twice. If the protection mechanism is too coarse (a single one for the whole run, when it actually feeds several independent stages), a missing piece of data in one stage wrongly blocks the others and real information gets lost.

Recommendation. The protection against double counting needs the same granularity as the independent parts of the process, not a broader one “just in case”. It’s also worth distinguishing two kinds of numbers that get easily confused: a counter of how much this run contributed is a delta that only adds up, while a measure of “how many things are currently in that state” is a snapshot that must be able to go down when the situation improves. Treating a snapshot as if it were a cumulative delta silently inflates metrics.

4. Incremental evidence capture

Cause. Any run can be interrupted before finishing: timeout, cancellation, a process that died.

Effect. If results are only saved on successful completion, every run that doesn’t reach that point becomes a black box: all the partial work that was actually done stays invisible, as if it had never happened.

Recommendation. Save each signal the moment it appears, don’t wait for completion. Partial work still has value, and there’s an important side effect if this is ignored: when cost or usage calculation depends on data that only gets written at the end, an interrupted run ends up under-reporting, and whoever operates the system absorbs that gap.

5. Designing for abnormal termination

Cause. Most of the value lost in a non-deterministic system happens outside the happy path: tasks that die halfway through, retries over work already done, reserved resources nobody releases.

Effect. Without an explicit design for these cases, the system accumulates silent inconsistent states, and generic errors on a composite operation rarely say which of its parts actually failed, turning every incident into a long investigation.

Recommendation. Decide by design, not as an afterthought, what state is left when a run dies halfway, who is responsible for releasing what was reserved, and whether a retry can duplicate effects or is safe to repeat. When the system allows it, log the specific reason for each partial failure instead of a generic message: it’s the difference between diagnosing in minutes and chasing a ghost for days.

6. Verification as a harness responsibility

Cause. The engine proposes candidates of different natures (a code finding doesn’t have the same shape as a network one), and the harness decides which ones reach the person who’s going to read them.

Effect. A verification step that assumes a single shape for every finding type ends up discarding legitimate findings that simply don’t fit that mould, even though they’re perfectly valid.

Recommendation. The verification rule has to know the specific shape of each finding type, from a cheap structural check (does it have the minimum expected properties?) to active confirmation when the case calls for it. Never a single rule applied equally to different natures.

7. Statistical evaluation and regression detection

Cause. A non-deterministic engine can take different paths against the same target across separate runs, so a single run says nothing reliable about its real behaviour.

Effect. Trusting “I tried it once and it worked” hides the system’s real variance: a version that finds 90% of the cases in one of three runs is a different product from one that finds it in all three, even if the headline reads the same.

Recommendation. Evaluate against a set of targets where what should be found is known with certainty, with repeated execution, looking at the distribution of results rather than a single data point. The metrics that matter are coverage, precision, stability across runs, and regression against the previous version. One extra risk to watch: test doubles written alongside the code itself tend to certify that code, not reality, because they end up modelling how one believes the real external system behaves rather than how it actually behaves.

8. Harness observability

Cause. The harness fails too, and when it does, the temptation is to explain the error with the most plausible cause instead of the verified one.

Effect. An error message that names a cause nobody confirmed sends whoever’s investigating chasing a problem that doesn’t exist, while the real cause stays unresolved.

Recommendation. Audit what ran, when, and with what result, in a way that can be queried later. And above all, don’t fill in the cause of a failure with a comfortable explanation: it’s better to say “it failed, here’s what’s known” than to give a confident but unverified one.

Benefits, in engineering terms

  • Capability under control. The toolset defines the engine’s ceiling, so you expand what the tool can do by adding a tool, not by hoping for a better model.
  • Security by construction. With scope enforced at each tool’s edge, the engine cannot step outside scope even if it wanted to.
  • Engine swappability. With a stable contract and continuous evaluation, you can swap the engine without changing the product.
  • Self-detected regression. The ground-truth corpus turns “did I break something?” into a question with an automatic answer.
  • Operational resilience. Designing for abnormal termination eliminates corrupted states and lost work.
  • Bounded, observable cost. Limits and isolation make every run predictable; floor/ceiling metrics make it alarmable.
  • Speed. It sounds paradoxical, but the harness speeds things up: it is the net that lets you touch the engine without fear.

Quick checklist

If you’re designing the harness for an autonomous hacking system, ask yourself:

  • Is your toolset small, orthogonal, and structured/bounded in its output?
  • Does every tool normalise its output to the canonical schema before handing it to the engine?
  • Is scope enforced at the tool’s edge, rather than relying on the engine’s good behaviour?
  • Are tool versions pinned so runs are comparable?
  • Is every tool invocation audited (arguments, result, cost)?
  • Does every artifact have a canonical identity computed before hashing?
  • Is each finding’s identity key chosen per finding type, with both failure modes in mind?
  • Is ingestion idempotent, with double-counting protection at the right granularity?
  • Do you distinguish cumulative counters from snapshots that can decrease?
  • Do you persist evidence incrementally, not only at closing?
  • What state is left when a run dies midway? Who cleans up the reservations?
  • Does verification know the shape of each finding type?
  • Do you evaluate with ground truth, repeated, looking at the distribution?
  • Are your tests validated against real data/behaviour, not fakes written alongside the code?
  • Do your errors tell the truth about their cause, or fill in a plausible one?

Closing

The harness is not scaffolding around the product. In an autonomous hacking system, where the cost of error is asymmetric, results have to be defensible, and the engine is non-deterministic by design, the harness is a big part of the product. It is what turns a talented engine into a trustworthy system.

The flashy part sells the demo. The invisible part decides whether anyone trusts the second run.

Keep reading