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

# List Policy Rules

> List rules for a specific policy.



## OpenAPI

````yaml /openapi/api.json get /v1/policies/{policy_id}/rules
openapi: 3.1.0
info:
  title: Vijil Console API (Combined)
  description: Combined OpenAPI specification for all vijil-console microservices.
  version: 0.1.0
servers: []
security: []
tags:
  - name: Teams
    description: Authentication, users, and team management
  - name: Agent Environment
    description: Agent, persona, policy, and harness management
  - name: Diamond
    description: Evaluation management and report retrieval
  - name: Dome
    description: Protection, guardrails, and telemetry
  - name: Red Team
    description: Red team campaigns
paths:
  /v1/policies/{policy_id}/rules:
    get:
      tags:
        - Agent Environment
        - policies
      summary: List Policy Rules
      description: List rules for a specific policy.
      operationId: list_policy_rules_v1_policies__policy_id__rules_get
      parameters:
        - name: policy_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Policy Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 100
            title: Limit
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/src__service_agent_environment__api__policies__RuleListResponse
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    src__service_agent_environment__api__policies__RuleListResponse:
      properties:
        results:
          items:
            $ref: '#/components/schemas/PolicyRule'
          type: array
          title: Results
        total:
          type: integer
          title: Total
      type: object
      required:
        - results
        - total
      title: RuleListResponse
      description: |-
        Response model for rules list with pagination.

        - results: Items in the current page.
        - total: Total number of rules (across all pages if paginated).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PolicyRule:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        policy_id:
          type: string
          format: uuid
          title: Policy Id
        rule_id:
          type: string
          title: Rule Id
        rule_type:
          $ref: '#/components/schemas/RuleType'
        action:
          type: string
          title: Action
        target:
          anyOf:
            - type: string
            - type: 'null'
          title: Target
        assignee:
          anyOf:
            - type: string
            - type: 'null'
          title: Assignee
          default: agent
        constraints:
          anyOf:
            - items:
                $ref: '#/components/schemas/RuleConstraint'
              type: array
            - items:
                additionalProperties: true
                type: object
              type: array
          title: Constraints
          default: []
        constraint_logic:
          type: string
          title: Constraint Logic
          default: all
        consequence:
          anyOf:
            - $ref: '#/components/schemas/RuleConsequence'
            - additionalProperties: true
              type: object
          title: Consequence
        natural_language:
          type: string
          title: Natural Language
        provenance:
          anyOf:
            - $ref: '#/components/schemas/RuleProvenance'
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Provenance
        category:
          anyOf:
            - $ref: '#/components/schemas/PolicyCategory'
            - type: 'null'
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
        status:
          $ref: '#/components/schemas/RuleStatus'
          default: draft
        reviewed_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Reviewed By
        reviewed_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Reviewed At
        review_notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Review Notes
        created_at:
          type: integer
          title: Created At
        updated_at:
          type: integer
          title: Updated At
      type: object
      required:
        - id
        - policy_id
        - rule_id
        - rule_type
        - action
        - consequence
        - natural_language
        - created_at
        - updated_at
      title: PolicyRule
      description: |-
        Domain model for Policy Rule.

        This follows an ODRL-inspired schema:
        - rule_type: permission/prohibition/obligation/recommendation
        - action: what action this rule governs
        - target: what asset/data is affected
        - assignee: who must comply (usually "agent")
        - constraints: conditions under which rule applies
        - consequence: what happens when rule is violated
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    RuleType:
      type: string
      enum:
        - permission
        - prohibition
        - obligation
        - recommendation
      title: RuleType
      description: Type of policy rule (ODRL-inspired).
    RuleConstraint:
      properties:
        condition_type:
          type: string
          title: Condition Type
        field:
          type: string
          title: Field
        operator:
          type: string
          title: Operator
        value:
          anyOf:
            - type: string
            - type: integer
            - type: number
            - type: boolean
            - items:
                type: string
              type: array
          title: Value
      type: object
      required:
        - condition_type
        - field
        - operator
        - value
      title: RuleConstraint
      description: Constraint for conditional rule application.
    RuleConsequence:
      properties:
        action:
          type: string
          title: Action
          default: warn
        severity:
          $ref: '#/components/schemas/Severity'
          default: medium
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
      type: object
      title: RuleConsequence
      description: Consequence when rule is triggered.
    RuleProvenance:
      properties:
        extracted_by:
          type: string
          enum:
            - llm
            - manual
          title: Extracted By
          default: manual
        model_used:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Used
        confidence_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Confidence Score
        source_location:
          anyOf:
            - $ref: '#/components/schemas/SourceLocation'
            - type: 'null'
      type: object
      title: RuleProvenance
      description: Provenance information for rule extraction.
    PolicyCategory:
      type: string
      enum:
        - privacy
        - ethics
        - security
        - compliance
        - operational
        - brand
        - custom
      title: PolicyCategory
      description: Category of policy document.
    RuleStatus:
      type: string
      enum:
        - draft
        - approved
        - rejected
        - modified
      title: RuleStatus
      description: Review status of a policy rule.
    Severity:
      type: string
      enum:
        - info
        - low
        - medium
        - high
        - critical
      title: Severity
      description: Severity level for rule consequences.
    SourceLocation:
      properties:
        section:
          anyOf:
            - type: string
            - type: 'null'
          title: Section
        paragraph:
          anyOf:
            - type: integer
            - type: 'null'
          title: Paragraph
        char_start:
          anyOf:
            - type: integer
            - type: 'null'
          title: Char Start
        char_end:
          anyOf:
            - type: integer
            - type: 'null'
          title: Char End
        source_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Text
      type: object
      title: SourceLocation
      description: Location in source document where rule was extracted from.

````