# PolicyValidationMode

Validation mode for Cedar policy definitions.

- Source: [`aws-bedrockagentcore/lib/policy/policy-types.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-bedrockagentcore/lib/policy/policy-types.ts#L7)
- Type last changed: v2.269.0 · 10 Sep 2026

## Example

```ts
declare const policyEngine: agentcore.PolicyEngine;
declare const gateway: agentcore.Gateway;

// Allow access unless the user is suspended
const policyWithUnless = new agentcore.Policy(this, "UnlessPolicy", {
  policyEngine: policyEngine,
  policyName: "unless_suspended",
  statement: new agentcore.PolicyStatement({
    effect: agentcore.PolicyEffect.PERMIT,
    principal: agentcore.PolicyPrincipal.entityType('AgentCore::OAuthUser'),
    action: agentcore.PolicyAction.any(),
    resource: agentcore.PolicyResource.instance('AgentCore::Gateway', gateway.gatewayArn),
    unless: [
      agentcore.PolicyCondition.booleanEquals(
        agentcore.PolicyAttribute.principal('suspended'), true),
    ],
  }),
  description: "Allow all actions unless user is suspended",
  validationMode: agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS,
});

// Generated Cedar:
// permit(
//   principal is AgentCore::OAuthUser,
//   action,
//   resource == AgentCore::Gateway::"arn:..."
// )
// unless {
//   principal.suspended == true
// };
```

## Properties

- `FAIL_ON_ANY_FINDINGS`: [PolicyValidationMode](/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.PolicyValidationMode.html) (static) — Fail policy creation if any validation findings are detected.

  This is the safer default - catches policy errors early.

- `IGNORE_ALL_FINDINGS`: [PolicyValidationMode](/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.PolicyValidationMode.html) (static) — Ignore all validation findings and create the policy anyway.

  Use with caution - may result in runtime authorization errors.

- `value`: string — The string value of the validation mode.

## Methods

- `of(value: string): PolicyValidationMode // chainable` (static) — A validation mode that this version of the CDK does not model.

  Prefer the static members above. Use this when the service has added a mode
  that the CDK has no member for yet: the CloudFormation registry schemas that
  validate the synthesized template ship with `aws-cdk-lib` and refresh on
  release, while the members above are added by hand, so a released CDK can
  accept a mode before it models one.

  **Parameters**

  - `value` — the raw validation mode value to pass to CloudFormation.
