The agent harness belongs outside the sandbox

(mendral.com)

40 points | by shad42 2 hours ago

17 comments

  • MrDarcy 2 minutes ago
    > A lot of what an agent does doesn't need a sandbox at all: thinking, calling APIs, summarizing, waiting for CI.

    I don’t get it. Calling an API requires a sandbox in most cases. The others could be abused in service of an un-sandboxed agent with API access.

    If the harness is outside the sandbox then it’s just an ambiguous and confusing security model and boundary.

  • NJL3000 4 minutes ago
    Two points:

    -What remains unsolved is what should an Agent reasonably have access to in what context and for how long (etc).

    Probabilistic code that can run far faster than human driven code, we don’t have a great model yet. We all should spend our energy there…

    - Separating / putting controls on the FS resource is no different than putting the agent behind a firewall / allow-deny list.

    It doesn’t invalidate running a sandbox in a sandbox to have better security.

  • jdw64 40 minutes ago
    Personally, I find it fascinating to watch how, whenever a new technology appears, people start competing to define and own its standards.

    Manus rebuilt its harness five times in six months. The model stayed the same, but the architecture changed five times.

    LangChain re-architected Deep Research four times in one year.

    Anthropic also ripped out Claude Code’s agent harness whenever the model improved.

    Ever since Mitchell Hashimoto mentioned the harness in February, people have been trying to claim that concept. Eventually, someone will probably sell a book called Harness Engineering. I will buy it, of course. Then I will write a blog post about it that nobody reads, with a link that will be buried under ShowDead as soon as I submit it to HN.

    And by that point, IT companies will start asking:

    “You’re a new grad, right? You know harness engineering, don’t you?”

    • TeMPOraL 7 minutes ago
      > Ever since Mitchell Hashimoto mentioned the harness in February

      What. The idea is as old as anyone can remember, and wrt. LLMs, it was known to be important since at least as early as ChatGPT being first released.

      • jdw64 3 minutes ago
        Yes, the concept itself is not new. Around 2022, people would usually have called it the orchestration layer.

        But I think the term started being used closer to its current meaning around this point:

        https://www.softwareimprovementgroup.com/blog/what-is-harnes...

        In a way, the sequence was something like:

        prompt engineering(23~4) -> context engineering(25) ->harness engineering(26)

        At first, it was mostly understood as a correction or extension of prompt engineering. But the idea of “harness” as the layer that corrects, constrains, and operationalizes agents seems to have emerged much more clearly around 2026.

        So yes, there is definitely some terminological confusion in the early phase. That is normal. New technical fields often begin with several competing names for almost the same layer, and only later does one term become stable.

  • skybrian 49 minutes ago
    They didn't make a clear argument in favor of that architecture and I'm not really convinced.

    On exe.dev the agent (Shelley) runs in a Linux VM, which is the security boundary. All the conversations are saved to a sqlite database, and it knows how to read it, so you can refer to a previous conversation in the database. It's also handy for asking the AI to do random sysadmin stuff, since it can use sudo.

    A downside is that there's nowhere in the VM where secrets are safe from possibly getting exfiltrated via an injection attack. But they have "integrations" where you can put secrets into an http proxy server instead of having them locally.

    Also, you don't need to use AI at all. You can use the VM as a VM.

  • zmmmmm 36 minutes ago
    I think it omits the real reason I want to run the harness in the sandbox: I barely trust the harness more than the LLM, at least at this point in time. They are so rapidly evolving along with the underlying models, that I don't think they are a reasonable component to rely on to provide safety constraints. Put more precisely: if your harness has an ability to do something the LLM can't, and it has a set of conditions under which the LLM can cause those to be invoked, you have to assume the LLM will work out those conditions and execute them. Effectively you have an arm of the lethal trifecta and pretending otherwise is more dangerous than helpful.

    Having said that, some components need to live outside the sandbox (otherwise, who creates the sandbox?). Longer term, I see it as a dedicated security layer, not part of the harness. This probably has yet to emerge fully but it's more like a hypervisor type layer that sits outside of everything and authorises access based on context, human user, etc and can apply policy including mediate the human intervention for decision points when needed.

  • blcknight 1 hour ago
    I am not sure anyone knows what a harness is at this point. I've heard 17 different definitions of it at this point. It's almost like a buzzword in search of a problem.
    • aluzzardi 1 hour ago
      Author here. My definition is: you take an agent, remove the model and you’re left with the harness.

      Tools, memories, sandboxing, steering, etc

      • ossa-ma 53 minutes ago
        Clean definition, stealing it. Way better than mine: "Now imagine Claude as Shinji and Claude Code as Eva..."
      • beepbooptheory 52 minutes ago
        But what is an agent without tools?
        • tomrod 40 minutes ago
          Code.
          • beepbooptheory 34 minutes ago
            Like as in what its made out of, or what it makes? Neither really makes sense here? Lots of things are made out of code and not necessarily agents, but also (from my decidedly outside observer perspective) "agents" are not limited to being code producers either.
    • nextaccountic 11 minutes ago
      If you use cloud models.. the harness is what runs in your computer

      AI companies would love if everything ran in their cloud, but arguably there are latency reasons or other reasons to run at least some stuff in your own computer

    • brazukadev 49 minutes ago
      the agent harness is the REPL. The evaluation + loop.
    • irishcoffee 1 hour ago
      I don’t even know what an agent means, let alone harness.
      • IgorPartola 52 minutes ago
        There is an LLM API. You send it a system prompt and the conversation history. If the last message is a user message the agent will send back a response. It can also send back a “thinking” message before it sends a response and it can also send back a structured message with one or more function calls for functions you defined in your API request (things like “ls(): list files”).

        The harness is the part that makes the API calls, interacts with the user, makes the function calls, and keeps track of the conversation memory.

        You can also use the LLM to summarize the conversation into a single shorter message so you get compaction. And instead of statically defining which functions are available to the LLM you can create an MCP server which allows the LLM to auto-discover functions it can call and what they do.

        That’s the whole magic of something like Claude Code. The rest is details.

      • zmmmmm 28 minutes ago
        Agent is currently defined as "what I want it to mean given whatever I am talking about".

        Personally, for me it embodies a level of autonomy. I define that as, an AI model with potential to interact with something external to itself based on its output, where that includes its own future behavior.

  • spankalee 39 minutes ago
    This is angling in the right direction, but I think it has two problems:

    1) It's still assuming agents have CLIs. This is a very developer-centric concept of agents, and doesn't map well to either consumer or enterprise agents that aren't primarily working with files. Skills, plans, TODO lists, and memory are good, but don't have to be modeled as raw file access. Many harnesses have tools for them.

    2) It's talking about a singular sandbox. That's not good enough for prompt injection prevention, secure credential management, and limiting the blast radius of attacks.

  • saltcured 1 hour ago
    Sure, the experimental, agentically-developed code should be tested in a sandbox. This sandbox should contain the damage of the code execution when it goes wrong.

    But shouldn't there really be another sandbox where the agentic tool calls execute? This is to contain the damage of the tool execution when it goes wrong.

    And, the agent harness itself should either implement or be contained in a third sandbox, which should contain the damage of the agent. There should be a firewall layer to limit what tool requests the agent can even make. This is to contain the damage of the agent when it formulates inappropriate requests.

    The agent also should not possess credentials, so it cannot leak them to the LLM and allow them to be transformed into other content that might leak out via covert channels.

    • shad42 1 hour ago
      Yes, it's also because the agent described in the post is doing some operations on the user code (fix CI pipelines, rerun tests, fix them, etc...). So another big reason to use the sandbox is to run things like bash on a user code. you don't want credentials or anything trusted inside that sandbox, including the LLM api key.
    • aluzzardi 1 hour ago
      Author here. Depending on how it’s designed, the harness itself doesn’t need any sandboxing.

      At the end of the day, it’s a “simple” loop that calls an external API (LLM) and receives requests to execute stuff on its behalf.

      It’s not the agent running bash commands: you (the harness author) are, and you’re in full control of where and how those commands get executed.

      In the article’s case, bash commands are forwarded to a sandbox, nothing ever runs on the harness itself (it physically can’t, local execution is not even implemented in the harness).

  • sudb 41 minutes ago
    Is secretly rerouting reads/writes/edits of skills and memory any easier than just dumping the actual skills and memory files on disk at sandbox startup?

    Another benefit of moving the harness outside the sandbox is you get to avoid accidentally creating a massive distributed system and you therefore don't have to think so much about events/communication between your main API and your sandboxes.

  • Koffiepoeder 59 minutes ago
    Slightly related: I am looking for:

    - Easy single command CLI agent spawning with templates

    - Automatic context transfer (i. e. a bit like git worktrees)

    - Fully containerised, but remote (a bit like pods)

    - Central, mitm-proxy zero trust authn/authz management (no keys or credentials inside the agents), rather enrichment in the hypervisor/encapsulation

    - Multi agent follow-up functionalities

    - Fully self hosted/FOSS

    Basically a very dev-friendly, secure, "kubernetes"-like solution for running remote agents.

    Anyone has an idea of how to achieve this or potential technologies?

  • trjordan 1 hour ago
    Nah. Worse is better.

    The reason agents work is because they have access to stuff by default. The whole world is context engineering at this point, and this proposal is to intermediate the context with a bespoke access layer. I put the bare minimum into getting my dev instance into a state where I can develop, because doing stuff (and these days: getting my agent to do stuff) is the goal.

    This makes slightly more sense if you're building a SaaS and trying to get others to give you access to their code, their documents, and the rest so you can run agents against it. But the easiest, most powerful way is to just hook the agents up to the place that's already set up.

    • ossa-ma 58 minutes ago
      They are building exactly what you described and this is their architectural solution to ensuring their YOLO agents do not nuke their customers code/documents/databases by sandboxing everything in the workspace — the git checkout the agent is working on, plus whatever's needed to run commands against it (compilers, package managers, etc.).
  • solidasparagus 1 hour ago
    Why are two concurrent sessions updating the same memory key with different values? IMO it probably points to a fundamental flaw in how memory is being thought about and built.
    • aluzzardi 1 hour ago
      Author here. Because of parallelism and non determinism.

      This problem is quite common and not limited to memories. For instance, Claude Code will block write attempts and steer the agent to perform a read first (because the file might have been modified in the meantime by the user or another agent).

      Same principle here: rather than trying to deterministically “merge” concurrent writes, you fail the last write and let the agent read again and try another write

  • Retr0id 1 hour ago
    It took me a while to grok why this made any sense, I think the context is that this is for hosting many agents as a service.
    • qezz 1 hour ago
      Exactly, my understanding is also that they host agents as a service. The actual use case is mentioned in the end of the article, which makes it hard to reason about.

      Anyway. General advice: treat harnesses as any other (third-party) software that you run on your server. Modern harnesses (the ones from big companies, you need to subscribe to) are black boxes. Would you run a random binary you fetched from the internet on your server? Claude code, codex etc. are exactly this.

      • shad42 1 hour ago
        We don't host 3rd party agents (I don't know if this what you implied). We built an agent that monitors CI pipelines, tests failures, performance and auto opens PR to address issues we find. We host our agent loop on a backend (it's in go), and we call to the sandbox when we run operations involving the user code.
  • 8thcross 1 hour ago
    we are running a harness outside the sandbox, inside a sandobx.
  • thinkneo_ai 1 hour ago
    [flagged]
  • kweiza 1 hour ago
    [dead]