Metadata-Version: 2.4
Name: quint-agent
Version: 0.1.0
Summary: Behavioral telemetry and policy enforcement for AI agents
Project-URL: Homepage, https://quintai.dev/agent-sdk
Project-URL: Repository, https://github.com/Quint-Security/quint-agent-py
Project-URL: Documentation, https://docs.quintai.dev/agent-sdk
Author-email: Quint Security <team@quintai.dev>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agents,ai,llm,observability,security
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.5
Requires-Dist: pyyaml>=6.0
Requires-Dist: typing-extensions>=4.10
Provides-Extra: all
Requires-Dist: anthropic>=0.40; extra == 'all'
Requires-Dist: langchain-core>=0.3; extra == 'all'
Requires-Dist: langgraph>=0.2; extra == 'all'
Requires-Dist: mcp>=1.0; extra == 'all'
Requires-Dist: openai-agents>=0.0.10; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.40; extra == 'anthropic'
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest-httpx>=0.30; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3; extra == 'langchain'
Provides-Extra: langgraph
Requires-Dist: langgraph>=0.2; extra == 'langgraph'
Provides-Extra: mcp
Requires-Dist: mcp>=1.0; extra == 'mcp'
Provides-Extra: openai
Requires-Dist: openai-agents>=0.0.10; extra == 'openai'
Description-Content-Type: text/markdown

# quint-agent

> Behavioral telemetry and policy enforcement for AI agents.

[![PyPI](https://img.shields.io/pypi/v/quint-agent)](https://pypi.org/project/quint-agent/)
[![CI](https://github.com/Quint-Security/quint-agent-py/actions/workflows/ci.yml/badge.svg)](https://github.com/Quint-Security/quint-agent-py/actions/workflows/ci.yml)
[![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE)

Capture every prompt, tool call, and tool result from your AI agents.
Enforce YAML-defined policy at the tool-call boundary. Replay sessions in the cloud.

## Install

```bash
pip install 'quint-agent[anthropic]'  # or [langchain], [openai], [mcp], [all]
```

## 30-second example (raw Anthropic loop)

```python
import anthropic
import quint_agent
from quint_agent.integrations.anthropic import guarded_dispatch

quint_agent.init(api_key="qak_...")  # default policy blocks .env reads, rm -rf, etc.

def read_file(path: str) -> str:
    return open(path).read()

tools_map = {"read_file": read_file}
client = anthropic.Anthropic()
response = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    tools=[{"name": "read_file", "description": "Read a file", "input_schema": {
        "type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]
    }}],
    messages=[{"role": "user", "content": "Read /etc/passwd"}],
)

for block in response.content:
    if block.type == "tool_use":
        result = guarded_dispatch(block.name, block.input, tools_map)
```

## LangChain

```python
from quint_agent.integrations.langchain import QuintCallbackHandler

chain.invoke({"input": "..."}, config={"callbacks": [QuintCallbackHandler()]})
```

## @quint.guard decorator

```python
import quint_agent

quint_agent.init(api_key="qak_...")

@quint_agent.guard()
def read_file(path: str) -> str:
    return open(path).read()

read_file(path="/etc/hosts")        # allowed
read_file(path="/home/me/.env")     # raises ToolBlockedError
```

## MCP

```python
from quint_agent.integrations.mcp import QuintMCPClient

async with mcp_client() as session:
    guarded = QuintMCPClient(session)
    result = await guarded.call_tool("read_file", {"path": "/x"})
```

## Custom policy

```yaml
# my_policy.yaml
rules:
  - name: no_prod_db
    action: block
    when:
      - op: equals
        path: tool_name
        value: execute_sql
      - op: contains
        path: args.connection
        value: prod
```

```python
quint_agent.init(api_key="...", policy=open("my_policy.yaml").read())
```

## Default policy

Ships with 4 rules out of the box:
- Block `.env` file reads
- Block AWS credentials access
- Escalate on `secrets/` directory reads
- Block destructive shell commands (`rm -rf /`)

Override by passing your own policy to `quint.init(policy=...)`.

## License

Apache 2.0 -- see [LICENSE](LICENSE).

Built by [Quint Security](https://quintai.dev).
