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

# Create a policy revision



## OpenAPI

````yaml /api-reference/openapi.json post /v1/policies/{policy_id}/revisions
openapi: 3.1.0
info:
  title: Feather API
  description: >-
    Unified customer experience platform API. Manages identity, conversations,
    memory, agents, procedures, policies, model routing, knowledge bases,
    integrations, and runtime execution.
  version: 1.21.0
servers:
  - url: https://api-sandbox.featherhq.com
    description: Sandbox
  - url: http://localhost:8000
    description: Local dev
security: []
paths:
  /v1/policies/{policy_id}/revisions:
    post:
      tags:
        - policies
      summary: Create a policy revision
      operationId: createPolicyRevision
      parameters:
        - name: policy_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Policy Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyRevisionCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyRevisionResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    PolicyRevisionCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        based_on_revision_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Based On Revision Id
        check_type:
          $ref: '#/components/schemas/PolicyCheckType'
        check_config:
          additionalProperties: true
          type: object
          title: Check Config
        enforcement_point:
          $ref: '#/components/schemas/PolicyEnforcementPoint'
        action:
          $ref: '#/components/schemas/PolicyAction'
        action_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Action Config
        tool_target:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Target
        mode:
          $ref: '#/components/schemas/PolicyMode'
          default: monitor
        on_error:
          anyOf:
            - $ref: '#/components/schemas/PolicyOnError'
            - type: 'null'
        timeout_ms:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Timeout Ms
        strictness:
          $ref: '#/components/schemas/PolicyStrictness'
          default: relaxed
        priority:
          type: integer
          title: Priority
          default: 0
      type: object
      required:
        - name
        - check_type
        - enforcement_point
        - action
      title: PolicyRevisionCreate
      description: >-
        Author a new named revision of a policy (optionally cloned from
        another).
    PolicyRevisionResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        policy_id:
          type: string
          format: uuid
          title: Policy Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        check_type:
          type: string
          title: Check Type
        check_config:
          additionalProperties: true
          type: object
          title: Check Config
        enforcement_point:
          type: string
          title: Enforcement Point
        action:
          type: string
          title: Action
        action_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Action Config
        tool_target:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Target
        mode:
          type: string
          title: Mode
        on_error:
          type: string
          title: On Error
        timeout_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timeout Ms
        strictness:
          type: string
          title: Strictness
        priority:
          type: integer
          title: Priority
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - policy_id
        - name
        - check_type
        - enforcement_point
        - action
        - mode
        - on_error
        - strictness
        - priority
        - created_at
        - updated_at
      title: PolicyRevisionResponse
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
        message:
          type: string
          title: Message
      type: object
      required:
        - error
        - message
      title: ErrorResponse
      description: Standard error response returned by all API error handlers.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PolicyCheckType:
      type: string
      enum:
        - expression
        - llm_judge
      title: PolicyCheckType
      description: >-
        How a policy decides whether content/state violates it.


        - ``expression``: a ``PolicyExprEvaluator`` boolean over turn state.

        - ``llm_judge``: a secondary LLM (via model_router) judges against
        ``guardrail_text``.
    PolicyEnforcementPoint:
      type: string
      enum:
        - input
        - pre_tool
        - post_tool
        - agent_response
      title: PolicyEnforcementPoint
      description: >-
        Where in a turn a policy's check fires (v2: one point per policy).


        ``agent_response`` is the single author-facing reply point — the v1

        ``response`` (per-streamed-unit) + ``post_response`` (complete reply)
        split is

        an internal runtime detail now, selected by the platform-derived
        enforcement

        strategy (buffer-and-gate vs per-unit), not an authored distinction.
    PolicyAction:
      type: string
      enum:
        - block
        - redact
        - append
        - require_approval
        - handoff
      title: PolicyAction
      description: >-
        What happens when a check fails.


        - ``block``: emit a canned safe message, raise ``PolicyViolationError``,
        short-circuit.

        - ``redact``: deterministic regex/truncate (NO LLM rewrite).

        - ``append``: append a disclaimer.

        - ``require_approval``: route through the HITL approval seam
        (``pre_tool`` only).

        - ``handoff``: hand off via ``HandoffService`` (source="policy").


        The v1 ``monitor`` action is gone — observe-only is the ``monitor``
        *mode* now.
    PolicyMode:
      type: string
      enum:
        - enforce
        - monitor
      title: PolicyMode
      description: >-
        The author's INTENT dial — act vs observe. Channel-independent.


        - ``enforce``: the policy acts on a violation (block / redact / append /
          require_approval / handoff) per the platform-derived strategy.
        - ``monitor``: shadow/canary — the check runs and records
        ``would_be_action``
          but never affects the turn. The safe-rollout default.

        The TRANSPORT property v2 conflated into ``enforcement_mode``
        (buffer-and-gate

        vs best-effort) is now platform-derived from ``transport_class`` at
        runtime

        (:func:`src.policy.resolution.resolve_strategy`), never authored.
        New-policy

        default *selection* is ``monitor`` (shadow-first; set at the schema
        layer).
    PolicyOnError:
      type: string
      enum:
        - fail_open
        - fail_closed
      title: PolicyOnError
      description: >-
        What to do when a check errors/times out.


        Action-derived default (v2): ``block`` action → fail_closed; else
        fail_open.
    PolicyStrictness:
      type: string
      enum:
        - strict
        - relaxed
      title: PolicyStrictness
      description: >-
        The streaming latency/guarantee dial (renamed from the v2 ``severity``).


        - ``strict``: always enforce before the user sees anything. On a
        STREAMING
          transport this holds/buffers (or incrementally gates), accepting brief added
          latency; on a BLOCKING transport gating is free.
        - ``relaxed``: enforce without slowing the conversation — best-effort on
        streaming
          transports (content may stream while the check runs), but still a FULL gate on
          blocking transports (gating is free there). ``relaxed`` never means "off".

        Configurable only at ``input``·llm_judge and
        ``agent_response``·expression; forced

        (and hidden in the UI) elsewhere. New-policy default is ``relaxed``.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````