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

# List Guardrail Violations

> List guardrail violations across the enterprise.

## Permissions

Requires a service user with the `ManageEnterpriseSettings` permission at the enterprise level.

## Time filters

This endpoint supports optional time filters using the `time_after` and `time_before` query parameters.

* Both `time_after` and `time_before` are **Unix timestamps in seconds**, interpreted as UTC.
* If you provide `time_before`, you must also provide `time_after`.
* The time range between `time_after` and `time_before` must be **100 days or less**.
* If no time filters are provided, the API returns guardrail violations for the full available history (subject to pagination).


## OpenAPI

````yaml /v3-openapi.yaml GET /v3beta1/enterprise/guardrail-violations
openapi: 3.1.0
info:
  description: Devin v3 API with Service User authentication and RBAC
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3beta1/enterprise/guardrail-violations:
    get:
      tags:
        - guardrail_violations
      summary: List Guardrail Violations
      description: List guardrail violations across the enterprise.
      operationId: >-
        handle_get_enterprise_guardrail_violations_v3beta1_enterprise_guardrail_violations_get
      parameters:
        - in: query
          name: order
          required: false
          schema:
            default: desc
            enum:
              - asc
              - desc
            title: Order
            type: string
        - in: query
          name: time_before
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Time Before
        - in: query
          name: time_after
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Time After
        - in: query
          name: after
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: After
        - in: query
          name: first
          required: false
          schema:
            default: 100
            maximum: 200
            minimum: 1
            title: First
            type: integer
        - in: query
          name: session_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Session Id
        - in: query
          name: guardrail_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Guardrail Id
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaginatedResponse_GuardrailViolationResponse_
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    PaginatedResponse_GuardrailViolationResponse_:
      properties:
        end_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: Cursor to fetch the next page, or None if this is the last page.
          title: End Cursor
        has_next_page:
          default: false
          description: Whether there are more items available after this page.
          title: Has Next Page
          type: boolean
        items:
          items:
            $ref: '#/components/schemas/GuardrailViolationResponse'
          title: Items
          type: array
        total:
          anyOf:
            - type: integer
            - type: 'null'
          description: Optional total count (can be omitted for performance).
          title: Total
      required:
        - items
      title: PaginatedResponse[GuardrailViolationResponse]
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    GuardrailViolationResponse:
      properties:
        action_taken:
          title: Action Taken
          type: string
        confidence_score:
          title: Confidence Score
          type: number
        created_at:
          title: Created At
          type: integer
        event_id:
          title: Event Id
          type: string
        guardrail_id:
          title: Guardrail Id
          type: string
        guardrail_name:
          title: Guardrail Name
          type: string
        org_id:
          title: Org Id
          type: string
        reasoning:
          title: Reasoning
          type: string
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
        user_message:
          title: User Message
          type: string
        violation_id:
          title: Violation Id
          type: integer
      required:
        - violation_id
        - org_id
        - session_id
        - event_id
        - guardrail_id
        - guardrail_name
        - confidence_score
        - action_taken
        - reasoning
        - user_message
        - created_at
      title: GuardrailViolationResponse
      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
  securitySchemes:
    bearerAuth:
      description: 'Service User credential (prefix: cog_)'
      scheme: bearer
      type: http

````