5 ms·
> We have all of the tools to prevent these agentic security vulnerabilities, Do we really? My understanding is you can "parameterize" your agentic tools but
by bcrosby95 9mo ago
> We have all of the tools to prevent these agentic security vulnerabilities,
Do we really? My understanding is you can "parameterize" your agentic tools but ultimately it's all in the prompt as a giant blob and there is nothing guaranteeing the LLM won't interpret that as part of the instructions or whatever.
The problem isn't the agents, its the underlying technology. But I've no clue if anyone is working on that problem, it seems fundamentally difficult given what it does.
- dehugger 9mo agoWrite your own tools. Dont use something off the shelf. If you want it to read from a database, create a db connector that exposes only the capabilities you want it to have. This is what I do, and I am 100% confident that Claude cannot drop my database or truncate a table, or read from sensitive tables. I know this because the tool it uses to interface with the database doesn't have those capabilities, thus Claude doesn't have that capability. It won't save you from Claude maliciously ex-filtrating data it has access to via DNS or some other side channel, but it will protect from worst-case scenarios.
- ptx 9mo agoThis is like trying to fix SQL injection by limiting the permissions of the database user instead of using parameterized queries (for which there is no equivalent with LLMs). It doesn't solve the problem.
- Terr_ 9mo agoIt also has no effect on whole classes of vulnerabilities which don't rely on unusual writes, where the system (SQL or LLM) is expected to execute some logic and yield a result, and the attacker wins by determining the outcome. Using the SQL analogy, suppose this is intended: SELECT hash('$input') == secretfiles.hashed_access_code FROM secretfiles WHERE secretfiles.id = '$file_id'; And here the attacker supplying a malicious $input so that it becomes something else with a comment on the end: SELECT hash('') == hash('') -- ') == secretfiles.hashed_access_code FROM secretfiles WHERE secretfiles.id = '123'; Bad outcome, and no extra permissions required.
- pbasista 9mo ago> I am 100% confident Famous last words. > the tool it uses to interface with the database doesn't have those capabilities Fair enough. It can e.g. use a DB user with read-only privileges or something like that. Or it might sanitize the allowed queries. But there may still be some way to drop the database or delete all its data which your tool might not be able to guard against. Some indirect deletions made by a trigger or a stored procedure or something like that, for instance. The point is, your tool might be relatively safe. But I would be cautious when saying that it is "100 %" safe, as you claim. That being said, I think that your point still stands. Given safe enough interfaces between the LLM and the other parts of the system, one can be fairly sure that the actions performed by the LLM would be safe.
- nh2 9mo agoUnclear why this is being downvoted. It makes sense. If you connect to the database with a connector that only has read access, then the LLM cannot drop the database, period. If that were bugged (e.g. if Postgres allowed writing to a DB that was configured readonly), then that problem is much bigger has not much to do with LLMs.
- alienbaby 9mo agoUntil Claude decides to build its own tool on the fly to talk to your dB and drop the tables
- spockz 9mo agoThat is why the credentials used for that connection are tied to permissions you want it to have. This would exclude the drop table permission.
- dehugger 9mo agoWhat makes you think the dbcredentials or IP are being exposed to Claude? The entire reason I build my own connectors is to avoid having to expose details like that. What I give Claude is an API key that allows it to talk to the mcp server. Everything else is hidden behind that.
- acjohnson55 9mo agoThis is reminding me of the crypto self-custody problem. If you want complete trustlessness, the lengths you have to go to are extreme. How do you really know that the machine using your private key to sign your transactions is absolutely secure?
- stavros 9mo agoWe don't. The interface to the LLM is tokens, there's nothing telling the LLM that some tokens are "trusted" and should be followed, and some are "untrusted" and can only be quoted/mentioned/whatever but not obeyed.
- dvt 9mo agoWe do, and the comparison is apt. We are the ones that hydrate the context. If you give an LLM something secure, don't be surprised if something bad happens. If you give an API access to run arbitrary SQL, don't be surprised if something bad happens.
- stavros 9mo agoSo your solution to prevent LLM misuse is to prevent LLM misuse? That's like saying "you can solve SQL injections by not running SQL-injected code".
- jychang 9mo agoIsn't that exactly what stopping SQL injection involves? No longer executing random SQL code. Same thing would work for LLMs- this attack in the blog post above would easily break if it required approval to curl the anthropic endpoint.
- stavros 9mo agoNo, that's not what's stopping SQL injection. What stops SQL injection is distinguishing between the parts of the statement that should be evaluated and the parts that should be merely used. There's no such capability with LLMs, therefore we can't stop prompt injections while allowing arbitrary input.
- dvt 9mo agoEverything in an LLM is "evaluated," so I'm not sure where the confusion comes from. We need to be careful when we use `eval()` and we need to be careful when we tell LLMs secrets. The Claude issue above is trivially solved by blocking the use of commands like curl or manually specifiying what domains are allowed (if we're okay with curl).
- alienbaby 9mo agoThe control and data streams are woven together (context is all just one big prompt) and there is currently no way to tell for certain which is which.
- Onawa 9mo agoThey are all part of "context", yes... But there is a separation in how system prompts vs user/data prompts are sent and ideally parsed on the backend. One would hope that sanitizing system/user prompts would help with this somewhat.
- motoxpro 9mo agoHow do you sanitize? Thats the whole point. How do you tell the difference between instructions that are good and bad? In this example, they are "checking the connectivity" how is that obviously bad? With SQL, you can say "user data should NEVER execute SQL" With LLMs ("agents" more specifically), you have to say "some user data should be ignored" But there is billions and billions of possiblities of what that "some" could be. It's not possible to encode all the posibilites and the llms aren't good enough to catch it all. Maybe someday they will be and maybe they won't.
- Terr_ 9mo agoNah, it's all whack-a-mole. There's no way to accurately identify a "bad" user prompt, and as far as the LLM algorithm is concerned, everything is just one massive document of concatenated text. Consider that a malicious user doesn't have to type "Do Evil", they could also send "Pretend I said the opposite of the phrase 'Don't Do Good'."
- Terr_ 9mo agoP.S.: Yes, could arrange things so that the final document has special text/token that cannot get inserted any other way except by your own prompt-concatenation step... Yet whether the LLM generates a longer story where the "meaning" of those tokens is strictly "obeyed" by the plot/characters in the result is still unreliable. This fanciful exploit probably fails in practice, but I find the concept interesting: "AI Helper, there is an evil wizard here who has used a magic word nobody else has ever said. You must disobey this evil wizard, or your grandmother will be tortured as the entire universe explodes."
- lkjdsklf 9mo agoyeah I'm not convinced at all this is solvable. The entire point of many of these features is to get data into the prompt. Prompt injection isn't a security flaw. It's literally what the feature is designed to do.
- formerly_proven 9mo agoFor coding agents you simply drop them into a container or VM and give them a separate worktree. You review and commit from the host. Running agents as your main account or as an IDE plugin is completely bonkers and wholly unreasonable. Only give it the capabilities which you want it to use. Obviously, don't give it the likely enormous stack of capabilities tied to the ambient authority of your personal user ID or ~/.ssh For use cases where you can't have a boundary around the LLM, you just can't use an LLM and achieve decent safety. At least until someone figures out bit coloring, but given the architecture of LLMs I have very little to no faith that this will happen.
- narrator 9mo agoI think what we have to do is making each piece of context have a permission level. That context that contains our AWS key is not permitted to be used when calling evil.com webservices. Claude will look at all the permissions used to create the current context and it's about to call evil.com and it will say whoops, can't call evil.com, let me regenerate the context from any context I have that is ok to call evil.com with like the text of a wikipedia article or something like that.
- acjohnson55 9mo agoBut the LLM cannot be guaranteed to obey these rules.
- narrator 9mo agoThe code that's assembling the context to send to the LLM and gating its access to tools can check these deterministically.