

Field note
Locus: how to stop an agent from using the wrong account
AI-generated illustration
On a laptop used for several clients, the active account can be the wrong one. Locus scopes commands and agent tools to an explicitly pinned identity.


Field note
AI-generated illustration
On a laptop used for several clients, the active account can be the wrong one. Locus scopes commands and agent tools to an explicitly pinned identity.
You finish work for one client and open another client's repository. The folder has changed; the account selected in your terminal may not have. An agent that inherits that session can carry the same mistake into its next command. Locus is built for that handoff.
Locus is built around one idea: pin the agent to one client. When you run locus pin and name a client, every command, every MCP tool and the local dashboard are scoped to that one identity. The agent gets a sealed session, not the ambient logins on your machine.
It does this by removing the ambient credentials. When you run a command through locus exec, Locus clears variables such as GH_TOKEN, AWS_PROFILE and SUPABASE_* from that command's environment. It then adds only the credentials of the pinned client. Agents can ask to be pinned. They cannot pin themselves, and they cannot override a locked project or team.
A folder can also refuse the wrong client. In a client's directory you can list which identities are allowed and require a pin, so a mix-up gets blocked instead of discovered later.
Locus works with Phantom Secrets. Phantom answers "can this secret enter the model?" Locus answers "as whom, against which account, right now?" Credentials in a Locus binding can be Phantom references, so the values never sit in a config file.
Locus is written in Rust and MIT licensed. At our October 17, 2026 review, the latest GitHub release was 0.5.0 and the source tree was at 0.5.1. The npm 0.5.0 package had a looping version command; the fix was in source but not yet on npm. Homebrew was the recommended installation route for that snapshot. Check the repository for the current package status.

Run the recipes in the examples folder. They show two clients, a directory allowlist and a CI session. Try to make the agent use the wrong account. The point is to watch it fail.
A wrong-account mistake can put one client's work in another client's system. Ask how your tools establish the intended identity before they act, and which execution paths that control covers.
A directory rule that rejects an incorrect pin is useful evidence. It is more concrete than a reminder to check the active account, but it still needs to be tested within its documented boundary.
If you work for more than one client, list the accounts your laptop is logged into today. Then try Locus on one of them.
Ashlr tools connected to this story. Review their source and setup requirements.
Keep coding agents scoped to the right client, account, and tenant. Manage identity bindings across command-line tools and MCP connections.
Source material behind this field note. Our practical implications are Ashlr’s interpretation.
Field notes explain an engineering or business practice. They are not reports of a new event. Cover artwork is illustrative.
Anthropic tested six Claude models across 1,700 scenarios in 26 sandbox setups. Spelling out isolation rules in prompts reduced unauthorized boundary crossings by 68 to 96 percent in recent models.
SecurityThe briefing
AI-generated illustration
Employees at Anthropic and OpenAI have clashed with executives about advanced models whose reasoning capabilities could pose dangers to humanity, according to more than two dozen sources cited by Axios.
SecurityThe briefing
AI-generated illustration
Amazon stated that AI agents running on the open-source Cairn framework discovered and exploited a zero-day vulnerability in a medical imaging application with only minimal human direction to obtain root access.