Skip to main content
Every time TealTiger evaluates a request, it returns a single, deterministic Decision object. This Decision tells your application exactly what to do and why.

What is a Decision?

A Decision is TealTiger’s answer to: “Should this action be allowed?” It contains three essential pieces of information:
  1. Action - What should happen (ALLOW, DENY, TRANSFORM, etc.)
  2. Reason codes - Why this decision was made
  3. Risk score - How risky is this action (0-100)
Think of it like a traffic light with an explanation:
  • 🟢 Green (ALLOW) - “Safe to proceed because…”
  • 🔴 Red (DENY) - “Blocked because…”
  • 🟡 Yellow (REQUIRE_APPROVAL) - “Needs review because…”

Decision structure

Here’s what a typical Decision looks like:

Decision actions

TealTiger supports six decision actions:

ALLOW

The request is safe and should proceed normally.
When it happens:
  • Request meets all policy requirements
  • Risk score is below thresholds
  • No violations detected

DENY

The request is blocked and should not proceed.
When it happens:
  • Policy explicitly blocks the action
  • Risk score exceeds limits
  • Required conditions not met

REQUIRE_APPROVAL

The request needs human review before proceeding.
When it happens:
  • High-value operations (e.g., refunds over $1000)
  • Sensitive data access
  • Unusual patterns detected

REDACT

The request can proceed, but sensitive data must be removed.
When it happens:
  • PII or PHI detected in output
  • Sensitive data in logs
  • Compliance requirements

TRANSFORM

The request can proceed, but parameters must be modified.
When it happens:
  • Token limits exceeded (clamp to max)
  • Cost limits exceeded (downgrade model)
  • Parameter validation (use safe defaults)

DEGRADE

The request can proceed with reduced capabilities.
When it happens:
  • Budget constraints
  • Rate limits approaching
  • Service degradation

Reason codes

Reason codes explain why a decision was made. They’re stable, machine-readable identifiers you can use in your code.

Common reason codes

Security:
  • TOOL_NOT_ALLOWED - Tool is blocked by policy
  • PII_DETECTED - Personal information found
  • PROMPT_INJECTION_DETECTED - Attack attempt detected
  • UNAUTHORIZED_ACCESS - Insufficient permissions
Cost:
  • BUDGET_EXCEEDED - Daily/monthly budget limit reached
  • TOKEN_LIMIT_EXCEEDED - Request exceeds token limits
  • COST_THRESHOLD_EXCEEDED - Single request too expensive
Reliability:
  • RATE_LIMIT_EXCEEDED - Too many requests
  • CIRCUIT_BREAKER_OPEN - System is recovering
  • TIMEOUT_EXCEEDED - Operation took too long

Using reason codes

Risk scores

Risk scores quantify how risky an action is on a scale of 0-100:
  • 0-30: Low risk (routine operations)
  • 31-60: Medium risk (requires monitoring)
  • 61-85: High risk (requires approval)
  • 86-100: Critical risk (usually denied)

Risk score breakdown

Risk scores can be broken down by domain:
This tells you that the high overall risk (75) is primarily driven by security concerns (85), not cost or reliability.

Policy modes

Decisions behave differently based on the policy mode:

MONITOR mode

  • Policies are evaluated
  • Decisions are recorded
  • Actions are NOT enforced
  • Useful for testing policies

ENFORCE mode

  • Policies are evaluated
  • Decisions are recorded
  • Actions ARE enforced
  • Production mode

Determinism guarantee

TealTiger guarantees that the same inputs always produce the same Decision:
This determinism is critical for:
  • Testing - Verify policy behavior with confidence
  • Debugging - Reproduce issues reliably
  • Compliance - Prove consistent enforcement
  • Auditing - Explain past decisions

Complete example

Here’s a complete example showing how to handle all decision types:

Best practices

  1. Always check the action - Don’t assume ALLOW
  2. Handle all action types - Use a switch/if-else for all six actions
  3. Log decisions - Record all decisions for debugging and compliance
  4. Use reason codes - Provide helpful error messages based on reason codes
  5. Test in MONITOR mode - Validate policies before enforcing
  6. Preserve correlation IDs - Link decisions to audit events

Next steps

Decision lifecycle

Learn how decisions flow through evaluation and enforcement

Policy modes

Understand MONITOR vs ENFORCE modes

Policy authoring

Write custom policies for your use case

Audit schema

See how decisions are logged