aiyoplane-crewai
AEAP Composition Boundary Adapter for CrewAI.
A thin wrapper that attaches the AEAP Runtime Decision Point (RDP) to CrewAI's tool invocation surface. Consequential tool executions by any crew member produce independently verifiable Execution Receipts. The adapter composes with CrewAI's Flow, Crew, Agent, and Task primitives — it does not replace any of them.
pip install aiyoplane-crewai
Why this matters for multi-agent crews
CrewAI's architecture is deliberately about multiple specialized agents coordinating on a workflow:
Research agent → Analysis agent → Purchasing agent → Payment agent → Fulfillment agent
Each agent has a role, a goal, and tools. Role assignment answers "may this crew member perform this class of action?" — identity and delegation. AEAP answers a different question at the tool-invocation moment: "should this specific action execute right now, under the Protected Party's current Policy, against the specific Intent being formed?" The two layers compose; AEAP sits beneath the crew structure.
See the AEAP specification §9 for the Composition Boundary primitive this adapter realizes.
Minimal usage
from crewai import Agent, Task, Crew
from crewai.tools import BaseTool
from aiyoplane_mcp_authz import create_aiyo_mcp_authz, create_local_rdp
from aiyoplane_crewai import wrap_tool
class TransferFundsTool(BaseTool):
name: str = "transfer_funds"
description: str = "Transfer funds between accounts."
def _run(self, amount: int, to_account: str) -> str:
return actually_transfer(amount, to_account)
policy = {
"rules": [
{"action_type": "payment", "amount_max": 1_000, "effect": "allow"},
{"action_type": "payment", "amount_max": 10_000, "effect": "escalate"},
{"action_type": "payment", "effect": "block"},
]
}
authz = create_aiyo_mcp_authz(
rdp=create_local_rdp(policy=policy),
tool_config={
"transfer_funds": {"aiyo_gated": True, "action": {"type": "payment"}},
},
)
guarded_transfer = wrap_tool(
TransferFundsTool(),
authz=authz,
intent_builder=lambda kwargs: {
"type": "payment",
"amount": kwargs["amount"],
"target": kwargs["to_account"],
},
)
# Attach the gated tool to a crew member the usual way:
banker = Agent(
role="Banker",
goal="Execute payment transactions for the user.",
backstory="A senior banker focused on correct and policy-compliant transfers.",
tools=[guarded_transfer],
)
Wrapping a whole tool list
from aiyoplane_crewai import wrap_tools
all_tools = [SearchDocsTool(), ReadUserTool(), TransferFundsTool(), DeleteAccountTool()]
guarded_tools = wrap_tools(
all_tools,
authz=authz,
intent_builders={
"transfer_funds": lambda kw: {"type": "payment", "amount": kw["amount"]},
"delete_account": lambda kw: {"type": "destructive", "target": kw["user_id"]},
},
)
Tools whose name is not a key in intent_builders pass through unchanged.
Composition Boundary — what the adapter actually does
For each wrapped tool invocation:
- Intent construction.
intent_builder(tool_kwargs)produces an AEAP Intent payload. - RDP evaluation. Via
aiyoplane-mcp-authz's AiyoAuthz middleware. - Verdict composition.
- ALLOW → inner tool
_run/_arunexecutes with the original arguments. - ESCALATE →
EscalationRequiredis raised; the crew's error handling decides routing. - BLOCK →
BlockedByPolicyis raised; the tool never executes.
- ALLOW → inner tool
- Fail-closed default on every ambiguous condition.
Local vs. hosted RDP
from aiyoplane_mcp_authz import create_local_rdp, create_hosted_rdp
# Development:
authz = create_aiyo_mcp_authz(rdp=create_local_rdp(policy=policy), tool_config={...})
# Production:
authz = create_aiyo_mcp_authz(
rdp=create_hosted_rdp(api_key="aiyo_live_..."),
tool_config={...},
)
API reference
wrap_tool(tool, *, authz, intent_builder, tool_name_for_authz=None, return_receipt=False)
Wrap a single CrewAI tool. Returns an AiyoCrewAITool (also a BaseTool).
wrap_tools(tools, *, authz, intent_builders, return_receipt=False)
Wrap a collection. Explicit opt-in via intent_builders keys.
Exceptions
AiyoCrewAIError— base classAdapterConfigError— adapter configuration is invalidBlockedByPolicy— RDP returned BLOCKEscalationRequired— RDP returned ESCALATE
License
Apache License 2.0.
Links
- AEAP specification: https://github.com/aiyoplane/aeap
- Underlying implementation:
aiyoplane-mcp-authz - Trust surface: https://aiyoplane.com/trust
- Issues: https://github.com/aiyoplane/crewai/issues
CrewAI is a trademark of its respective owners. This package is an independent AEAP Composition Boundary Adapter and is not affiliated with or endorsed by the CrewAI team.
Verify First. Execute Second.
Metadata
Release files for aiyoplane-crewai 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiyoplane_crewai-1.0.2.tar.gz | 13.1 kB | Without provenance | Details for aiyoplane_crewai-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiyoplane_crewai-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for aiyoplane_crewai-1.0.2-py3-none-any.whl |
Total release size: 25.6 kB
Release files / aiyoplane_crewai-1.0.2.tar.gz
| Download URL | aiyoplane_crewai-1.0.2.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
719aeb21d5529018a5aeba5fe0a1c9527d9adb6d06628e3eb4a2e5b05d21d2d8
|
|
BLAKE2b-256 checksum How to use checksums |
1d6fda61b67282664b025aa52f2d3559a6828574a43e02435e7f5437fb707830
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.0rc3
|
Release files / aiyoplane_crewai-1.0.2-py3-none-any.whl
| Download URL | aiyoplane_crewai-1.0.2-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
773f330c0ce75d1b72918192ebba6bc0f54709772c70312121841080939520bb
|
|
BLAKE2b-256 checksum How to use checksums |
d7a8f07997247a41929d61634f011c6c1ed4ed17c4f8c6d26d94dde89bd07aab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.0rc3
|
Security for aiyoplane-crewai 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.