Powerful protection for AI agents - Open-source security and cost tracking for AI applications
AI Agent Security & Governance SDK
Deterministic governance, guardrails, cost tracking, and policy management for LLM applications. Open source. TypeScript + Python. Works with any provider.
Website · Documentation · Examples · Discord · Contributing
Install: npm install tealtiger or pip install tealtiger, then wrap one existing OpenAI call:
import { TealOpenAI } from 'tealtiger';
const client = new TealOpenAI({ apiKey: process.env.OPENAI_API_KEY, guardrails: { promptInjection: true } });
const res = await client.chat.completions.create({ model: 'gpt-4o-mini', messages: [{ role: 'user', content: 'Hello!' }] });
console.log(res.security?.decision ?? 'ALLOW');
import os
from tealtiger import TealOpenAI
client = TealOpenAI(api_key=os.environ["OPENAI_API_KEY"], guardrails={"prompt_injection": True})
print(client.chat.completions.create(model="gpt-4o-mini", messages=[{"role": "user", "content": "Hello!"}]).security.decision)
ALLOW
Governance receipt emitted; cost and guardrails tracked.
Next: full Quick Start and examples.
One line adds cost tracking, audit logging, PII detection, and behavioral baselines to any LLM client. No config files, no policy definitions.
import { observe, freeze } from 'tealtiger';
const client = observe(new OpenAI()); // done — all calls are now instrumented
console.log(client.getCost()); // { totalCost: 0.0023, requestCount: 1, ... }
from tealtiger.observe import observe, freeze
client = observe(OpenAI()) # done — all calls are now instrumented
print(client.get_cost()) # ObserveCostSummary(total_cost=0.0023, ...)
What you get automatically: per-request cost tracking across 12 providers, structured audit log with correlation IDs, behavioral baseline (P50/P95/P99), PII detection in REPORT_ONLY mode, and an instant kill switch via freeze(). Under 5ms overhead per call.
See examples/observe-quickstart.ts and examples/observe_quickstart.py.
Real-time visibility into your AI agent fleet — security posture, cost governance, and behavioral alerts in one view.
What you see at a glance:
Every panel is independently data-fetched with fault isolation — one widget failure never cascades to others.
Run locally: cd dashboard/api && npm run dev then cd dashboard/web && npm run dev (API on :3100, UI on :3000)
| Level | Entry Point | What You Get |
|---|---|---|
| 0 | observe(client) | Cost tracking, audit trail, PII detection, behavioral baseline, kill switch |
| 1 | + guardrails config | Prompt injection, content moderation, secret detection |
| 2 | + TealEngine policies | ENFORCE/MONITOR/REPORT_ONLY per rule, deterministic decisions |
| 3 | + TealFlow workflows | Org-level governance inheritance, declarative YAML |
TealTiger is an open-source SDK that provides deterministic governance for AI agents. It enforces security policies, tracks costs, and produces structured evidence — all at runtime, with no infrastructure required.
Looking for the source code? This is the hub repo. The SDK source lives in the language-specific repos:
- TypeScript SDK: tealtiger-typescript-prod
- Python SDK: tealtiger-python-prod
Or clone this repo with submodules:
git clone --recurse-submodules https://github.com/agentguard-ai/tealtiger.git
Unlike probabilistic safety filters, TealTiger uses deterministic policy evaluation: same input + same policy = same decision, every time. Every governance verdict is reconstructable, traceable to the human who authored the policy, and exportable as structured evidence (SARIF, JUnit XML, JSON).
Key principle: Governance should be an engineering property embedded in the runtime — not a document reviewed after the fact.
npm install tealtiger
import { TealOpenAI } from 'tealtiger';
const client = new TealOpenAI({
apiKey: process.env.OPENAI_API_KEY,
guardrails: {
piiDetection: true,
promptInjection: true,
contentModeration: true,
},
budget: {
maxCostPerRequest: 0.50,
maxCostPerDay: 10.00,
},
});
const response = await client.chat.completions.create({
model: 'gpt-4',
messages: [{ role: 'user', content: 'Hello!' }],
});
// Guardrails enforced. Cost tracked. Evidence produced.
pip install tealtiger
from tealtiger import TealOpenAI
client = TealOpenAI(
api_key=os.getenv("OPENAI_API_KEY"),
guardrails={
"pii_detection": True,
"prompt_injection": True,
"content_moderation": True,
},
budget={
"max_cost_per_request": 0.50,
"max_cost_per_day": 10.00,
},
)
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello!"}],
)
# Guardrails enforced. Cost tracked. Evidence produced.