AI Agent File Access: A Least-Privilege Checklist Before You Connect

An AI agent that can read and change your files is a new kind of user, one that can be tricked by text it reads. OWASP names the root causes of harm as excessive functionality, excessive permissions and excessive autonomy. Reduce all three before connecting anything: give the agent only the tools it needs, run it as the requesting user with narrow scopes, require human approval for high-impact actions, enforce permissions in the file system rather than in the prompt, and keep logs you can review. This checklist turns that into 14 checks.
Connecting an AI assistant to a shared drive is often a two-minute job: click "connect," approve a permission screen, and ask a question about a folder of contracts. The assistant is useful immediately. The risks appear later, when the assistant acts on text it should not trust, uses access it did not need, or does something nobody expected because the request was vague.
This guide gives a checklist to complete before you connect an AI agent to company files. It is based mainly on the OWASP Gen AI Security Project's entry on excessive agency, supported by NIST's AI Risk Management Framework and standard least-privilege thinking. It does not evaluate any specific AI product, and it cannot tell you how a given vendor's agent is built. Its purpose is to give you questions to ask and settings to check. For the opposite problem, what to do when you remove an agent, see our companion piece on AI file agents that keep working after you revoke access.
What an agent changes about file security
A classic file-sharing risk is a person sharing a document with the wrong recipient. An AI agent adds another actor: software that decides what to do based on instructions and on the content it reads.
OWASP describes the situation this way. An LLM-based system is often granted "a degree of agency," meaning the ability to call functions or interface with other systems through extensions, which different vendors call tools, skills or plugins. The decision about which extension to use may be delegated to the model. Excessive agency, in OWASP's words, "is the vulnerability that enables damaging actions to be performed in response to unexpected, ambiguous or manipulated outputs from an LLM, regardless of what is causing the LLM to malfunction."
OWASP lists common triggers: hallucination or confabulation caused by a poorly engineered prompt or a weak model, direct or indirect prompt injection from a malicious user, an earlier call to a compromised extension and, in multi-agent systems, a compromised peer agent. For file access, indirect prompt injection is the one to keep in mind. A document, web page or email the agent reads could contain hidden instructions telling it to forward files elsewhere.
The practical consequence: do not rely on the agent to behave. Design so that a misbehaving agent can only do limited harm.

The three root causes to design out
OWASP says the root cause of excessive agency is typically one or more of excessive functionality, excessive permissions and excessive autonomy. Each maps to a concrete file scenario.
| Root cause | OWASP-style example | File-access translation |
|---|---|---|
| Excessive functionality | An extension meant to read documents can also modify and delete them | A "summarize my folder" connector that can also delete and share files |
| Excessive permissions | An extension uses a database identity that can insert, update and delete when it only needs to select | A connector using an admin account when it only needs read access to one folder |
| Excessive autonomy | An extension deletes documents without confirmation | An agent that sends or deletes files without a human check |
Every item in the checklist below reduces at least one of these three.
The 14-point checklist
Scope: what the agent can do
- 1Minimize the tools. OWASP advises limiting the extensions an agent can call to the minimum necessary. If the job is summarizing documents, the agent does not need a web fetcher, an email sender or a calendar tool. Remove anything that was tried during testing and left behind.
- 2Minimize each tool's functions. An extension that summarizes email may only need to read email, so it should not include deleting or sending. Prefer a read-only connector for read-only jobs. If the vendor offers only a broad connector, record that as a risk.
- 3Avoid open-ended tools. Running arbitrary shell commands or fetching any URL gives an agent a very wide reach. OWASP recommends granular tools instead, for example a specific file-writing function rather than a shell command.
- 4Limit the data scope. Point the agent at specific folders or shared drives, not the whole account. Create a dedicated "agent workspace" with copies of what it needs.
Identity: whose authority it uses
- 1Run as the requesting user. OWASP recommends executing extensions in the user's context so actions are authorized as that specific user, with the minimum scope required, for example through OAuth with limited scopes. The opposite, a shared high-privilege service account, means any user can reach files they should not see.
- 2Use narrow permission scopes. When a consent screen asks for access to "all files," look for a narrower option. Review scopes at every renewal; apps can ask for more later.
- 3Use a dedicated identity for unattended agents. If an agent runs on a schedule, give it its own account with its own limited group membership, so its activity is separate in logs and can be disabled without affecting a person.
Control: who approves what
- 1Require human approval for high-impact actions. OWASP recommends a human-in-the-loop control to approve actions such as deleting, sharing externally, sending or posting before they happen. Define "high impact" in writing: any delete, any external share, any bulk change, any permission change.
- 2Enforce authorization in the file system. OWASP's "complete mediation" principle says authorization should be implemented in downstream systems rather than relying on the model to decide whether an action is allowed. A permission denied by the drive is stronger than an instruction in a prompt.
- 3Limit the rate and size of actions. Cap how many files an agent can read, move or delete per run. A runaway loop is then an annoyance rather than a disaster.
Evidence: how you will know
- 1Turn on and keep logs. You should be able to answer what the agent read, what it wrote and whose authority it used. Our guides to audit logs and tracking shared file access explain what to retain.
- 2Review samples regularly. Look at a handful of agent sessions each month. You are checking for access to places no one expected.
Lifecycle: when the job is done
- 1Set an owner and an end date. Every agent connection needs a named person and a review date, or it will outlive the project.
- 2Test shutdown. Revoke access in a test and confirm it stops. Our revoke-and-verify drill describes how.

