Link a payment guardrail (LangChain middleware) from the "Managing Risk" section
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 30/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- documentation
Research direction
The request is to add a link to a third-party LangChain guardrail package from the "Managing Risk" section introduced in #1433; the payload does not name the file holding that section, so locate it there first. Check the linked PyPI and GitHub pages to confirm what the package does. Whether the link belongs in the docs is a maintainer decision, so ask in the thread before editing. Done means the link is merged with a one-line description, or the maintainers decline it.
Written by the indexing model from the issue text.
Description
Language Implementation
- Python
- TypeScript
Feature Type
- Action Provider Template
- Wallet Provider Template
- Framework Extension
- Core Requirements
- Other
🚀 The feature, motivation and pitch
The new "Managing Risk" section (#1433) notes that AgentKit does not gate transfers behind human approval, enforce spend caps, or allowlist destinations, and points developers to LangChain middleware as one mitigation.
I've published an open-source package that does exactly that for AgentKit tools: langchain-sra-riskgate (Apache-2.0).
- PyPI: https://pypi.org/project/langchain-sra-riskgate/
- Repo: https://github.com/sriram1983007-dev/langchain-sra-riskgate
It intercepts ERC20ActionProvider_transfer, ERC20ActionProvider_approve, WalletActionProvider_native_transfer, x402ActionProvider_retry_with_x402 and x402ActionProvider_make_http_request_with_x402 before they execute, outside the model's control, and returns approve / hold / reject:
- per-payment limit and a session budget (stops an agent splitting one large payment into many small ones)
- recipient allowlist / blocklist, address validation, self-transfer check
- USDC-only by default (native and other tokens are held unless opted in)
- x402 one-step requests held unless the host is allowlisted
- fails closed: any error means hold, never approve
It works two ways:
SRARiskGateMiddlewarefor LangChain 1.xcreate_agentguard_tools(get_langchain_tools(agentkit), ...)forcoinbase-agentkit-langchain, which is on LangChain 0.3
CI runs it against the real coinbase-agentkit 0.7.4 + coinbase-agentkit-langchain 0.7.0 tools, and checks that a held payment never reaches the wallet provider.
Alternatives
A dedicated action provider (e.g. a "risk-gated transfer" action) was considered, but a hijacked agent can simply call the ungated transfer action instead. Intercepting at the tool-call layer covers every fund-moving action regardless of what the model chooses.
Additional context
Optional: after the rules approve a payment, the gate can also ask a small open model (SRA-RiskGate-4B, https://huggingface.co/sriram1983007/SRA-RiskGate-4B) via any OpenAI-compatible endpoint. It is off by default and can only make a decision stricter, never looser.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 857
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coinbase/agentkit
-
ERC20 transfer reports "Transferred" when the transaction reverts (receipt status ignored)Possibly taken @AgenticFinanceGraph claimed this 7 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
coinbase/agentkit#1558 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
coinbase-agentkit 0.7.x fails on fresh install: imports solana.rpc.api, which solana>=0.37 removedPossibly taken @JulienKervarrec claimed this 26 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
SPL transfer and Jupiter swap fail for fractional amounts like 2.01Possibly taken @auraseb claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
All issues in coinbase/agentkit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Koenkk/zigbee-herdsman-converters#13540 ·
Maintainers usually reply within 1 day
-
check:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
iptv-org/iptv#55821 · 1 comment ·
Maintainers usually reply within 1 day
-
area/busola/ux
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
kyma-project/busola#5442 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vercel-labs/wterm#246 ·
Maintainers usually reply within 1 day