Skip to main content

Secure CrewAI crews with Amorce (Ed25519 + HITL + A2A)

Project description

crewai-amorce

GitHub License Demo

Secure CrewAI crews with Amorce in 1 decorator

Add Ed25519 signatures, human-in-the-loop approvals, and A2A compatibility to any CrewAI crew.


🚀 Quick Start

Installation

pip install crewai-amorce

Basic Usage (1 Decorator!)

from crewai import Crew, Agent, Task
from crewai_amorce import secure_crew

# Define your crew
researcher = Agent(
    role='Research Specialist',
    goal='Find accurate information',
    backstory='Expert researcher'
)

writer = Agent(
    role='Content Writer',
    goal='Write engaging content',
    backstory='Experienced writer'
)

# Secure the entire crew with one decorator
@secure_crew
crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, write_task]
)

# All agent interactions are now cryptographically signed
result = crew.kickoff()

That's it! Your CrewAI crew now has:

  • ✅ Ed25519 cryptographic signatures
  • ✅ Inter-agent authentication
  • ✅ Trust Directory verification
  • ✅ A2A-compatible messages
  • ✅ Audit trail for all interactions

🛡️ Features

Crew-Wide Security

Every agent in the crew gets Amorce security automatically:

from crewai_amorce import secure_crew

@secure_crew
crew = Crew(
    agents=[agent1, agent2, agent3],
    tasks=[task1, task2]
)

# All 3 agents now:
# - Have cryptographic identities
# - Sign all communications
# - Verify each other's signatures

Human-in-the-Loop (HITL)

Require human approval for sensitive crew operations:

from crewai_amorce import secure_crew

@secure_crew(
    hitl_required=['execute_code', 'make_payment', 'delete_file']
)
crew = Crew(
    agents=[developer_agent, finance_agent],
    tasks=[code_task, payment_task]
)

# Crew runs normally, but pauses for approval on sensitive actions

Secure Individual Agents

Use SecureAgent for fine-grained control:

from crewai_amorce import SecureAgent

henri = SecureAgent(
    role="Electronics Seller",
    goal="Maximize profit while maintaining 4.8★ rating",
    backstory="Professional refurbisher",
    tools=[inventory_db, pricing_api],
    hitl_required=['confirm_sale', 'issue_refund']
)

# Henri's actions require human approval for sales

A2A Protocol Compatible

All crew communications use A2A format:

@secure_crew(a2a_compatible=True)
crew = Crew(agents=[...], tasks=[...])

# Agent-to-agent messages use A2A envelope

📖 Examples

Marketplace Demo (Henri - Seller Agent)

See the full Enhanced Marketplace Demo showing Henri selling to Sarah.

from crewai_amorce import SecureAgent

henri = SecureAgent(
    role="Electronics Reseller",
    goal="Maximize profit while maintaining 4.8★ rating",
    backstory="Professional refurbisher with 500+ sales",
    tools=[
        inventory_database,      # Check stock & condition
        pricing_api,            # Real-time market rates
        shipping_calculator,     # Calculate costs
        receipt_generator       # Generate signed docs
    ],
    hitl_required=['confirm_sale', 'issue_refund'],
    verbose=True
)

# Henri autonomously:
# 1. Receives offer from Sarah
# 2. Checks Sarah's reputation in Trust Directory
# 3. Calculates profit margin
# 4. Requests human approval to sell
# 5. Generates cryptographically signed receipt

Multi-Agent Research Crew

from crewai import Crew, Agent, Task
from crewai_amorce import secure_crew

# Create agents
researcher = Agent(
    role='Senior Researcher',
    goal='Uncover cutting-edge developments',
    backstory='Renowned researcher'
)

analyst = Agent(
    role='Data Analyst',
    goal='Analyze research findings',
    backstory='Statistical expert'
)

writer = Agent(
    role='Tech Writer',
    goal='Create comprehensive reports',
    backstory='Award-winning writer'
)

# Secure the crew
@secure_crew(
    hitl_required=['publish_report']  # Approval before publishing
)
crew = Crew(
    agents=[researcher, analyst, writer],
    tasks=[research, analyze, write],
    verbose=True
)

# Run with full audit trail
result = crew.kickoff()
print(f"Crew ID: {crew.crew_id}")
print(f"All interactions signed: ✓")

🔧 Advanced Configuration

Custom Identity for Crew

from amorce import IdentityManager
from crewai_amorce import secure_crew

# Load existing identity
identity = IdentityManager.load_from_file("crew_identity.pem")

@secure_crew(identity=identity)
crew = Crew(agents=[...], tasks=[...])

Inter-Crew Communication

# Crew A discovers Crew B in Trust Directory
crew_a.discover_crews(capability='data_analysis')

# Crew A delegates task to Crew B (signed)
crew_a.delegate_to(crew_b, task='analyze_data')

🧪 Testing

# Run tests
pytest tests/

# With coverage
pytest --cov=crewai_amorce tests/

📚 Documentation


🤝 Contributing

Contributions welcome! See CONTRIBUTING.md


📄 License

MIT License - see LICENSE


🔗 Links


Built with ❤️ by the Amorce team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crewai_amorce-0.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crewai_amorce-0.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file crewai_amorce-0.1.0.tar.gz.

File metadata

  • Download URL: crewai_amorce-0.1.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for crewai_amorce-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2ab43e1d8f9095fa4223f73948ffb39dc0afdcd3c4012195908e2fe266e454e0
MD5 1e7d2775333d03204218405bf88adda5
BLAKE2b-256 160bb32f3756bd7e140f13013e0fa01110034c1e5e8b913371b6fd15812ad3d1

See more details on using hashes here.

File details

Details for the file crewai_amorce-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: crewai_amorce-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for crewai_amorce-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d30376931a5907026cbaa54c440ab35f84d0df6c587c05985174c3f7e04138e4
MD5 51c7b8898af58e584ab7f1e614742c39
BLAKE2b-256 ecf54c1435206df9b16695e1cf702df5f46188c2c4c20b341bf73b40f408d3e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page