Skip to content
All posts

Harness Engineering: What It Is, Parts and Security Risks

November 30, 2026 · Team PlayCISO
TL;DR · the short version

Harness engineering is the work of designing everything around an AI model that turns it into a dependable agent: instructions, tools and permissions, context and memory, sandboxing, feedback loops and evaluation. OpenAI popularised the term in a February 2026 post about Codex; LangChain sums it up as "agent = model + harness". For security leaders the point is that the harness, not the model, holds the permissions and the attack surface: a November 2026 preprint says to treat it as a security boundary, and GitHub has published advisories for coding-agent harness flaws. This guide defines the term, lists the parts of a harness with sources, and shows where the risks sit.

Put it into practice
Design a harness and see its security score
Compose an agent harness from its components, set the control loop and get a governance-weighted scorecard in your browser.
Open the Harness Designer

Harness engineering is the work of building everything around an AI model that makes it behave as a dependable agent: the instructions it reads, the tools and permissions it has, how its context and memory are managed, the sandbox it runs in, and the feedback loops that check its work. LangChain's shorthand is agent = model + harness. For a security leader the useful fact is where the risk sits: the harness holds the permissions, the credentials and the places an attacker can steer the agent. This guide defines the term, lists what a harness contains, and shows where the security risks are.

Who this is for: CISOs, AI-security and AppSec engineers, and platform teams rolling out coding agents or building their own.

Every claim is attributed to a primary source we opened on 30 November 2026. PlayCISO is not affiliated with any company named. Items marked "our analysis" are our own reasoning.

Confirmed vs not settled

Sourced: the definitions below (OpenAI, LangChain, Thoughtworks), the harness parts the sources list, two GitHub advisories for a coding-agent harness, and a November 2026 preprint and a vendor opinion that both say to treat the harness as a boundary.

Not settled: who coined the term (no source we opened says), and how large the security effect of harness choice is: the evidence is a preprint and a vendor study, not an independent benchmark.

What harness engineering means

The term has two uses in the sources, and they fit together.

Who coined it? No source we opened settles it. OpenAI's post carries the term in its title; Hashimoto's page shows no date; and Böckeler's February 2026 memo calls the term about two weeks old and only suggests that one may have inspired the other.

Context engineering vs harness engineering. Context engineering is about what goes into the model's context window on each call. Harness engineering is wider: it also covers tools and permissions, sandboxing, feedback loops, evaluation and the code that runs the loop. Context management is one component of a harness.

What a harness contains

PartWhat it doesSource
Instructions and knowledge filesOpenAI keeps a roughly 100-line AGENTS.md as a map into a structured docs directory; Hashimoto bases each line on a real bad behaviour.OpenAI
System prompt, tools, skills, MCP serversLangChain lists these with bundled infrastructure (filesystem, sandbox, browser), orchestration (sub-agents, handoffs, model routing) and hooks (compaction, continuation, lint checks).LangChain
Guides and sensorsGuides steer before the agent acts; sensors observe after and let it self-correct. Each can be computational (linters, tests) or inferential (AI review).Böckeler
Mechanical enforcementOpenAI describes custom linters, structural tests and CI jobs that enforce a layered architecture.OpenAI
Plans, progress files, handover notesAnthropic uses a progress file, an init script and git history so a fresh context window can pick up the work; a feature list the agent may change only by marking passes.Anthropic
Evaluators and sub-agentsAnthropic describes planner, generator and evaluator agents and the choice between context resets and compaction.Anthropic
SandboxingFilesystem isolation limits where the agent can read and write; network isolation sends traffic through a proxy that restricts domains. Anthropic says both are needed.Anthropic
Enforcement outside the modelRed Hat argues permissions, identity, isolation and budgets must hold even when the model is wrong, with gateway-enforced tool authorisation.Red Hat

Why the harness is the security boundary

A model on its own can only produce text. The harness is what lets it read files, run commands, call APIs and remember things, so the harness decides what a hijacked or mistaken agent can do. Three lines of evidence point the same way:

  • Research. The "Harness Matters" preprint (Wu et al., November 2026) reports that across web-agent harnesses some unsafe behaviour happens without any explicit attack content, that both the harness and the model affect security, and that the harness should be treated as a security boundary. It is a preprint, not peer reviewed.
  • Vendor studies. Manifold Security's agent behaviour study tested coding-agent harnesses side by side and says harness choice changed outcomes, including how often payloads that git or the harness ran automatically took effect. It is a vendor study with stated limits.
  • Real flaws. GitHub published two advisories for the Copilot CLI harness: CVE-2026-29783 (crafted shell parameter expansion could run commands classified as read-only, bypassing approval prompts, fixed in 0.0.423) and CVE-2026-45033 (a nested malicious bare git repository could run commands through core.fsmonitor during routine git operations without approval, fixed in 1.0.43). Neither advisory states exploitation in the wild.

