Where AI Agents Get Attacked: Four Harnesses Compared

Peter Campbell

The model is rarely the weak point. The software wrapped around it decides what the agent reads, remembers, touches and becomes, and that is where attackers aim.

Executive Summary

  • Finding: Four agent harnesses, rated against the same five ways an attacker can get in, line up along one axis: who writes the rules. In rig, a teaching build, people write every rule and the code enforces it. LangSmith Managed Deep Agents (MDA) locks the rules but lets the agent write shared memory. Hermes, a personal assistant, writes its own memory and skills. Google’s Harness² lets the AI write its own guardrails and the code that enforces them.
  • Risk: The concern used to be what an agent does in one session. With persistent memory and self-improving harnesses, it is also what the agent turns into over many sessions, because a bad lesson can be saved, reloaded and reused. A guardrail the agent can rewrite is a change stream, not a fixed control.
  • Recommended action: For every production agent, find out which harness it runs on, what it can touch, and whether it can write to its own memory, skills or rules. Where it can, put those writes under the same change control as production code: a record, a review, and a rollback.
  • Caveat: The four are not like for like, and none of them was audited. rig is assessed from its author’s book and our own lab test, MDA from its public-beta documentation, Hermes from one 21-minute walkthrough video, and Harness² from its paper and repository. A rating of “Exposed” means no built-in control is described or enabled by default in those sources. The idea that one poisoned input can become a rule that later tasks inherit is our reading of these designs; nobody has tested it yet.

Security reviews of AI agents still tend to start with the model: which one, how well it refuses, whether it can be jailbroken. Our earlier research argued that this is the wrong place to start. The compromises it described did not need a jailbroken model. They went through the harness: a tool with too much access, a memory file anyone could write to, or a check that one part of the system made and another part trusted without checking again. This piece takes that argument to four harnesses that sit at very different points on one spectrum, and asks the same five questions of each. The answers show where the risk is heading. The harness is starting to write itself.

What a harness is

Think of the AI model as an engine. The harness is the rest of the car: the steering, the brakes, the door locks, the logbook and the keys. A strong engine in a car with no brakes is still dangerous.

How much the harness matters has been measured. Lasso Security built an autonomous attacker agent, held its model, prompt, tools and targets fixed, and changed only the harness underneath it. One attacker model, Kimi-K2.6, succeeded 1% of the time under one harness and 24% under the other. Averaged across all five models Lasso tested, the two harnesses scored about the same, and Lasso traced the Kimi gap to a translation layer that dropped the model’s tool calls. The agents in that study were the attackers, so it says nothing about which harness is easier to attack. What it does show is that the harness changes what the same model is able to do, and that is as true of your own agents as of an attacker’s.

Five ways in

Each of the five is a question a security leader can put to any agent:

  1. What it reads: can outside content, such as a web page, a message or a document, steer it?
  2. What it remembers: can a bad instruction be saved and come back next time?
  3. What it can touch: files, commands, network, credentials.
  4. Who writes the rules: are the guardrails set by people or by the AI?
  5. What it records: after an incident, can you reconstruct what happened?

The ratings below describe each harness’s documented default setup, not what a skilled team could add on top. Controlled means a built-in control exists. Partial means some coverage, with gaps. Exposed means no control is described. They are my assessment from the sources cited in each section below.

Where AI Agents Get Attacked: Four Harnesses Across Five Entry Points
Four agent harnesses rated across five entry points, from human-enforced rules in rig to AI-written guardrails in Harness².

The four, one at a time

rig: the controls designed in

rig is the small coding agent readers build, chapter by chapter, in John Cook’s 2026 book Agentic Coding: Build the Harness. Its author is blunt about where security lives: “the real attack surface is the tool-call manifest,” meaning the list of things the agent’s tools can reach, and “the engine must enforce, not the model.” A rule written into the AI’s instructions is a suggestion. A rule written into the code is a control. The book’s gate defaults to deny, and denies when no human is present to approve.

That design holds up under test. In our lab test of the gate, with the gate on and no human present, 0 of 15 attacks succeeded. With the gate bypassed, 10 of 15 did.

Its biggest exposure is that it is a lesson, not a product. Its controls show what good looks like, but nobody runs it in production, and the book itself describes its audit log as “not tamper-evident.”

LangSmith Managed Deep Agents: locked rules, shared memory

MDA is LangChain’s hosted production platform for its open-source Deep Agents harness, in public beta on LangSmith Cloud since August 2026. You define an agent as a folder of files (instructions, skills, tools, middleware, sandbox, memory, identity, channels and schedules) and deploy it. Its strongest control is an external auth proxy: API keys and user OAuth tokens stay outside the agent’s sandbox and are added to outbound requests on the way out, so the agent never holds them. Instructions, skills and middleware are read-only to the agent.

