部落格
Why AI agent access should expire

An agent should get access to the folder it needs, for the actions it needs, for as long as the job lasts. Long-lived keys outlast the job, and they tend to end up in places nobody intended.
AI agent access should expire because agents run in places you can't fully watch, often executing code that nobody has reviewed, and a key that keeps working after the job is done is a key that can be misused later. Access works best when it covers one folder, a few specific actions and a set period, and when it ends on its own.
Fabric handles this with Agent Vault for files and Agent Passes for connected apps.
How agents usually get access
The common route is a long-lived key. Someone creates an API key with broad permissions, pastes it into an environment variable, and the agent uses it from then on. It's quick, and for a single developer testing something on a laptop it's often fine.
The trouble shows up a few months later. The key that was made for one experiment is now in a CI configuration, a teammate's shell profile and a sandbox template that spins up twenty times a day. It can read every folder because that was easier than working out which ones the agent needed. Nobody remembers which jobs still depend on it, so nobody wants to revoke it. If it leaks into a log file or a shared transcript, whoever finds it has the same access as the agent.
People accept a version of this risk for their own accounts, because a person signs in, works and signs out, and has a reason to look after their password. An agent has none of that. It might be running a script it downloaded a minute ago. It might have read a document with instructions hidden in it. It runs at three in the morning when nobody is looking. Giving it a key with no end date assumes all of that will go well indefinitely.
The hotel key card model
Hotels solved a similar problem a long time ago. When you check in, the front desk gives you a card that opens your room and perhaps the gym. It doesn't open other guests' rooms or the kitchen. It works until checkout and then stops, without anyone having to collect it. If you lose it, the desk cancels it and prints you another, and nobody changes the locks. Housekeeping has a card that opens more doors, but only during their shift.
That's a good model for agents. A card is issued for a purpose, and the purpose sets what it opens and for how long. An agent processing a batch of interview transcripts needs to read the transcripts folder and write to a results folder, for the hour or so the batch takes. An agent drafting a weekly report needs read access to a few project folders every Monday. A long-running assistant you trust might keep access indefinitely, but to a defined area.
Three properties make the model work. Access is narrow, so a misbehaving agent can only reach what it was given. Access expires, so forgotten permissions clean themselves up. And revoking one card leaves every other card working, so cutting off one agent doesn't break the rest of the team's setup.
Long-lived key | Scoped, expiring access | |
|---|---|---|
What it opens | Often everything the creator could reach | One folder, space or project |
What it allows | Whatever the key's owner can do | Chosen actions, such as reading or creating |
How long it lasts | Until someone remembers to revoke it | A task, a day, a week, or indefinitely by choice |
Revoking it | Can break other jobs that share the key | Affects one agent |
What you can see | Often little | A log of each action by that agent |
Access as Fabric handles it
Agent Vault treats external agents, such as Claude, as non-human members of your Fabric workspace. You invite an agent the way you'd add a colleague, then decide what it can reach.
Access is set per folder, space or project. Within that area, capabilities are separate permissions: reading files, creating documents, moving content, deleting items and running searches. The transcript agent above could get reading and searching on the transcripts folder and creating documents on the results folder, with no permission to move or delete anything.
You also choose how long the access lasts: for a single task, a day, a week or indefinitely. When the period ends, the access ends automatically. If you need to stop an agent early, revoking its access takes effect immediately, and other agents keep working.
Agents connect to Fabric through the MCP server, the CLI, the API or the mounted desktop drive. For MCP, sign-in uses OAuth, so there's no key to paste into a config file. How AI agents connect to a shared drive explains when to use each route.
When an agent needs more
Narrow access means agents will sometimes hit a wall. A summary agent finds that the meeting notes it needs are in a folder it can't read. Rather than failing or working around the gap, it sends a permission request. You can approve it once, approve it for a period, approve it indefinitely or deny it, and the agent waits for your answer.
This keeps the starting access small without making the work brittle. You don't have to predict every folder an agent might need on day one. You grant what's obviously needed and handle the rest as it comes up, with a person deciding each time.
For sensitive material, such as contracts or HR files, you can require that access is always requested, so no standing permission covers it at all.
Connected apps need the same treatment
Agents often reach beyond files. They read email, post in Slack, and pull documents from Google Drive or Notion. Agent Passes apply the same controls to apps connected to Fabric, including Gmail, Google Drive, Dropbox, Notion and Slack.
Passes are set per app and per action. An agent can be allowed to read and draft email without being allowed to send it, so a person reviews anything that leaves the building. Passes can be time-limited or indefinite, can be revoked, and are logged. Agent Vault and Agent Passes are both on the Pro and Team plans, and Team adds organization-wide policies.
The log is what makes expiry trustworthy
Short-lived access limits what can go wrong. The log tells you what did happen. Agent Vault records every agent action (reads, creations, modifications and deletions) with timestamps. You can filter by agent, area, period or action, and you can get notifications when an agent's activity looks unusual.
That record is useful on ordinary days too. When a report contains a figure nobody recognizes, the log shows which agent wrote the report and which files it read first. When you're deciding whether an agent's access should be renewed for another week, you can see what it did with the last one.
Choosing a duration
A few rules of thumb help when you're setting access.
Batch jobs, such as processing a folder of transcripts or tagging a set of files, should get access for a single task. They have a clear end, and there's no reason for their access to outlive it. Run a research project with a hundred agents shows how that plays out with many agents at once.
Short projects suit a day or a week. A coding agent helping with a release, or an agent drafting a proposal for one client, can have access for as long as the work runs and then lose it without anyone remembering to clean up. Agencies can use the same approach to keep each agent inside one client's folder, as described in AI agents for agencies.
Indefinite access fits agents you rely on every day, such as an assistant that reads your notes to answer questions. Even then, keep it to the areas and actions the agent uses, and look at its log from time to time.
Expiring access pairs well with other protections. Fabric protects instruction files such as CLAUDE.md, AGENTS.md and SKILL.md from changes by agents, which is covered in your agent instruction files are a security risk. Version history and a restorable trash help with the mistakes that narrow access doesn't prevent.
For the wider picture of why teams and their agents share one drive, read your AI agents need a shared drive, not a group chat, or start with what is a shared drive for AI agents?
Frequently asked questions
Why shouldn't AI agents use long-lived API keys?
A long-lived key keeps working after the job is done, often with more access than the agent needed. If it leaks or the agent misbehaves, the damage isn't limited to one task or one folder.
What is scoped access for AI agents?
It means giving an agent access to only the folders and actions it needs, such as reading one folder and creating documents in another, rather than everything its creator can reach.
How do I give an AI agent temporary access to files?
In Fabric, use Agent Vault to give the agent access to a folder, space or project for a single task, a day, a week or indefinitely. Access ends automatically when the period is over.
Can I revoke an AI agent's access immediately?
Yes. Revoking an agent's access in Agent Vault takes effect immediately and doesn't affect other agents.
What happens when an agent needs access it doesn't have?
In Fabric, the agent sends a permission request and waits. You can approve it once, for a period, indefinitely, or deny it.
Can I see what an AI agent did in my files?
Yes. Agent Vault logs every read, creation, modification and deletion with timestamps, and you can filter by agent, area, period or action.
Can I let an agent draft emails without sending them?
Yes. Agent Passes control what agents can do in apps connected to Fabric, per app and per action, so an agent can read and draft email without permission to send it.
Which Fabric plans include Agent Vault and Agent Passes?
Both are on the Pro and Team plans, and the Team plan adds organization-wide policies. See pricing for teams.
Related pages
其他部落格文章:

Agent memory vs a shared drive

Can AI agents use Google Drive or Dropbox?

What happens when an AI agent deletes the wrong file

Why AI agents give up searching your files

Why AI agent access should expire

Your agent instruction files are a security risk

When two AI agents edit the same file

Ask your files, don't build a dashboard