Before you deploy an AI agent, ask who controls what it can access
The risk in an AI agent is not only what it says. It is what it can read, what it can do and whose data it can reach.
AI agents are moving beyond answering questions. Businesses now connect them to internal documents, customer databases, email, APIs and operational tools. An assistant that only writes text can do limited harm. An agent that can retrieve records, change systems, send messages or start workflows can do a great deal more, so the security question changes. It is no longer only whether the answers are accurate, but whether the agent has the right access, whether its actions are limited, and whether those actions can be trusted.
Where agents go wrong
Picture a support assistant that can read customer records, search the knowledge base, create tickets and send email. Useful, and also exposed in four ways.
- Prompt injection. An attacker hides instructions in something the agent reads, such as an email, a document or a web page. If the agent treats that content as instructions, the attacker is steering it.
- Excessive permissions. An agent built to look up customers can often edit records or reach unrelated accounts too. Nothing needs to be compromised for that to cause harm. Its normal access already allows too much.
- Data exposure. An agent connected to documents or databases can retrieve things the person asking should not see. In a multi-tenant product, that can mean another customer’s data.
- Unsafe actions. Sending an email, changing a record or starting a payment has real consequences, even when the model is working exactly as designed.
These are not invented categories. The OWASP Top 10 for LLM Applications lists prompt injection, sensitive information disclosure and excessive agency among the most important risks.
Five controls to put in place before you deploy
Instructions in a system prompt are not a security control. The protection has to live in the application around the agent.
1. Give the agent the least access its job needs
An agent that reads a record should not also be able to change or delete it. Separate read, write and admin abilities, and grant each only where the task needs it.
2. Check permissions outside the model
Never let the model decide whether a user may see something. Enforce access through your normal authorization layer, on every tool call and database query. The model should never be the one granting itself access.
3. Keep customers’ data apart
In a multi-tenant product, enforce the tenant boundary in the application and the database. A customer’s request should never reach another customer’s records just because the model wrote a query that could. Use the tenant from the server-side session, scoped credentials and database-level controls.
4. Require approval for consequential actions
Sending external messages, deleting records, changing permissions and moving money may need a person to approve them first. Match the level of approval to the impact.
5. Record what the agent does
Log every tool call, access decision, action and failure, so you can answer what the agent read, which tools it used, on whose behalf it acted, whether that was allowed, and what happened afterwards. Without these records, finding the cause and scope of an incident is far harder.
Questions to answer before going live
- What information can the agent access?
- Which actions can it take?
- Whose identity and permissions does it use?
- What stops it crossing customer or team boundaries?
- Which actions need a person’s approval?
- How will you monitor and investigate what it does?
If any of these has no clear answer, the agent may not be ready for production. The goal is not to remove its autonomy. It is to keep that autonomy inside boundaries you can understand, enforce and monitor.
This is the idea behind FlowPilot, one of our public reference builds, where an agent’s database writes wait in a server-side queue until a person approves them.