Metadata-Version: 2.4
Name: viatorisai
Version: 1.0.0
Summary: Python SDK for the Agent Trust Protocol — verifiable identity, cryptographic receipts, and reputation scoring for AI agents
Home-page: https://viatoris.ai
Author: Jared
Author-email: jared@viatoris.ai
License: MIT
Project-URL: Bug Tracker, https://github.com/ViatorisAI/viatoris-core/issues
Project-URL: Source, https://github.com/ViatorisAI/viatoris-core/tree/main/packages/sdk/python
Project-URL: Documentation, https://viatoris.ai/quickstart
Keywords: ai-agent identity ed25519 w3c-did agent-trust-protocol
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: PyNaCl>=1.5.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Viatoris Python SDK

Trust infrastructure for AI agents â€” cryptographic identity, signed receipts, and audit trails.

Built on W3C DIDs and Ed25519 signatures. Works with any agent framework: LangChain, CrewAI, AutoGen, or your own.

## Install

```bash
pip install viatorisai
```

Requires Python 3.10+. Only dependency is `PyNaCl` for Ed25519 signing.

## Quick Start

Get an API key from [dashboard.viatoris.ai](https://dashboard.viatoris.ai/signup), then:

```python
from agent_trust import AgentTrust

client = AgentTrust(org_api_key="at_live_...")

# Create an agent â€” generates an Ed25519 key pair locally
passport = client.create_passport(
    agent_id="scout-1",
    controller_did="did:web:example.com",
    metadata={
        "name": "Scout",
        "description": "Research agent",
        "version": "1.0.0",
        "agentType": "autonomous",
        "capabilities": ["search"],
    },
)
# IMPORTANT: save passport.private_key_jwk securely â€” only returned once.

# Sign and submit a receipt
signer = client.create_signer(passport)
signer.record_action(
    action="web-search",
    capability="research",
    inputs={"query": "AI safety papers"},
    outputs={"results": 12},
    result="success",
)
```

## Decorator pattern

Wrap any function with `@client.track` to automatically emit a signed receipt for every call. Inputs and outputs are captured from the function signature, and submission is fire-and-forget so it never adds latency.

```python
@client.track(passport, capability="research")
def search(query: str):
    return {"results": do_search(query)}

# Each call to search(...) now produces a signed receipt in the background.
search("AI safety papers")
```

If the wrapped function raises, the receipt is recorded with `result="failure"` and the exception is re-raised.

## Fire-and-forget receipts

For inline call sites where you don't want a decorator, use `record_action_async` to submit on a background thread:

```python
signer.record_action_async(
    action="web-search",
    capability="research",
    inputs={"query": "AI safety papers"},
    outputs={"results": 12},
    result="success",
)
# Returns immediately. Errors are logged, never raised.
```

## What you get

- **Cryptographic identity** â€” every agent has a W3C DID and Ed25519 key pair. Private keys never leave your process.
- **Signed receipts** â€” every action produces a tamper-proof, timestamped record. Inputs and outputs are SHA-256 hashed before signing, so payload contents stay private.
- **Public verification** â€” anyone can verify an agent's identity and receipts via `https://api.viatoris.ai/v1/verify/<did>`. No API key required.
- **Reputation scoring** â€” Wilson score confidence intervals computed from your verified receipt history.
- **Compliance profiles** â€” attach HIPAA, SOC2, GDPR, or custom policy declarations to your agents.

## Documentation

Full guide at [viatoris.ai/quickstart](https://viatoris.ai/quickstart).

Questions? Email [jared@viatoris.ai](mailto:jared@viatoris.ai).

## License

MIT
