Claude Platform Docs
AdminEncryption keys (CMEK)

Configure AWS KMS for CMEK

Use AWS KMS to provide an encryption key for your organization.

Claude Code

Let Claude Code set up this feature for you

/claude-api help me configure a customer-managed encryption key with AWS KMS

This guide shows how to use an AWS KMS key as a customer-managed encryption key (CMEK) for your Anthropic organization.

Prerequisites

  • An AWS account with permissions to create KMS keys and set key policies (kms:CreateKey and kms:PutKeyPolicy).
  • To create the key from the command line, the AWS CLI installed and authenticated.
  • To register the key through the API, an Anthropic Admin API key for your organization.

Amazon Resource Name (ARN) for Anthropic

The key policy in this guide gives the following Anthropic IAM role access to your key:

arn:aws:iam::915198916910:role/anthropic-cmek-client-us

Encryption key setup

Prepare the key policy

Copy this policy into a text editor:

key-policy.json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AccountRootAdmin",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::<AWS_ACCOUNT_ID>:root"
      },
      "Action": "kms:*",
      "Resource": "*"
    },
    {
      "Sid": "AllowAnthropicCMEKCrypto",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::915198916910:role/anthropic-cmek-client-us"
      },
      "Action": ["kms:Encrypt", "kms:Decrypt"],
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "kms:EncryptionContext:anthropic:org_uuid": ["<ORGANIZATION_UUID>"]
        }
      }
    },
    {
      "Sid": "AllowAnthropicCMEKDescribe",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::915198916910:role/anthropic-cmek-client-us"
      },
      "Action": "kms:DescribeKey",
      "Resource": "*"
    }
  ]
}

Replace the two placeholders:

  • <AWS_ACCOUNT_ID>: your AWS account ID. To print it with the AWS CLI, run aws sts get-caller-identity --query Account --output text.
  • <ORGANIZATION_UUID>: your Anthropic organization ID

Don't remove the kms:EncryptionContext:anthropic:org_uuid condition, or validation fails. To share one key among several Anthropic organizations, list each organization ID in it. To limit the key to specific workspaces, see the optional workspace condition.

Create the key

Create the key in a US region. For the lowest latency, use us-east-2.

  1. Open the Create key wizard

    Open the AWS KMS console and switch to the region for the key. Go to Customer managed keys and click Create key.

  2. Configure key

    Make sure that these options are selected:

    • Key type: Symmetric
    • Key usage: Encrypt and decrypt
    • Advanced options > Key material origin: KMS
    • Advanced options > Regionality: Single-Region key

    Click Next.

    AWS KMS Create key wizard on the Configure key step, with Symmetric key type, Encrypt and decrypt key usage, and Single-Region key selected.

    Symmetric, encrypt and decrypt, single-Region key.
  3. Add labels

    Enter an Alias for the key, such as anthropic-cmek. Click Next.

    AWS KMS Add labels step with an alias of anthropic-cmek and a description of Anthropic CMEK.

    An alias for the key.
  4. Define key administrative permissions

    Don't select any key administrators. Your key policy already gives your AWS account full admin control. Click Next.

    AWS KMS Define key administrative permissions step listing IAM roles that can administer the key.

    Leave key administrators empty.
  5. Define key usage permissions

    Don't select any key users, and don't add anything under Other AWS accounts. Your key policy already grants the access that's needed. Click Next.

  6. Edit key policy

    Click Edit. Replace the whole policy with your key policy, then click Next.

  7. Review

    Click Finish.

  8. Copy the key ARN

    In Customer managed keys, open the new key and copy its ARN. You need the ARN to register the key.

To replace the key policy on a key that already exists:

  1. Open the key and click the Key policy tab.
  2. If you see Switch to policy view, click it.
  3. Click Edit.
  4. Replace the JSON with your key policy.
  5. Click Save changes.

Register the key with Anthropic

Validating the key adds expected access-denied errors to CloudTrail. If you alert on these errors, see Expected errors in CloudTrail first.

  1. Open the encryption key settings

    In the Claude Console, go to the Data retention page (platform.claude.com/settings/privacy). If you don't see Encryption keys, select Organization from the dropdown menu at the top of the page.

  2. Add the key

    Under Encryption keys, click Add key. Enter a Display name and select AWS KMS. Click Continue.

  3. Enter the key ARN

    The dialog box shows the Organization ID for the key policy. Check that your key policy contains this ID. Paste the key ARN into KMS key ARN and click Add.

  4. Validate the key

    In the Encryption keys list, click Verify next to the key. Connected appears when the check passes. If it fails, see Troubleshoot validation for common causes.

  5. Attach the key to a workspace

    Attaching a key can't be undone. If you can, attach it to a new workspace before that workspace receives any requests. In a workspace that already receives requests, the key can take up to a day to take effect.

    On the Data retention page, select the workspace from the dropdown menu at the top of the page. Under Encryption key, select the key and click Save.

  6. Confirm the change

    Select the checkbox to confirm that you have read the CMEK documentation, then click Confirm.

Troubleshoot validation

If validation fails, common causes are:

  • Wrong organization ID: Make sure the org_uuid condition lists your bare organization ID, not the org_-prefixed ID.
  • Encryption context mismatch: If the policy has a kms:EncryptionContext:anthropic:compartment_uuid condition, make sure it lists the compartment ID of each workspace the key is attached to. On an older key, the compartment statement might still allow kms:Encrypt. In that case, keep the all-zeros value (00000000-0000-0000-0000-000000000000) in the list too.
  • Resource control policies (RCPs): Some RCPs deny KMS operations when aws:PrincipalOrgID does not match your AWS organization. An RCP like this blocks Anthropic's role. Add an exception to it for this key or for Anthropic's role ARN. Service control policies do not apply here.
  • Access granted through IAM instead of the key policy: Grant Anthropic's role access in the key policy itself, not through an IAM policy in your account. To check the key policy, run aws kms get-key-policy --region <REGION> --key-id <KEY_ARN> --policy-name default.
  • Region mismatch: Confirm that the key is in a US region.

Expected errors in CloudTrail

Anthropic validates the key whenever you verify it, attach it to a workspace, or view it in the Claude Enterprise settings. Each validation adds four access-denied errors to CloudTrail. These errors are expected.

To filter them out, match all three of these values:

  • requestParameters.encryptionContext.associatedData: Y21lay12YWxpZGF0aW9u
  • userIdentity.accountId: 915198916910
  • resources.ARN: arn:aws:kms:<REGION>:<AWS_ACCOUNT_ID>:key/<KEY_ID>

The first value alone isn't enough, because any caller can set it.

Terraform

To create the key with Terraform, use the aws_kms_key and aws_kms_alias resources from the aws provider.

Was this page helpful?