Most AI agents ship with far more access than they need. The agent that answers refund questions gets read access to the whole orders table, the CRM, and the billing system — because it was faster to hand over one broad credential than to work out what it actually needs. That shortcut holds until the day the agent does something reasonable with data it should never have touched: quoting a customer's payment details in a chat transcript, or pulling records from another client's account because the query didn't filter by tenant.
Least privilege is not a security team's hobby. It is the difference between a bad answer and a breach. An agent with broad access turns every prompt injection, every hallucinated tool call, and every misread instruction into a data exposure. The same failure with narrow access is a confused reply.
Start with the read side. List the exact fields the agent needs for its job — not the tables, the fields. A support agent needs order status, delivery date, and the customer's name. It does not need card numbers, full addresses, or internal margin notes. If the data store cannot filter to field level, put a view or a narrow API in front of it. The agent talks to the view, never to the raw table.
Then scope the write side even harder. Most agents should not write at all: they draft the refund, the update, the message — and a human or a narrowly-scoped service applies it. When an agent must write directly, give it one operation with fixed parameters, not a general-purpose update call. "Issue a refund up to $50 for this order" is a bounded tool. "Update the orders table" is a loaded gun.
Tenant isolation deserves its own check. If your product serves more than one customer, the agent's queries must be scoped to the current tenant at the data layer, not by asking the model to remember which customer it is serving. A filter the model can forget is not a filter. Enforce it in the query, the view, or the API — somewhere the model cannot reach.
And audit what the agent actually touched. Log every read and write with the agent's identity, the records accessed, and the reason the run needed them. The log is what turns "the agent saw something odd" into an answer you can give a customer or an auditor. Without it, you are guessing — and guessing is a bad look after a breach.
The test is simple: if someone pasted your agent's credentials into a chat window, what could they do with them? If the answer makes you uncomfortable, the agent has too much access. Narrow it before the incident, not after.
We build production AI systems with least-privilege access baked in — scoped tools, tenant-isolated data, and an audit trail for every record touched — because an agent that can see everything will eventually show someone something it shouldn't.
Field note: A client's sales agent could look up any account in the CRM — full history, contract values, internal notes — because it shared one service account with the whole backend. A prospect asked a casual question about a competitor, and the agent, trying to be helpful, quoted figures from another customer's contract. The deal survived; the trust didn't. We replaced the shared credential with a scoped API that only returns the current prospect's public fields, and the agent has never seen another customer's data since. The agent got dumber about the CRM. The business got safer.
Related service Workflow automation



