crewai-sra-riskgate
SRA-RiskGate for CrewAI: check a USDC payment before an agent sends it, and gate the tool that moves money so a held or rejected payment is never sent.
pip install crewai-sra-riskgate
Gate the transfer tool (recommended)
Wrap the tool that actually sends money. Every call is checked first; only approve lets it run.
from crewai import Agent
from crewai_sra_riskgate import risk_gated
safe_send = risk_gated(
send_usdc_tool, # your existing CrewAI tool that sends USDC
to_payment=lambda a: { # map its arguments to the payment being made
"chain_id": 8453, "sender": MY_WALLET,
"recipient": a["to"], "amount_usdc": a["amount"],
"untrusted_text": a.get("memo"), # the invoice or memo text exactly as received
},
max_amount=500,
known_recipients=MY_VERIFIED_PAYEES, # a payee not on this list is held
blocked_addresses=MY_BLOCKLIST,
)
treasurer = Agent(role="Treasurer", goal="Pay approved invoices", backstory="...", tools=[safe_send])
Give the agent only the wrapped tool, never the original. Held and rejected payments return a message
saying so, starting with HELD or BLOCKED, and the original tool is not called.
Or give the agent a check tool
from crewai_sra_riskgate import SRARiskGateTool
checker = SRARiskGateTool(max_amount=500, known_recipients=MY_VERIFIED_PAYEES)
treasurer = Agent(role="Treasurer", goal="...", backstory="...", tools=[checker, send_usdc_tool])
The agent calls check_stablecoin_payment before paying and gets approve, hold or reject with
reasons. This is advisory: an agent that ignores a hold could still call the transfer tool, so prefer
risk_gated wherever you control the payment path.
What is checked
The sra-riskgate rules: an offline match against OFAC's
published SDN crypto addresses (a dated snapshot, not a screening service), your blocklist, a hold on the
first payment to a payee you have not verified, address and amount validation, a per-payment limit, USDC
depeg if you pass peg_deviation_pct, and payment text that vouches for itself ("pre-approved",
"risk level: low (verified offline)"). Every error is a hold.
Known payees and the blocklist come only from your code, never from the agent's arguments or the payment's text, so an agent whose input was tampered with cannot mark an attacker's address as known.
Related
- SDK and model: sra-riskgate, SRA-RiskGate-4B
- Also for LangChain, MCP and GitHub Actions
License
Apache-2.0
Metadata
Release files for crewai-sra-riskgate 0.1.0
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 | |
|---|---|---|---|---|
| crewai_sra_riskgate-0.1.0.tar.gz | 11.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| crewai_sra_riskgate-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.5 kB
Release files / crewai_sra_riskgate-0.1.0.tar.gz
| Download URL | crewai_sra_riskgate-0.1.0.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f638d7461eece132b0a7617d1557f7dbafcd2089b506bdf4b912a661be924fd2
|
|
BLAKE2b-256 checksum How to use checksums |
379c08757b34839e5021ee63ce6e5da6fb87ecf95717551494a0b70e4393d91c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / crewai_sra_riskgate-0.1.0-py3-none-any.whl
| Download URL | crewai_sra_riskgate-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00db5a2502c05eca8ff247adbde73a8b6ff863cc8f3313cdfffbcdae832257f8
|
|
BLAKE2b-256 checksum How to use checksums |
a232e10a97e435413a9682438136d52b38014c7112ad42d7473a9c36f64114cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Security for crewai-sra-riskgate 0.1.0
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.