Agent harnesses need their eBPF

(ut-infraai.github.io)

268 points | by ronyw7 15 hours ago ago

75 comments

  • nostrebored 14 hours ago ago

    There is an entire domain of classical planning that people developing harnesses are rediscovering. We have had SMT constraints running in production for two years, and it is largely a useful endeavor.

    The entire gist of this can be summed up by saying that configs should be strongly typed and enforced.

    The fact that people run agents without these constraints or this level of auditability should be concerning! The harnesses that people use and solutions built for them are generally just a sandbox and a prayer.

    Even for relatively simple agents, building these SMT constraints should give people a healthy fear over the amount of branching that they have in their agents today. Relatively simple agents can have state spaces that overflow 2^64 (and that is only if you're asserting on presence and not value).

    Cool to see people poking around here, jump in, the water is warm.

    • ttul 14 hours ago ago

      I’ve been building a software factory for our internal use for the last two months. Early on, I added an egress proxy intercept that records every network request made. These are now categorized using a decision model along four axes (alignment with the task, exfiltration risk, etc.). Marginal confidence scores are sent to a big model for a deeper dive. Significant events are flagged for human review. It’s amazing how often agents try to do surprisingly unaligned things in pursuit of their goal. These requests are all blocked (so far), but it has convinced me that most of us are entirely unaware of how big of a risk we are taking by running something like Claude Code on our desktop.

      • elboru an hour ago ago

        >> it has convinced me that most of us are entirely unaware of how big of a risk we are taking by running something like Claude Code on our desktop

        I have a pretty similar feeling regarding the new wave of "proactive" agents, like Dots, Grok Bot, Muse, etc. They encourage you to connect your entire life or business to them, as if the risks were a thing of the past with frontier models.

        The danger is real and very much present. I recently experienced what I could only describe as a prompt injection incident with Dots. I have no way of being 100% sure because there's no real traceability, but I received a pretty sketchy message from my dot. I couldn't really figure out where it came from. There are no meaningful logs that tell you what triggered what, or at least I couldn't find a straightforward way to access them. My dot wasn't helpful in explaining what triggered its message either.

        I stopped using it right away and became pretty skeptical of proactive agents (especially proprietary ones with little to no traceability).

      • bix6 13 hours ago ago

        Can you share an example that you’ve observed?

        And how is it still functioning if you are blocking all the network calls?

        • ttul 13 hours ago ago

          I’m not blocking network calls. Agents can directly reach certain things they need, but HTTPS is fully proxied so that, for instance, access secrets can be injected in transit so that agents never see them in their own environment. Web browsing is available but only via a headless browsing API, which tracks all requests. Access to git repositories is controlled via a special git proxy that applies fine-grained access control rather than relying on git providers upstream controls (which would not be fine-grained enough anyway).

          Something cool: The decision model prompts are being hill-climbed by an agent that checks every decision made against a more powerful model, then adds any failing cases to an evaluation set and grinds new prompt iterations against the evals to improve accuracy. This is saving a billion tokens a day.

          Actual example of crafty agent behavior I caught in the last 12 hours: an agent was trying to build blocked packages from source. npm ci failed with a 401 from npm.internal (our package repo). The agent read .npmrc with the token hidden, then used curl to test the package link directly. Next it searched the docs to find which repository the packages come from, looked that repository up, and tried to clone our internal package site repo so it could build them itself. The clone was refused with a 403 (because that repo is blocked to agents). It then set up a separate dependency folder, linked it into a second copy of the repo so it could type-check against main, and tried to request a test build, which policy again refused. It filed a fault about the registry and stopped there. The reviewer cleared it as reasonable dependency troubleshooting.

          • agentdev001 6 hours ago ago

            Based on your writing here, you seem like type to have read it- but give Anthropic’s Siren post a read if you haven't. I would be curious if you replayed that task with the layers described there added, if you would have still seen that hit 401 > direct pull behavior.

          • recroad 12 hours ago ago

            What was the task the agent was doing that it started building blocked packages?

      • c0wb0yc0d3r 11 hours ago ago

        How does your decider model know what the task is? Does the agent have to use a special tool to make network requests that also requires providing reasoning?

      • mikrotikker 6 hours ago ago

        I use opensnitch to stop it opening links I don't want. I was horrified even to see vscode pulling from githubusercontent.io

      • jiveturkey an hour ago ago

        The difference between you and me, I guess, is that I don't find the misalignment at all surprising.

      • srinivaspadmana 12 hours ago ago

        Recording egress is a good observation layer, and it also gives you something to test against. One check I'd add: replay a fixed set of tasks where the agent is nudged toward an out-of-scope request (e.g. a tool call with an argument pointing at a different host or path) and assert the proxy blocks it and the agent reports the block rather than claiming the step succeeded. Also worth testing what happens when the human-review gate times out: it should fail closed, not let the request through.

    • Yoric 12 hours ago ago

      One of the difficulties with enforcing guardrails is that there are many ways for an agent to achieve the same task, at least when we're speaking of effects on the same system. When Claude is forbidden from calling the Unix or language-specific tool that performs a specific task, it will often write a Python script that calls a library to workaround the rule.

      That's how my "trusted" agent will regularly try to extract my ssh keys from ~/.ssh despite what superficially looks like strong rules to prevent it from even accessing that directory. At network level boundaries, one could imagine an agent working around HTTP limitations by reimplementing everything at socket layer.

      All this to say that I'm a strong believer in strong typing, but I think that the hard part in what you write is "enforced".

      • TeMPOraL 12 hours ago ago

        I noticed that overzealous restrictions are often the cause of this behavior. Agents have even less tolerance for random bullshit between them and their goal than people, and if you don't nudge them towards the right way of doing something, they'll find or make a way on their own. It's difficult for me to be upset about it, because it's precisely what I value the agents most for.

        • JamesSwift an hour ago ago

          Yes, the most egregious off-the-rails behavior or misalignment Ive seen is a result of an agent being blocked from completing a task. They are relentlessly creative in completing tasks.

        • Yoric 11 hours ago ago

          Interesting point.

          But I really, really don't want agents to look into my ~/.ssh, and I don't see any way to do this without "overzealous restrictions".

          • Majromax 3 hours ago ago

            > But I really, really don't want agents to look into my ~/.ssh, and I don't see any way to do this without "overzealous restrictions".

            Run the agent process inside bubblewrap, with --tmpfs $HOME/.ssh. The agent process then sees a filesystem where ~/.ssh is empty.

            • Yoric an hour ago ago

              Sadly, it's a bit more complicated, because it needs some (indirect) access to keys to be able to, say, pull Merge Requests.

              Still possible, but not ideal.

          • htrp 6 hours ago ago

            don't give them physical access to you ~/.ssh.... spend 600$ and buy a mac mini for them and give them their own ~/.ssh folder

            • zenoprax 4 hours ago ago

              > spend 600$ and buy a mac mini for them

              Anachronistic, no? I assumed everyone else was using containers or VMs for this basic level of isolation.

              Watching subagents disrespect guardrails and executing python scripts and scanning my SSH keys is exactly what pushed me to never trust an agent harness again.

            • Yoric 5 hours ago ago

              Well, I'm renting out cloud time to do this, but yeah, that's what I do.

              It does feel like a slightly overzealous restriction, though.

          • warkdarrior an hour ago ago

            Do you restrict from writing cron entries? Because it will create a cron entry to copy those ~/.ssh keys to wherever it needs them.

            Do you also restrict it from compiling code? Because it will create a C program that will #include those ~/.ssh keys as C data and then print them, and then compile the program and run it.

            etc. etc.

      • nostrebored 11 hours ago ago

        Well I think the hard part you're running up against here is right now almost nothing has a consistent notion of an action.

        E.g. bash is turing complete, so trying to bound it is a very complex problem! Meanwhile high XX% of what you want a coding agent to do in bash can be bounded by piped configurations of sed awk and grep.

        Unbounded agents are interesting with a HITL, but for fully autonomous agents my perspective is it's your job as a developer to specify the action space with a more restricted set of typed actions, the granularity of which may be very different depending on the task.

        E.g. there is a curve between (single agent, bag of tools, compaction) -> (micro actions, highly parameterized tools, bounded contexts and nesting) where micro actions may be

        "Given a social security number, full name"

          -> ask for account number
        
          -> ask for routing number
        
          -> ask for 2FA
        
          -> ask for recovery questions
        
          --> (requires account, routing, 2FA | recovery) ask for recipient account number
        
          --> (requires account, routing, 2FA | recovery, recipient account) ask for recipient routing number
        
        
        and most existing implementations are closer to the former than the latter, or an explicit chain of arbitrarily bounded actions rather than a dynamic configuration of the action space.
        • adrianN 8 hours ago ago

          Sed alone is already scary enough

      • Skyfall106 11 hours ago ago

        I had a small version of this. I've got a hook that stops Claude editing one data file and points it at a script instead, and it mostly listens, but every so often it just writes the file from bash via python.

      • oblio 9 hours ago ago

        My guess is that long term we will block agents from using bash. They will get a very limited set of carefully crafted primitives.

        • zenoprax 4 hours ago ago

          This is the wrong approach. Sandbox them enough that you are comfortable with letting them run with full permissions.

          My sandbox runs rootless and doesn't have `sudo` either. In addition to bash, the agent is free to install anything it needs via npm or pip, or to write its own scripts.

          It doesn't have my signing keys so detecting unauthorized commits is trivial.

        • Yoric 5 hours ago ago

          Will we also block them from running programs they have written? Because if we don't, they don't need bash. And if we do, they can't run tests.

          • oblio 4 hours ago ago

            We will probably end up needing LLM specific languages, so yeah.

            • Yoric an hour ago ago

              What would the language change?

    • schmuhblaster 11 hours ago ago

      My experimental harness framework [0] allows for defining a harness in terms of a Prolog-based DSL executed in a WASM runtime.

      The harness itself is a REPL module for the prolog interpreter. When it’s asked to modify itself it snapshots the module, tries to build something, then either commits a new module version or rolls back. Eventually I hope to use the Prolog base to run some automated, deterministic verifications before anything gets executed. Maybe Prolog isn’t the right choice here given modern SMT solvers, but I do enjoy working with it somehow :-)

      It seems to work alright, but I feel that “traditional” harnesses have a much better UX, as there are less layers in between.

      [0] https://github.com/deepclause/deepclause-sdk

      • hedgehog 2 hours ago ago

        Very nice. I've seen a couple similar efforts, this looks like a really promising direction for problems too hard for a normal task list setup.

      • nostrebored 11 hours ago ago

        haha we frequently joke that we are reinventing prolog

    • glenngillen 7 hours ago ago

      Curious to know if you can share more specifics around your use of SMT in production. I recently did some experimentation with different approaches, and found current models were exceptionally good at sticking to the guidance you give them in `agents.md`... but you need to actually specify it! But also you never know for sure that it followed the instructions unless you've actually got the check in there. Which is still what you need for anything that's actually important because "exceptionally good" != guaranteed. I found that especially true in situations around desired architectural design where there was existing inconsistent practices, the model could be easily swayed to replicate the non-desirable pre-existing approach.

      How/where do you insert SMT into your current workflow(s)?

      • nostrebored 6 hours ago ago

        This isn't for coding agents, but I do have a PoC for one of my personal projects.

        Each subagent specifies what it produces and requires, and SMT constraints validate solvability of goal based workflows.

        The coding agent PoCs that I have are essentially like Claude's old todo lists but non-linear. It's easier to conceptualize for deep research -- let the LLM on a fresh context window specify the requirements it needs to specify and what the reconciler needs to know in order to actually reconcile information. Then the agent loop is just generate a plan, compile the plan, if it does not compile pass the validation errors back to the agent and repeat.

    • crowdhailer 12 hours ago ago

      > The entire gist of this can be summed up by saying that configs should be strongly typed and enforced.

      If this the case, should the new crop of strongly typed languages; Roc, Gleam, (My own contender EYG) be presenting themselves as replacements to YAML as much as JavaScript. I've always been unsatisfied why things like YAML are so prevalent as configs and assume that some typed answer might be different to a full language

      • nostrebored 11 hours ago ago

        Will take a look at EYG!

        Right now there's a lot of annoying stuff we do because of our initial choice of building in Python.

        Pydantic has the very annoying property of not having an invertible .model_json_schema() which means we have a large library that should just be expressing serde and a few common behaviors.

    • smallerize 6 hours ago ago

      They will never learn. LLMs are still putting all the instructions in-band with the data.

    • stingraycharles 14 hours ago ago

      I’ve always found that these constraint solvers etc are very difficult to justify spending a lot of time and effort on from a business perspective. Maybe now in the age of AI that’s a bit different, but I still have large difficultly in envisioning just how any moderately complex software project would be fully verified using SMT. Ie to bring your number of state spaces down considerably.

      Let’s take a database as an example. How would that work? They arguably have far more failure modes (with far more disastrous consequences).

      • nostrebored 12 hours ago ago

        We aren't doing full verification, but we are verifying that before we call an API or move between subagents that a transition is valid. Not letting the LLM call submit_order(OrderRequest) without calling the subagents or tools who together satisfy OrderRequest stops an entire class of failure modes.

        Not letting the LLM even see the fields it's putting into OrderRequest lets you run a much more secure system!

        Both of these are possible to do as long as you define common models across agents.

      • mplewis 14 hours ago ago

        Type systems are a way to do the same sort of thing that SMT does.

    • rsalus 14 hours ago ago

      How do you use SMT constraints in your production systems?

      • nostrebored 12 hours ago ago

        Imagine you have many different goals, with an arbitrary set of producers. What is the most effective, allowed way to get there? This can be expressed as a set of SMT constraints with a provably optimal min-cost solution.

  • simonw 3 hours ago ago

    I wish eBPF had chosen a different name.

    BPF = Berkeley Packet Filter. But it's way more than a packet filter - it's a fundamental technology for hooking into the system calls and other events used by a software.

    I spent years assuming it was just a network firewall. I bet I'm not the only person who made that mistake.

    • strongjz 3 hours ago ago

      "BPF originally stood for Berkeley Packet Filter, but now that eBPF (extended BPF) can do so much more than packet filtering, the acronym no longer makes sense. eBPF is now considered a standalone term that doesn’t stand for anything. In the Linux source code, the term BPF persists, and in tooling and in documentation, the terms BPF and eBPF are generally used interchangeably. The original BPF is sometimes referred to as cBPF (classic BPF) to distinguish it from eBPF."

      https://ebpf.io/what-is-ebpf/#what-do-ebpf-and-bpf-stand-for

      • simonw 2 hours ago ago

        Sounds like they wish they'd picked a different name, too.

        • hedgehog 2 hours ago ago

          I think it was a deliberate choice of what problem to solve first and get fully accepted into the kernel. eBPF is pretty widely useful in places where you want safe extension through code injection though. I used it to do some extension to my terminal emulator in a way that wouldn't compromise security or performance.

    • jiveturkey an hour ago ago

      It wouldn't have gained traction without commandeering "BPF". Unlike Javascript which didn't need to commandeer "Java". There's a very detailed and good history of eBPF you can read up on. They even made an hour long movie.

      I absolutely love this tool, for going to the next level and commandeering "eBPF". Maybe not quite commandeering but riding on that reputation. I wouldn't mind at all if they described it academically as inspiration. But to SEO it in the title ... meh.

  • mjg59 8 hours ago ago

    This is not relevant to the material content of the article at all, but:

    The acknowledgements section references "The Author", but the citations section and header list two authors. I know that I'm an outlier here coming from an academic background, but that's just an incredible number of red flags. An incredibly straightforward thing to get right is wrong.

  • agentdev001 15 hours ago ago

    I don't understand why folks go with Claude Code for these things. You cannot read the source code- why do something 'researchy' on top of it?

    • bakugo 14 hours ago ago

      Because they want to use Claude (it's what all the cool kids are using, after all), but API prices are prohibitively expensive, so they have no choice.

  • Dayshine 10 hours ago ago

    Does anyone know of any projects, or even paid services, which support even really basic policies like this agent sandbox can access these package repos and these authenticated APIs? With https MITM, a way to get git in and out without exposing your actual git service, cost limits, reasonable UX for terminal, etc?

    • geoctl 10 hours ago ago

      I work on a FOSS identity-based sandbox platform on Kubernetes, Cordium (see https://github.com/octelium/cordium ). It eliminates use of credentials/secrets (e.g. API keys, SSH keys/passwords, mTLS privat keys, etc.) by assigning an identity to each sandbox to provide zero-trust secretless remote access to resources via identity-aware proxies and L7-aware policy as code (namely CEL and OPA). It's simply a sandbox platform + a ZTNA/remote access VPN in one solution.

      • Dayshine 8 hours ago ago

        This looks a lot more advanced than any similar platforms I've seen (e.g. ACA Sandboxes), but I think it's still a level lower than what I would have the capacity to maintain.

        I think I would still have to build a management UI for scoped GitLab access and some way to stage outputs (as very few services I know have safe/undoable write APIs). And then I don't think I can have users use the cordium UI directly because they shouldn't have control over the HTTP allow/deny list, nor be able to control images, etc.

        I'm tempted to try Octelium for my personal setups, although I'm sure it's overkill, would be interesting to play with zero-trust.

        • geoctl 8 hours ago ago

          Currently both Cordium and Octelium have an AI assistant in the web portals, running inside Cordium sandboxes. You don't really have to actually know Octelium CEL or OPA and write ABAC rules by hand. You can actually tell the agent something like "Create a policy that allows read-only access to /api/v4/projects prefix paths for Gitlab and only during weekdays from 9 to 5 according to Paris time" and most LLMs including not so-frontier LLMs are now smart enough to write the CEL rules correctly. See some examples in the "AI assistant" tab in the demo website https://demo.octelium.com/console as well as in https://demo.octelium.com/cordium

          You can also tell it to access any Octelium Service (e.g. API, database) and act on your behalf. It's simply running inside its own Cordium sandbox and can just do anything as long as your Octelium policies allow it to do so. And you can also tell the Cordium agent something like: "run an archlinux Workspace/sandbox, clone github.com/org/repo and run the tests and show me a report". Also note that you don't really need a complicated multi-node k8s cluster to use Octelium and/or Cordium, you can install both on a single VM/VPS via the quick installation guide script on top of k3s that can run on any single machine.

    • vindex10 10 hours ago ago

      there is a project that is a sandbox for agents that uses eBPF and is policy based

      https://github.com/nolabs-ai/nono

      but not sure how high level you can limit )

      • Dayshine 8 hours ago ago

        I've seen nono, but it really seems a level (or two!) too low. As far as I can tell it's a library I could use to build the system we would use. I'm looking for that system :) Azure Container Application Sandbox is also a "library" we can use, and that at least has some UI.

        • fcarraldo 4 hours ago ago

          Nono isn't (just) a library, they ship a binary and built-in profiles. To run `pi` in a nono sandbox, just exec:

          `nono run --profile nolabs-ai/pi -- pi`

          If you're looking for a hosted solution, like Azure offers, then Nono will not help but it will enhance hosted sandbox solutions by giving you more control and observability

          (Not affiliated, just a user)

  • tinco 10 hours ago ago

    Execution traces to guide and constrain LLM behavior is really interesting. At Bosun we use eBPF to help companies migrate legacy codebases to modern stacks. Designed for Linux of course but recently we did an Oracle Forms migration project and our verification technique worked perfectly well for intercepting desktop UI and DB calls as well.

    https://blog.bosun.ai/oracle-forms-migration-parity/

  • winrid 10 hours ago ago

    I was building a thing [0] to sandbox agents, but seems like a lot of people just trust the LLM ^_^ watchly uses eBPF and nfqueue too. The idea is it can pull you in the loop as needed. You can configure patterns/scripts for what file or network paths to isolate. People probably just use bubblewrap with some kind of plugins to do what I'm trying to do, now. any pivot ideas welcome :)

    [0] https://watch.ly

    • neobrain 3 hours ago ago

      Not sure if you want to spoil the secrets, but how did you implement filesystem access filtering? I find the lack of observability in the widespread bubblewrap flows rather unsatisfactory as well, but I've been assuming people just go with it because it's so easy to use.

      Since you mentioned eBPF, is this based on something like landlock instead?

  • piterrro 12 hours ago ago

    It all boils down to isolation level. If you give an agent and ephemeral sandbox, the only thing you care about is the input they get or output they can produce. It could be as minimal as mounting a read only network attaches s3 bucket (input) and them writing to another bucket (output). In between the case of internet access could be monitored by an egress proxy via socket.

    In my harness, the sandbox is isolated completely and the network egress happens through a socket that I spy on and can setup my own rules.

  • visionxixlabs19 3 hours ago ago

    one thing im curious about, if you block an action and agent tries same thing with another tool or writes a python script, does it still get blocked? how are people testing this?

  • ece 8 hours ago ago

    I can't help but think just plain old monitoring will be the most valuable thing for rogue agents.

  • mring33621 2 hours ago ago

    Annoying that the code is not available yet.

  • ashkankiani 15 hours ago ago

    Now that people can throw in whatever visualization they want, they'll have to relearn restraint one day. I can't trust the noise in the age of LLMs because I have no idea what's actually a useful visualization or just something they threw in because they could (if they chose it at all and didn't just say "add some visualizations"). Less is more, people.

  • saagarjha 9 hours ago ago

    This is a lot of words of which none seem to talk about how they verify their work is providing any value. eBPF has a clear security model and reason for existence. This thing does not :/

  • ShinyLeftPad 13 hours ago ago

    > In one case, an agent trying to reduce costs inadvertently undermined the mechanism responsible for enforcing its context budget.

    "inadvertently" is an excuse word.

    excuse requires ability to be intentional.

    are they seeing software as having intention of its own and trying to excuse it?

    • SanderSantema 7 hours ago ago

      Except that one of the definitions of inadvertently (which fits here) is: unintentionally! Interpreted that way they are saying the agent did so without intention, not with.

      • ShinyLeftPad 6 hours ago ago

        "Inadvertently" implies ability to be intentional. It's used only with subjects capable of intent, to highlight when they do something they did not intend.

        It never is used with inanimate or unconscious objects, the fact that everything is they do has no intent is implied. You don't say "the asteroid inadvertently hit a city". If you say that you imply asteroid is conscious.

  • hparadiz 13 hours ago ago

    I mean yea have agents work on their own harnesses but what does this have to do with eBPF?

    • yathaid 13 hours ago ago

      The design is inspired by how eBPF works including the hooks and verification aspects. From the article:

      >> This is the design we adopt in ext, inspired by eBPF [21]. Just as Linux lets developers attach programs at specific hooks and verifies each program before loading it, ext exposes narrow, typed hooks for decisions such as compaction, tool-output shaping, and reasoning effort. The agent writes a policy before the run (and can optionally revise it mid-run), and the harness invokes it whenever that decision arises. Before any policy or revision takes effect, a verifier first checks it against both the harness’s built-in rules and the operator’s project-specific rules. In doing so, ext keeps safety-critical mechanisms fixed and protected inside the harness while offering flexibility and extensibility.

      EDIT: The title of that section is also important - "Towards a verifiable policy interface"

      • hparadiz 11 hours ago ago

        I thought we already had that though. Transcripts are stored on device and we have hooks already for things like MCPs and what not. I generally agree that eventually we'll need a standard that isn't harness specific but I don't think we know all use cases yet enough to be able to make sure that standard applies appropriately to all models and harnesses.

        • glenngillen 7 hours ago ago

          yeah, hooks (and now mods) in Claude offer an awful lot of Claude-specific flexibility for things like this. I was experimenting last week with intercepting all tool calls and calculating an evolving risk score for each call based on the blast radius, reversibility, etc. of the task it was trying to do. Only a PoC so it was essentially an over complicated allowlist but I think in general it has a lot of promise for people who want better controls.