# Trasor Python SDK
Official Python SDK for [Trasor.io](https://trasor.io) - AI Agent Security & Governance Platform
## Installation
```bash
pip install trasor-sdk
```
## Quick Start
```python
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:
```python
# 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:
```python
# 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:
```python
# 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:
```python
# 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
```python
from trasor.integrations.crewai import TrasorCrewCallbacks
crew = Crew(
agents=[agent],
tasks=[task],
callbacks=[TrasorCrewCallbacks(api_key="trasor_live_xxx")]
)
```
### LangChain Integration
```python
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
- Documentation: https://docs.trasor.io
- Email: support@trasor.io
- GitHub Issues: https://github.com/trasor-io/trasor-python/issues
## License
MIT License. See LICENSE file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/trasor-io/trasor-python",
"name": "trasor-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8.1",
"maintainer_email": "\"Trasor.io\" <support@trasor.io>",
"keywords": "audit, logging, security, ai, agents, blockchain, verification, trust, infrastructure",
"author": "Trasor.io",
"author_email": "\"Trasor.io\" <support@trasor.io>",
"download_url": "https://files.pythonhosted.org/packages/8f/93/4eb2a477367496f4c692efc80541d3f83f116dc67f8b30c1316d67ea6138/trasor_sdk-2.1.0.tar.gz",
"platform": null,
"description": "# Trasor Python SDK\n\nOfficial Python SDK for [Trasor.io](https://trasor.io) - AI Agent Security & Governance Platform\n\n## Installation\n\n```bash\npip install trasor-sdk\n```\n\n## Quick Start\n\n```python\nfrom trasor import TrasorClient\n\n# Initialize the client\nclient = TrasorClient(api_key=\"trasor_live_your_api_key_here\")\n\n# Log an audit event\nresult = client.log_event(\n agent_name=\"my_agent\",\n action=\"process_data\",\n inputs={\"user_id\": \"12345\", \"query\": \"Hello world\"},\n outputs={\"response\": \"Hello! How can I help you?\"},\n status=\"success\"\n)\n\nprint(f\"Event logged: {result['id']}\")\n```\n\n## Security & Governance Features\n\n### Zero-Knowledge Proofs\nGenerate cryptographic proofs for audit verification without exposing sensitive data:\n\n```python\n# Generate proof\nproof = client.generate_zk_proof(\n agent_name=\"payment_processor\",\n start_date=\"2025-01-01\", \n end_date=\"2025-01-31\"\n)\n\n# Verify proof\nverification = client.verify_zk_proof(proof[\"hash\"])\n```\n\n### Behavioral Drift Detection\nMonitor agent behavior and detect anomalies:\n\n```python\n# Set baseline behavior\nclient.set_agent_baseline(\"my_agent\", {\n \"average_response_time\": 150,\n \"error_rate\": 0.01,\n \"normal_actions\": [\"process_payment\", \"validate_card\"]\n})\n\n# Get drift alerts\nalerts = client.get_drift_alerts(\n agent_name=\"my_agent\",\n severity=\"critical\"\n)\n```\n\n### Role-Based Access Control (RBAC)\nManage agent permissions and monitor violations:\n\n```python\n# Assign role to agent\nclient.assign_agent_role(\n agent_name=\"data_processor\",\n role_id=2, # Writer role\n enforcement_mode=\"block_violations\"\n)\n\n# Monitor violations\nviolations = client.get_rbac_violations(limit=50)\n```\n\n### Compliance & Monitoring\nTrack ISO 42001 compliance and security threats:\n\n```python\n# Get compliance score\ncompliance = client.get_iso_compliance_score()\nprint(f\"Overall Score: {compliance['overallScore']}%\")\n\n# Analyze security threats\nthreats = client.get_threat_analysis(time_range=\"24h\")\n\n# Get real-time metrics\nmetrics = client.get_observability_metrics(\n agent_name=\"my_agent\",\n metric_type=\"performance\"\n)\n```\n\n## Framework Integrations\n\n### CrewAI Integration\n```python\nfrom trasor.integrations.crewai import TrasorCrewCallbacks\n\ncrew = Crew(\n agents=[agent],\n tasks=[task],\n callbacks=[TrasorCrewCallbacks(api_key=\"trasor_live_xxx\")]\n)\n```\n\n### LangChain Integration\n```python\nfrom trasor.integrations.langchain import TrasorLangChainCallback\nfrom langchain.callbacks import CallbackManager\n\ncallback_manager = CallbackManager([\n TrasorLangChainCallback(api_key=\"trasor_live_xxx\")\n])\n```\n\n## API Reference\n\nFor complete API documentation, visit: https://docs.trasor.io/api\n\n## Support\n\n- Documentation: https://docs.trasor.io\n- Email: support@trasor.io\n- GitHub Issues: https://github.com/trasor-io/trasor-python/issues\n\n## License\n\nMIT License. See LICENSE file for details.\n",
"bugtrack_url": null,
"license": null,
"summary": "Official Python SDK for Trasor.io trust infrastructure platform",
"version": "2.1.0",
"project_urls": {
"API Reference": "https://docs.trasor.io/api",
"Bug Tracker": "https://github.com/trasor-io/trasor-python/issues",
"Documentation": "https://docs.trasor.io/sdk/python",
"Homepage": "https://trasor.io",
"Repository": "https://github.com/trasor-io/trasor-python"
},
"split_keywords": [
"audit",
" logging",
" security",
" ai",
" agents",
" blockchain",
" verification",
" trust",
" infrastructure"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "74a514b8d58f9f66d2634bc63ce8d8fda9d52d2043208d303f840969b4c9d465",
"md5": "9092a42aecd3528a9a64e475447907c8",
"sha256": "30a3d34d93f405d190f2abae7df43bc4fbb0e38a903f05314e40c86f56b08b79"
},
"downloads": -1,
"filename": "trasor_sdk-2.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9092a42aecd3528a9a64e475447907c8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.1",
"size": 20517,
"upload_time": "2025-09-11T13:51:01",
"upload_time_iso_8601": "2025-09-11T13:51:01.109561Z",
"url": "https://files.pythonhosted.org/packages/74/a5/14b8d58f9f66d2634bc63ce8d8fda9d52d2043208d303f840969b4c9d465/trasor_sdk-2.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8f934eb2a477367496f4c692efc80541d3f83f116dc67f8b30c1316d67ea6138",
"md5": "512ea1b87bf0811ed4ef5c3f57aa568a",
"sha256": "c66d57a68dbfada93bfd263e27a3ad6f55c194ab031e759aaee10275acec852a"
},
"downloads": -1,
"filename": "trasor_sdk-2.1.0.tar.gz",
"has_sig": false,
"md5_digest": "512ea1b87bf0811ed4ef5c3f57aa568a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.1",
"size": 17746,
"upload_time": "2025-09-11T13:51:02",
"upload_time_iso_8601": "2025-09-11T13:51:02.242923Z",
"url": "https://files.pythonhosted.org/packages/8f/93/4eb2a477367496f4c692efc80541d3f83f116dc67f8b30c1316d67ea6138/trasor_sdk-2.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-11 13:51:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "trasor-io",
"github_project": "trasor-python",
"github_not_found": true,
"lcname": "trasor-sdk"
}