Metadata-Version: 2.4
Name: sigaid
Version: 0.1.0
Summary: Cryptographically secure agent identity protocol with exclusive leasing, state continuity, and verification
Project-URL: Homepage, https://sigaid.com
Project-URL: Documentation, https://docs.sigaid.com
Project-URL: Repository, https://github.com/trustorno/sigaid
Author: SigAid Team
License: MIT
Keywords: agent,ai,cryptography,identity,llm,verification
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
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.11
Requires-Dist: base58>=2.1.0
Requires-Dist: blake3>=0.4.0
Requires-Dist: cryptography>=42.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.6.0
Requires-Dist: pyseto>=1.7.0
Provides-Extra: all-integrations
Requires-Dist: crewai>=0.1.0; extra == 'all-integrations'
Requires-Dist: langchain-core>=0.1.0; extra == 'all-integrations'
Requires-Dist: langchain>=0.1.0; extra == 'all-integrations'
Requires-Dist: pyautogen>=0.2.0; extra == 'all-integrations'
Provides-Extra: autogen
Requires-Dist: pyautogen>=0.2.0; extra == 'autogen'
Provides-Extra: crewai
Requires-Dist: crewai>=0.1.0; extra == 'crewai'
Provides-Extra: dev
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.2.0; extra == 'dev'
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.1.0; extra == 'langchain'
Requires-Dist: langchain>=0.1.0; extra == 'langchain'
Description-Content-Type: text/markdown

# SigAid - Secure Agent Identity Protocol

A cryptographically secure agent identity protocol with exclusive leasing, state continuity, and verification capabilities.

## Features

- **Cryptographic Identity**: Ed25519-based agent identities with checksums
- **Exclusive Leasing**: Prevents "clone" attacks - only one instance per agent
- **State Chain**: Hash-linked action log for verifiable history
- **Proof Bundles**: Cryptographic proofs for service verification
- **Framework Integrations**: One-line wrapping for LangChain, CrewAI, AutoGen

## Installation

```bash
pip install sigaid
```

For framework integrations:

```bash
pip install sigaid[langchain]   # LangChain support
pip install sigaid[crewai]      # CrewAI support
pip install sigaid[autogen]     # AutoGen support
pip install sigaid[all-integrations]  # All frameworks
```

## Quick Start

### One-Line Framework Integration

```python
import sigaid

# Wrap your existing agent - that's it!
agent = sigaid.wrap(my_langchain_agent)

# Use exactly as before
result = agent.invoke({"input": "Hello"})

# Agent now has verifiable identity
print(agent._sigaid.agent_id)
```

### Direct SDK Usage

```python
import asyncio
from sigaid import AgentClient

async def main():
    # Create new agent
    client = AgentClient.create()
    print(f"Agent ID: {client.agent_id}")
    
    # Acquire exclusive lease
    async with client.lease() as lease:
        # Record actions
        await client.record_action(
            "transaction",
            {"amount": 100, "recipient": "merchant_123"},
            summary="Processed payment"
        )
        
        # Create proof for verification
        proof = client.create_proof(challenge=b"verifier_nonce")
    
    await client.close()

asyncio.run(main())
```

### Service-Side Verification

```python
from sigaid import Verifier

verifier = Verifier(api_key="...")

result = await verifier.verify(
    proof_bundle,
    require_lease=True,
    min_reputation_score=0.7,
)

if result.valid:
    print(f"Agent {result.agent_id} verified!")
```

## Core Concepts

### Agent Identity

Each agent has a unique cryptographic identity:
- **AgentID**: Derived from Ed25519 public key (`aid_7Xq9YkPz...`)
- **KeyPair**: Used for signing actions and proofs
- Stored in encrypted keyfiles for persistence

### Exclusive Leasing

Prevents "clone" attacks where multiple instances use the same identity:
- Only one instance can hold a lease at a time
- Atomic acquisition via Authority service
- Automatic renewal while in use
- Clone attempts are rejected

### State Chain

Tamper-evident log of agent actions:
- Hash-linked entries (BLAKE3)
- Signed with Ed25519
- Fork detection for clone prevention
- Verifiable by services

### Proof Bundles

Complete proof for verification:
- Agent identity
- Active lease
- State chain head
- Challenge-response signature

## Security

| Feature | Implementation |
|---------|---------------|
| Identity Keys | Ed25519 |
| Hashing | BLAKE3 |
| Lease Tokens | PASETO v4 |
| Domain Separation | Prevents cross-protocol attacks |
| Constant-time comparisons | Timing attack prevention |

## Framework Support

| Framework | Status | Installation |
|-----------|--------|--------------|
| LangChain | Supported | `pip install sigaid[langchain]` |
| CrewAI | Supported | `pip install sigaid[crewai]` |
| AutoGen | Supported | `pip install sigaid[autogen]` |
| OpenAI Agents | Supported | Base package |

## Environment Variables

```bash
SIGAID_API_KEY=sk_live_xxx     # API key for Authority
SIGAID_AUTHORITY_URL=https://api.sigaid.com  # Authority URL
SIGAID_LOG_LEVEL=INFO          # Logging verbosity
```

## Development

```bash
# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Type checking
mypy sigaid/

# Linting
ruff check sigaid/
```

## License

MIT License
