upvote
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.
reply
Can you share an example that you’ve observed?

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

reply
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.

reply
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.
reply
What was the task the agent was doing that it started building blocked packages?
reply
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?
reply
I use opensnitch to stop it opening links I don't want. I was horrified even to see vscode pulling from githubusercontent.io
reply
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.
reply
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".

reply
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.
reply
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".

reply
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
reply
> 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.

reply
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.

reply
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.
reply
Sed alone is already scary enough
reply
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.
reply
My guess is that long term we will block agents from using bash. They will get a very limited set of carefully crafted primitives.
reply
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.
reply
[dead]
reply
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

reply
haha we frequently joke that we are reinventing prolog
reply
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)?

reply
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.

reply
> 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

reply
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.

reply
They will never learn. LLMs are still putting all the instructions in-band with the data.
reply
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).

reply
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.

reply
Type systems are a way to do the same sort of thing that SMT does.
reply
How do you use SMT constraints in your production systems?
reply
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.
reply