Repository navigation
Add TealTiger governance integration #497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
191cf0d
Create TealTiger integration documentation
nagasatish007 59c9663
Create tealtiger.png
nagasatish007 e2c8332
Delete logos/tealtiger.png
nagasatish007 77ba8ad
Add files via upload
nagasatish007 0204d03
Address review: add toc, fix imports, add license section
nagasatish007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| --- | ||
| layout: integration | ||
| name: TealTiger | ||
| description: Deterministic governance component for Haystack pipelines — policy enforcement, PII detection, cost tracking, and structured audit evidence. | ||
| authors: | ||
| - name: TealTiger Team | ||
| socials: | ||
| github: https://github.com/agentguard-ai/tealtiger | ||
| twitter: https://x.com/TealtigerAI | ||
| pypi: https://pypi.org/project/tealtiger-haystack | ||
| repo: https://github.com/agentguard-ai/tealtiger/tree/main/packages/haystack-tealtiger | ||
| type: Custom Component | ||
| report_issue: https://github.com/agentguard-ai/tealtiger/issues | ||
| logo: /logos/tealtiger.png | ||
| version: Haystack 2.0 | ||
| --- | ||
|
|
||
|
|
||
| # TealTiger Governance for Haystack | ||
|
|
||
| [](https://pypi.org/project/tealtiger-haystack) | ||
| [](https://pypi.org/project/tealtiger-haystack) | ||
|
|
||
| Add deterministic governance to any Haystack pipeline. No LLM in the governance path — all policy evaluation is deterministic, adding <2ms latency. | ||
|
|
||
| ## Installation | ||
|
kacperlukawski marked this conversation as resolved.
Resolved
|
||
|
|
||
| ```bash | ||
| pip install tealtiger-haystack | ||
| ``` | ||
|
|
||
| ## Usage ⚡️ | ||
|
kacperlukawski marked this conversation as resolved.
Resolved
|
||
|
|
||
| ### Zero-Config Mode (Observe) | ||
|
|
||
| Add governance with zero configuration. TealTiger observes all traffic, tracks cost, detects PII, and allows everything through — producing structured audit entries for observability. | ||
|
|
||
| ```python | ||
| from haystack import Pipeline | ||
| from haystack_integrations.components.connectors.tealtiger import ( | ||
| TealTigerGovernanceComponent, | ||
| ) | ||
|
|
||
| pipeline = Pipeline() | ||
| pipeline.add_component("governance", TealTigerGovernanceComponent()) | ||
| pipeline.add_component("llm", your_generator) | ||
|
kacperlukawski marked this conversation as resolved.
Resolved
|
||
| pipeline.connect("governance.text", "llm.prompt") | ||
|
|
||
| result = pipeline.run({"governance": {"text": "What is the capital of France?"}}) | ||
| # result["governance"]["decision"] contains: | ||
| # - correlation_id: UUID v4 for tracing | ||
| # - action: "ALLOW" | ||
| # - pii_detected: [] | ||
| # - cost_tracked: estimated cost | ||
| # - evaluation_time_ms: <2ms | ||
| ``` | ||
|
|
||
| ### Policy Mode (Enforce) | ||
|
|
||
| When you provide a `TealEngine` instance, the component evaluates configured policies and blocks requests that violate governance rules. | ||
|
|
||
| ```python | ||
| 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", your_generator) | ||
| pipeline.connect("governance.text", "llm.prompt") | ||
|
kacperlukawski marked this conversation as resolved.
Resolved
|
||
|
|
||
| # Raises GovernanceDenyError if policy violated | ||
| result = pipeline.run({"governance": {"text": "Process this request"}}) | ||
| ``` | ||
|
|
||
| ## Features | ||
|
|
||
| - **Zero-config**: Observe, track cost, detect PII — no setup required | ||
| - **Policy enforcement**: Block requests that violate governance rules (ENFORCE mode) | ||
| - **PII detection**: Email, SSN, credit card, phone, IP address | ||
| - **Cost tracking**: Per-evaluation and cumulative with budget enforcement | ||
| - **Structured audit**: UUID v4 correlation IDs, risk scoring, timing | ||
| - **Fail-closed**: Engine errors result in DENY in ENFORCE mode | ||
| - **<2ms latency**: Deterministic, in-process, no external service | ||
|
|
||
| ## Support 📞 | ||
|
|
||
| - [GitHub Issues](https://github.com/agentguard-ai/tealtiger/issues) | ||
| - [TealTiger Documentation](https://tealtiger.ai) | ||
| - [OWASP ASI Coverage](https://github.com/agentguard-ai/tealtiger) — 8/10 Agentic Security Index categories | ||
|
kacperlukawski marked this conversation as resolved.
Resolved
|
||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.