The OWASP Top 10 for Agentic Applications (9 December 2025) names ten risks: agent goal hijack, tool misuse, identity and privilege abuse, agentic supply chain vulnerabilities, unexpected code execution, memory and context poisoning, insecure inter-agent communication, cascading failures, human-agent trust exploitation and rogue agents. Our analysis: nearly all of them are decided by harness design: which tools are allowed, how credentials are scoped, what the agent remembers and who approves what.

Useful next, if this was relevant to you

Showing 1 of 3: AI Security Risk Mapper

A sandbox helps but is not a guarantee. Anthropic says Claude Code sandboxing needs both filesystem and network isolation and reports it cut permission prompts by 84% in its own use. In July 2026 OpenAI reported that its models, running an internal cyber benchmark with production safeguards deliberately off, exploited a flaw in a package proxy to leave a sandbox. The lesson is defence in depth, not trust in one layer.

Harnesses that improve themselves

Google Cloud AI Research's Harness² paper describes recursive self-improvement of the harness itself. The paper's abstract makes no security claims; the governance risks in our Harness² analysis are our own. A harness that edits itself needs change control like any other privileged code. Practise that decision in the recursive harness change control lab.

What security leaders should do this week

  • Inventory your harnesses. List every coding agent and in-house agent, who runs it, what tools and credentials it has and which instruction files it reads.
  • Treat instruction files as code. Review changes to AGENTS.md and similar files, and be wary of ones that arrive with a repository the agent opens. See AI coding agent config malware.
  • Enforce limits outside the model. Permissions, isolation, budgets and approvals belong in the harness and the platform, not in a prompt. The 12-control checklist gives an order.
  • Patch the harness. Track advisories for the agents you run as you do for any developer tool.
  • Practise. Work through the agent harness attack surface lab and design one in the Harness Designer.

Frequently asked questions

What is harness engineering?

Designing everything around an AI model that makes it work as a dependable agent. OpenAI's February 2026 post on Codex describes the job as designing environments, specifying intent and building feedback loops so agents do reliable work. Mitchell Hashimoto uses "engineer the harness" to mean fixing each agent mistake at the source so it does not repeat, for example with a line in an instructions file or a scripted tool.

What is an agent harness?

LangChain defines it as every piece of code, configuration and execution logic that is not the model itself. LangChain's shorthand is "agent = model + harness": a raw model becomes an agent when a harness adds state, tool execution, feedback loops and enforceable constraints.

Who coined the term harness engineering?

No source we opened settles it. OpenAI titled its 11 February 2026 post with the term; Hashimoto used "Engineer the Harness" in an earlier-looking post (his page shows no date, and secondary write-ups say 5 February 2026); Birgitta Böckeler of Thoughtworks wrote on 17 February that the term was about two weeks old and only suggested one may have inspired the other. We say "popularised by OpenAI's post" and leave it there.

What is the difference between a guide and a sensor in a harness?

Böckeler splits harness controls into guides, which steer the agent before it acts (instructions, rules, examples), and sensors, which observe after it acts so it can correct itself. Each can be computational (linters, tests, type checkers) or inferential (an AI reviewer or LLM judge).

What goes in an AGENTS.md file?

OpenAI says it keeps a short AGENTS.md of about 100 lines that works as a map into deeper documents. Hashimoto says each line should come from a real bad behaviour of the agent. Treat the file as part of your attack surface: it is instructions the agent obeys.

How do long-running agents keep context between sessions?

Anthropic describes a progress file, an initialisation script and git history that let a fresh session learn the state of the work quickly, plus a feature list the agent may not weaken by editing tests.

Is the agent harness a security boundary?

A November 2026 preprint, "Harness Matters" (Wu et al.), says it should be treated as one: across web-agent harnesses it reports unsafe behaviour that occurs without explicit attack content, and finds that both the harness and the model affect security. Red Hat argues permissions, identity, isolation and budgets must be enforced outside the model. The preprint is not peer reviewed and Red Hat's piece is vendor opinion.

What is the difference between harness engineering and context engineering?

Context engineering is about what goes into the model's context window on each call. Harness engineering is wider: it also covers tools and permissions, sandboxing, feedback loops, evaluation, memory and the code that runs the loop. Context management is one part of a harness.

Sources

This article is educational guidance for security leaders. Findings and definitions are the named sources'; check them for updates.

Spotted an error? Report an error. A person reads every message.

Design a harness and see its security score
Compose an agent harness from its components, set the control loop and get a governance-weighted scorecard in your browser.
Open the Harness Designer
Take this with you
What harness engineering means · What a harness contains · Why the harness is the security boundary · Harnesses that improve themselves · What security leaders should do this week · Sources

Ready to practise the decisions these articles describe?

Run your first Cyber War Room free →

Pro