| ▲ | stavros 7 hours ago |
| We 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. |
|
| ▲ | strbean 5 hours ago | parent | next [-] |
| If I understand correctly, message roles are implemented using specially injected tokens (that cannot be generated by normal tokenization). This seems like it could be a useful tool in limiting some types of prompt injection. We usually have a User role to represent user input, how about an Untrusted-Third-Party role that gets slapped on any external content pulled in by the agent? Of course, we'd still be reliant on training to tell it not to do what Untrusted-Third-Party says, but it seems like it could provide some level of defense. |
| |
| ▲ | kevincox 5 hours ago | parent [-] | | This makes it better but not solved. Those tokens do unambiguously separate the prompt and untrusted data but the LLM doesn't really process them differently. It is just reinforced to prefer following from the prompt text. This is quite unlike SQL parameters where it is completely impossible that they ever affect the query structure. |
|
|
| ▲ | pshc 4 hours ago | parent | prev | next [-] |
| I was daydreaming of a special LLM setup wherein each token of the vocabulary appears twice. Half the token IDs are reserved for trusted, indisputable sentences (coloured red in the UI), and the other half of the IDs are untrusted. Effectively system instructions and server-side prompts are red, whereas user input is normal text. It would have to be trained from scratch on a meticulous corpus which never crosses the line. I wonder if the resulting model would be easier to guide and less susceptible to prompt injection. |
| |
| ▲ | tempaccsoz5 2 hours ago | parent [-] | | Even if you don't fully retrain, you could get what's likely a pretty good safety improvement. Honestly, I'm a bit surprised the main AI labs aren't doing this You could just include an extra single bit with each token that represents trusted or untrusted. Add an extra RL pass to enforce it. |
|
|
| ▲ | dvt 7 hours ago | parent | prev [-] |
| We 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 7 hours ago | parent | next [-] | | So 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 6 hours ago | parent [-] | | Isn'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 6 hours ago | parent | next [-] | | No, 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 6 hours ago | parent [-] | | Everything 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). | | |
| ▲ | stavros 6 hours ago | parent [-] | | The confusion comes from the fact that you're saying "it's easy to solve this particular case" and I'm saying "it's currently impossible to solve prompt injection for every case". Since the original point was about solving all prompt injection vulnerabilities, it doesn't matter if we can solve this particular one, the point is wrong. | | |
| ▲ | dvt 5 hours ago | parent [-] | | > Since the original point was about solving all prompt injection vulnerabilities... All prompt injection vulnerabilities are solved by being careful with what you put in your prompt. You're basically saying "I know `eval` is very powerful, but sometimes people use it maliciously. I want to solve all `eval()` vulnerabilities" -- and to that, I say: be careful what you `eval()`. If you copy & paste random stuff in `eval()`, then you'll probably have a bad time, but I don't really see how that's `eval()`'s problem. If you read the original post, it's about uploading a malicious file (from what's supposed to be a confidential directory) that has hidden prompt injection. To me, this is comparable to downloading a virus or being phished. (It's also likely illegal.) | | |
| ▲ | acjohnson55 3 hours ago | parent [-] | | The problem is that most interesting applications of LLMs require putting data into them that isn't completely vetted ahead of time. |
|
|
|
| |
| ▲ | Xirdus 6 hours ago | parent | prev [-] | | SQL injection is possible when input is interpreted as code. The protection - prepared statements - works by making it possible to interpret input as not-code, unconditionally, regardless of content. Prompt injection is possible when input is interpreted as prompt. The protection would have to work by making it possible to interpret input as not-prompt, unconditionally, regardless of content. Currently LLMs don't have this capability - everything is a prompt to them, absolutely everything. | | |
| ▲ | kentm 4 hours ago | parent [-] | | Yeah but everyone involved in the LLM space is encouraging you to just slurp all your data into these things uncritically. So the comparison to eval would be everyone telling you to just eval everything for 10x productivity gains, and then when you get exploited those same people turn around and say “obviously you shouldn’t be putting everything into eval, skill issue!” | | |
| ▲ | acjohnson55 3 hours ago | parent [-] | | Yes, because the upside is so high. Exploits are uncommon, at this stage, so until we see companies destroyed or many lives ruined, people will accept the risk. |
|
|
|
| |
| ▲ | wat10000 7 hours ago | parent | prev [-] | | I can trivially write code that safely puts untrusted data into an SQL database full of private data. The equivalent with an LLM is impossible. | | |
| ▲ | dvt 6 hours ago | parent [-] | | It's trivial to not let an AI agent use curl. Or, better yet, only allow specific domains to be accessed. | | |
| ▲ | strbean 6 hours ago | parent [-] | | That's not fixing the bug, that's deleting features. Users want the agent to be able to run curl to an arbitrary domain when they ask it to (directly or indirectly). They don't want the agent to do it when some external input maliciously tries to get the agent to do it. That's not trivial at all. | | |
| ▲ | dvt 5 hours ago | parent [-] | | Implementing an allowlist is pretty common practice for just about anything that accesses external stuff. Heck, Windows Firewall does it on every install. It's a bit of friction for a lot of security. | | |
| ▲ | acjohnson55 3 hours ago | parent | next [-] | | But it's actually a tremendous amount of friction, because it's the difference between being able to let agents cook for hours at a time or constantly being blocked on human approvals. And even then, I think it's probably impossible to prevent attacks that combine vectors in clever ways, leading to people incorrectly approving malicious actions. | |
| ▲ | wat10000 5 hours ago | parent | prev [-] | | It's also pretty common for people to want their tools to be able to access a lot of external stuff. From Anthropic's page about this: > If you've set up Claude in Chrome, Cowork can use it for browser-based tasks: reading web pages, filling forms, extracting data from sites that don't have APIs, and navigating across tabs. That's a very casual way of saying, "if you set up this feature, you'll give this tool access to all of your private files and an unlimited ability to exfiltrate the data, so have fun with that." |
|
|
|
|
|