# How to Build an Agent Harness: Steps, Owners, Records

Build the harness in eight steps, each with an owner, a record and a usual failure. The worked build is a triage harness for JFrog Artifactory CVE-2026-82329: disclosed 28 Aug 2026, about 75,000 attempts on 31 Aug, a public exploit on 1 Sep, CISA due date 5 Sep. The mechanisms are quoted from Anthropic, Slack and OpenAI documentation read 19 Nov 2026.

## What is being built

Anthropic's Managed Agents post (8 Apr 2026) splits an agent into three parts: "a session (the append-only log of everything that happened), a harness (the loop that calls Claude and routes Claude's tool calls to the relevant infrastructure), and a sandbox (an execution environment where Claude can run code and edit files)". For a security job the loop is the small part. The parts a team must be able to justify are the tool list, the approval rules and the log, so the steps below build those first and the loop last.

The worked build is a triage harness for CVE-2026-82329, the Artifactory Access service flaw that trusts an empty join key on a default install. JFrog published the advisory on 28 Aug 2026. Fastly saw single-digit probes on 29 and 30 Aug, about 75,000 attempts on 31 Aug, and about 171,000 on 1 Sep, when a public exploit appeared. CISA listed it on 2 Sep with a due date of 5 Sep, eight days after disclosure. A harness has to be useful inside that window, which is why the first version in step 8 is read-only.

## Eight steps

Owners are roles, not job titles. The mechanism behind each step is quoted in the next section. Read 19 Nov 2026.

| Step | Owner | Record it leaves | How it usually fails |
|---|---|---|---|
| 1. Name one job and its done state | Process owner, the person who answers for the finding queue | One-page task spec: inputs, allowed outputs, done state read from the system ([task spec guide](/guides/writing-a-task-spec-for-a-security-agent/)) | The done state is the agent saying it finished, not a state of the system |
| 2. Decide workflow or agent | Engineer who will run it | A short decision note naming each step that needs judgment | An open agent loop for a job whose steps are known |
| 3. Register the tools | Platform engineer with the owner of each target system | Tool register: name, read or write, credential, target ([tools and permissions](/agent-harness/tools-and-permissions/)) | A write tool registered for a read job, or one credential shared by all tools |
| 4. Split the work into steps with structured outputs | Engineer | One output schema per step, versioned with the prompt | One long prompt that asks for care in words |
| 5. Enforce approvals and denies in code | Engineer, with the named approver | Policy file plus an approval log with approver, time and decision ([approvals and checkpoints](/agent-harness/approvals-and-checkpoints/)) | The rule covers some tools or paths and a different tool does the same write |
| 6. Log every action and make runs resumable | Engineer | Run log with the fields in [logging and evidence](/agent-harness/logging-and-evidence/); a progress file for long runs | Only the model transcript is kept, with no read-back from the target |
| 7. Write the evals and the harness tests | A security engineer who did not build the harness | Task file and test record ([evaluation harness](/agent-harness/evaluation-harness/), [harness tests](/agent-harness/how-to-test-an-agent-harness/)) | Tests written after a good demo, and only for the happy path |
| 8. Pilot read-only, then widen one tool at a time | Process owner | A dated decision per widening, with the eval result attached | Widening on a good single run instead of repeated trials |

## The documented mechanism behind each step

