Metadata-Version: 2.4
Name: crewai-agentoath
Version: 0.1.0
Summary: AgentOath trust protocol integration for CrewAI -- automatic trust receipts for crew task delegation and completion.
Author-email: AgentOath Protocol Team <team@agentoath.ai>
License: Apache-2.0
Project-URL: Homepage, https://agentoath.ai
Project-URL: Repository, https://github.com/AgentOath/agentoath
Project-URL: Documentation, https://agentoath.ai/docs/integrations/crewai
Keywords: ai,agent,trust,crewai,agentoath,identity,delegation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software 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: Programming Language :: Python :: 3.13
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: agentoath>=0.2.0
Provides-Extra: crewai
Requires-Dist: crewai>=0.30.0; extra == "crewai"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"

# crewai-agentoath

AgentOath trust protocol integration for [CrewAI](https://www.crewai.com/).

Adds automatic trust receipt generation to CrewAI crews. Every task delegation and completion produces a cryptographically signed receipt, and agents below a trust threshold can be filtered out of delegation.

## Installation

```bash
pip install crewai-agentoath
```

For full CrewAI integration (optional):
```bash
pip install crewai-agentoath[crewai]
```

## Quick Start

### TrustedCrew -- automatic receipts for crew execution

```python
from agentoath import TrustAgent
from crewai_agentoath import TrustedCrew

manager = TrustAgent.create(name="CrewManager", capabilities=["orchestration"])
trusted = TrustedCrew(crew=my_crew, agent_identity=manager)

# Optionally register individual agents with identities
researcher_id = TrustAgent.create(name="Researcher", capabilities=["search"])
trusted.register_agent(researcher_agent, researcher_id)

result = trusted.kickoff()

# Every delegation + completion has a signed receipt
for receipt in trusted.receipts:
    print(receipt.action, receipt.rating, receipt.description)
```

### TrustedAgent -- bind CrewAI agents to AgentOath identities

```python
from crewai_agentoath import TrustedAgent

identity = TrustAgent.create(name="Analyst", capabilities=["analysis"])
trusted = TrustedAgent(crew_agent=analyst_agent, identity=identity)

print(trusted.did)    # did:trust:agent:...
print(trusted.role)   # "Senior Analyst" (from CrewAI)
```

### TaskCallback -- per-task lifecycle receipts

```python
from crewai_agentoath import TaskCallback

cb = TaskCallback(delegator_identity=manager)
cb.on_task_delegated(task, worker_did=worker.did)
cb.on_task_completed(task, worker_did=worker.did, output="report.pdf")
cb.on_task_failed(task, worker_did=worker.did, error="Timeout")

print(len(cb.receipts))  # 3 signed receipts
```

### TrustFilter -- gate delegation by trust score

```python
from crewai_agentoath import TrustFilter

trust_filter = TrustFilter(min_score=0.6)

candidates = [trusted_agent_a, trusted_agent_b, trusted_agent_c]
eligible = trust_filter.filter_agents(candidates, all_receipts)

# Or rank by score
ranked = trust_filter.rank_agents(candidates, all_receipts)
for agent, score in ranked:
    print(f"{agent.name}: {score:.2f}")
```

## Components

| Component | Description |
|-----------|-------------|
| `TrustedCrew` | Crew wrapper with automatic pre/post and per-task receipts |
| `TrustedAgent` | Binds a CrewAI Agent to an AgentOath identity |
| `TaskCallback` | Generates receipts for task delegation, completion, and failure |
| `TrustFilter` | Filters/ranks agents by trust score threshold |

## License

Apache-2.0
