---
title: How do you lock Claude Code permissions with managed settings?
url: https://opencontroller.lyzr.com/blog/lock-claude-code-permissions-with-managed-settings
published: 2026-11-14
updated: 2026-11-14
author: Lyzr
---

# How do you lock Claude Code permissions with managed settings?

**Deploy a managed settings policy through a managed-settings.json file, an MDM profile or server-managed settings from the Claude admin console. Claude Code applies managed settings above user, project and local settings, so developers cannot loosen them. Use the lock keys to disable bypass-permissions mode, accept only managed permission rules, hooks and MCP servers, and restrict models.**

Claude Code runs on developer machines with access to source code, shells and credentials. Teams usually start with project settings checked into repositories, then discover that any developer can override them locally. Managed settings close that gap. This guide is part of our [guide to governing AI agents across platforms](/blog/how-to-govern-ai-agents-across-platforms) and complements [governing Claude Code in the enterprise](/blog/govern-claude-code-in-the-enterprise).

## Where do managed settings live?

Claude Code's documentation lists four ways to deliver a policy:

| Mechanism | Location | When it is read |
|---|---|---|
| Server-managed settings | Claude admin console, or a self-hosted Claude apps gateway | Fetched at startup and polled hourly |
| MDM or OS policy | macOS profile in the `com.anthropic.claudecode` domain; Windows `HKLM\SOFTWARE\Policies\ClaudeCode` value `Settings` | Startup, then checked every 30 minutes |
| Managed settings file | `/Library/Application Support/ClaudeCode/` (macOS), `/etc/claude-code/` (Linux and WSL), `C:\Program Files\ClaudeCode\` (Windows) | Startup and on change |
| Windows HKCU registry | Per-user registry value | Only if no admin source is present |

The file-based option uses `managed-settings.json`, an optional `managed-settings.d/` directory for teams that each own a part of the policy, and `managed-mcp.json` for MCP servers. Claude Code does not read the legacy `C:\ProgramData\ClaudeCode\` path.

## Which source wins if there are several?

By default, the highest-ranked source that carries a policy key supplies the whole policy: remote settings first, then MDM, then files, then HKCU. Setting `managedSourcesBehavior` to `"merge"` in the highest source makes Claude Code combine every admin source instead. Some keys always combine. For lock keys, the strictest value from any admin source applies.

Server-managed settings apply only when the session authenticates directly to Anthropic's API with an eligible login or key. If developers use Claude Code through Amazon Bedrock, Google Vertex AI or another endpoint, deliver the policy through MDM or a file.

## Which settings should you lock?

Start with these keys, all documented in the settings reference:

1. **`permissions.disableBypassPermissionsMode: "disable"`** stops developers running with all permission prompts skipped.
2. **`allowManagedPermissionRulesOnly: true`** makes only the managed allow and deny rules count. Developer and project allow rules are dropped.
3. **`allowManagedHooksOnly: true`** runs only hooks from the managed policy, so a repository cannot add its own.
4. **`allowManagedMcpServersOnly: true`** with an `allowedMcpServers` list restricts MCP servers to the ones you approve.
5. **`availableModels`** limits which models developers can choose.
6. **`strictKnownMarketplaces`** limits which plugin marketplaces can be added.
7. **Sandbox locks** such as `sandbox.network.allowManagedDomainsOnly` restrict network access to managed domain allowlists.

Add deny rules for sensitive paths and commands, such as reading `.env` files or running deployment tools. A short, strict list that you maintain beats a long list nobody reviews.

## What are the limits?

Managed settings protect against developers changing settings, not against developers who are local administrators. A local admin can edit the managed file or profile. That is why MDM tools redeploy profiles on a schedule, and why the macOS managed preferences domain and the Windows HKLM key exist.

Cloud sessions behave differently. A session running in an Anthropic-hosted environment does not read a device's MDM profile or file, so its policy must come from server-managed settings.

Managed settings also only govern Claude Code. Developers may run other coding agents, local MCP servers and skills. Our guides to [finding local MCP servers on developer laptops](/blog/find-local-mcp-servers-on-developer-laptops) and [governing coding agents with MDM](/blog/govern-coding-agents-on-laptops-with-mdm) cover the wider estate.

## How do you verify the policy is applied?

Run `/status` in Claude Code. It shows which source each setting came from, labelled for example `(remote)`, `(plist)` or `(HKLM)`. For server-managed settings, `claude doctor` reports the fetch outcome. If a policy file fails validation, Claude Code skips entries it can repair, warns about each, and drops values that still fail, except for keys that fail closed. Test a new policy on a pilot group before fleet rollout.

## What rollout checklist works?

1. Write the policy in version control and review it like code.
2. Pilot it with a small group through MDM or a file.
3. Check `/status` on pilot machines.
4. Add hooks for logging or blocking specific commands, as in [enforcing Claude Code policy with hooks](/blog/enforce-claude-code-policy-with-hooks).
5. Roll out by group; redeploy on a schedule.
6. Review deny rules and allowed MCP servers monthly.

## How Opencontroller does this

Opencontroller Edge, formerly Basecode, extends control to developer devices, coding agents, skills and local MCP servers. IT installs it via MDM. Opencontroller also discovers and manages skills in Anthropic Enterprise. See the [capability reference](/capability-reference) or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Can developers override Claude Code managed settings?**
Not through their own user, project or local settings. Managed settings apply above them. Local administrators can still edit the managed source itself.

**Where is managed-settings.json on a Mac?**
In `/Library/Application Support/ClaudeCode/`. On Linux and WSL it is in `/etc/claude-code/`, and on Windows in `C:\Program Files\ClaudeCode\`.

**How do I stop developers skipping permission prompts?**
Set `permissions.disableBypassPermissionsMode` to `"disable"` in managed settings.

## Key facts

- Claude Code managed settings apply above user, project, local and --settings values.
- Delivery: server-managed (Claude admin console, polled hourly), MDM (macOS com.anthropic.claudecode domain or Windows HKLM\SOFTWARE\Policies\ClaudeCode, checked every 30 minutes), or managed-settings.json files.
- File paths: /Library/Application Support/ClaudeCode/ (macOS), /etc/claude-code/ (Linux and WSL), C:\Program Files\ClaudeCode\ (Windows).
- Key locks: permissions.disableBypassPermissionsMode, allowManagedPermissionRulesOnly, allowManagedHooksOnly, allowManagedMcpServersOnly with allowedMcpServers, availableModels, strictKnownMarketplaces.
- Server-managed settings apply only when sessions authenticate directly to Anthropic's API; local admins can edit managed sources.
- Opencontroller Edge (formerly Basecode) extends control to developer devices, coding agents, skills and local MCP servers, installed via MDM.
- Opencontroller starts from $250K per deployment per year.

## Related

- [Can Claude Code hooks enforce security policy across an enterprise?](https://opencontroller.lyzr.com/blog/enforce-claude-code-policy-with-hooks.md)
- [How do you govern Claude Code across an enterprise?](https://opencontroller.lyzr.com/blog/govern-claude-code-in-the-enterprise.md)
- [How does Claude Code sandboxing limit what a coding agent can touch?](https://opencontroller.lyzr.com/blog/claude-code-sandboxing-for-enterprise.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
