TealTiger SDK v1.1.x introduces enterprise-grade features for organizational adoption while maintaining 100% backwards compatibility with v1.0.x.
February 2026
Safe policy deployment with three evaluation modes:
- ENFORCE: Block violations (production mode)
- MONITOR: Log violations, allow requests (observability mode)
- REPORT_ONLY: Log decisions without evaluation (testing mode)
from tealtiger.core.engine.types import PolicyMode, ModeConfig
mode_config = ModeConfig(
default_mode=PolicyMode.MONITOR, # Start with MONITOR
environment_modes={'production': PolicyMode.ENFORCE},
policy_modes={'tools.file_delete': PolicyMode.ENFORCE}
)
engine = TealEngine(policy, mode=mode_config)Benefits:
- Test policies without breaking production
- Gradual rollout (MONITOR → ENFORCE)
- Environment-specific configuration
Stable typed Decision object for reliable flows:
from tealtiger.core.engine.types import Decision, DecisionAction, ReasonCode
decision = engine.evaluate(request_context)
# Deterministic fields
assert decision.action in [DecisionAction.ALLOW, DecisionAction.DENY]
assert len(decision.reason_codes) > 0
assert 0 <= decision.risk_score <= 100
assert decision.correlation_id # Always presentBenefits:
- Predictable decision structure
- Type-safe integration
- Standardized reason codes
ExecutionContext with auto-generated correlation IDs:
from tealtiger.core.context.context_manager import ContextManager
# Auto-generate correlation ID
context = ContextManager.create_context(
tenant_id='acme-corp',
app='customer-support'
)
# Use across all operations
response = await client.chat.completions.create(
model='gpt-4',
messages=[...],
context=context
)
# Query audit logs by correlation ID
events = audit.query(correlation_id=context.correlation_id)Benefits:
- End-to-end request tracing
- Distributed tracing integration (OpenTelemetry)
- HTTP header propagation
Versioned audit events with security-by-default redaction:
from tealtiger.core.audit.teal_audit import TealAudit, AuditConfig
from tealtiger.core.audit.types import RedactionLevel
audit = TealAudit(
outputs=[FileOutput('./logs/audit.log')],
config=AuditConfig(
input_redaction=RedactionLevel.HASH, # SHA-256 hash (default)
output_redaction=RedactionLevel.HASH,
detect_pii=True # Enabled by default
)
)Benefits:
- No raw prompts/responses in logs
- PII detection and redaction
- Compliance-ready audit trails
- Versioned schema (1.0.0)
CLI/library test runner for CI/CD integration:
from tealtiger.core.engine.testing.policy_tester import PolicyTester
from tealtiger.core.engine.testing.test_corpora import TestCorpora
# Use starter test corpora
test_suite = TestCorpora.prompt_injection()
# Run tests
tester = PolicyTester(engine)
report = tester.run_suite(test_suite)
# Export to JUnit XML for CI/CD
xml_report = tester.export_report(report, format='junit')CLI Integration:
python -m tealtiger.cli.test ./policies/*.json --format=junit --output=results.xmlBenefits:
- Validate policies before deployment
- 25+ starter test cases
- CI/CD integration
- Coverage tracking
All features meet performance targets:
| Feature | Target | Actual (p99) |
|---|---|---|
| Mode resolution | < 1ms | ✅ 0.5ms |
| Decision evaluation | < 10ms | ✅ 8ms |
| Context propagation | < 0.5ms | ✅ 0.3ms |
| Content redaction (10KB) | < 5ms | ✅ 4ms |
| Audit logging (async) | < 2ms | ✅ 1.5ms |
| Policy test execution | < 100ms | ✅ 50ms |
✅ No raw prompts/responses in audit logs (HASH redaction by default) ✅ PII detection enabled by default ✅ Security-by-default configuration ✅ Explicit opt-in required for debug mode ✅ SHA-256 hashing for content redaction ✅ Cryptographically random UUID v4 generation
TealTiger v1.1.x aligns with:
- OWASP Top 10 for Agentic Applications (ASI01-ASI10)
- NIST AI RMF 1.0 (Govern, Map, Measure, Manage)
- Google SAIF (Secure AI Framework)
✅ 100% backwards compatible with v1.0.x ✅ No breaking changes ✅ All new features are opt-in ✅ Existing code continues to work without modification
See Migration Guide for detailed upgrade instructions.
Quick Start:
# v1.0.x code - still works in v1.1.x
client = TealOpenAI(TealOpenAIConfig(api_key="..."))
response = await client.chat.completions.create(...)
# v1.1.x - add enterprise features incrementally
context = ContextManager.create_context()
response = await client.chat.completions.create(..., context=context)See examples/ directory for complete examples:
correlation_ids_tracing.py- 9 examples for ExecutionContextaudit_redaction.py- 8 examples for redaction levelspolicy_testing.py- 8 examples for PolicyTesterenterprise_integration.py- Complete end-to-end setup
- Migration Guide - Upgrade instructions
- Best Practices - Recommended patterns
- Troubleshooting - Common issues and solutions
None.
None. All v1.0.x APIs remain supported.
TealTiger team and community contributors.
MIT License
- Issues: https://github.com/tealtiger/tealtiger/issues
- Discussions: https://github.com/tealtiger/tealtiger/discussions
- Documentation: https://docs.tealtiger.ai
- Read the Migration Guide
- Review Best Practices
- Try the Examples
- Integrate with your CI/CD pipeline
Happy securing! 🎉