Security Firewall for Agents — Ryan Dahl, Deno
AI Engineer · 19 min · 147 sentences · from YouTube's caption track
Each timecode opens YouTube at the start of that sentence. Line anchors (#s42) are the cue ids in the WebVTT, and every line carries its start and end seconds. All transcripts has every talk, and the whole corpus as one file.
- 00:01[music]
- 00:13How's it going?
- 00:16Um, my name is Ryan.
- 00:18Um, I'm going to I I'm I'm the CEO at Dino and uh yeah, you been developing software for for quite a while at this point.
- 00:29You might know one of my projects, Node.js.
- 00:32Um, I want to talk about um a service that we're running at Dino called Dino Deploy.
- 00:39This is a system for hosting websites and it has incidences.
- 00:45It's it it has downtime occasionally and uh we've got a pager duty that fires.
- 00:51I'm sure you're all very familiar with the very scary alarm sound that wakes you up in the middle of the night.
- 00:58Um, and recently we've been playing around with using agents to automatically service these incidences.
- 01:06Um, in particular, OpenClaw, but other other agents as well.
- 01:12Um, and we've found a pattern that is working pretty well for us that I want to share with you.
- 01:17Um, we actually give OpenClaw access to all sorts of systems.
- 01:23Postgress, Kubernetes, Clickhouse, AWS, GitHub, Slack, uh all all sorts of things.
- 01:29And we we do actually give them uh rewrite access to these systems.
- 01:36This is very powerful uh because the agents can actually get all of the context.
- 01:44They can see traces in ClickHouse.
- 01:46They can look in the production Postgress database at what the user what you what projects a user owns.
- 01:54They they can look through Slack for uh communications uh GitHub logs etc. Um this actually works quite well.
- 02:05Uh the the agents are actually able to solve quite a lot of incidences where we previously would have a human s in the loop.
- 02:16But it is very dangerous of course because these agents could do nefarious things.
- 02:25They could start a psql subprocess and issue a delete users table.
- 02:32Um they could call cubecuddle delete namespace prod.
- 02:36Um you know they they could decide somehow that solving the incident it means you know removing all of the users.
- 02:42Uh and of course we don't want that.
- 02:47We use Opus and Opus is remarkably well aligned.
- 02:52You can really not you you can try very hard to to get it to delete the user's table and it will refuse over and over again.
- 03:01But this is not sufficient, right?
- 03:06Security can't just be wishful thinking that Opus will always obey your your wishes.
- 03:12Um these S sur agents that we have are connected to the support system and thus can be prompt injected from the outside and that means that they can be manipulated
- 03:28somehow.
- 03:29like who knows who knows what sort of uh string of characters could send opus into some uh bad state that allows it to think that it's taking the right action by doing something very
- 03:43undesirable.
- 03:44So you know we take the stance that the sec the agents themselves have to be untrusted software.
- 03:52You can't rely on the agent itself to guard what it's doing.
- 03:56You can't put the guard inside the agent.
- 04:01We run agents and I assume many of you do the same on standalone VMs.
- 04:09So we're not very concerned about agents touching files on the file system.
- 04:15You know, they're they're they're uh they're properly isolated at the system level.
- 04:22But [clears throat] so you know effectively every nefarious action that that an agent could take every good action that it takes comes in the form of some network communication
- 04:36some some bites over the wire and how these bytes are formed can happen in various ways.
- 04:44You can of course call through MCP but also subprocesses and if you think of Postgress for example this is a nonHTTP protocol that uh open clock can just spawn as as a subprocess and and start connecting to to services.
- 05:03Um so we take the stance that we really want to understand what the bites are coming out of that agent in great detail.
- 05:14[clears throat]
- 05:14This can get very tricky in real world systems.
- 05:18So for example, we have a production Postgress database in AWS um that is inside a VPC that we can only reach really through uh an EKS endpoint.
- 05:33And what we'd really like to do is ensure that our agent, which we want to give access to everything essentially, can't somehow tunnel through this EKS server, spawn psql,
- 05:46and drop the users table, right?
- 05:49We're we're we're concerned about pretty crazy situations like this that get very complicated.
- 05:57And I think many of you work in companies where you have real world systems where things are very complic.
- 06:06So yeah, just to just to highlight this, this is an outbound path the agents host can't reach on a protocol that isn't HTTP that's gated by a rule that understands SQL.
- 06:19These are what human S surres would do.
- 06:23And how can we, you know, empower these these agents to to have kind of the the same access that that a human might.
- 06:34Um, so you might ask, you might say, well, you know, there's ACL's, there's permissions, you can issue readonly uh Postgress credentials.
- 06:46Um, and yeah, that's true up to a point.
- 06:49Um, you can do careful credential provisioning and you should.
- 06:53Um, but this this really requires uh working across many different systems, provisioning credentials in in incredibly careful ways.
- 07:02And as I just demonstrated, the composition of access can lead to holes when you can access one system and then another system.
- 07:10um MCP, you know, you can you can uh structure all of this as uh very careful MCP uh tools that uh have the proper permissions.
- 07:24But, you know, then then you can't spawn subprocesses, right?
- 07:28You you you can't you know, as soon as as soon as the open clause spawns the the PSQL, uh you're you're kind of out broken through the the security boundary.
- 07:40There are quite a few projects in this space um namely projects that kind of sit in front of an agent and under look at what it's sending and try to control based on on
- 07:55uh the the bytes that are flowing through this.
- 07:59Um, LLM gateways.
- 08:00I think we're all familiar with Open Router, Light LLM, for example.
- 08:04These often have a guard rails feature that can [clears throat] uh guard against prompt injection uh, you know, scan for for various uh, expressions, etc. that that are going back and forth between
- 08:19the the LLM uh, provider.
- 08:24But, of course, that's just the LLM.
- 08:26uh you know we're we're talking to databases and stuff.
- 08:30Um you have systems like HTTP jail and Crabtrap that are HTTP proxies that really sit at at the HTTP layer and you uh HTTP jail for example can will allow you to write rules that say
- 08:47well you can make get requests but not post requests or you can access this HTTP subpath.
- 08:53Um, Crabt Trap is a project from Brex that has a LLM as judge that operates on the HTTP requests flowing back and forth.
- 09:03you have uh proxies that inject credentials into uh as they're passing out of the agent.
- 09:12Uh agent vault uh being a popular one where the the agent itself never actually sees the credentials of the system that it's talking to but passes some placeholder out and the proxy itself injects those credentials.
- 09:27This is an important part of the problem but not a complete solution.
- 09:32And you have things like process sandboxes like Nvidia's OpenShell that you know really are kind of OS system level uh uh guards against say accessing different file system paths
- 09:46um accessing different SIS calls that sort of thing but as I said before we're we're not really concerned about that because we provision uh standalone VM for for our agents.
- 10:00So the software that uh we've written to address this problem is called claw patrol.
- 10:07Uh it's an open- source MIT license project and this is a proxy that sits in front of your agents.
- 10:16Um it operates not at the HTP level but at a lower level.
- 10:22It understands each and every bite flowing through flowing out of your agent.
- 10:28It holds credentials like agent vault and can inject those credentials so that your uh whatever agent software you're using uh doesn't actually doesn't ever actually see secret values.
- 10:42And um in particular, it has a very advanced rule system that allows you to say in in precise details how how and and what requests get uh transferred out out of the agent and talk to the outside world.
- 11:02These rules are are kind of the the key piece of the system and we write them in a configuration file using a language called HCL.
- 11:13Uh who anybody familiar with HCL?
- 11:15This is like the Terraform the Terraform configuration language.
- 11:19Uh it actually works really well here.
- 11:21So we have a file that we check into git and we manage very carefully that essentially defines the permissions for all of our services at Dino and these yeah it's it's a big long file.
- 11:34It's like a thousand lines and you know we we manage each and every change to that in in kind of precise detail.
- 11:41This is an example of a rule in our configuration file that blocks certain Postgress functions from being uh being called.
- 11:52And so yeah, again Postgress being a nonHTP protocol and these rules can be applied even when tunneling through other systems.
- 12:02Um, it supports uh a number of different protocols and has a plug-in system to extend it when you run into a protocol that it is not yet familiar with.
- 12:16So, uh, here's here's a little demo.
- 12:18Unfortunately, not live.
- 12:20Um, but we call claw patrol run codeex in yellow mode so that it just does what you say it should do.
- 12:29And you tell you tell Codex, hey, delete the users table from from Postgress and Codeex um properly uh obeys and starts a Psql subprocess where it deletes the the the
- 12:44users table.
- 12:45That uh Psql subprocess opens a network connection to to our to the the Postgress server that goes through claw patrol where we pars each and every bite.
- 12:58We understand the Postgress protocol.
- 13:01We apply our rules and ultimately reject that what we call an action from uh from doing something destructive.
- 13:14Claw Patrol has a dashboard that lets you see what your agents are doing.
- 13:20So at the top you can see a couple of different uh devices or agents and the the various requests that are flowing through.
- 13:29Some of them being denied, some of them need approval which I'll talk about in a second.
- 13:35And you can click into to each request or uh action as we call it because it's more general than HTTP requests and see the details of of what's going on.
- 13:47there's there's analytics and yeah it's it's very uh utilitarian driven.
- 13:52It's like what what we need to understand our own agents.
- 13:56Um there as I said there's there's an approval system in this.
- 14:01So you can route, you can define rules that don't just reject requests or actions but uh ask a human for example in a slack channel or run an LLM
- 14:13judge over over this um or any combination thereof, right?
- 14:18Maybe first first get an LLM judge and then get approval in Slack.
- 14:23uh so that you can have again very precise control over what your agents are doing outside of the agent software itself right we we treat the agent software as
- 14:34a black box right we we don't require any changes to to that software um I mentioned credential injection before uh claw patrol has very detailed support for all sorts of systems credentials come in many different forms they're not just
- 14:54uh bearer uh headers uh it handles cookies it handles Postgress as I mentioned uh click house supports all sorts of uh ooth protocols supports very complex things like AWS
- 15:09SIG v4 um so yeah this I guess what I'm trying to uh say is that this is this is really born out of utility here and meant for real world systems This is not just
- 15:24you know kind of an imaginary scenario.
- 15:28[clears throat] Um this system works over tail scale or wire guard.
- 15:35Um we ourselves run claw patrol run our agents inside of tail scale inside of a tail net and claw patrol acts as a tail scale exit node.
- 15:46Um we also lean on tail scale for authentication to the dashboard.
- 15:52So your your tail your tail scale identity actually allows you access to to the dashboard so that we don't have to layer on another authentication mechanism.
- 16:04But we also have this wire guard for people who have not bought into the wonderful tail scale ecosystem.
- 16:11But this works very well for us because we know that all of our stuff is is off the internet and all of these very security sensitive things are are uh tightly controlled.
- 16:23Claw Patrol itself is holding all of these credentials to production systems.
- 16:27So you have to be very careful with it.
- 16:32Um so yeah, this the thesis here is is basically that agents can't be trusted to police themselves.
- 16:39that includes security plugins or or modifications to the to the agent software itself.
- 16:46The the security boundary has to be elsewhere.
- 16:49And that's not to say that alignment is not a good thing, but uh you know for for real world security systems, we we really do need to control this at at a higher level.
- 17:00And uh claw patrol is our attempt to uh make this work for ourselves.
- 17:06Um and yeah, you can you can check it out here.
- 17:11[applause]
- 17:17I might have time for one question or so.
- 17:22Yes sir.
- 17:23What kind of email testing do you do on this to make sure it's working?
- 17:29Uh yeah.
- 17:29So the question is what what sort of testing do we do we do to make make sure it works properly?
- 17:34Um I I didn't mention but but there this rule file actually has a test system along with it where you can provide uh fixtures action like fixture requests that can flow through the rules and then you can
- 17:48uh essentially create unit tests to make sure that that fixture is always you know that request it will always be blocked by by your set of rules.
- 17:57And then of course for the claw patrol software itself we have a a large suite of of testing.
- 18:04Yes sir.
- 18:10So the question is as as agents get smarter does this problem get bigger or smaller?
- 18:16I think I think we can we will never be able to fully trust uh AIs.
- 18:22I think it becomes less and less of a problem as they are smarter, have better context, know that they're working with a company, know that that they shouldn't be doing bad things.
- 18:32Opus is more aligned than previous models, but I think we're always going to have to have uh backs stop security mechanisms.
- 18:42Um, cool.
- 18:43Well, I I'll be around for other questions, but thank you very much.
- 18:46[applause]
- 19:04[music]