> ## 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.

# Attach/detach policies on an assistant revision



## OpenAPI

````yaml /api-reference/openapi.json put /v1/agents/revisions/{revision_id}/policies
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/agents/revisions/{revision_id}/policies:
    put:
      tags:
        - policies
      summary: Attach/detach policies on an assistant revision
      operationId: setAgentRevisionPolicies
      parameters:
        - name: revision_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Revision Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyAttachmentUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyAttachmentResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    PolicyAttachmentUpdate:
      properties:
        policy_refs:
          anyOf:
            - items:
                $ref: '#/components/schemas/PolicyRefSpec'
              type: array
            - type: 'null'
          title: Policy Refs
        policies_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Policies Enabled
      type: object
      title: PolicyAttachmentUpdate
      description: >-
        Full-replace of an assistant revision's policy attachment.


        ``policy_refs`` is the complete attached set (``[]`` detaches all; omit
        to

        leave unchanged). ``policies_enabled`` flips the per-revision master
        switch;

        omit to leave unchanged.
    PolicyAttachmentResponse:
      properties:
        revision_id:
          type: string
          format: uuid
          title: Revision Id
        policies_enabled:
          type: boolean
          title: Policies Enabled
        policy_refs:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Policy Refs
        inert_tool_policies:
          items:
            $ref: '#/components/schemas/InertToolPolicy'
          type: array
          title: Inert Tool Policies
      type: object
      required:
        - revision_id
        - policies_enabled
      title: PolicyAttachmentResponse
      description: The assistant revision's current policy attachment after a write/read.
    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
    PolicyRefSpec:
      properties:
        policy_id:
          type: string
          format: uuid
          title: Policy Id
      type: object
      required:
        - policy_id
      title: PolicyRefSpec
      description: >-
        One attached-policy reference stored on ``AgentRevision.policy_refs``.


        The single canonical attachment shape, shared by the assistant-revision

        attachment API (``PolicyAttachmentUpdate``) and the agents request
        bodies

        (``AgentRevisionCreate``/``Update``, which import this type). A ref
        carries ONLY

        the ``policy_id`` — attaching a policy is what makes it run on the
        assistant.

        There is no separate per-attachment run/suspend toggle: detach to stop a
        policy,

        or use the per-revision ``policies_enabled`` master switch (or the
        org-wide kill

        switch) for coarser control. Mode is per-policy now (no per-attachment
        override).

        Only ``scope=attachable`` policies are referenced here —
        ``scope=organization``

        policies auto-apply and are never listed. Catalog existence +
        org-ownership of

        the referenced policy is checked at write time.
    InertToolPolicy:
      properties:
        policy_id:
          type: string
          format: uuid
          title: Policy Id
        name:
          type: string
          title: Name
        tool_target:
          type: string
          title: Tool Target
        reason:
          type: string
          title: Reason
          default: tool_not_in_assistant_surface
      type: object
      required:
        - policy_id
        - name
        - tool_target
      title: InertToolPolicy
      description: >-
        An attached tool-targeted policy that can never fire on this assistant.


        Advisory only (NOT a blocking error): the policy is pinned to a
        ``tool_target`` the

        assistant doesn't use — neither in its off-script ``tool_refs`` nor in
        its bound

        workflow graph — so the runtime gate filters it out on every tool call
        (a silent

        no-op). Attaching it is still allowed (the tool may be added later, and
        org-wide tool

        policies are inert on assistants lacking the tool by design); the UI
        surfaces this so

        the operator isn't surprised by coverage they think they have.
    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

````