Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 1.0.2 instead.
Reason given by maintainers: Version constant drift; superseded by 1.0.2

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:

  1. Intent construction. intent_builder(tool_kwargs) produces an AEAP Intent payload.
  2. RDP evaluation. Via aiyoplane-mcp-authz's AiyoAuthz middleware.
  3. Verdict composition.
    • ALLOW → inner tool _run/_arun executes with the original arguments.
    • ESCALATE → EscalationRequired is raised; the crew's error handling decides routing.
    • BLOCK → BlockedByPolicy is raised; the tool never executes.
  4. 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 class
  • AdapterConfigError — adapter configuration is invalid
  • BlockedByPolicy — RDP returned BLOCK
  • EscalationRequired — RDP returned ESCALATE

License

Apache License 2.0.

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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiyoplane-crewai 1.0.1
File Size Uploaded
aiyoplane_crewai-1.0.1.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiyoplane-crewai 1.0.1
File Interpreter ABI Platform
aiyoplane_crewai-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 25.4 kB

Release files / aiyoplane_crewai-1.0.1.tar.gz

Download URL aiyoplane_crewai-1.0.1.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
eab0fed3626c5ee425c246774f309b5c5efe99165ebda75dfb40d3de6017127c
BLAKE2b-256 checksum
How to use checksums
ddfcc7ab5af7354139677fa28f5319692927509dc4e4733bf9f12722896d7269
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / aiyoplane_crewai-1.0.1-py3-none-any.whl

Download URL aiyoplane_crewai-1.0.1-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d8105e6483d98f1718bd438c2cb454ae51cdda682234f6acd27a439baf23ec7
BLAKE2b-256 checksum
How to use checksums
15a6541c989baabd5d9407dd9f38f3cc134f63fdb51af1d61b25f95494f0eb90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

1.0.2

2 release files

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page