{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-bedrock/json-schema/amazon-bedrock-update-policy-request-schema.json",
  "title": "UpdatePolicyRequest",
  "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/UpdatePolicyRequest",
  "type": "object",
  "properties": {
    "policyEngineId": {
      "type": "string",
      "description": "The identifier of the policy engine that manages the policy to be updated. This ensures the policy is updated within the correct policy engine context."
    },
    "policyId": {
      "type": "string",
      "description": "The unique identifier of the policy to be updated. This must be a valid policy ID that exists within the specified policy engine."
    },
    "description": {
      "$ref": "#/$defs/UpdatedDescription"
    },
    "definition": {
      "$ref": "#/$defs/PolicyDefinition"
    },
    "validationMode": {
      "type": "string",
      "enum": [
        "FAIL_ON_ANY_FINDINGS",
        "IGNORE_ALL_FINDINGS"
      ],
      "description": "The validation mode for the policy update. Determines how Cedar analyzer validation results are handled during policy updates. FAIL_ON_ANY_FINDINGS runs the Cedar analyzer and fails the update if validation issues are detected, ensuring the policy conforms to the Cedar schema and tool context. IGNORE_ALL_FINDINGS runs the Cedar analyzer but allows updates despite validation warnings. Use FAIL_ON_ANY_FINDINGS to ensure policy correctness during updates, especially when modifying policy logic or conditions."
    },
    "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. If you omit this field, the policy's existing enforcement mode is unchanged."
    }
  },
  "required": [
    "policyEngineId",
    "policyId"
  ],
  "$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"
      ]
    },
    "UpdatedDescription": {
      "type": "object",
      "properties": {
        "optionalValue": {
          "type": "string",
          "description": "Represents an optional value that is used to update the human-readable description of the resource. If not specified, it will clear the current description of the resource."
        }
      }
    }
  }
}