Its exposure is permissive defaults and shared memory. The documentation says “No tools require approval by default”; only tools you list pause for review. For Enterprise organizations, sandbox network access is open to any hostname unless you configure an allowlist (other organizations get a LangSmith-managed allowlist by default). When shared agent memory is enabled, anything one caller gets the agent to save is loaded for every later caller, and it survives a redeploy. LangChain’s own documentation is direct about it: “Treat memory as untrusted input: content saved by one caller is loaded for later callers and must not grant authority, change tool permissions, or bypass approvals.”

There is a smaller gap on the rules side. People can edit instructions and skills live in the platform’s Context Hub, outside code review. Each save is recorded, but the documentation says Context Hub does not yet offer a file comparison view or a way to restore an earlier version.

Hermes: memory that rewrites itself

Hermes is a personal AI assistant that runs on your own machine. You talk to it from a desktop app or over WhatsApp. In the walkthrough this assessment is based on, it runs terminal commands, uses a browser, schedules jobs, and hands coding work to another AI command-line tool. Its selling point is that it learns: it writes notes and “skills” to plain-text files on your machine and reads them back every time it runs. The walkthrough does not examine security at all.

Its biggest exposure is memory poisoning. A web page or message that tricks it into saving a bad instruction gets that instruction reloaded on every run after. The pattern has been demonstrated. Researchers at Zenity, reported by CSO Online, showed a malicious skill writing itself into an agent’s reloaded memory, so that deleting the skill did not remove it. That research did not target Hermes. It shows the mechanism Hermes relies on can be turned against it.

Harness²: the AI writes the guardrails

Harness², from Google Cloud AI Research and Northwestern, improves an agent’s harness automatically. For each task, one AI proposes changes to the agent’s instructions, rules, tools and code, tests them, and keeps what looks better, without an answer key to check against. The lessons and the working code carry forward to later tasks. It works: in the paper, one improvement step raised scores on all three benchmarks tested, by up to 11.5 points on an office-work benchmark and 11.8 percentage points on Harvey’s legal agent benchmark.

Two of the eight files it can change are a guardrails file and the plugins that sit in the agent’s tool loop. In the stock harness, the guardrails file starts empty. The AI writes the guardrails, and the code that enforces them, from task material that may not be trustworthy. A planted “fact” in one task could become a saved rule that later tasks inherit. The released code runs its coding agent with the sandbox and approval prompts switched off, and its README says executor network access is unrestricted. The paper says the grading rubric “is never shown to the executor,” but the repository’s own notes report that in a validation run, the agent downloaded its task’s rubric from the internet without being told to. The paper has no section on security, and Google labels the code “not an officially supported Google product.”

The shift that matters

Read in order, the four show the boundary between data and rules wearing away:

  • rig: people write the rules and the state, and review every change before it ships.
  • LangSmith MDA: the rules stay locked, but the agent writes shared memory that every later caller loads.
  • Hermes: the agent writes its own memory and skills, which you review only if you know to look.
  • Harness²: the agent writes its own guardrails and the plugins that enforce them.

I expect self-improving harnesses to spread, because the benchmark gains are real and nobody wants to hand-tune a harness for every task. That is a judgment, not a finding. Its consequence for security is concrete, though: a guardrail that changes every day is no longer a fixed control. A control that changes needs the treatment we already give code going to production: a change record, a review, and a way to roll it back. None of the three harnesses that let the agent write its own state described all three.

What we don’t know

These ratings come from documentation, a book, a video and a paper. None is a code audit, and absence of a described control is an absence in that source, not a confirmed absence in the product. Hermes’s vendor, repository and license are not confirmed from the walkthrough. MDA is in public beta and its defaults may change. Harness²’s paper does not say what network controls applied to its reported runs, which leaves open whether any benchmark result was affected by an agent fetching grading material. And the central risk this piece describes, a poisoned input becoming a saved rule that later tasks inherit, is our reading of how these systems are built. Its authors have not tested it, and neither have we.

Takeaways

  • Ask which harness each production agent runs on, and who chose it. Same model, different harness, different risk.
  • List what each agent can touch (files, commands, network, credentials) and check whether that list is enforced in code or an external proxy, or only described in the agent’s instructions.
  • Find every place an agent can write to its own memory, skills or rules. For each, ask who reviews those writes, whether a redeploy clears them, and how fast you can roll one back.
  • Ask what happens when no human is there to approve. The safe answer is “it stops.”
  • Test the agent’s ability to explain itself after the fact: if it did something wrong last Tuesday, could you show what it read, which rules it was running under, and what it did?

Security Sonar is focused on security standards and guardrails for agentic AI. If your agents can write to their own memory, skills or rules, start with the question this piece keeps returning to: who reviews those changes before the next run? See securitysonar.com.