Metadata-Version: 2.4
Name: agentsentinel-core
Version: 1.2.0
Summary: Safety controls for AI agents — budgets, approvals, rate limits, and audit logs
Project-URL: Homepage, https://agentsentinel.net
Project-URL: Documentation, https://docs.agentsentinel.net
Project-URL: Repository, https://github.com/ordocaelum/agentsentinel-landing
Project-URL: Changelog, https://github.com/ordocaelum/agentsentinel-landing/releases
Author-email: "Leland E. Doss" <contact@agentsentinel.net>
License: BSL-1.1
Keywords: agents,ai,anthropic,approval,audit,autogen,budget,crewai,dlp,guardrails,langchain,llamaindex,llm,openai,pii,rate-limit,safety
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Provides-Extra: all
Requires-Dist: langchain>=0.1.0; extra == 'all'
Requires-Dist: slack-sdk>=3.0.0; extra == 'all'
Requires-Dist: tiktoken>=0.5.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: langchain
Requires-Dist: langchain>=0.1.0; extra == 'langchain'
Provides-Extra: slack
Requires-Dist: slack-sdk>=3.0.0; extra == 'slack'
Provides-Extra: tiktoken
Requires-Dist: tiktoken>=0.5.0; extra == 'tiktoken'
Description-Content-Type: text/markdown

# AgentSentinel

**Safety controls for AI agents** — budgets, approvals, rate limits, audit logs, and DLP.

[![PyPI version](https://badge.fury.io/py/agentsentinel.svg)](https://pypi.org/project/agentsentinel/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Installation

```bash
pip install agentsentinel
```

## Quick Start

```python
from agentsentinel import AgentPolicy, AgentGuard

policy = AgentPolicy(
    daily_budget=10.00,
    require_approval=["send_email", "delete_*"],
    rate_limits={"web_search": "10/min"},
)

guard = AgentGuard(policy)

@guard.protect("web_search")
def search_web(query: str) -> str:
    return f"Results for: {query}"
```

## Features

- 💰 **Budget Controls** — Daily/hourly spending limits with per-model caps
- ✋ **Approval Gates** — Require human approval for sensitive operations
- ⏱️ **Rate Limiting** — Prevent runaway loops with sliding window limits
- 📋 **Audit Logging** — Complete trail of every tool invocation
- 🔒 **DLP & PII Detection** — Block credit cards, SSNs, API keys from leaking
- 🌐 **Network Controls** — Allowlist/blocklist outbound domains

## Framework Integrations

```python
# LangChain
from agentsentinel.integrations.langchain import protect_langchain_agent
executor = protect_langchain_agent(executor, policy=policy)

# CrewAI
from agentsentinel.integrations.crewai import protect_crew
crew = protect_crew(crew, policy=policy)

# LlamaIndex
from agentsentinel.integrations.llamaindex import protect_agent
agent = protect_agent(agent, policy=policy)

# OpenAI Assistants
from agentsentinel.integrations.openai_assistants import protect_function_map
functions = protect_function_map(functions, guard=guard)

# Anthropic Tools
from agentsentinel.integrations.anthropic_tools import protect_tool_handlers
handlers = protect_tool_handlers(handlers, guard=guard)
```

## 101 Models Supported

Cost tracking for OpenAI, Anthropic, Google, Mistral, Cohere, Meta, AWS Bedrock, Azure OpenAI, Groq, Together, Perplexity, DeepSeek, xAI, and local models.

## Documentation

Full docs at [docs.agentsentinel.net](https://docs.agentsentinel.net)

## License

MIT
