Python SDK for pushing AI-asset inventory snapshots to Trust3 AI governance.
Project description
trust3-ai-collector-sdk
Python SDK for pushing AI-asset inventory snapshots directly to Trust3 governance.
Describe your agents, tools, models, identities, and the relationships between them using a typed generic model. The SDK maps the snapshot to the governance bulk ingest format and POSTs it to the governance API.
- Direct — pushes to the Trust3 governance bulk ingest API
- Typed — closed enums prevent invalid asset or relationship kinds at construction time
- Resilient — automatic retry on transport errors and 5xx responses
- Idempotent — push a full snapshot every time; governance upserts, so re-sending is safe
Installation
pip3 install trust3-ai-collector-sdk
Requires Python ≥ 3.9 and a Trust3 governance API key. See the AI Assets Collector documentation for platform setup and credentials.
Quick start
import os
from trust3_ai_collector_sdk import (
Asset, AssetKind, IdentityKind,
InventoryClient, InventoryClientConfig,
InventorySnapshot,
Relationship, RelationshipKind,
)
snap = InventorySnapshot(
source="my_platform",
account="prod.example.com",
vendor="Acme Corp",
product_name="My Platform",
environment="prod",
)
snap.assets += [
Asset(kind=AssetKind.AGENT, id="billing_agent", name="Billing Agent",
owners=["ops-team@example.com"], provider="openai", model_name="gpt-4o"),
Asset(kind=AssetKind.MODEL, id="openai:gpt-4o", name="GPT-4o", provider="openai"),
]
snap.relationships += [
Relationship(kind=RelationshipKind.USES_MODEL,
from_id="billing_agent", from_kind=AssetKind.AGENT,
to_id="openai:gpt-4o", to_kind=AssetKind.MODEL),
]
config = InventoryClientConfig(
api_server_host=os.environ["TRUST3_API_SERVER_HOST"],
api_key=os.environ["TRUST3_API_KEY"],
)
with InventoryClient(config) as client:
result = client.submit(snap)
print(f"pushed {result.assets_pushed} assets, governance HTTP {result.governance_status}")
Set TRUST3_API_SERVER_HOST to your Trust3 API hostname (for example https://api.na.trust3ai.com)
and TRUST3_API_KEY to your governance API key.
Configuration
config = InventoryClientConfig(
api_server_host="https://api.na.trust3ai.com",
api_key="your-trust3-api-key",
)
| field | description |
|---|---|
api_server_host |
Trust3 API server base URL |
api_key |
Your Trust3 governance API key |
Error handling
from trust3_ai_collector_sdk.errors import InventoryValidationError, InventoryTransportError
try:
result = client.submit(snap)
except InventoryValidationError as e:
print(f"rejected (HTTP {e.status_code}): {e.response_text}")
except InventoryTransportError as e:
print(f"failed after retries: {e}")
License
Proprietary software. Copyright Privacera, Inc. All rights reserved. Use is subject to your Trust3 AI agreement with Privacera.
Further reading
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trust3_ai_collector_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: trust3_ai_collector_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0aef061c6ec2741358d6ef4caa42fcb18480f930c7603a2edc160a556cd8e9b
|
|
| MD5 |
30b1a2f744f5ca27f2338aeb1d604394
|
|
| BLAKE2b-256 |
05e50d5229cf2dede2c395b87e056316c55b164c9c1c1769b0ea4902da3f3462
|