Skip to content

Powerful protection for AI agents - Open-source security and cost tracking for AI applications

License

Notifications You must be signed in to change notification settings

agentguard-ai/tealtiger

TealTiger Logo

TealTiger

AI Security & Cost Control Platform

npm version PyPI version License: MIT

Secure your AI. Control your costs.

Drop-in SDKs that add security guardrails and cost tracking to your AI applications. Works with OpenAI, Anthropic, and Azure OpenAI.

πŸ“– Read the introduction blog post to learn more about TealTiger!


πŸš€ Quick Start

For Users (Install from Package Registries)

TypeScript/JavaScript:

npm install tealtiger

Python:

pip install tealtiger

For Contributors (Clone & Develop)

# Clone the repository with submodules
git clone --recurse-submodules https://github.com/agentguard-ai/tealtiger.git
cd tealtiger

# If you already cloned without --recurse-submodules, initialize them:
git submodule update --init --recursive

# TypeScript SDK
cd packages/tealtiger-sdk
npm install
npm test
npm run build

# Python SDK
cd packages/tealtiger-python
pip install -e .
pytest

πŸ“¦ Repository Structure

tealtiger/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ tealtiger-sdk/          # TypeScript/JavaScript SDK
β”‚   β”‚   β”œβ”€β”€ src/                # Source code
β”‚   β”‚   β”œβ”€β”€ tests/              # Test files
β”‚   β”‚   └── package.json        # NPM package config
β”‚   β”‚
β”‚   └── tealtiger-python/       # Python SDK
β”‚       β”œβ”€β”€ src/tealtiger/      # Source code
β”‚       β”œβ”€β”€ tests/              # Test files
β”‚       └── pyproject.toml      # PyPI package config
β”‚
β”œβ”€β”€ examples/                   # Usage examples
└── README.md                   # This file

πŸ’» Usage

TypeScript/JavaScript

import { TealOpenAI } from 'tealtiger';

const client = new TealOpenAI({
  apiKey: process.env.OPENAI_API_KEY,
  enableGuardrails: true,
  enableCostTracking: true,
});

const response = await client.chat.create({
  model: 'gpt-4',
  messages: [{ role: 'user', content: 'Hello!' }],
});

Python

from tealtiger.clients import TealOpenAI, TealOpenAIConfig

config = TealOpenAIConfig(
    api_key="your-api-key",
    enable_guardrails=True,
    enable_cost_tracking=True
)

client = TealOpenAI(config)

response = await client.chat.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "Hello!"}]
)

✨ Features

πŸ›‘οΈ Security Guardrails

  • PII Detection - Automatically detect and redact sensitive information
  • Prompt Injection Prevention - Block malicious prompt injection attempts
  • Content Moderation - Filter toxic, harmful, or inappropriate content

πŸ’° Cost Control

  • Real-time Tracking - Monitor AI costs as they happen
  • Budget Limits - Set spending limits and get alerts
  • Usage Analytics - Detailed cost breakdowns

πŸ”Œ Provider Support

  • OpenAI - GPT-4, GPT-3.5, and all OpenAI models
  • Anthropic - Claude 3 Opus, Sonnet, and Haiku
  • Azure OpenAI - Enterprise-ready Azure integration

πŸ“š Documentation


πŸ§ͺ Testing

TypeScript SDK

cd packages/tealtiger-sdk
npm test                    # Run all tests
npm run test:coverage       # Run with coverage

Python SDK

cd packages/tealtiger-python
pytest                      # Run all tests
pytest --cov=tealtiger      # Run with coverage

🀝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository

  2. Clone your fork

    git clone https://github.com/YOUR-USERNAME/tealtiger.git
    cd tealtiger
  3. Install dependencies

    # TypeScript
    cd packages/tealtiger-sdk && npm install
    
    # Python
    cd packages/tealtiger-python && pip install -e ".[dev]"
  4. Make your changes

  5. Run tests

  6. Submit a pull request

See CONTRIBUTING.md for detailed guidelines.


πŸ“¦ Publishing (Maintainers Only)

TypeScript SDK

cd packages/tealtiger-sdk
npm version patch  # or minor, major
npm run build
npm test
npm publish

Python SDK

cd packages/tealtiger-python
# Update version in pyproject.toml
python -m build
python -m twine upload dist/*

πŸ“„ License

MIT Β© TealTiger Team

See LICENSE for details.


πŸ”’ Security

Security is our top priority. If you discover a security vulnerability, please see our Security Policy.


πŸ“ž Support


🌟 Links


Made with ❀️ for the AI community

About

Powerful protection for AI agents - Open-source security and cost tracking for AI applications

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published