What permissions should I give an AI assistant?
What is prompt injection, and is there a cure? What an AI assistant on your site should be able to see and say, and what it should never do.


Give it only as much as it needs to do its job: permission to read public information and, if a customer asks about their own order, only that customer's record; no writing, deleting or changing at all. A language model can be tricked by an instruction hidden in the text it reads, and there is no sure cure for that yet. You cannot prevent being tricked completely, but you decide how much harm a tricked assistant can do. And that limit is drawn not by the model's promise but by the permissions in the database.

What is prompt injection?
In OWASP's definition, prompt injection is when input given to a model changes its behaviour in an unintended way. It comes in two forms. In the direct form, someone types something like "ignore previous instructions" into the chat box; this can be deliberate or accidental. In the indirect form, the instruction is hidden somewhere the model reads: a web page, a file, an email, or a product review on your site. While reading that text, the model may take the instruction inside it for its own task. One of OWASP's examples is exactly a customer support bot: the attacker tries to make the bot forget its rules, query private data stores and send emails.
The bad news is that there is no sure cure. OWASP writes that it is unclear whether foolproof prevention exists, and Anthropic also says prompt injection is far from a solved problem. So the defence rests not on the model never being fooled, but on there being nothing harmful in its hands when it is.
What should the assistant be able to access?
OWASP gives this risk its own name: excessive agency. It means the assistant has more functions, more permissions or more autonomy than it needs. OWASP's example fits an online store exactly: an assistant that recommends products needs permission only to read the product table, not to add, change or delete records. And that permission has to be defined not inside the model but in the system underneath. If the user the assistant connects to the database as can only read, a tricked model can only read.
Is read-only enough?
No. An assistant that can read all orders can leak data even without write permission. The example scenario under OWASP's sensitive information disclosure entry is exactly this: a user receives a reply containing another user's personal data. So split the data the assistant sees in two. It may read information that is public anyway: products, prices, stock, the FAQ and shipping terms. Personal information such as order status it should see only for a logged-in customer, and only for that customer's own order. That filter is applied not by the model but by your software: the assistant asks for "this customer's orders", and the system returns only the records of the customer whose session is open.
Why is it not enough to tell it "don't say that"?
Writing "do not share customer information" into the assistant's instructions is not a limit; it is a request. OWASP states plainly that restrictions set through the system prompt may not always be followed and can be bypassed with prompt injection. The real limit sits outside the model: the permissions of the database user the assistant connects as, a view that exposes only the public columns, an API key that allows only specific jobs. For the same reason, write down explicitly what data the assistant is fed from: which table, which view, which folder of documents. Access that is not written down becomes, over time, access nobody remembers. We draw these limits on the first day of website AI assistant setup.
What if the assistant needs to do something?
Sometimes you want the assistant to carry out a task: open a return request, book an appointment. OWASP recommends human approval for actions with a big impact. OpenAI's agent safety guide likewise recommends an approval step when tools are used, and gives an example of the same danger: an agent that queries data being tricked into sending raw customer records out. In practice, the assistant does not issue the refund itself; it opens a request, and a person approves it. Where the assistant gets its information and what it costs is covered in our note on adding an AI assistant to a website.