> ## 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.

# Policy API

> Defines a new policy with specific detectors (PII, Injection, etc.) and enforcement thresholds.



## OpenAPI

````yaml openapi POST /v1/policies
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/policies:
    post:
      tags:
        - Policy Management
      summary: Create a new security policy
      description: >-
        Defines a new policy with specific detectors (PII, Injection, etc.) and
        enforcement thresholds.
      operationId: createPolicy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicPolicy-Input'
      responses:
        '200':
          description: Policy created successfully.
      security:
        - HTTPBearer: []
components:
  schemas:
    PublicPolicy-Input:
      type: object
      required:
        - id
      properties:
        id:
          type: string
        definition:
          type: string
        threshold:
          type: number
          default: 0.8
        detectors:
          type: array
          items:
            $ref: '#/components/schemas/PublicDetector'
    PublicDetector:
      type: object
      required:
        - model
      properties:
        model:
          type: string
          description: The detector model to use (e.g., pii-v0, injection-v1).
        target:
          type: string
          enum:
            - user
            - assistant
            - system
            - all
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      description: Use your Guardion API Key as a Bearer token.

````