Metadata-Version: 2.4
Name: elizaos-plugin-tee
Version: 2.0.0a5
Summary: elizaOS TEE Plugin - Trusted Execution Environment integration for secure key management and remote attestation
Project-URL: Homepage, https://github.com/elizaos/eliza
Project-URL: Documentation, https://elizaos.ai/docs
Project-URL: Repository, https://github.com/elizaos/eliza
Author: elizaOS Contributors
License-Expression: MIT
License-File: LICENSE
Keywords: agents,ai,attestation,elizaos,phala,security,tee
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Security :: Cryptography
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: cryptography>=43.0.0
Requires-Dist: eth-account>=0.13.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.10.0
Requires-Dist: pynacl>=1.5.0
Requires-Dist: solders>=0.21.0
Requires-Dist: web3>=7.0.0
Provides-Extra: dev
Requires-Dist: mypy>=1.19.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
Requires-Dist: pytest-xprocess>=1.0.2; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: python-dotenv>=1.0.0; extra == 'dev'
Requires-Dist: ruff>=0.14.0; extra == 'dev'
Description-Content-Type: text/markdown

# elizaos-plugin-tee (Python)

Python implementation of the elizaOS TEE Plugin for Trusted Execution Environment integration.

## Features

- 🔐 **Remote Attestation** - Prove agent execution in TEE
- 🔑 **Key Derivation** - Secure Ed25519 and ECDSA key derivation
- 🛡️ **Vendor Support** - Extensible vendor system (Phala Network)
- ⚡ **Async** - Full async/await support
- 🔒 **Type Safe** - Pydantic models with strict validation

## Installation

```bash
pip install elizaos-plugin-tee
```

## Quick Start

```python
from elizaos_plugin_tee import TEEService, TeeMode

# Start the service
service = await TEEService.start(tee_mode="LOCAL")

# Derive Ed25519 keypair (for Solana)
solana_result = await service.derive_ed25519_keypair(
    path="my-secret-salt",
    subject="solana",
    agent_id="agent-123"
)
print(f"Solana Public Key: {solana_result.public_key}")

# Derive ECDSA keypair (for EVM)
evm_result = await service.derive_ecdsa_keypair(
    path="my-secret-salt",
    subject="evm",
    agent_id="agent-123"
)
print(f"EVM Address: {evm_result.address}")

# Stop the service
await service.stop()
```

## Configuration

| Variable             | Description                                     | Required |
| -------------------- | ----------------------------------------------- | -------- |
| `TEE_MODE`           | Operation mode: `LOCAL`, `DOCKER`, `PRODUCTION` | Yes      |
| `WALLET_SECRET_SALT` | Secret for key derivation                       | Yes      |
| `TEE_VENDOR`         | Vendor name (default: `phala`)                  | No       |

## API Reference

### TEEService

Main service for TEE operations.

```python
# Initialize
service = await TEEService.start(tee_mode="LOCAL")

# Derive keys
await service.derive_ed25519_keypair(path, subject, agent_id)
await service.derive_ecdsa_keypair(path, subject, agent_id)
await service.raw_derive_key(path, subject)

# Cleanup
await service.stop()
```

### Remote Attestation

```python
from elizaos_plugin_tee import (
    PhalaRemoteAttestationProvider,
    handle_remote_attestation,
)

# Using provider directly
provider = PhalaRemoteAttestationProvider("LOCAL")
quote = await provider.generate_attestation(report_data)
await provider.close()

# Using action handler
result = await handle_remote_attestation(
    tee_mode="LOCAL",
    agent_id="agent-123",
    entity_id="entity-456",
    room_id="room-789",
    content="Message content"
)
```

### Types

```python
from elizaos_plugin_tee import (
    TeeMode,
    TeeVendor,
    RemoteAttestationQuote,
    Ed25519KeypairResult,
    EcdsaKeypairResult,
)
```

## Development

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

# Run tests
pytest

# Type checking
mypy elizaos_plugin_tee

# Linting
ruff check .
ruff format .
```

## License

MIT



