Skip to main content

CrewAI integration for PQSafe AgentPay — post-quantum safe payments for AI crews

Project description

crewai-pqsafe

Post-quantum safe payments for CrewAI agents, powered by PQSafe AgentPay.

Built on @pqsafe/agent-pay — see github.com/PQSafe/pqsafe


Install

pip install crewai-pqsafe

Quick start — crew with a payment-capable agent

from crewai import Agent, Crew, Task
from crewai_pqsafe import PQSafePaymentTool

payment_tool = PQSafePaymentTool()

finance_agent = Agent(
    role="Finance Agent",
    goal="Process approved supplier payments",
    backstory="You pay invoices that have been pre-authorized via PQSafe envelopes.",
    tools=[payment_tool],
)

pay_invoice = Task(
    description=(
        "Renew Perplexity Pro subscription at perplexity.ai — $20 USD. "
        "Use envelope: {envelope_json}"
    ),
    agent=finance_agent,
    expected_output="Payment confirmation with txId and rail",
)

crew = Crew(agents=[finance_agent], tasks=[pay_invoice])
result = crew.kickoff(inputs={"envelope_json": "<your signed envelope JSON>"})
print(result)

How it works

  1. A human wallet owner issues a signed SpendEnvelope — a post-quantum (ML-DSA-65) token constraining agent ID, max amount, allowed recipients, and validity window.
  2. The CrewAI agent calls pqsafe_pay with the envelope, recipient, amount, and memo.
  3. PQSafe verifies constraints server-side and routes the payment over the cheapest available rail (Airwallex, Wise, Stripe, USDC/Base, or x402).
  4. The tool returns {txId, status, rail}.

Tool parameters

Parameter Type Required Description
envelope_json str Yes SignedEnvelope as JSON string
recipient str Yes Recipient address (IBAN, crypto addr, etc.)
amount float Yes Amount in envelope's currency (> 0)
memo str No Human-readable payment reference

Links

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_pqsafe-0.1.0.tar.gz (4.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_pqsafe-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for crewai_pqsafe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 805d5ef71c8c4a7a8348f9f1ea547b570c3cb676691476b7696451edace1ec07
MD5 37a75924be9b03e3eb8d5bde207f0e2a
BLAKE2b-256 b8f36c45dce791259ce792272c53534f6fc5ae99f8832d017121ee60eaa1e0e3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for crewai_pqsafe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f8bf9175ca267108824d8c459ca2cd025e8676a525d47f87c83eccdb2130f040
MD5 b6b29823a44b6bcb912fb915b6ea8a34
BLAKE2b-256 a61fb1bc8f44fc31fd2f78dbea825265e7906d763b008bce8f5df3366422dde3

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