Skip to main content

Overview

In TealTiger, a policy is evaluated as a simple but powerful construct:
If conditions are met → execute actions
This separation allows policies to be:
  • Deterministic
  • Auditable
  • Easy to reason about
  • Composable across security, cost, reliability, and governance use cases
This document explains how conditions and actions are modeled and evaluated.

Conditions

Conditions define when a policy should trigger. A condition evaluates runtime, configuration, or contextual signals and produces a boolean outcome (true or false).

Common Condition Categories

Conditions can be grouped into the following categories.

1. Input Conditions

Evaluate properties of the incoming request or prompt. Examples:
  • Prompt length exceeds a threshold
  • Presence of restricted keywords
  • Use of system or developer role prompts
Example signals:
  • input.tokens
  • input.language
  • input.contains_sensitive_data

2. Model Conditions

Evaluate properties of the model or inference configuration. Examples:
  • Model is not on an approved allowlist
  • Temperature exceeds policy limits
  • Deprecated model version is used
Example signals:
  • model.name
  • model.version
  • model.temperature

3. Cost Conditions

Evaluate cost-related signals before or after execution. Examples:
  • Estimated cost exceeds budget
  • Token usage crosses daily quota
  • Cost anomaly detected compared to baseline
Example signals:
  • cost.estimated_usd
  • cost.tokens_input
  • cost.tokens_output

4. Risk Conditions

Evaluate security or compliance risk. Examples:
  • Risk score above allowed threshold
  • Policy violation detected by a classifier
  • External risk feed flags the request
Example signals:
  • risk.score
  • risk.category
  • risk.confidence

5. Execution Context Conditions

Evaluate who or what is making the request. Examples:
  • Untrusted agent identity
  • Environment is not production-approved
  • Missing execution identity metadata
Example signals:
  • execution.identity
  • execution.environment
  • execution.source

Condition Evaluation Model

  • All conditions are evaluated in a deterministic order
  • Conditions can be combined using logical operators:
    • AND
    • OR
    • NOT
  • A policy triggers only when the final condition result is true
Conditions are side‑effect free and do not modify state.

Actions

Actions define what happens when a policy triggers. Actions are executed only after all conditions evaluate to true.

Common Action Categories

1. Enforcement Actions

Directly control execution. Examples:
  • Block request
  • Allow with restrictions
  • Force safe completion mode
Typical actions:
  • block
  • allow
  • restrict

2. Transformation Actions

Modify inputs or outputs. Examples:
  • Redact sensitive data
  • Mask PII fields
  • Rewrite prompts
Typical actions:
  • redact
  • mask
  • rewrite