Metadata-Version: 2.4
Name: chiroid
Version: 0.1.0
Summary: CHIROID: Cryptographically Verifiable Runtime and Authorization Layer for Autonomous AI Agents
Author-email: RelayMesh Labs <relaymesh@gmail.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/relaymesh-labs/chiroid
Project-URL: Documentation, https://github.com/relaymesh-labs/chiroid#readme
Project-URL: Repository, https://github.com/relaymesh-labs/chiroid.git
Project-URL: Issues, https://github.com/relaymesh-labs/chiroid/issues
Keywords: ai-agents,security,cryptography,attestation,ed25519,audit-trail,runtime-security,llm-guardrails
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.9.0
Requires-Dist: PyYAML>=6.0.0
Requires-Dist: cryptography>=42.0.0
Requires-Dist: fastapi>=0.110.0
Requires-Dist: uvicorn>=0.29.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: typer>=0.12.0
Requires-Dist: rich>=13.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Dynamic: license-file

# CHIROID

**The trust infrastructure for autonomous software.**  
*Every consequential agent action should be authorized, attributable, and independently verifiable.*

> **Product Category:** Attested Agent Runtime  
> **License:** Apache-2.0  
> **Notice:** Conduct independent trademark and package namespace availability verification before commercial use of the `CHIROID` name or domain.

---

## 1. Overview

**CHIROID** is a cryptographically verifiable execution and authorization layer for autonomous AI agents. It intercepts agent tool calls, evaluates them deterministically against explicit YAML authorization policies, mediates execution through allowlisted adapters, and produces tamper-evident, SHA-256 hash-chained, Ed25519-signed **CHIROID Attested Agent Actions (CAA)**.

CHIROID is **not** an AI agent framework. It is an independent security boundary that integrates with existing agent frameworks and tools.

---

## 2. Quickstart

### Installation

```bash
pip install -r requirements.txt
pip install -e . --no-build-isolation
```

### CLI Usage

```bash
# 1. Initialize SQLite store, Ed25519 signing key, and default policy
python -m chiroid.cli.main init --db chiroid.db --policy policy.yaml

# 2. Validate a YAML policy
python -m chiroid.cli.main policy validate policies/staging-policy.yaml

# 3. Register an agent and start a session
python -m chiroid.cli.main agent register --id deployment-agent --name "Staging Deployer"
python -m chiroid.cli.main session start --agent-id deployment-agent --session-id session-1 --env staging

# 4. Run the end-to-end demonstration (allow, deny, approval, offline verification, tamper detection, replay)
python examples/end_to_end_demo.py

# 5. Export and verify an audit chain offline
python -m chiroid.cli.main export --session session-1 --output audit.jsonl
python -m chiroid.cli.main verify ./audit.jsonl

# 6. Check runtime health and host sandbox capabilities
python -m chiroid.cli.main doctor

# 7. Start the FastAPI server and Security Dashboard at http://127.0.0.1:8787
python -m chiroid.cli.main serve --host 127.0.0.1 --port 8787
```

---

## 3. Python SDK Example

```python
from chiroid import ChiroidClient

client = ChiroidClient(
    runtime_url="http://127.0.0.1:8787",
    policy_file="./policies/staging-policy.yaml",
)

result = client.execute(
    agent_id="deployment-agent",
    session_id="session-staging-1",
    tool="kubernetes.scale",
    arguments={
        "deployment": "api",
        "replicas": 5,
    },
    environment="staging",
)

print("Allowed:", result.allowed)
print("Attestation ID:", result.attestation.attestation_id)
print("Ed25519 Signature:", result.attestation.signature)
```

---

## 4. Documentation Index

- [`PRODUCT_SPEC.md`](PRODUCT_SPEC.md) — Product thesis, CAA primitive, epistemic boundaries, and MVP scope.
- [`ARCHITECTURE.md`](ARCHITECTURE.md) — TCB definition, canonical serialization, non-circular CAA hashing, and mediation architecture.
- [`THREAT_MODEL.md`](THREAT_MODEL.md) — 23 threat vectors mapped to controls, residual risks, and automated tests.
- [`SECURITY.md`](SECURITY.md) — Cryptographic domain separation constants and six distinct verification properties.
- [`ROADMAP.md`](ROADMAP.md) — Implemented capabilities vs. simulated adapters vs. planned Rust/Go distributed architecture.
- [`docs/CRYPTO_SPEC.md`](docs/CRYPTO_SPEC.md) — Formal hashing and signing specification.
- [`docs/API_SPEC.md`](docs/API_SPEC.md) — HTTP v1 REST API specification.
