> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ankra.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Set the security baseline policy mode (audit or enforce)



## OpenAPI

````yaml https://platform.ankra.app/openapi.json post /org/clusters/imported/{cluster_id}/security/policy-mode
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
paths:
  /org/clusters/imported/{cluster_id}/security/policy-mode:
    post:
      tags:
        - Security
      summary: Set the security baseline policy mode (audit or enforce)
      operationId: set_imported_cluster_security_policy_mode
      parameters:
        - in: path
          name: cluster_id
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SecurityPolicyModeRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecurityPolicyModeResponse'
          description: >-
            The kyverno-policies addon values were updated with the requested
            validationFailureAction; the reconciler applies the release.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecurityPermissionDenied'
          description: Permission or CSRF denied
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecurityDetailError'
          description: >-
            Cluster not found or the security baseline policy addon is not
            installed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: >-
            Request validation error (mode outside audit/enforce) or the GitOps
            push failed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecurityDetailError'
          description: Internal server error
components:
  schemas:
    SecurityPolicyModeRequest:
      properties:
        mode:
          enum:
            - audit
            - enforce
          type: string
      required:
        - mode
      type: object
    SecurityPolicyModeResponse:
      properties:
        commit_sha:
          nullable: true
          type: string
        commit_url:
          nullable: true
          type: string
        mode:
          enum:
            - audit
            - enforce
          type: string
        valid:
          type: boolean
      required:
        - valid
        - mode
        - commit_sha
        - commit_url
      type: object
    SecurityPermissionDenied:
      properties:
        detail:
          enum:
            - permission_denied
          type: string
        permission:
          type: string
        scope_type:
          type: string
      required:
        - detail
        - permission
        - scope_type
      type: object
    SecurityDetailError:
      properties:
        detail:
          type: string
      required:
        - detail
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````