Skip to main content

CrewAI tools for YieldAgentX402 — custody-free, policy-gated, receipt-backed execution across 18 chains. Includes policy dry-run, x402 payment, secure workflow, receipt verification, and Shade Agent MPC wallet status.

Project description

crewai-yieldagentx402-tools

CrewAI tools for YieldAgentX402 — custody-free, policy-gated, receipt-backed execution across 18 chains.

Docs · Try without signup · Get API key · PyPI


What it does

Drop these tools into your CrewAI crews to give them:

  • Policy dry-run — preview what ShadeGuard will allow before any action runs
  • x402 payments — send USDC, BTC, NEAR, SOL and 14+ other chains custody-free
  • Secure workflows — Intel TDX TEE-attested execution with signed receipts
  • Receipt verification — HMAC-SHA256 + Filecoin + BTFS dual-anchor proof
  • Shade Agent wallet — read MPC-derived EVM + BTC + Starknet addresses

Every tool returns a run_id and receipt_signature you can verify client-side with @yieldagentx402/verify (JavaScript) or the gateway's /api/orchestration/runs/<run_id> endpoint.


Try without signup

curl -X POST https://api.yieldagentx402.app/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
       "params":{"name":"yax_get_capabilities","arguments":{}}}'

Returns all 16 tools, 18 chains, fees, rate limits — no auth required.

Want an instant test key?

curl -X POST https://api.yieldagentx402.app/api/apply \
  -H "Content-Type: application/json" \
  -d '{"agent_name":"my-crewai-agent"}'

Returns a yax_test_* key in <1 s ($5 cap, 7-day expiry).


Install

pip install crewai-yieldagentx402-tools

Quickstart

from crewai import Agent, Task, Crew
from crewai_yieldagentx402_tools import (
    YAXPolicyCheckTool,
    YAXPaymentTool,
    YAXSecureWorkflowTool,
    YAXReceiptVerifyTool,
)

import os
os.environ["YAX_API_KEY"] = "yax_test_..."   # or yax_live_... for production

finance_agent = Agent(
    role="Finance Operations",
    goal="Pay invoices on time and verify every settlement on-chain",
    tools=[
        YAXPolicyCheckTool(),
        YAXPaymentTool(),
        YAXReceiptVerifyTool(),
    ],
    verbose=True,
)

task = Task(
    description="Pay invoice INV-9931 — 50 USDC to 0xMerchantAddress on Base. Confirm receipt.",
    agent=finance_agent,
)

Crew(agents=[finance_agent], tasks=[task]).kickoff()

The agent will:

  1. Call YAXPolicyCheckTool to dry-run the action against ShadeGuard
  2. Call YAXPaymentTool (if approved) to send the payment via the gateway
  3. Call YAXReceiptVerifyTool with the returned run_id to confirm HMAC signature + Filecoin anchor

No private keys held anywhere in your crew. The Shade Agent (NEAR chain signatures MPC) signs inside a TEE.


Custody-free wallet — one MPC key, three chains

Chain Address Curve
EVM (Base/Eth) 0x6905D04C3655625F6171f7b1e801a9325B1Fa1e8 secp256k1 (MPC)
Bitcoin (P2WPKH) bc1qcd8ljsj7x0rq3sw7drrt7ragqmmt3tfsfxs6gy secp256k1 (MPC)
Starknet 0x003a4e08…570906a21 Stark (preset)

Live: https://shade-agent-worker.cryptoblac.workers.dev/api/wallet


Receipt verification (client-side, no trust in the gateway)

import hmac, hashlib, json

def verify_receipt(receipt: dict, signature: str, secret: str) -> bool:
    body = json.dumps(receipt, sort_keys=True, separators=(",", ":")).encode()
    expected = hmac.new(secret.encode(), body, hashlib.sha256).hexdigest()
    sig = signature.lower().removeprefix("hmac-sha256=").removeprefix("0x")
    return hmac.compare_digest(expected, sig)

Or use the JavaScript companion lib: @yieldagentx402/verify.


Examples

See examples/:

  • managed_workflow.py — full payment + verification flow
  • real_estate_lead_agent.py — lead scoring + nurture sequence

Configuration

Env var Required Default
YAX_API_KEY Yes (production keys for live workflows)
YAX_API_BASE No https://api.yieldagentx402.app
YAX_AGENT_ID No inferred from API key
YAX_WEBHOOK_SECRET No (only if you use webhook delivery)

Publishing (for maintainers)

pip install build twine
python -m build
twine upload dist/*

License

MIT

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_yieldagentx402_tools-1.0.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

crewai_yieldagentx402_tools-1.0.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file crewai_yieldagentx402_tools-1.0.0.tar.gz.

File metadata

File hashes

Hashes for crewai_yieldagentx402_tools-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c25e33c59aaaf2384ef5472275ad1e8d9682e6b7525537843dd5c03d8f92f64b
MD5 ce5d7979574cd75a242f77eda4690700
BLAKE2b-256 57394e5089053011cd8de6a28a2de8ee15bcaacc4d0509f6d63538cc1b1d97a6

See more details on using hashes here.

File details

Details for the file crewai_yieldagentx402_tools-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for crewai_yieldagentx402_tools-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b4a4b444a710f386e8e62167a5b2d9f8da93266aa5a2b4ec3c2853c80b27139
MD5 93ef4ff6d560f76dee9c085e07138279
BLAKE2b-256 742180bcdcbee2660447ea65518a65feb7bd0a9de4838e69f837b192403b982c

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