{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-bedrock/json-schema/amazon-bedrock-create-policy-request-schema.json",
  "title": "CreatePolicyRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-bedrock-policies-api-openapi.yml#/components/schemas/CreatePolicyRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The customer-assigned immutable name for the policy. Must be unique within the account. This name is used for policy identification and cannot be changed after creation."
    },
    "definition": {
      "$ref": "#/$defs/PolicyDefinition"
    },
    "description": {
      "type": "string",
      "description": "A human-readable description of the policy's purpose and functionality (1-4,096 characters). This helps policy administrators understand the policy's intent, business rules, and operational scope. Use this field to document why the policy exists, what business requirement it addresses, and any special considerations for maintenance. Clear descriptions are essential for policy governance, auditing, and troubleshooting."
    },
    "validationMode": {
      "type": "string",
      "enum": [
        "FAIL_ON_ANY_FINDINGS",
        "IGNORE_ALL_FINDINGS"
      ],
      "description": "The validation mode for the policy creation. Determines how Cedar analyzer validation results are handled during policy creation. FAIL_ON_ANY_FINDINGS (default) runs the Cedar analyzer to validate the policy against the Cedar schema and tool context, failing creation if the analyzer detects any validation issues to ensure strict conformance. IGNORE_ALL_FINDINGS runs the Cedar analyzer but allows policy creation even if validation issues are detected, useful for testing or when the policy schema is evolving. Use FAIL_ON_ANY_FINDINGS for production policies to ensure correctness, and IGNORE_ALL_"
    },
    "enforcementMode": {
      "type": "string",
      "enum": [
        "ACTIVE",
        "LOG_ONLY"
      ],
      "description": "The enforcement mode for the policy. Run this policy in LOG_ONLY mode to collect data on how it affects your application. Once you are satisfied with the data gathered, switch the policy to ACTIVE. Defaults to ACTIVE."
    },
    "policyEngineId": {
      "type": "string",
      "description": "The identifier of the policy engine which contains this policy. Policy engines group related policies and provide the execution context for policy evaluation."
    },
    "clientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier to ensure the idempotency of the request. The Amazon Web Services SDK automatically generates this token, so you don't need to provide it in most cases. If you retry a request with the same client token, the service returns the same response without creating a duplicate policy."
    }
  },
  "required": [
    "name",
    "definition",
    "policyEngineId"
  ],
  "$defs": {
    "CedarPolicy": {
      "type": "object",
      "properties": {
        "statement": {
          "type": "string",
          "description": "The Cedar policy statement that defines the authorization logic. This statement follows Cedar syntax and specifies principals, actions, resources, and conditions that determine when access should be allowed or denied."
        }
      },
      "required": [
        "statement"
      ]
    },
    "PolicyDefinition": {
      "type": "object",
      "properties": {
        "cedar": {
          "$ref": "#/$defs/CedarPolicy"
        },
        "policyGeneration": {
          "$ref": "#/$defs/PolicyGenerationDetails"
        },
        "policy": {
          "$ref": "#/$defs/PolicyStatement"
        }
      },
      "description": "Exactly one member is set."
    },
    "PolicyGenerationDetails": {
      "type": "object",
      "properties": {
        "policyGenerationId": {
          "type": "string",
          "description": "The unique identifier for this policy generation request."
        },
        "policyGenerationAssetId": {
          "type": "string",
          "description": "The unique identifier for this generated policy asset within the policy generation request."
        }
      },
      "required": [
        "policyGenerationId",
        "policyGenerationAssetId"
      ]
    },
    "PolicyStatement": {
      "type": "object",
      "properties": {
        "statement": {
          "type": "string",
          "description": "The body of the AgentCore Cedar or Dogwood policy statement. Contains the policy logic, which can be a Cedar policy, a temporal policy, or a guardrails definition."
        }
      },
      "required": [
        "statement"
      ]
    }
  }
}