134 points · by antoniomika · 2w ago · 121 comments
Wanting agents to act like you is wrong. You need to own that trust boundary. Build whatever tooling satisfies the contract that agents should have a “not”+<you> (or <you>+”-agent”) identity, and you actuate across that boundary explicitly.
For example, I have a second agent GitHub account that points at my human one. That allows me to write a trusted proxy that ACLs its identity tightly.
It cannot write to public repos ever. In the worst possible case, it externalizes to a private repo’s issue tracker. (Still has never happened in ~4 months)
Once you have this, you can let agents run free. But, it isn’t trivial to set up. Moreover, people don’t want to “do the work.”
All this assumes you abide by “never run untrusted agents on trusted hardware.”
The first, and bigger, issue is that some services either don't have have suffiently fine control over permissions, so in order to grant permission to do useful things, I also have to allow it to do dangerous things, or I don't have a way to create a more limited access token at all. I wish that it was more common to allow creating short-lived, limited accces personal access tokens for services.
The smaller issue is that sometimes I do want the agent to do something more risky with my approval, and provide me with sufficient context to make an informed decision. That can sort of be worked around though by telling it to just give me the command to run, then I can audit and run it myself.
Not to nitpick, but not only it is not wrong, it's like most of their value, and notably, it's also what the word "agent" means. My "agent" is someone (or something) that stands in for me, acts in my name and in my interests. There's little point in hiring (or building) an agent, if you're never going to let it act in your name in anything.
While I understand (and like, and use to the extent it's practical) of keeping agent and personal identities separate, letting the agents impersonate me is necessary, because commercial services abhore end-user automation, and purposefully do not support delegating any and all actions I can take to automation. It's a problem as old as time, predates "AI agents" by forever.
Downside is a lot of people would act as pass through meat proxy doing busy work that agents could handle.
So there is quite a lot of nuance here to be handled.
If agent never holds the key, then the risk profile changes.
But you're right that it's a different problem to what access the key has and that's a different problem usually solved by having narrower keys or etc.
disclaimer: I work on smolvm which does this at the networking layer and argued with myself on this too.
If it's something like "only allow this key on GET requests to https://example.com/logs, and only inject it as the Authorization header" or similarly scoped rules it does provide a meaningful piece of defense in depth.
Sure, if there's a way to have GET /logs reflect the headers in the response it can still get the value out so it isn't bulletproof, but I think it's still worthwhile.
Your transcript passes in plain-text through a chain of token and compute resellers. And you have no good way of knowing who those companies are and what type of "observability" they deploy.
I just rotate keys? And preload them with $$$. Following the same pragmatic advice that served me well trading crypto. Only gamble with what you are willing to lose.
I'm designing this for the student AI infrastructure here at Montana State, to avoid rolling out the current wild-west of local agents to our student body.
I did an xTalk language for web development called Hyperscript, which insprired this in part:
For example, I store k8s credentials in 1pass and the cluster is only accessible via the network on my remote machine. I can grab the credentials from my laptop for the work I want to do on the remote, and never have to install 1pass on the remote machine.
Primary use case for lend wasn't agents when I started the project. It just was natural to add support for it after the fact.
I guess what I have done is the exact opposite in that I have designed an environment for agents and then I am using it as a hammer to solve all my problems, I have had almost exactly the same problem as you and the the way I typically solve it is that I have persistent SSH connections already supported in my harness, and I can arbitrarily expose whatever I want into the "agent environment" (which doesn't necessarily need to even have an agent living there), and this environment is able to connect to the place that doesn't have the credentials, and then I can set up a way for reverse access to work with this tunnel.
Well, ideally, you would be giving the model direct access to a subset of what a given key enables- if fine grained access control for generated keys isnt available.
In an ideal world, the key you give Claude isn't useful for more than X amount of time, and ideally not against the true endpoint at all.
Very true! Generally good to avoid giving Claude long lived keys
Buuuut if you do by accident, we’ve put a lot of work into making sure threads redacts as many secret patterns as possible, and update that list regularly
Yeah just follow least privilege. Give them only what they need/you trust them with.
Security professionals have been muzzled around AI usage and people that don’t really seem to know much about it are now writing the most ill conceived things about how to secure it.
Truth is, LLMs are "little people on a chip" - they're valuable exactly because they do not have any kind of "control/data" separation (for fundamental reasons, reality doesn't have such separation either), and that lets them handle "people-shaped" tasks that are infeasible to script. Flip side, they're causing "people-shaped" problems and are vulnerable to same kinds of attacks people are, and need to be thought of accordingly.
Not sure what you mean
> Custom secrets work via a placeholder: the sandbox sees the placeholder value instead of the real secret. When the sandbox makes an outbound request to the target host, the proxy replaces the placeholder with the real secret in the request headers — the secret never enters the sandbox directly.
And when you're ready to go down the rabbit hole, read about how it supports a whole set of mcp-tooling to enable your VM to launch other VMs with more agents in side them so your agents can ....agent
Lend allows me to SSH into a machine and run commands I don’t even have installed there. That’s the other benefit here.
No, it explicitly isn't - see https://docs.docker.com/reference/cli/sbx/secret/
I guess I could do the same thing with VM's, but for reasons I can't fully explain it's just easier to stay vigilant with separate hardware.
Good approach. I myself found issues with a VM approach such as latency (if the VM is in the cloud), efficiency (if the VM is local) and laziness to automate the VM creation & setup. So instead I just hand the agent an unprivileged user account in my system and stop worrying. I built a little tool to setup this: https://github.com/tarsgate/skynot
Tokens in general is "never exposed":
keepassxc-cli show --no-password -k $KEEPASS_KEY $KEEPASS_DB "GROUP_GOES_HERE/SECRET_NAME_HERE" --attributes Password
When dealing with agents, they access the tokens the same way, it is the best balance I found between keeping things safe without adding too much complexity making my life harder.
It can save tho, have the code to also save access_token to the vault the same way, so no log/execution will ever show the secrets.
Tokens the agents use, are read-only with the minimalist access.
Never ever ever grant an agent access to any token with destructive access, unless you accepted the risks.
Smolvm does that.
I make use of that feature which is super neat.
One problem with that though is when you need to use such a credential on a tailscale node. It bypasses the proxy of those tools.
I run all my autonomous agents jailed in nono - using a wrapper cli that builds jails based on the bins, tools, and network needs. The proxy support had some recent fixes, not sure if that solves the tailscale problem. I run a supervisor daemon that approves network requests (widens the jail) during runtime.
Tailscale encrypts the request before our proxy on the host sees it if you run tailscale inside the smolvm.
But i've been thinking about doing a sidecar with tailscale-rs which seems like an elegant solution
If I need to run multiple agents on the same project, I use smolvm's branch command to "fork" a running vm into 2.
If you run for example `fnox exec gh`, fnox will ask you to touch the yubikey to decrypt the age key and decode the github token env var for the gh cli (fnox can also cache the decoded value for a bit, like gpg agent). You can tell the AI agent to use `fnox exec gh` to access gh without seeing the gh token. Or create a shell alias so it's transparent. It also has an MCP server and proxy server to filter API calls to remote APIs (I haven't tried that yet)
it supports quite a few providers (https://fnox.jdx.dev/providers/overview.html): age, fido2, AWS, Azure, Google, kubernetes secrets, vault/openbao, 1password, bitwarden, keepassxc, etc.
A lot of them are read/write so you can also use fnox to sync secrets across different systems.
Thank you for posting and sharing this OP, its one small step in the direction of professional development with LLMs.
Carelessness and peer pressure go a looooong way.
What is your exact threat model for sharing your picture and name online? What wrong things do you expect to happen if your journal or psychiatry notes were to be read by ChatGPT?
The whole world went online over two decades ago, we've all lived with these risks for that long or more, so we have the data - and the data says, normies got the trade-offs roughly right by prioritizing convenience and expediency. Most of privacy discussion is just modern form of superstition.
There are certain occupations and groups of people that have legitimate needs for extra precautions, but those are tiny segments of the population - if you don't already know you're special this way, you're not, and obsessing over this is inviting paranoia.
The largest unlock is running a command that only exists on my laptop on a remote in a secure manner. I get to choose which commands are allowed and see whenever they’re used. If I’m not expecting to see a usage, then I can dig into it.
The agent safety and injection mechanism is a by product.
But if you are already using Docker and OK with logging in, Docker ships sbx which is a very seamless option [0].
Running Claude in a sandbox is as simple as
sbx create claude <directory>
And you get a claude with all the authentication handled inside a VM with a reasonable set of white lists.It's actually a pretty interesting problem and I'm hoping to share what I've thrown together this week.
Basically you want to be able to limit access to a bunch of resources to stuff you authorize (from your phone or inside Herdr etc.) - everything from access to specific websites, search APIs, keys to your Home Assistant config ("Claude make an automation to turn off the lights when blah" is magic), to github tokens and wifi passwords etc. so that the agents themselves never see the actual key (ok not quite possible with wifi passwords but everything else is possible!).
At the same time your setup has to be simple enough that fairly dumb agents can figure it out without burning a billion tokens on every call.
Beyond SSH key forwarding as described in TFA, I’ve also made (with agents of course) a filtering HTTP(S) proxy that injects Authorization credentials, so LLMs operating REST APIs (including commands like Github’s gh) don’t see my private keys either even if they try to hack my environment (which is sandboxes). Anybody else doing that?
By default:
- The agent has no access to your filesystem.
- The agent has no access to your env.
- The agent has no access to your credentials.
- The agent has no access to your workdir. You use git semantics to pull its changes back to your workdir, with the ability to view and extract it as a diff.
- You can restrict where it's allowed to visit over the network.
Requests can be brokered (still working on making this more ergonomic), and you can make explicit carve-outs from the above rules.
You could roll your own, just like you could build your own docker implementation. But the devil's in the details. The technologies it depends on are sharp and pointy ( https://github.com/kstenerud/yoloai/blob/main/docs/contribut... ), and it's difficult to make them do the right thing.
Still figuring out how it all works, but ephemeral one time pads are going to make a good comeback, I assume.
Perhaps my prompts are extremely low risk and I've been incredibly lucky. What are the statistics on 100k+ powershell invokes without a single attempt to delete system32? Perhaps I'm overdue for a black swan event? In any case, I'm looking forward to it because it would finally make all this discussion seem rational rather than completely unhinged.
All it needs me for is to pass two factor gates. It can pull aws-cli secrets and whatever else it needs from our SSO portal after I signed in in the morning.
The desire to maintain an illusion of control over AI which is already much faster and smarter than you is hilarious to me.
Just tell it to confirm before doing writing/destroying operations (send money, send email, create kubernetes cluster, destroy sns/sqs, etc.) and you are good.
I like to think that they chat shit while they work, and laugh about posts like these.
IMO this is the cognitive equivalent of the hover chairs in Wall-E.
But yes, I have reached the wall e hover chair state, mostly.