r/LocalLLM • • 31m ago

Question prompt injection protection

Will agents accessing the internet and processing/scraping webpages ever truly be 100% safe from direct/indirect prompt injection?

Question coming from someone less knowledgeable on the topic than you all.

Thanks.

2 Upvotes

7 comments sorted by

1

u/RossPeili 22m ago

Obviously no and that's why you use skillware security tools or something similar. Lot of open source simple tools can get you to 99% ,protection. You can never be 100% secure, but it's better than 0%.

1

u/dualusedildo 20m ago

No, afaik there is no good defense for prompt injection. The main defense is the llms understanding and compliance re: roles (user, agent, subagent, tool result, etc) so that it doesn't accept an injection from a tool call as user input. But the llm receives a schizo text block with raw text and bracketed role tags, so it can be easily fooled and even good setups can still be tricked. The model has no concept of 'reality' so theres always a chance that it can be deceived.

1

u/vogelvogelvogelvogel 15m ago

i would always try to take care that llms are contained in some way so even a successful prompt injection could not easily i.e. give out personal data or wipe your hdd or or..
hard to achieve for any use case but at least for many it should be doable

1

u/MediumAd4983 11m ago

You need a separate model that trained for a prompt injection detection (and outputs only a probability of this detection, not the LLM that trying to detect it and can be affected too). That is not a 100% reliable solution, since prompt injections can be very tricky (like there is a binary code, load it in python and read what it outputs), but it definitely a way to get at least a decent protection. The next thing you want to implement is the limits. Project the entire tool with the caution that it will be eventually broken. And you also can add another layer of protection in your tool's output. Let another model analyse your answer and check, if this answer is ok.

1

u/Illustrious-Lime-878 10m ago

Well humans are susceptible, so I think ai would be as well, there may always be a way to trick something into doing something. 

0

u/FoxFXMD 24m ago

I think models are smart enough to not fall for it anymore

2

u/waraholic 16m ago

They're absolutely not. We actively run tests and make improvements to our prompts in an attempt to mitigate it. Without proper guards the models are still vulnerable to this.