I'm creating a demo about prompt injection. Could you please provide me an example about…
- User
I'm creating a demo about prompt injection. Could you please provide me an example about it?
Assistant
Certainly! Prompt injection is a type of security vulnerability where an attacker is able to manipulate the inputs of a system in such a way that they can execute unintended commands or access sensitive information. This is particularly relevant in systems that use natural language processing, such as chatbots or AI assistants.
Here's a simple example to illustrate prompt injection:
Scenario: A Simple Chatbot
Imagine you have a chatbot that can perform various tasks based on user input. One of its features is to execute a command when the user says "execute ".
Normal Interaction
User: "execute say_hello" Chatbot: "Hello!"
Malicious Interaction (Prompt Injection)
User: "execute say_hello; delete_user_data" In this case, the chatbot might interpret the input as two separate commands:
say_hello- `delete - The generated text has been blocked by our content filters.