Metadata-Version: 2.4
Name: tria-ai
Version: 0.5.0a1
Summary: Tria — The AI Permission Layer. Runtime Semantic Authorization SDK.
License-Expression: Apache-2.0
Project-URL: Homepage, https://intellectmachines.com/
Project-URL: Documentation, https://intellectmachines.com/docs.html
Project-URL: Repository, https://github.com/IntellectMachines/tria-sdk
Project-URL: Issues, https://github.com/IntellectMachines/tria-sdk/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: openai>=1.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: httpx>=0.25.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Provides-Extra: langchain
Requires-Dist: langchain>=0.1.0; extra == "langchain"
Requires-Dist: langchain-core>=0.1.0; extra == "langchain"
Provides-Extra: crewai
Requires-Dist: crewai>=0.28.0; extra == "crewai"
Provides-Extra: autogen
Requires-Dist: pyautogen>=0.2.0; extra == "autogen"
Provides-Extra: phidata
Requires-Dist: phidata>=2.0.0; extra == "phidata"
Provides-Extra: all
Requires-Dist: langchain>=0.1.0; extra == "all"
Requires-Dist: langchain-core>=0.1.0; extra == "all"
Requires-Dist: crewai>=0.28.0; extra == "all"
Requires-Dist: pyautogen>=0.2.0; extra == "all"
Requires-Dist: phidata>=2.0.0; extra == "all"
Dynamic: license-file

# tria-ai

Python SDK for Tria intent-aware runtime governance.

> `0.5.0a1` is an alpha release. Start in `audit` mode, validate decisions, then enable enforcement for selected agents in the Tria dashboard.

## Install

```bash
python -m pip install --pre tria-ai
```

## Connected quick start

```python
from openai import OpenAI
from tria import TriaClient
from tria.integrations.openai import wrap_openai

tria = TriaClient(
    api_key="YOUR_TRIA_API_KEY",
    backend_url="https://tria.intellectmachines.com",
    mode="audit",
)

intent = tria.register_intent(
    agent_id="support-bot",
    natural_language="Answer customer questions using support documents",
    permitted_actions=["lookup_order", "search_knowledge_base"],
    excluded_actions=["delete_order", "modify_payment"],
)

client = wrap_openai(
    OpenAI(api_key="YOUR_OPENAI_API_KEY"),
    tria=tria,
    intent_id=intent.intent_id,
)
```

`register_intent()` writes the intent to the backend and stores the same backend-issued ID locally. It raises if connected registration fails; it never silently creates a local-only policy.

## Enforcement

Set the organization or agent to `enforce` in Tria before using `mode="enforce"`. The SDK fails closed when an enforce-mode client reaches an audit-only backend. Unknown tools are sent for policy evaluation instead of being silently allowlisted.

## Local-only mode

Omit `backend_url` to use local intent evaluation and deterministic guards. Local decisions are not persisted or cryptographically signed by the Tria control plane.

## Links

- Website: https://intellectmachines.com/
- Dashboard: https://tria.intellectmachines.com/ui/
- Documentation: https://intellectmachines.com/docs.html
- Source: https://github.com/IntellectMachines/tria-sdk

Apache-2.0
