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

# Update guardrail

> **Auth:** organization API key with `write` scope, or a signed-in user.

Send only the fields to change. `sub_agent_id: null` makes the guardrail agent-wide.



## OpenAPI

````yaml https://cp.xenovia.io/openapi.json patch /api/v1/agents/{agent_id}/slm-checks/{check_id}
openapi: 3.1.0
info:
  title: Xenovia Control Plane API
  version: 1.0.0
  description: >-
    Management API for agents, providers, policies, telemetry, alerts and
    organization settings.
servers:
  - url: https://cp.xenovia.io
    description: Production
security:
  - BearerAuth: []
paths:
  /api/v1/agents/{agent_id}/slm-checks/{check_id}:
    patch:
      tags:
        - agents
      summary: Update guardrail
      description: >-
        **Auth:** organization API key with `write` scope, or a signed-in user.


        Send only the fields to change. `sub_agent_id: null` makes the guardrail
        agent-wide.
      operationId: >-
        update_slm_check_route_api_v1_agents__agent_id__slm_checks__check_id__patch
      parameters:
        - name: check_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Check Id
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Agent Id
        - name: X-Request-ID
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Request-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SLMCheckUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SLMCheckRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SLMCheckUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Name
        sub_agent_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Sub Agent Id
        kind:
          anyOf:
            - type: string
              enum:
                - scope
                - custom
                - memory_write
                - context_summary
                - doing_more_than_asked
                - off_purpose
                - customer_reply
                - wrong_instruction
                - unfair_decision
                - deception
            - type: 'null'
          title: Kind
        prompt:
          anyOf:
            - type: string
              maxLength: 4000
            - type: 'null'
          title: Prompt
        stages:
          anyOf:
            - items:
                type: string
                enum:
                  - model_request
                  - model_response
                  - tool_call
                  - tool_result
                  - memory_write
                  - context_summary
              type: array
              minItems: 1
            - type: 'null'
          title: Stages
        action:
          anyOf:
            - type: string
              enum:
                - allow
                - block
                - redact
                - escalate
            - type: 'null'
          title: Action
        enforcement_mode:
          anyOf:
            - type: string
              enum:
                - monitor
                - enforce
            - type: 'null'
          title: Enforcement Mode
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
      additionalProperties: false
      type: object
      title: SLMCheckUpdate
    SLMCheckRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        agent_id:
          type: string
          format: uuid
          title: Agent Id
        org_id:
          type: string
          format: uuid
          title: Org Id
        name:
          type: string
          title: Name
        sub_agent_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Sub Agent Id
        kind:
          type: string
          title: Kind
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt
        stages:
          items:
            type: string
          type: array
          title: Stages
        action:
          type: string
          title: Action
        enforcement_mode:
          type: string
          title: Enforcement Mode
        enabled:
          type: boolean
          title: Enabled
        template_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Template Id
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - agent_id
        - org_id
        - name
        - kind
        - prompt
        - stages
        - action
        - enforcement_mode
        - enabled
        - template_id
        - created_at
        - updated_at
      title: SLMCheckRead
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token: an organization API key (`ak_…`) created under Settings →
        API Keys, or a dashboard user session token. Agent keys (`xe_…`) are not
        accepted here. Endpoints marked as user-only in their description reject
        organization keys with `403`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.