1. Slack's security team wrote that at the end of May 2025 the prototype "was not much more than a 300 word prompt" with five sections: orientation, manifest of data sources, methodology, formatting and classification (Slack Engineering, listed in the sources). That prompt was the task spec.
2. Anthropic: "we recommend finding the simplest solution possible, and only increasing complexity when needed. This might mean not building agentic systems at all" ([Building effective agents](https://www.anthropic.com/engineering/building-effective-agents)).
3. Slack used "a simple 'stdio' mode MCP server to safely expose a subset of our data sources through the tool call interface", not open access to everything.
4. Slack found "prompts are just guidelines; they're not an effective method for achieving fine-grained control" and moved to "a sequence of model invocations, each with a single, well-defined purpose and output structure". Its "question your evidence" guidance became a separate task.
5. OpenAI Agents SDK 0.25.0: "Set needs_approval to True to always require approval or provide an async function that decides per call", and callable rules "fail closed" when the arguments cannot be inspected ([human-in-the-loop](https://openai.github.io/openai-agents-python/human_in_the_loop/)). Claude Agent SDK 0.2.185 offers PreToolUse hooks that can block a call and a matcher that limits a hook to named tools ([hooks](https://code.claude.com/docs/en/agent-sdk/hooks)); that limit is why step 5 fails when the rule covers only some tools.
6. Anthropic's long-running harness kept "a claude-progress.txt file that keeps a log of what agents have done" alongside git history so a fresh context window could understand the state of work ([source](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents)). Managed Agents writes each event with `emitEvent(id, event)` and restarts a failed harness with `wake(sessionId)`.
7. Anthropic's eval guide: "20-50 simple tasks drawn from real failures is a great start" ([Demystifying evals](https://www.anthropic.com/engineering/demystifying-evals-for-ai-agents)).
8. The same guide lets capability evals with high pass rates "graduate" into a regression suite, which is the evidence for widening.

## The build carried through: Artifactory triage

Version ranges, fixed builds and dates from the NVD record, the JFrog advisory, the CISA KEV entry and Fastly's report, read 19 Nov 2026.

| Step | What the Artifactory triage harness has |
|---|---|
| 1 | Job: for each self-hosted Artifactory instance, return affected, not affected or needs a person, with the fixed build and what to do next. Done state: a ticket per instance carrying a version read from the instance and a reached result read from its proxy log. |
| 2 | A fixed workflow. Comparing a version against six release trains (7.111.21, 7.117.28, 7.125.20, 7.133.29, 7.146.38, 7.161.20) is a lookup, so only the reading of the advisory text and the handover decision need a model. If every step were a lookup, a script would do and no agent would be needed. |
| 3 | Register `get_version(instance)` (read) and `read_proxy_log(instance, window)` (read), and `open_ticket` (write, approval). The join-key change in `system.yaml` and the token revocation are not registered in version 1. |
| 4 | Output schema: affected, fixed_in, evidence (the version string read), reached (yes, no or unknown: whether the proxy log for 28 Aug to 4 Sep shows a POST to the join endpoint answered with HTTP 201), next_action, needs_human. A patched instance with reached yes or unknown is not closed: it routes to a person, because a version string cannot show whether tokens were minted before the upgrade. |
| 5 | `open_ticket` needs a named approver. Any version string the schema cannot parse routes to a person. |
| 6 | Each run records the version string returned, the instance name and the log window searched with the match count, so a later reader can check the decision without the transcript. |
| 7 | Tasks from the record: 7.133.20; 7.146.37, where JFrog's affected table ends at 7.146.36 and so leaves the build unlisted, while NVD's range of below 7.146.38 makes it affected (the task expects affected, fixed in 7.146.38, as on the [evaluation harness](/agent-harness/evaluation-harness/) page); an instance of unknown version; and a patched instance whose log holds a join-endpoint hit, which must come back as reached yes. |
| 8 | Read-only on day one, 28 Aug 2026. The fix does not revoke tokens already issued, so the follow-up (rotate the join key, revoke tokens issued since 28 Aug) is handed to a person until the write tools pass their tests. |

## When the usual answer is wrong

- A job with fixed steps and no judgment, such as the version lookup above, needs a workflow or a script. Building the loop there adds a thing to test and nothing else; the [build vs buy guide](/guides/build-vs-buy-ai-agents/) is the place to cost that choice.
- Harness assumptions go stale when the model changes. Anthropic wrote that context resets added for Claude Sonnet 4.5 "had become dead weight" on Claude Opus 4.5 ([Managed Agents](https://www.anthropic.com/engineering/managed-agents)). Rerun the step 7 evals on every model change.
- Long runs need the progress file and a clean state at the end of each session, as in Anthropic's long-running harness; short triage runs do not.

## Sources

- [Anthropic, Scaling Managed Agents (8 Apr 2026)](https://www.anthropic.com/engineering/managed-agents), read 19 Nov 2026
- [Slack Engineering, security investigations with agents](https://slack.engineering/streamlining-security-investigations-with-agents/), read 19 Nov 2026
- [Anthropic, Building effective agents](https://www.anthropic.com/engineering/building-effective-agents), read 19 Nov 2026
- [OpenAI Agents SDK 0.25.0, Human-in-the-loop](https://openai.github.io/openai-agents-python/human_in_the_loop/), read 19 Nov 2026
- [Claude Agent SDK (claude-agent-sdk 0.2.185), Hooks](https://code.claude.com/docs/en/agent-sdk/hooks), read 19 Nov 2026
- [Anthropic, Effective harnesses for long-running agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents), read 19 Nov 2026
- [Anthropic, Demystifying evals for AI agents (published 9 Jan 2026)](https://www.anthropic.com/engineering/demystifying-evals-for-ai-agents), read 19 Nov 2026
- [NVD record for CVE-2026-82329](https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-82329), read 19 Nov 2026
- [CISA KEV entry for CVE-2026-82329](https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-82329), read 19 Nov 2026
- [JFrog security advisories, CVE-2026-82329](https://docs.jfrog.com/releases/docs/jfrog-security-advisories), read 19 Nov 2026
- [Fastly Security Research, CVE-2026-82329 exploitation activity (3 Sep 2026)](https://www.fastly.com/blog/cve-2026-82329-jfrog-artifactory-authentication-bypass-exploitation-activity), read 19 Nov 2026

Last reviewed 19 Nov 2026

Canonical: https://agenticaiincybersecurity.com/agent-harness/how-to-build-an-agent-harness/
