Integration: TealTiger
Deterministic governance, cost tracking, and PII detection for Haystack pipelines. No LLM in the governance path.
Table of Contents
Overview
Add deterministic governance to any Haystack pipeline. No LLM in the governance path โ all policy evaluation is deterministic, adding <2ms latency.
Installation
pip install tealtiger-haystack
Usage
Zero-Config Mode (Observe)
No policies needed โ just add the component and get instant visibility into cost, PII, and tool usage:
from haystack import Pipeline
from haystack.components.generators import OpenAIGenerator
from haystack_integrations.components.connectors.tealtiger import TealTigerGovernanceComponent
pipeline = Pipeline()
pipeline.add_component("governance", TealTigerGovernanceComponent())
pipeline.add_component("llm", OpenAIGenerator(model="gpt-4o-mini"))
pipeline.connect("governance.text", "llm.prompt")
result = pipeline.run({"governance": {"text": "What is the capital of France?"}})
# Access governance decision
decision = result["governance"]["decision"]
print(decision["action"]) # "ALLOW"
print(decision["cost_tracked"]) # 0.0023
print(decision["pii_detected"]) # []
Policy Mode (Enforce)
Add a TealEngine with policies for full governance enforcement:
from haystack import Pipeline
from haystack.components.generators import OpenAIGenerator
from tealtiger import TealEngine
from haystack_integrations.components.connectors.tealtiger import TealTigerGovernanceComponent
engine = TealEngine(policies=[
{"type": "cost_limit", "max_per_session": 5.00},
{"type": "pii_block", "categories": ["ssn", "credit_card"]},
])
pipeline = Pipeline()
pipeline.add_component(
"governance",
TealTigerGovernanceComponent(engine=engine, mode="ENFORCE"),
)
pipeline.add_component("llm", OpenAIGenerator(model="gpt-4o-mini"))
pipeline.connect("governance.text", "llm.prompt")
result = pipeline.run({"governance": {"text": "Process payment for card 4111-1111-1111-1111"}})
# PII detected โ action: "DENY"
Features
- Deterministic โ Same input + same policy = same decision, every time
- <2ms overhead โ No LLM in the governance path
- Zero-config mode โ Observe cost, PII, and behavior without writing policies
- Policy enforcement โ ALLOW, DENY, REQUIRE_APPROVAL, REVISE decisions
- Cost tracking โ Per-request and cumulative session cost
- PII detection โ Email, phone, SSN, credit card, IP address patterns
- Audit trail โ Every decision produces a structured evidence record
- TEEC receipts โ Compliance-grade execution receipts with correlation IDs
Support
- GitHub Issues
- TealTiger Documentation
- OWASP ASI Coverage โ 8/10 Agentic Security Index categories
License
tealtiger-haystack is distributed under the
Apache 2.0 License.
