Skip to main content

tealtiger-phoenix

Governance spans in Arize Phoenix LLM trace viewer — see why tool calls were blocked, which policies fired, and what governance costs look like, directly in your traces.

PyPI License Python 3.10+

Part of the TealTiger ecosystem — deterministic AI agent governance.


What it does

tealtiger-phoenix exports TealTiger governance decisions as OpenTelemetry spans that Phoenix auto-ingests. Every ALLOW, DENY, or MONITOR decision appears inline with your LLM traces — answering "why didn't this tool call happen?" directly in the trace viewer.

Installation

pip install tealtiger-phoenix arize-phoenix-otel

Quick Start

import os
from openai import OpenAI
from phoenix.otel import register
from tealtiger_phoenix import PhoenixGovernanceSpanExporter
from tealtiger import observe

# 1. Register Phoenix tracer
tracer_provider = register(project_name="governed-agent")

# 2. Create governance span exporter
exporter = PhoenixGovernanceSpanExporter()

# 3. Wrap your LLM client with TealTiger governance
client = observe(
    OpenAI(api_key=os.environ["OPENAI_API_KEY"]),
    guardrails={"pii_detection": True, "cost_limit": 5.00},
    on_decision=exporter.export,
)

# 4. Use normally — governance spans appear in Phoenix
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Summarize this data"}],
)

Open Phoenix at http://localhost:6006 — you'll see governance spans alongside your LLM spans.

How it looks in Phoenix

Each governance decision creates a span with:

Attribute Example
tealtiger.governance.action DENY
tealtiger.governance.reason_codes ["PII_DETECTED:ssn"]
tealtiger.governance.risk_score 90
tealtiger.governance.tool_name send_email
tealtiger.governance.mode ENFORCE
tealtiger.governance.evaluation_time_ms 0.42
tealtiger.governance.cost_tracked 0.002
tealtiger.governance.cumulative_cost 1.50

DENY decisions show as ERROR spans (red in Phoenix).
ALLOW decisions show as OK spans (green).
MONITOR decisions show as UNSET spans (yellow).

Configuration

exporter = PhoenixGovernanceSpanExporter(
    # Custom tracer name (default: "tealtiger.governance")
    tracer_name="tealtiger.governance",

    # Custom span name (default: "tealtiger.governance.decision")
    span_name="tealtiger.governance.decision",

    # Only record DENY/MONITOR decisions to reduce noise (default: True)
    record_allows=False,

    # Include cost tracking attributes (default: True)
    include_cost=True,
)

Usage with TealEngine

from tealtiger_phoenix import PhoenixGovernanceSpanExporter

exporter = PhoenixGovernanceSpanExporter()

# Works with any TealTiger governance callback
engine = TealEngine(
    policies=[...],
    on_decision=exporter.export,
)

Usage with Google ADK + TealTiger

from tealtiger_adk import TealTigerCallback
from tealtiger_phoenix import PhoenixGovernanceSpanExporter

exporter = PhoenixGovernanceSpanExporter()

governance = TealTigerCallback(
    policies=[{"type": "pii_block", "categories": ["ssn"]}],
    mode="ENFORCE",
    on_decision=exporter.export,  # Sends to Phoenix
)

Batch Export

# Export multiple decisions at once
exporter.export_batch(decisions_list)

# Check counters
print(f"Exported: {exporter.decision_count}")
print(f"Denied: {exporter.deny_count}")

Requirements

  • Python 3.10+
  • opentelemetry-api >= 1.20.0
  • opentelemetry-sdk >= 1.20.0
  • arize-phoenix-otel >= 0.16.0 (for Phoenix setup)

License

Apache 2.0 — see LICENSE.

Release files for tealtiger-phoenix 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tealtiger-phoenix 0.1.0
File Size Uploaded
tealtiger_phoenix-0.1.0.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tealtiger-phoenix 0.1.0
File Interpreter ABI Platform
tealtiger_phoenix-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.2 kB

Release files / tealtiger_phoenix-0.1.0.tar.gz

Download URL tealtiger_phoenix-0.1.0.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
36c963e26d6855c817574bae8fba724bc000440c449f533548657fe2e922c0dd
BLAKE2b-256 checksum
How to use checksums
11d7e08ff8f004a32a751bb46f544a88f414a04d19c0302f7aa23c7dd31d34ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / tealtiger_phoenix-0.1.0-py3-none-any.whl

Download URL tealtiger_phoenix-0.1.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
920d996692713c76af01c19c0f9f8d69c7a83fbc5c633707634c1301a0058d9b
BLAKE2b-256 checksum
How to use checksums
888fd0fad00462c6417647c4534c9dfc3c0a152f3f58afdee48e9bfffa3cd202
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page