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

# Evaluate an eval run against a CI policy



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/ci/gate
openapi: 3.1.0
info:
  title: TruLayer API
  version: 0.1.0
  description: |
    Trace ingestion, evaluation, query, and feedback API for TruLayer AI.

    ### Authentication

    Two auth schemes coexist: SDK API keys (`Authorization: Bearer tl_...`)
    and Clerk session JWTs (dashboard). Routes marked "requires Clerk auth"
    in their summary are unreachable via API key.

    ### Roles (TRU-234)

    Dashboard requests carry one of three organization roles: `owner`,
    `member`, `viewer`. Endpoints enforce role allowlists, not rank
    comparisons. See `docs/security.md` for the full role-permission
    matrix.

    - **owner** — full control including billing, member management,
      destructive deletes on failure-rules/model-routes/webhooks/eval-rules,
      control-loop execution, and DLQ resolution.
    - **member** — read + write (ingest, feedback, evals, API keys,
      projects, failure-rules, model-routes, webhooks).
    - **viewer** — read-only dashboard access plus compliance read access
      to `/v1/audit-log` and `/v1/dlq`.
servers:
  - url: https://api.trulayer.ai
    description: Production
  - url: http://localhost:8080
    description: Local development
security:
  - BearerAuth: []
tags:
  - name: health
  - name: ingest
  - name: traces
  - name: metrics
  - name: feedback
  - name: evals
  - name: eval-rules
  - name: control
  - name: apikeys
  - name: model-routes
  - name: datasets
  - name: search
  - name: anomaly
  - name: webhooks
  - name: failure-rules
  - name: eval-runs
  - name: ci
  - name: otlp
  - name: billing
  - name: deprecations
  - name: audit
  - name: failures
  - name: projects
  - name: compliance
  - name: dsr
  - name: policies
  - name: members
paths:
  /v1/ci/gate:
    post:
      tags:
        - ci
      summary: Evaluate an eval run against a CI policy
      operationId: ciGate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CIGateRequest'
      responses:
        '200':
          description: Gate decision
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CIGateResponse'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    CIGateRequest:
      type: object
      required:
        - dataset_id
        - run_id
        - policy
      properties:
        dataset_id:
          type: string
          format: uuid
        run_id:
          type: string
          format: uuid
        baseline_run_id:
          type: string
          format: uuid
          nullable: true
        policy:
          $ref: '#/components/schemas/CIPolicy'
    CIGateResponse:
      type: object
      required:
        - decision
        - mean_score
        - run_url
        - reason
      properties:
        decision:
          type: string
          enum:
            - pass
            - warn
            - block
        mean_score:
          type: number
        mean_delta:
          type: number
          nullable: true
        run_url:
          type: string
        reason:
          type: string
    CIPolicy:
      type: object
      required:
        - on_fail
      properties:
        score_floor:
          type: number
          nullable: true
        delta_tolerance:
          type: number
          nullable: true
        on_fail:
          type: string
          enum:
            - warn
            - block
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  responses:
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: SDK API key (`tl_...`) or Clerk session JWT

````