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

# Guard API

> The primary entry point for real-time evaluation. Scans messages against your policies and returns a breakdown of violations and a redacted correction choice.



## OpenAPI

````yaml openapi POST /v1/guard
openapi: 3.1.0
info:
  title: Guardion AI API
  summary: Enterprise-grade guardrails.
  description: >-
    Runtime Guardrails & Observability. Guardion AI provides a robust security
    layer for LLM applications. Use our API to detect prompt injections, PII
    leakage, and toxic content in real-time. For comprehensive guides and SDKs,
    visit [docs.guardion.ai](https://docs.guardion.ai).
  termsOfService: https://guardion.ai/terms
  contact:
    name: Guardion Support
    email: support@guardion.ai
  version: 0.1.2
servers:
  - url: https://api.guardion.ai
    description: Production Server
security: []
paths:
  /v1/guard:
    post:
      tags:
        - Protection
      summary: Evaluate and Protect
      description: >-
        The primary entry point for real-time evaluation. Scans messages against
        your policies and returns a breakdown of violations and a redacted
        correction choice.
      operationId: guardEvaluate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvaluationRequest'
      responses:
        '200':
          description: Evaluation complete. Returns flagged status and corrections.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvaluationResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    EvaluationRequest:
      type: object
      required:
        - messages
      properties:
        application:
          type: string
          description: The unique ID of the application calling the API.
        policy:
          type: string
          description: >-
            Specific policy ID to enforce. Defaults to application global policy
            if null.
        session:
          type: string
          description: A unique identifier to track conversations across multiple turns.
        messages:
          type: array
          items:
            $ref: '#/components/schemas/Messages'
        metadata:
          type: object
          description: Key-value pairs for custom filtering in the dashboard.
        fail_fast:
          type: boolean
          default: false
          description: >-
            If true, stops processing and returns immediately after the first
            policy violation.
        breakdown_all:
          type: boolean
          default: false
          description: >-
            If true, returns details for all detectors, including those that did
            not flag.
    EvaluationResponse:
      type: object
      required:
        - time
        - created
        - flagged
      properties:
        id:
          type: string
        time:
          type: number
          description: Processing time in milliseconds.
        created:
          type: integer
          description: Unix timestamp of evaluation.
        flagged:
          type: boolean
          description: True if any policy violation was detected.
        breakdown:
          type: array
          items:
            $ref: '#/components/schemas/Breakdown'
        correction:
          $ref: '#/components/schemas/Correction'
    Messages:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
            - system
            - developer
        content:
          type: string
    Breakdown:
      type: object
      required:
        - policy_id
        - detector
        - detected
      properties:
        policy_id:
          type: string
        detector:
          type: string
        detected:
          type: boolean
        threshold:
          type: number
        score:
          type: number
          description: Raw model confidence score.
        result:
          type: array
          items:
            type: object
          description: Detailed evidence of findings (spans, labels, etc).
    Correction:
      type: object
      required:
        - choices
      properties:
        choices:
          type: array
          items:
            $ref: '#/components/schemas/Messages'
          description: The recommended safe version of the input/output messages.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      description: Use your Guardion API Key as a Bearer token.

````