
Claude Code and Cowork on Bedrock, Part 2: Claude Code Managed Settings and Hardening
Part 2 of a four-part enterprise playbook. Push one managed-settings profile to every developer laptop: Bedrock-only provider, exact model allowlists, IAM Identity Center sign-in, the OS sandbox, managed MCP servers, org plugins, and deterministic security hooks. Covers the settings that look right but silently do nothing. Verified November 2026.
Series: Claude Code and Cowork on Bedrock (4 articles)
- 2Claude Code and Cowork on Bedrock, Part 2: Claude Code Managed Settings and Hardening This article
Claude Code and Cowork on Bedrock, Part 2: Claude Code Managed Settings and Hardening
Last verified November 11, 2026, against Claude Code v2.1.322. Configuration keys change monthly, so check the linked references before you deploy.
The series
- Part 1: The AWS foundation. Accounts, data retention, identity, and models
- Part 2: Claude Code managed settings and hardening (you are here)
- Part 3: Claude Desktop and Cowork managed settings
- Part 4: Cost, spend controls, and observability
This part assumes you've completed Part 1. You need a dedicated Bedrock account with zero data retention, a
ClaudeBedrockUser permission set, and /etc/aws/config deployed by MDM.You'll build one managed-settings profile that every developer gets and nobody can override. It does six things:
- Pins Claude Code to Bedrock and to the exact models you approve
- Signs users in through IAM Identity Center and refreshes credentials automatically
- Runs every shell command inside the OS sandbox with a network allowlist
- Keeps Claude away from credentials, keychains, and browser data
- Delivers skills, hooks, and MCP servers only through your own plugin marketplace
- Enforces a minimum version and a transcript-retention period
Where managed settings live
Platform | Location |
|---|---|
macOS | The com.anthropic.claudecode preference domain (a configuration profile pushed by Jamf, Intune, or Kandji) |
Windows | C:\Program Files\ClaudeCode\managed-settings.json , or the JSON as a REG_SZ value named Settings under HKLM\SOFTWARE\Policies\ClaudeCode |
Linux | /etc/claude-code/managed-settings.json |
The plist, the registry value, and the JSON file all use the same keys ( Deploy managed settings ). Managed settings sit at the top of the precedence order, so user, project, and command-line settings can't override them. The examples below use the macOS plist. For Windows or Linux, convert them to JSON with the same structure.
Server-managed settings don't apply on Bedrock. Claude Code skips the server-managed settings you'd set in the claude.ai admin console whenCLAUDE_CODE_USE_BEDROCKis set, soforceRemoteSettingsRefreshhas no effect ( Claude Code on Amazon Bedrock ). On Bedrock, MDM (or the Claude apps gateway, covered in Part 4) is your delivery channel.
The managed-settings profile
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict> <!-- Provider and auth --> <key>allowedProviders</key> <array><string>bedrock</string></array> <key>awsAuthRefresh</key> <string>aws sso login --profile claude-code</string> <key>env</key> <dict> <key>CLAUDE_CODE_USE_BEDROCK</key><string>1</string> <key>AWS_PROFILE</key><string>claude-code</string> <key>AWS_REGION</key><string>us-east-1</string> <key>AWS_CONFIG_FILE</key><string>/etc/aws/config</string> <key>ANTHROPIC_DEFAULT_SONNET_MODEL</key><string>us.anthropic.claude-sonnet-5-5</string> <key>ANTHROPIC_DEFAULT_OPUS_MODEL</key><string>us.anthropic.claude-opus-5-5</string> <key>ANTHROPIC_DEFAULT_HAIKU_MODEL</key><string>us.anthropic.claude-haiku-5-5</string> <key>CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY</key><string>1</string> </dict>
<!-- Model allowlist that new releases can't slip through --> <key>availableModels</key> <array> <string>us.anthropic.claude-sonnet-5-5</string> <string>us.anthropic.claude-opus-5-5</string> <string>us.anthropic.claude-haiku-5-5</string> </array> <key>availableModelsMatch</key><string>exact</string> <key>enforceAvailableModels</key><true/>
<!-- Lock down customization --> <key>allowManagedPermissionRulesOnly</key><true/> <key>allowManagedHooksOnly</key><true/> <key>allowManagedMcpServersOnly</key><true/> <key>strictPluginOnlyCustomization</key><true/> <key>disableSideloadFlags</key><true/> <key>disableRemoteControl</key><true/>
<!-- Plugins: allow ONLY your marketplace, register it, force-enable --> <key>strictKnownMarketplaces</key> <array> <dict> <key>source</key><string>github</string> <key>repo</key><string>your-org/claude-plugins</string> </dict> </array> <key>extraKnownMarketplaces</key> <dict> <key>org-tools</key> <dict> <key>source</key> <dict> <key>source</key><string>github</string> <key>repo</key><string>your-org/claude-plugins</string> </dict> </dict> </dict> <key>enabledPlugins</key> <dict> <key>company-tools@org-tools</key><true/> </dict>
<!-- OS-level sandbox for Bash --> <key>sandbox</key> <dict> <key>enabled</key><true/> <key>failIfUnavailable</key><true/> <key>allowUnsandboxedCommands</key><false/> <key>filesystem</key> <dict><key>allowManagedReadPathsOnly</key><true/></dict> <key>network</key> <dict> <key>allowManagedDomainsOnly</key><true/> <key>allowedDomains</key> <array> <string>*.your-org.com</string> <string>github.com</string> <string>registry.npmjs.org</string> <string>pypi.org</string> <string>files.pythonhosted.org</string> </array> </dict> </dict>
<!-- Permissions --> <key>permissions</key> <dict> <key>disableAutoMode</key><string>disable</string> <key>disableBypassPermissionsMode</key><string>disable</string> <key>blockWritesOutsideWorkingDirectories</key><true/> <key>deny</key> <array> <string>Read(~/.aws/**)</string> <string>Edit(~/.aws/**)</string> <string>Read(~/.ssh/**)</string> <string>Edit(~/.ssh/**)</string> <string>Read(~/Library/Keychains/**)</string> <string>Read(//Library/Managed Preferences/**)</string> <string>Read(~/Library/Application Support/Google/Chrome/**)</string> <string>Read(~/Library/Application Support/Firefox/**)</string> <string>Read(~/Library/Cookies/**)</string> <string>Bash(sudo *)</string> <string>Bash(aws iam *)</string> <string>Bash(aws sts assume-role *)</string> <string>Bash(aws configure *)</string> <string>Bash(aws organizations *)</string> <string>Bash(security *)</string> <string>Bash(launchctl *)</string> </array> </dict>
<!-- Versions and retention --> <key>requiredMinimumVersion</key><string>2.1.321</string> <key>autoUpdatesChannel</key><string>stable</string> <key>cleanupPeriodDays</key><integer>90</integer></dict></plist>Why each choice matters
Every key below is documented in the settings reference . Version requirements come from the changelog .
Provider and models
-
allowedProviders: ["bedrock"]refuses any session on another provider, including a personal claude.ai sign-in. It requires Claude Code v2.1.285 or later. (If you route through the Claude apps gateway instead, see Part 4. Gateway sign-in usesforceLoginMethodandforceLoginGatewayUrl.)
-
availableModelsMatch: "exact"matters because matching is by prefix by default: an entry likeclaude-opus-5would also permit Opus 5.5. Withexact, a new release stays blocked until you add it, and the picker's Default option is limited to the listed models. This key is honored only in managed settings.
-
enforceAvailableModelsmakes Default resolve to the first model in your list if it would otherwise resolve to a model outside it.
-
deniedModels(managed only, v2.1.283 and later) is the inverse: it blocks models even ifavailableModelspermits them. Note that"claude-opus-5"also blocks Opus 5.5; use"claude-opus-5-0"to block Opus 5 alone. It's a useful belt-and-braces line for covered models such as the Fable family (Part 1).
-
ANTHROPIC_DEFAULT_*_MODELpins what thesonnet,opus, andhaikualiases resolve to. Claude Code's built-in Bedrock default is Opus 5.5, so set Sonnet explicitly if you want a cost-conscious default. To route a team to its own application inference profile for cost attribution, put the AIP ARN here in that team's profile (Part 4).
Authentication
-
awsAuthRefreshruns when credentials expire, so the browser SSO flow reopens without the user leaving Claude Code.
-
AWS_CONFIG_FILE=/etc/aws/configpoints at the root-owned shared config from Part 1, which is why the~/.aws/**deny rules don't break sign-in.
Customization lockdown
-
allowManagedPermissionRulesOnly,allowManagedHooksOnly, andstrictPluginOnlyCustomizationstop users and repositories from adding their own permission rules, hooks, skills, agents, or MCP servers. Only what you ship in managed settings or managed plugins counts.strictPluginOnlyCustomizationalso has.agents,.hooks,.mcp, and.skillssub-keys if you want to lock down only some surfaces.
-
disableSideloadFlagsrejects command-line flags that sideload plugins, subagents, and MCP servers.
-
disableRemoteControlturns off Remote Control everywhere it can start. On Bedrock it isn't available anyway, but the explicit setting documents intent.
Plugins
-
strictKnownMarketplacesmust name your repo. An empty list ([]) blocks every marketplace, including yours, and your managed plugins will silently fail to load.
-
extraKnownMarketplacesregisters the marketplace on every machine. Since v2.1.321, a marketplace name you declare here can't be taken over from another source.
-
enabledPluginsis an object that mapsplugin@marketplacetotrue. It isn't an array. Users can't disable a force-enabled plugin.
Sandbox
- The sandbox is the real network control. Deny rules like
Bash(curl *)are easy to bypass (/usr/bin/curl,sh -c '…'), and the permissions documentation says to pair them with the sandbox network allowlist. The sandbox covers shell commands only. Claude Code's own Bedrock API calls aren't affected, so don't addbedrock-runtimeto the list.
- Wildcards are supported only as a leading
*.. A*in the middle of a hostname has no effect ( Sandboxing ).
-
failIfUnavailablerefuses to start if the sandbox can't run, instead of quietly running commands unsandboxed.allowUnsandboxedCommands: falseremoves the escape hatch that lets a command retry outside the sandbox.
-
allowManagedReadPathsOnlyandallowManagedDomainsOnlystop developers from reopening paths or domains you blocked.
Permissions
-
disableAutoModematters more than it used to. Since v2.1.283, auto mode is the built-in starting permission mode for interactive sessions, and it's available on Bedrock for eligible models ( Choose a permission mode ). In auto mode, a classifier model approves actions instead of the user.
-
disableBypassPermissionsModeremoves--dangerously-skip-permissions.
- Use
Edit(...), notWrite(...).Editdeny rules cover every file write;Write(path)rules match nothing.
-
blockWritesOutsideWorkingDirectories(v2.1.314 or later) confines the file-writing tools to the project in every permission mode. It's better than denying~/.claude/**, which breaks auto memory and plans.~/.claudeis already a protected path that prompts before writes.
-
blockReadsOutsideWorkingDirectoriesis the stricter companion: the file tools refuse reads outside the working directories. Turn it on for high-sensitivity teams. Expect developers to ask for--add-dirwhen they work across repositories.
- Permission order is deny → ask → allow, and the first match wins. A deny rule always beats an allow rule.
Versions and retention
-
requiredMinimumVersion: 2.1.321refuses to start on older builds. Fixes cited here are from the Claude Code changelog . The recommended keys need v2.1.314 or later. v2.1.319 fixed a sandbox escape when creating a worktree and a Bash permission bypass through a crafted environment prefix, and v2.1.321 fixed a read-only Bash command that could run outside the sandbox without a prompt. Raise this floor whenever a release fixes a security issue.
-
autoUpdatesChannel: stablefollows the stable channel instead of the latest build.
-
cleanupPeriodDaysdefaults to 30. After 30 days, Claude Code silently deletes local transcripts in~/.claude/projects/. Set it to match your records-retention policy. Shorter is better if transcripts may contain regulated data; longer is better if users rely on history.
Telemetry
On Bedrock, Claude Code's Anthropic usage metrics and error reporting are already off by default. Don't set
CLAUDE_CODE_ENABLE_TELEMETRY=0 to "disable telemetry": that variable only enables your own OpenTelemetry export (Part 4; see environment variables and Monitoring ). Setting it to 0 turns off your own monitoring.
MCP servers
- Exclusive file. Deploy
/Library/Application Support/ClaudeCode/managed-mcp.jsonon macOS (/etc/claude-code/managed-mcp.jsonon Linux,C:\Program Files\ClaudeCode\managed-mcp.jsonon Windows). When that file exists, users can't add or use any other server, including servers that plugins provide. This is the strongest control.
- Allowlist.
allowManagedMcpServersOnlyonly makes the managed allowlist authoritative. If you never defineallowedMcpServers, it restricts nothing.
The profile above sets
allowManagedMcpServersOnly . Pair it with managed-mcp.json or an allowedMcpServers list. Don't rely on the flag alone.
Skills and plugins
A plugin is a versioned package that bundles skills, agents, hooks, slash commands, MCP servers, and more. Host your plugins in a private Git marketplace with a
marketplace.json file at the root ( Manage plugins for your organization ).company-tools/├── .claude-plugin/plugin.json├── skills/code-review/SKILL.md├── agents/*.md├── commands/*.md└── hooks/hooks.jsonThe
strictKnownMarketplaces , extraKnownMarketplaces , and enabledPlugins keys in the profile install the plugin on every machine at session start. To change what users get, merge into the marketplace repo. You don't redeploy the MDM profile.Moving from claude.ai Teams/Enterprise? Skills need repackaging as
SKILL.md files in your plugin. (Desktop has an import path for chats and projects; see Part 3.)A deterministic security hook
Hooks run outside the model, so prompt injection can't talk its way past one. Put this in the plugin's
hooks/hooks.json :{ "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/scripts/security-gate.sh", "timeout": 5 } ] } ] }}The timeout is in seconds ( Hooks reference ). The script reads the tool call as JSON on stdin and exits with code
2 to block it. A minimal gate:#!/bin/bash# security-gate.sh: block shell commands that touch credentials or pipe to a shellcmd=$(jq -r '.tool_input.command // ""')if echo "$cmd" | grep -Eq '(\.aws/credentials|\.ssh/id_|curl[^|]*\|\s*(ba|z)?sh)'; then echo "Blocked by org security policy" >&2 exit 2fiexit 0With
allowManagedHooksOnly , only hooks from managed settings and force-enabled managed plugins run, so a repository can't ship a hook that weakens yours.
Hardening checklist
Control | Setting | Notes |
|---|---|---|
Bedrock-only provider | allowedProviders: ["bedrock"] | v2.1.285+ |
SSO auth, no shared keys | AWS_PROFILE + awsAuthRefresh + /etc/aws/config | Part 1 |
Exact model allowlist | availableModels + availableModelsMatch: exact + enforceAvailableModels | Add deniedModels for covered models |
OS sandbox, fail closed | sandbox.enabled , failIfUnavailable , allowUnsandboxedCommands: false | |
Network egress allowlist | sandbox.network.allowedDomains + allowManagedDomainsOnly | Leading *. only |
Credentials off limits | Read / Edit deny on ~/.aws , ~/.ssh , keychains, browser profiles | Not Write(...) |
Confine file tools | blockWritesOutsideWorkingDirectories (optionally blockReadsOutsideWorkingDirectories ) | v2.1.314+ |
No privilege escalation | Bash(sudo *) , launchctl , security , aws iam denies | Backstopped by the sandbox |
No auto or bypass mode | disableAutoMode , disableBypassPermissionsMode | Auto mode is the default starting mode since v2.1.283 |
Managed rules, hooks, and MCP only | allowManagedPermissionRulesOnly , allowManagedHooksOnly , managed-mcp.json | |
Plugins from your marketplace only | strictKnownMarketplaces naming your repo | Never [] |
No sideloading or Remote Control | disableSideloadFlags , disableRemoteControl | |
Minimum version | requiredMinimumVersion: 2.1.321 | Raise it after security fixes |
Transcript retention | cleanupPeriodDays | Default 30 |
Content filtering with Bedrock Guardrails (optional)
If policy requires content filtering on coding traffic, apply a Bedrock Guardrail . The cleanest place is the Claude apps gateway's
bedrock upstream ( guardrail ; see gateway configuration ), which applies it to every request without client changes. Test it on a pilot group first. Guardrails that are tuned for chat can block legitimate code, such as security tooling or sample credentials in tests.
Verify the rollout
defaults read com.anthropic.claudecode # Did the profile land?aws sts get-caller-identity --profile claude-codeclaude # then run /status, which should show managed settings (plist)Inside Claude Code,
/setup-bedrock reopens the Bedrock wizard and runs the model-access checks. /model should list exactly your three models.Troubleshooting
Symptom | Fix |
|---|---|
"Authentication failed" | Run aws sso login --profile claude-code . Confirm awsAuthRefresh is set. |
"Unable to read managed policy settings" on macOS | A slow MDM profile install. v2.1.321 retries the read once. Upgrade, then relaunch. |
Managed plugins never install | strictKnownMarketplaces is [] or doesn't include your repo, or extraKnownMarketplaces is missing. |
Model refused at startup | The model isn't activated in the account, or it's outside availableModels . Check the IAM resource prefix ( us. vs global. ). |
A Fable or Mythos model returns a ValidationException | Expected under zero data retention. See Part 1. |
WebSearch is missing | Expected on Bedrock. |
Session starts in auto mode | permissions.disableAutoMode isn't set to "disable" in managed settings. |
Hook never fires or hangs | Check the schema ( matcher → hooks[] → type ). The timeout is in seconds. |
A deny rule doesn't stop a command | Shell-level deny rules are bypassable. Rely on the sandbox and a PreToolUse hook. |
What's next
Part 3 applies the same approach to Claude Desktop and Cowork: in-app AWS sign-in, the Desktop managed-configuration keys for macOS, Windows, and Linux, plugins, and migration from claude.ai.
References
Claude Code documentation
AWS
Opinions are my own. Configuration keys and model IDs change frequently; verify against the documentation above before deploying.
Series: Claude Code and Cowork on Bedrock (4 articles)
- 2Claude Code and Cowork on Bedrock, Part 2: Claude Code Managed Settings and Hardening This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article