Skip to main content

Tria — The AI Permission Layer. Runtime Semantic Authorization SDK.

Project description

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

python -m pip install --pre tria-ai

Connected quick start

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

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tria_ai-0.5.0a1.tar.gz (55.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tria_ai-0.5.0a1-py3-none-any.whl (63.4 kB view details)

Uploaded Python 3

File details

Details for the file tria_ai-0.5.0a1.tar.gz.

File metadata

  • Download URL: tria_ai-0.5.0a1.tar.gz
  • Upload date:
  • Size: 55.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for tria_ai-0.5.0a1.tar.gz
Algorithm Hash digest
SHA256 7912e13f13b9683a1880ca1ca5200a4c10ad3b51c9edf26ae8f848243a05f373
MD5 73575e265c1df727b846cc1bd928d0e5
BLAKE2b-256 d28ebfa68ff1885be1087c831b69e1b4b5e4a6bbe511371b9cf2594fcbac4b3b

See more details on using hashes here.

File details

Details for the file tria_ai-0.5.0a1-py3-none-any.whl.

File metadata

  • Download URL: tria_ai-0.5.0a1-py3-none-any.whl
  • Upload date:
  • Size: 63.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for tria_ai-0.5.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 76d8c7d980ad77bdced653bbd7a0fce002a7090780900b4d8c55fc3177617e5a
MD5 d6b10d862ed43f14884196cc07d6b45a
BLAKE2b-256 ac1623ec45b180c1aa8a9047fd1707de1d6d8e2cb838872b2ab668b8e8869c70

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page