Skip to content

Configuration Overview ​

elsai Guardrails provides flexible configuration options to customize guardrail behavior for your specific use case.

Configuration Methods ​

  1. YAML Configuration - Recommended for most use cases
  2. Programmatic Configuration - For dynamic configuration

Configuration Sections ​

LLM Configuration ​

Configure the language model provider and settings. See LLM Configuration for details.

Guardrails Configuration ​

Configure safety checks and validation rules. See Guardrails Configuration for details.

Quick Reference ​

yaml
llm:
  engine: "openai"           # LLM provider
  model: "gpt-4o-mini"        # Model name
  api_key: "sk-..."           # API key
  temperature: 0.7             # Generation temperature

guardrails:
  input_checks: true           # Validate input
  output_checks: true          # Validate output
  check_toxicity: true        # Enable toxicity detection
  check_sensitive_data: true  # Enable sensitive data detection
  check_semantic: true        # Enable semantic classification
  toxicity_threshold: 0.7     # Toxicity blocking threshold
  block_toxic: true           # Block toxic content
  block_sensitive_data: true  # Block sensitive data

  # PII/PHI detection policy
  pii:
    enabled: true
    input_checks: true
    output_checks: true
    language: en
    default_confidence_threshold: 0.5
    below_threshold_action: flag
    default_action: flag
    default_mask: true
    enable_phi_detection: true
    entity_types:
      - PERSON
      - LOCATION
      - EMAIL_ADDRESS
      - PHONE_NUMBER
      - CREDIT_CARD
      - NRP
      - MEDICAL_LICENSE
      - US_SSN
      - IBAN_CODE
      - IP_ADDRESS
    entity_thresholds:
      PERSON: 0.7
    entity_policies:
      CREDIT_CARD:
        action: block
        mask: true
      US_SSN:
        action: block
        mask: true
      EMAIL_ADDRESS:
        action: flag
        mask: true
      PHONE_NUMBER:
        action: flag
        mask: true
      PHI_MRN:
        action: review
        mask: true
      PHI_PATIENT_ID:
        action: review
        mask: true

  # Token budget enforcement policy
  token_budget:
    enabled: true
    input_checks: true
    output_checks: true
    max_request_tokens: 50
    max_run_tokens: 80
    reserved_output_tokens: 10
    block_on_exceeded: true

  # Tool authorization policy
  tool_authorization:
    enabled: true
    denied_tools:
      - execute_shell
    sensitive_tools:
      - delete_record
    roles:
      analyst:
        allowed_tools:
          - search_web
          - calculator

  # Rate limiting policy
  rate_limit:
    enabled: true
    max_requests_per_session: 5
    max_tool_calls_per_session: 50
    max_tool_execution_seconds: 60

  # Data exfiltration detection (output only)
  data_exfiltration:
    enabled: true
    action_thresholds:
      warn: 20
      block: 80

  # Memory protection
  memory_guardrails:
    enabled: true
    isolation_scope: session
    ttl_days: 90

  # ARMS Backend storage
  storage:
    enabled: true
    project: my-app
    arms_correlation: true

Configuration Files ​

See YAML Configuration for complete configuration file examples.

Copyright © 2026 elsai foundry.