AI Agents and Coding Assistants
Giving an Agent the Least Access It Needs: A Practical Checklist
A step-by-step checklist for deciding what an AI agent may read, change, send and spend, and for taking that access back afterward.
Key takeaways
- Decide what the task needs before you connect anything, instead of accepting every permission an app requests.
- Reading, editing, sending, deleting and spending are separate powers and should be granted separately.
- A dedicated account or folder for the agent is safer than handing it your own full login.
- Access should expire or be removed when the job ends, and you should know how to revoke it fast.
- Any limit that matters should be enforced by the account or system, not only written into the instructions.
Give an AI agent only the accounts, files and actions that its current task requires, for only as long as the task lasts. If it needs to read your calendar, let it read the calendar and nothing else. If it drafts replies, it does not need permission to send them.
This idea is called least privilege, and security teams have applied it to people and programs for decades. It matters more with agents because they act quickly, interpret instructions loosely at times and can be misled by content they read. Narrow access caps how bad any of that can get.
Start with the task, not the tool
Write one sentence that describes the job: "Collect this month's invoices from the shared folder and list their totals in a spreadsheet." Then underline the nouns and verbs. The nouns tell you what the agent must reach, here the invoice folder and one spreadsheet. The verbs tell you what it must do, here read and write.
Notice what the sentence does not mention. There is no email, no payment system and no other folder. Those stay disconnected.
If you cannot describe the task in a sentence or two, the agent will struggle with it too, and you will be tempted to grant broad access just in case. Narrow the job first.
Sort permissions by what they can break
Not all access carries equal risk. A useful way to rank a permission is to ask two questions: can the result be undone, and does it affect anyone outside your control?
Reading is low on the list but not harmless. An agent that can read private records can repeat them in the wrong place, particularly if it also browses untrusted pages. That risk is the heart of prompt injection.
The checklist before you connect
Work through these in order.
- Name the task and its end point. Know what "done" looks like.
- List the data it needs. Prefer one folder, label or project over a whole drive or mailbox.
- Choose read-only where possible. Add write access only if the output must go back into the system.
- Remove outbound powers you do not need. Sending mail, posting and sharing links are separate switches in many products.
- Block deletion. If the service allows archiving without deleting, choose that.
- Keep money out. If a payment is unavoidable, set a cap and require approval.
- Check what else comes along. One connection may quietly include contacts, shared drives or other people's files.
- Set an expiry or a reminder. Decide now when access ends.
- Find the off switch. Locate the page where you revoke the connection before you need it.
Read the permission screen itself. When an app asks for far more than the task requires and offers no narrower option, that is a fair reason to look for another tool or another method, such as exporting the few files it needs.
Give the agent its own identity
Letting an agent sign in as you means it inherits everything you can do. It also muddies the record, since its actions look like yours.
A better pattern is a separate account, role or access token for the agent. An access token is a stored credential that lets software act within set limits without knowing your password. A separate identity lets you grant precisely what is needed, see which actions came from the agent and shut it off without locking yourself out.
For personal use, simpler versions work. Create a folder that holds copies of only the files in question. Use a second email address for sign-ups. Use a browser profile with no saved passwords when a computer use agent needs to click through websites, because anything you are logged into in that window is within its reach.
A worked example
Say you run a small community club and want help turning sign-up emails into a membership list. The tempting setup is to connect your whole email account and your whole drive, then tell the agent to sort it out.
The narrower setup takes a few minutes more. You create a mail filter that copies sign-up messages into one label, or you forward them to a club address that holds nothing else. You make a single spreadsheet and share only that file with the agent's account. You leave sending switched off, so welcome messages arrive in your drafts folder.
Now consider the failures. If the agent misreads a message, one row is wrong and the version history lets you restore it. If a hostile message tries to make it share your files, it can see none beyond the list itself. That list still holds names and addresses, so it deserves care, but the rest of your life is out of reach.
At the end of the sign-up season, you remove the connection and delete the copied messages you no longer need. The whole arrangement can be rebuilt next year in the same few minutes.
Common mistakes
- Connecting first and thinking later. Defaults often lean toward broad access.
- Reusing one key everywhere. A single leaked credential then opens several doors, and revoking it breaks everything at once.
- Treating read access as free. What can be read can be copied into an output.
- Forgetting inherited access. A folder shared with you may be visible to your agent even though it belongs to someone else.
- Leaving experiments connected. The tool you tried for an afternoon may still hold access a year later.
- Widening access to clear an error. Find out which single permission is missing instead of granting administrator rights to make a message go away.
Match access to the level of trust
Access can grow as evidence accumulates. A reasonable ladder looks like this.
| Stage | What the agent may do | What earns the next step |
|---|---|---|
| Observe | Read sample data and propose actions | Proposals are mostly correct |
| Draft | Prepare changes that you apply | Few corrections over many items |
| Act with approval | Execute after you confirm | Approvals become routine and well checked |
| Act within limits | Handle low-risk, reversible actions alone | Spot checks stay clean |
Moving up should be a decision, not a drift. Moving down should be easy, for instance after an error or a change in the underlying model. The wider question of how much an agent should do without asking depends on the stakes of each action.
Enforce limits outside the conversation
Writing "never delete anything" in your instructions is useful, but the model may misread it, lose track of it in a long task or be argued out of it by planted text. If the account has no delete permission, none of that matters.
For each rule you care about, ask where it is enforced. The strongest answer is the service that holds the data. Next best is the software around the agent, such as an approval prompt it cannot skip. The weakest is a sentence in the prompt. Use instructions to guide behavior and permissions to guarantee boundaries.
Teams connecting agents to tools through shared connectors should apply the same test to each one. A connector that offers "search" and a connector that offers "run any command" are very different grants. Review which tools are switched on, who built them and what they can reach.
Review and remove
Access tends to pile up. Schedule a short review, monthly for most people and more often for sensitive systems.
- Which agents and apps are still connected?
- When was each last used?
- Does any hold more than its current task needs?
- Is there an owner who can explain why each one exists?
Remove anything idle. Rotate, meaning replace, any key that may have been exposed, and never paste passwords or keys into a chat window. When someone leaves a team, transfer or retire the agents they set up.
Revoking access also needs to work under pressure. Try it once on a test connection so you know it takes effect. Some sessions stay active until they expire, so check your provider's guidance. Pair this with logs you can read, as described in how to audit an agent's actions.
Common questions
Won't narrow access make the agent useless?
Sometimes it will stall because it lacks something. That is a helpful signal. You can grant the missing item deliberately, which is far better than discovering that it had broad access all along.
What if the product only offers all or nothing?
Reduce what "all" contains. Use a separate account with little in it, or move copies of the relevant material into it. For high-stakes data, you may decide the tool is not ready for the job. Practicing in a test account first will show you how it behaves.
Does this apply to work accounts I did not set up?
Yes, but the decision may not be yours alone. Employers often have rules about connecting outside tools to company data. Ask your IT or security team before you authorize anything.