Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#1,543 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
30/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
documentation

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
1.3k
Fork
871
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di coinbase/agentkit

Tutte le issue di coinbase/agentkit

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.