How do I stop employees from connecting personal coding agent accounts to company systems?
Updated
Short answer
Pin sign-in to your organization in managed settings and push them with the MDM you already run, so the agent refuses a personal login. Claude Code exits at startup if the claude.ai login belongs to an organization you haven't listed. Codex has admin-enforced requirements that users can't override. These settings only cover the agents you configure, so also inventory what's installed and check what each agent does, whichever account is signed in.
What the risk actually is#
A personal coding agent account on a work laptop is a login you don't own, on a vendor plan you don't administer, working with credentials you do own.
The agent acts as the developer. Whatever the developer can reach, a personal-account agent can reach: the repo, the cloud CLI, the VPN-only internal tools. Your retention terms, SSO, audit logs and revocation don't apply to the account driving it.
IBTimes UK has reported allegations that an Accenture contractor linked a personal Claude agent to a Pentagon system. Accenture says the allegations were independently investigated and found to be without merit. Whatever happened there, the pattern is the one to plan for: personal account, corporate access, nobody watching.
Pin the login in managed settings#
Claude Code lets an admin restrict login to listed organizations in managed settings. With that set, Claude Code reports an error for a claude.ai login to any other organization and exits at startup if the credential in use belongs to an organization that isn't listed.
Codex takes a similar approach. OpenAI's managed configuration describes requirements as "admin-enforced constraints that users can't override." Check its docs for which login settings it covers today.
What this does not stop:
- Credential types the org check doesn't cover. Anthropic's authentication docs say which credentials and commands are handled differently. Read that list before you rely on the setting.
- Any agent you haven't configured. Managed settings for one vendor say nothing about the next tool someone installs.
- Machines you don't manage. If MDM can't reach the laptop, the setting isn't there.
Deploy it where developers can't edit it#
Settings only count if a developer can't overwrite them. Managed settings sit at the top of Claude Code's precedence stack: nothing in a user's own settings files or --settings overrides a managed key.
Deliver them through MDM, not a file in the repo. A project file is something a hostile repo can edit.
Then test on a real laptop. Confirm the managed settings are in effect, try a personal login, and confirm it fails.
Give people a better account than the personal one#
Developers connect personal accounts because the company one is slow to arrive, rate-limited or missing a tool. Take that reason away.
- Provision seats or an org API route before you enforce.
- Tell people what happens to the personal account they already have (they keep it, off work machines).
- Set a date. Enforcement without a ramp becomes a ticket queue.
Shrink the network path#
Block the endpoints of agents you haven't approved at the proxy or DNS layer. It's blunt, and it catches tools you didn't know existed.
It doesn't see inside traffic to approved hosts. It also can't tell a personal login from a work one when both go to the same vendor domain.
A decision rule#
- One approved agent, one vendor: pin the org in managed settings and push it by MDM.
- Several agents: do the same per agent, and keep a written list of which ones you've covered.
- Contractors on their own hardware: managed settings won't reach them. Give them a managed environment or don't give them access.
- Anything you can't enforce: treat it as unmanaged and log it.
Where Harden fits#
Login controls answer "which account is this?" They don't answer "what is it about to do?"
Harden Agentic Integrity Foundation (AIF) 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, decisions are made locally in milliseconds, and one policy applies across every agent that exposes a hook. So the action gets checked whichever account signed in.
It starts watch-only, so you see what agents on your fleet actually do before you enforce anything. It doesn't replace pinning logins, least privilege or egress policy. See one security policy across coding agents and shadow AI governance.
Pin the login where you can. Check the action everywhere.
FAQ
Related questions
Can I fully block personal Claude Code accounts?
On managed machines, mostly. Restrict login to your organization in managed settings pushed by MDM. Gaps remain for credential types the org check doesn't cover, unmanaged devices and other agents.
Does managed settings stop a developer from installing another agent?
No. Managed settings configure one vendor's tool. Use software inventory and network controls to find other agents, and apply a check at each agent's hook.
What about contractors using their own laptops?
MDM can't reach machines you don't manage. Give contractors a managed environment, or don't connect their personal setups to company systems.
Should I block first or watch first?
Provision a company account first, then enforce login pinning with a date. Run action checks in watch-only mode to see what's happening before you block.