Join our Newsletter — 33% off our NHI Course

What is the difference between the model, the agent, and the harness in AI pentesting workflows?

The model generates reasoning and candidate actions, the agent turns that capability into a task-executing loop, and the harness defines the rules, tools, permissions, and boundaries around execution. In practice, the harness often determines whether the system is safe and useful. Strong results depend on all three working together, not on model quality alone.

Why the Three Parts Matter in a Pentesting Workflow

The distinction matters because AI pentesting fails for different reasons at each layer. The model is the reasoning engine, the agent is the execution layer that can chain steps and use tools, and the harness is the control plane that decides what those steps are allowed to touch. In practice, the highest-risk failures usually come from assuming model quality alone makes the workflow safe. As NHIMG’s LLMjacking: How Attackers Hijack AI Using Compromised NHIs shows, attackers do not need perfect model behaviour if they can abuse access and execution conditions around the system.

A useful mental model is that the model proposes, the agent acts, and the harness constrains. If any one of those is weak, the workflow can become noisy, unsafe, or operationally useless. In real pentests, teams often discover that the agent is capable enough, but the harness is either too permissive to trust or too restrictive to be useful.

How They Differ in Practice

The three components answer three separate questions. What should be tried? Who or what actually performs the steps? What boundaries keep the system under control?

  • Model: Produces reasoning, classifications, and candidate next actions. It does not, by itself, execute a test or enforce policy.
  • Agent: Converts model output into a task loop, selects tools, follows state, and can continue after one prompt.
  • Harness: Supplies the prompt template, tool list, permissions, rate limits, sandboxing, logging, stop conditions, and escalation rules.

That separation matters because pentesting workflows often need reproducibility. A strong model can still be a poor pentesting system if the agent has no disciplined loop or if the harness allows uncontrolled tool use. Conversely, a careful harness can make a weaker model safer and more auditable by forcing every action through boundaries, approvals, and traceable outputs. The real security property is not “does the model know what to do,” but “can the whole system be trusted to do only what was intended.”

For example, a model may suggest scanning a target, but the agent determines whether that suggestion becomes an actual request, and the harness decides whether that request is legal, logged, rate-limited, and scoped to approved assets. That is why pentesting teams should treat the harness as part of the control architecture, not as mere plumbing. These controls tend to break down when the agent can persist state across steps without a strong execution boundary, because small planning errors then compound into real-world action.

Common Variations and Edge Cases

Tighter harness design often increases friction, so teams must balance test realism against safety, reproducibility, and operator oversight.

Some workflows blur the lines. A very small prototype may collapse the model and agent into one loop, while a mature system may split the harness across policy, orchestration, and sandboxing layers. The distinction still holds: if a component changes the reasoning, it is model-like; if it advances the task, it is agent-like; if it limits or authorises execution, it is harness-like.

Another common edge case is tool access. Tooling does not automatically make something an agent, and a tool wrapper does not automatically count as a harness. The practical test is whether the component merely exposes capability or actually governs it. In higher-risk environments, the harness should also decide what is out of bounds before execution begins, rather than trying to clean up unsafe outputs after the fact.

The hardest cases are dynamic environments where targets, permissions, or tool outputs change mid-run. In those settings, the harness must be able to revoke or narrow access without depending on the model to self-censor. That is the point where conceptual clarity becomes operational control.

Risk and Threat Considerations

The main risk is confusing reasoning with authorization. In AI pentesting workflows, the model may suggest a valid next step while the agent and harness determine whether that step is safe, bounded, and attributable. If those layers are not separated cleanly, a test system can drift from supervised assessment into uncontrolled execution.

Failure mechanism: Unsafe outcomes usually appear when the agent inherits too much implicit trust, the harness exposes overly broad tools or credentials, or both. An attacker or careless operator can then turn a benign test loop into a path for prompt injection, unauthorized tool use, excessive privilege, or uncontrolled action chaining.

Impact: The result can be data exposure, unintended modification of systems, unreliable test results, or loss of containment around the pentest itself. In the worst case, the workflow becomes a live attack surface rather than a controlled assessment environment.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10, CSA MAESTRO, MITRE ATLAS and OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Agentic AI Top 10 A1 — Agentic Access Control AI pentesting agent execution and tool permission boundaries are central to this workflow.
Recommendation — Define and enforce tool, scope, and approval boundaries before any agent action is executed.
CSA MAESTRO L3 — Orchestration and Control Plane The harness functions as the orchestration layer governing multi-step agent execution.
Recommendation — Implement orchestration controls that constrain agent actions, outputs, and escalation paths.
MITRE ATLAS T0002 — Prompt Injection Pentesting agents that use prompts and tools can be manipulated through injected instructions.
Recommendation — Hunt for prompt injection paths and validate that harness controls block hostile instruction following.
OWASP Non-Human Identity Top 10 NHI-03 — Excessive Privilege Agent workflows often fail when tools or credentials are overprivileged relative to task scope.
Recommendation — Reduce credential and tool privilege to the minimum required for the test workflow.
NIST CSF 2.0 PR.AC-4 — Access Permissions The harness must enforce least-privilege access and controlled execution boundaries.
Recommendation — Limit permissions so the agent can only reach approved tools, targets, and data.

Practitioner Guidance

What to prioritise: Treat the harness as the primary safety boundary. If it does not clearly define tools, scope, approvals, and termination conditions, the agent is operating with more freedom than the assessment can justify.

What to verify: Confirm that the model cannot directly bypass policy, that the agent cannot silently expand scope, and that every externally visible action is logged with enough context to replay the decision path later. If that trace does not exist, the workflow is hard to trust even when results look accurate.

Decision rule: If a control failure would let the system act outside approved scope, fix the harness before tuning the model. If a failure only reduces reasoning quality, model improvement may help, but it will not compensate for weak execution boundaries.

Practitioner takeaway: Strong AI pentesting is less about making the model smarter and more about making execution narrower, observable, and reversible.