Guide
How do I control which AI agents can access my systems and accounts?
Updated
Short answer
Control it at three points. Limit who can grant agents access, using consent settings and an approved-agent list. Give each agent its own short-lived, narrowly scoped credential instead of a developer's login. Then check what an approved agent actually does with that access, because access control decides which agent gets in, not what it does once it's in.
Access has two layers#
"Which agents can access our systems" sounds like one question. It's two.
The first is admission: which agents exist, who approved them, and what identity they hold. The second is conduct: what an admitted agent does with that identity, one command at a time.
It's easy to build the first and assume it covers the second. It doesn't.
Admission: how agents get in#
Agents get access in a few ways, and each one needs its own control.
- A user clicks consent. Someone approves an app or agent in your identity provider, and now it holds permissions.
- An agent borrows a developer's login. Coding agents on laptops act with whatever the developer can reach: cloud CLIs, SSH keys, tokens in environment variables.
- An agent connects through a tool server. An MCP server or extension brings its own tokens and its own reach. See how to secure MCP servers for coding agents.
Attackers like the consent path. Proofpoint's "BluePhishing" research covers initial access via third-party agent blueprint consent, and notes that one blueprint can have up to 250 agent identities attached to it. Proofpoint says it hasn't seen this in the wild yet, so read it as a preview, not an incident.
The control is boring and cheap. Apply your user consent restrictions to agents too, so one click by one employee can't mint a fleet.
Credentials: give agents their own, and keep them small#
If an agent runs as a developer, you can't tell the developer's actions from the agent's. You also can't revoke one without the other.
- Give each agent or agent workload its own identity where the platform supports it.
- Make credentials short-lived. Use OIDC in CI instead of stored keys.
- Scope each one to a task: one repo, one environment, one API.
- Keep production credentials off laptops that run coding agents.
- Inventory every agent identity and name an owner for each. No owner, no access.
OWASP's excessive agency guidance makes two of the same moves. Limit the extensions an agent can call to the minimum necessary, and implement authorization in downstream systems instead of relying on the model to decide what's allowed.
That second point matters most. Your systems should refuse what the agent shouldn't do, whatever the agent was told.
Policy: what the built-in controls give you, and what they don't#
The tools' own controls are worth turning on. They set a floor.
In Claude Code, per Anthropic's docs, nothing in a developer's own settings files or --settings overrides a managed key. By default, Claude Code merges permissions.allow across scopes. Setting allowManagedPermissionRulesOnly turns that off, so developers' own allow rules can't widen yours.
What a managed floor doesn't give you:
- Rules that see the action. Permission rules match what a command looks like, and the same action can be written another way. More on that in why command denylists fail.
- Intent. A rule can't tell a cleanup from a mistake when the command is identical.
- Other agents. Each agent has its own settings format, so policies drift apart as you add agents.
- Approval prompts that hold up. Anthropic found people approve 93% of prompts. A human clicking yes all day is a control that wears out.
Sandboxes and scoped credentials bound how far an agent can reach. They don't judge each action inside that reach. The permissions vs hooks vs sandbox breakdown covers what each layer stops.
Conduct: check each action before it runs#
Once an agent is admitted and scoped, what's left is what it does inside its box. A secret read and then sent out. A force-push. A dependency it shouldn't install. A rules file it rewrites so it comes back next session.
Harden Agentic Integrity Foundation (AIF) checks that layer. It runs on the developer laptop, outside the agent, at the agent's pre-execution hook. Every command, file edit and push is checked against the session's intent before it runs, decided locally in milliseconds, under one policy across every agent.
It starts watch-only, so you see what agents do before you enforce anything, and it's pushed by the MDM you already run. It sits on top of scoped credentials, egress policy and least privilege. It doesn't replace them. For the rollout order, see how to govern coding agents in an enterprise.
A checklist you can run this week#
- Restrict user consent so employees can't approve third-party agents or blueprints on their own.
- List every agent identity, its owner and its permissions. Delete the ones with no owner.
- Replace shared and long-lived keys with short-lived, per-agent credentials.
- Push managed settings to every machine and confirm they're in force on a sample of laptops.
- Make downstream systems enforce authorization on their own.
- Turn on watch-only checking at the pre-execution hook and read a week of real agent actions.
- Gate the small set of irreversible actions first: publish, deploy, push to a shared repo.
Decision rule: if an agent's access would hurt you in someone else's hands, that agent needs its own credential, an owner and a check on every action.
FAQ
Related questions
Should AI agents use a developer's own credentials?
Avoid it where you can. When an agent runs as the developer, you can't separate the developer's actions from the agent's, and you can't revoke one without the other. Give each agent its own short-lived, narrowly scoped identity.
Can managed settings stop developers from loosening agent permissions?
For Claude Code, yes for that agent. Per Anthropic's docs, developer settings files can't override a managed key, and allowManagedPermissionRulesOnly stops developers' own allow rules from merging in. It's a floor for one agent. The rules still match command text, and they don't cover your other agents.
Is the BluePhishing attack happening now?
Proofpoint says it hasn't found any in-the-wild activity yet. Restricting user consent for agents is cheap, so you can apply it now anyway.
What if I can't inventory every agent?
Start with the agents on developer laptops, since those hold real credentials. Watch-only checking at the pre-execution hook shows which agents are acting and what they do, before you enforce anything.