The short answer
Write a managed-settings.json in the same JSON shape as settings.json, and place it at /Library/Application Support/ClaudeCode/managed-settings.json on macOS, /etc/claude-code/managed-settings.json on Linux and WSL, or C:\Program Files\ClaudeCode\managed-settings.json on Windows. Claude Code applies managed settings above every other level, so no user, project, local or --settings value overrides them.1 Run /status on one machine; the Setting sources line should show Enterprise managed settings (file).1
Deedglass
A tool call meets your rules before it runs
Asks to run
DELETE FROM visits;
Deletes every row in visits
Deedglass checks your rules
- Reading dataAllowed
- Deleting a whole table (DROP, TRUNCATE)Never
- Changing or deleting rows without saying which (WHERE)This one
- Other changesWait for a person
Why managed, and not a shared settings.json
A committed .claude/settings.json is a good default for a team, and it’s weaker than it looks:
| Shared project file | Managed settings | |
|---|---|---|
| Precedence | Below project-local, command line and managed2 | Above everything1 |
| A developer can override it | Yes, in .claude/settings.local.json2 |
No, apart from a few stricter-value exceptions1 |
| Applies outside that repository | No | Every project on the machine |
allow rules wait for folder trust |
Yes | Not applicable |
Lists such as permissions.allow merge across files, so a developer’s own allow rules add to the team’s.2 That’s why the key below matters.
Where the file goes
Four delivery mechanisms carry the same keys:1
| Mechanism | Read | Use when |
|---|---|---|
managed-settings.json in the system folder |
At startup; reloaded when the file changes | Machines without MDM, Linux hosts, images you build |
MDM or OS policy (macOS profile, Windows HKLM) |
At startup, then every 30 minutes | You already manage devices |
| Server-managed, from the claude.ai admin console | At startup, then hourly | One place to change policy for an organisation |
Windows HKCU registry |
At startup, then every 30 minutes, only when no admin source is above it | You can’t write HKLM |
When more than one mechanism delivers a policy, Claude Code by default uses one and ignores the others, so pick one per fleet.1
A starter policy for agent safety
The docs’ own minimal example blocks two file reads, turns off bypass mode and makes Claude Code ignore permission rules from user, project and local files:1
Code Data in JSON, the format software uses to pass records and settings.
{
"permissions": {
"deny": [
"Read(./.env)",
"Read(./secrets/**)"
],
"disableBypassPermissionsMode": "disable"
},
"allowManagedPermissionRulesOnly": true
}
What each line buys you:
denyonReadkeeps the built-in Read tool off secret files. It doesn’t cover every shell command; our post on agents reading .env files lists the gaps.disableBypassPermissionsModeremoves the mode in which nothing asks.allowManagedPermissionRulesOnlystops developers’ ownallowrules from widening access. Without it, a “Yes, and don’t ask again” click in any project writes anallowrule that applies alongside yours.2
Extending it for agent work, using keys the docs describe elsewhere:
- The sandbox (
sandbox.enabled,denyReadfor credential folders, a shortallowedDomainslist), so shell commands can’t write outside the project or reach arbitrary hosts. Our sandbox settings post has a full example. askrules for remote and destructive commands, such asBash(ssh *), so a person confirms each one. The ALTER TABLE over SSH report is the case for that.- Managed MCP servers, deployed through
managed-mcp.jsonor themanagedMcpServerskey, so the servers developers can connect are the ones you chose.1
Write the file, then validate it: entries Claude Code can’t parse are reported, and claude doctor lists what it dropped.1
Roll out in two steps
Turning on allowManagedPermissionRulesOnly on day one tends to break people’s work: every command they’d approved for themselves starts prompting again. A gentler path:
- Week one: deny rules and bypass off only. These remove the dangerous options without touching anyone’s allow list. Ask developers to send you the commands they approve most often.
- Week two: your allow list plus
allowManagedPermissionRulesOnly. Put the common, safe commands (tests, linters,git status) in the managedallowlist, then switch off personal allow rules.
The goal is fewer prompts for safe work and no way around the rules for unsafe work. Approval fatigue is how “always allow” spreads.
Confirm it applied
On one machine before rolling out:11
- Run
/status. TheSetting sourcesline names the managed source in use, such asEnterprise managed settings (file). - Run
claude doctorto see entries it rejected. - Try something the policy blocks: ask Claude to read
.env. It should be refused. - Try a developer override: add an
allowrule to.claude/settings.local.jsonfor something the policy denies. It shouldn’t take effect.
If /status names a different source than the one you deployed, a higher-priority managed source is present.
What developers can still change
The docs list what sits outside the rule that managed values win:1
| Outside managed control | Why |
|---|---|
| The model for a session | A managed model is a default; --model and ANTHROPIC_MODEL still choose. Use availableModels to restrict |
| The auto-compact window for a session | Also a default |
| The managed file itself, for local administrators | An admin can edit it; MDM can redeploy on a schedule |
| The server-managed cache | Local edits last only until the next successful fetch |
| Other tools | Managed settings bind Claude Code only; a developer using another tool isn’t under them |
The last row is the important one for agent safety. If your team also uses Cursor, Codex or Gemini CLI, each needs its own policy, and none of these settings protects a production database from a script run outside any agent. Credentials are the control that covers every tool: an agent can’t misuse a production key it never had.
A rollout checklist
- One delivery mechanism chosen per fleet.
- Deny rules for secret files;
disableBypassPermissionsMode. -
allowManagedPermissionRulesOnly: trueonce your own allow list covers daily work. - Sandbox on, with credential folders in
denyRead. - Ask rules for SSH and destructive database commands.
- MCP servers managed centrally.
- Verified on one machine with
/status,claude doctorand a blocked read. - A PreToolUse hook deployed for checks rules can’t express.
- Equivalent policies for the other coding agents your team uses.
To see what an agent could do under your current settings, paste a config into the check page or run npx deedglass scan (how the grade works), which reads .claude/settings.json but not managed settings; to try tool-call rules in your browser, open the playground.
Written with AI assistance and checked against our claims register.