Skip to main content

Official Python SDK for Trasor.io trust infrastructure platform

Project description

Trasor Python SDK

Official Python SDK for Trasor.io - AI Agent Security & Governance Platform

Installation

pip install trasor-sdk

Quick Start

from trasor import TrasorClient

# Initialize the client
client = TrasorClient(api_key="trasor_live_your_api_key_here")

# Log an audit event
result = client.log_event(
    agent_name="my_agent",
    action="process_data",
    inputs={"user_id": "12345", "query": "Hello world"},
    outputs={"response": "Hello! How can I help you?"},
    status="success"
)

print(f"Event logged: {result['id']}")

Security & Governance Features

Zero-Knowledge Proofs

Generate cryptographic proofs for audit verification without exposing sensitive data:

# Generate proof
proof = client.generate_zk_proof(
    agent_name="payment_processor",
    start_date="2025-01-01", 
    end_date="2025-01-31"
)

# Verify proof
verification = client.verify_zk_proof(proof["hash"])

Behavioral Drift Detection

Monitor agent behavior and detect anomalies:

# Set baseline behavior
client.set_agent_baseline("my_agent", {
    "average_response_time": 150,
    "error_rate": 0.01,
    "normal_actions": ["process_payment", "validate_card"]
})

# Get drift alerts
alerts = client.get_drift_alerts(
    agent_name="my_agent",
    severity="critical"
)

Role-Based Access Control (RBAC)

Manage agent permissions and monitor violations:

# Assign role to agent
client.assign_agent_role(
    agent_name="data_processor",
    role_id=2,  # Writer role
    enforcement_mode="block_violations"
)

# Monitor violations
violations = client.get_rbac_violations(limit=50)

Compliance & Monitoring

Track ISO 42001 compliance and security threats:

# Get compliance score
compliance = client.get_iso_compliance_score()
print(f"Overall Score: {compliance['overallScore']}%")

# Analyze security threats
threats = client.get_threat_analysis(time_range="24h")

# Get real-time metrics
metrics = client.get_observability_metrics(
    agent_name="my_agent",
    metric_type="performance"
)

Framework Integrations

CrewAI Integration

from trasor.integrations.crewai import TrasorCrewCallbacks

crew = Crew(
    agents=[agent],
    tasks=[task],
    callbacks=[TrasorCrewCallbacks(api_key="trasor_live_xxx")]
)

LangChain Integration

from trasor.integrations.langchain import TrasorLangChainCallback
from langchain.callbacks import CallbackManager

callback_manager = CallbackManager([
    TrasorLangChainCallback(api_key="trasor_live_xxx")
])

API Reference

For complete API documentation, visit: https://docs.trasor.io/api

Support

License

MIT License. See LICENSE file for details.

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

trasor_sdk-2.1.0.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

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

trasor_sdk-2.1.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file trasor_sdk-2.1.0.tar.gz.

File metadata

  • Download URL: trasor_sdk-2.1.0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for trasor_sdk-2.1.0.tar.gz
Algorithm Hash digest
SHA256 c66d57a68dbfada93bfd263e27a3ad6f55c194ab031e759aaee10275acec852a
MD5 512ea1b87bf0811ed4ef5c3f57aa568a
BLAKE2b-256 8f934eb2a477367496f4c692efc80541d3f83f116dc67f8b30c1316d67ea6138

See more details on using hashes here.

File details

Details for the file trasor_sdk-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: trasor_sdk-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for trasor_sdk-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30a3d34d93f405d190f2abae7df43bc4fbb0e38a903f05314e40c86f56b08b79
MD5 9092a42aecd3528a9a64e475447907c8
BLAKE2b-256 74a514b8d58f9f66d2634bc63ce8d8fda9d52d2043208d303f840969b4c9d465

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