Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Link a payment guardrail (LangChain middleware) from the "Managing Risk" section

Open
#1,543 0 comments 0 reactions 0 assignees View on GitHub

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

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:

  • SRARiskGateMiddleware for LangChain 1.x create_agent
  • guard_tools(get_langchain_tools(agentkit), ...) for coinbase-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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coinbase/agentkit

All issues in coinbase/agentkit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.