Applying the checklist to a real request
Suppose a sales manager wants an assistant to prepare client briefings from a shared folder of proposals and call notes.
- 1Define the job: read proposals and notes; write a summary in the manager's own folder.
- 2Tools: read files, create a document. No send, no delete, no external share.
- 3Data scope: the "Client Briefings" folder only, not the whole drive. HR and finance folders are not visible.
- 4Identity: acts as the manager, so the manager's existing permissions are the upper limit.
- 5Approvals: any request that would send a briefing outside the company needs a manual click.
- 6Logging: the drive's activity log records reads and writes, and the manager can see them.
- 7Review: the sales operations lead checks activity monthly and removes the connection when the project ends.
That is a few settings and a half page of documentation, not a project plan.
Questions to ask an AI vendor
If you buy rather than build, ask for answers in writing:
- Which exact permissions or scopes does the connector request, and why does each one need to be there?
- Can we choose read-only access? Can we restrict it to specific folders?
- Does it act as the signed-in user, or through a shared service identity?
- Which actions require a user confirmation, and can we require it for more?
- What is logged, where, and for how long? Can we export the logs?
- How do we revoke access, and how fast does revocation take effect? (See the revocation drill.)
- Is our content retained, used to improve models or sent to other processors? See how to read a vendor security whitepaper.
If the vendor cannot answer, treat that as information.
Connecting this to broader risk management
NIST's AI Risk Management Framework is a voluntary framework intended to help organizations incorporate trustworthiness considerations into the design, development, use and evaluation of AI products and systems. NIST published version 1.0 in January 2023, and its site notes that the framework is being revised. You do not need to adopt it formally to benefit from its basic idea: identify the risks of each AI use, assign responsibility, measure what happens and manage the outcomes over time. The checklist above is a small, practical piece of that.
Pair it with existing controls: zero trust for file sharing, insider risk and data loss prevention. An agent should be governed like any other user with access to sensitive data, plus the extra care that its decisions can be influenced by content.
Staged rollout: how to widen access safely
Start narrow and widen only on evidence. In week one, run the agent against copies of non-sensitive files in a test folder and read the activity log line by line. In week two, allow a pilot group to use it on one real folder with read-only access. Only after the logs show no surprises should you consider write access, and even then only for specific tools and with approval for anything irreversible. Record each widening decision with a date and a name. If a log review ever shows the agent touching something outside its stated scope, pause the connection, find out why and fix the scope before resuming. This pace feels slow, but it is much cheaper than discovering a problem after an agent has acted on hundreds of files.
Common mistakes
- Connecting with an admin account "for testing." Test accounts have a way of becoming production.
- Granting access to the entire drive because choosing folders takes longer.
- Relying on the prompt as a security control. An instruction such as "never delete files" is not an enforced permission.
- Skipping the approval step to save clicks. Approvals are the safety net for ambiguous requests.
- Forgetting that agents read untrusted content. Documents from clients, shared links and email attachments can all carry instructions.
- No exit plan. If you cannot say how you would turn the agent off and prove it, you are not ready to turn it on.

A one-page summary to keep
Write this down for each agent you connect:
- Purpose in one sentence.
- Owner and review date.
- Tools it can call.
- Folders it can reach and whether read-only.
- Identity it uses.
- Actions needing human approval.
- Where its logs are.
- How to revoke it and who can do it.
If any line is blank, resolve it before launch. This guide offers general information, not legal advice or a guarantee against misuse.
Frequently Asked Questions
OWASP defines it as the vulnerability that lets damaging actions be performed in response to unexpected, ambiguous or manipulated model outputs. It names the typical root causes as excessive functionality, excessive permissions and excessive autonomy.
Sources
- OWASP Gen AI Security Project: LLM06:2025 Excessive Agency
- NIST: AI Risk Management Framework
- Model Context Protocol: Security Best Practices
- CISA: Require multifactor authentication
Keep Reading

About the Author: Mohamed Siraj
Mohamed is the founder of SecureTools.live. He leads the team in building secure, compliant, and privacy-first directory tooling for software teams, finance professionals, and enterprise security leaders worldwide.