Export TealTiger governance decisions as OpenTelemetry spans in Arize Phoenix LLM trace viewer.
Project description
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.
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.0opentelemetry-sdk >= 1.20.0arize-phoenix-otel >= 0.16.0(for Phoenix setup)
Links
License
Apache 2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tealtiger_phoenix-0.1.0.tar.gz.
File metadata
- Download URL: tealtiger_phoenix-0.1.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36c963e26d6855c817574bae8fba724bc000440c449f533548657fe2e922c0dd
|
|
| MD5 |
29c239f8fd803e82968065b01889d05b
|
|
| BLAKE2b-256 |
11d7e08ff8f004a32a751bb46f544a88f414a04d19c0302f7aa23c7dd31d34ec
|
File details
Details for the file tealtiger_phoenix-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tealtiger_phoenix-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
920d996692713c76af01c19c0f9f8d69c7a83fbc5c633707634c1301a0058d9b
|
|
| MD5 |
dbc7ff7f4b76118f9c68640fac9741c1
|
|
| BLAKE2b-256 |
888fd0fad00462c6417647c4534c9dfc3c0a152f3f58afdee48e9bfffa3cd202
|