Optional pre-sign transaction guard: catch approval/Permit2 drains before the wallet signs
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- ドキュメント
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- python, typescript
- 領域
- blockchain, security
調査の方向性
payload には EthAccountWalletProvider、CdpEvmWalletProvider、send_transaction、coinbase-agentkit==0.7.4 が記載されていますが、repository のファイルやテストはありません。まずこれらの provider のエントリーポイントを見つけ、トランザクションがどのように署名およびブロードキャストされるかを確認してください。指定された署名前のブロック動作をカバーする、合意済みで文書化された opt-in パターンがあれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
Sharing a small, optional pre-sign safety hook in case it is useful to AgentKit users, and to get the team's read on whether it belongs as a documented pattern. Feedback very welcome — including "this belongs in a wallet layer, not here."
Disclosure: I maintain chain-signer, the library referenced below. This is an optional integration suggestion, not a dependency ask.
The gap
AgentKit's wallet providers screen recipients (sanctions / known-bad addresses), which is great. What they don't do today is decode the calldata of the transaction the agent is about to sign. Most agent fund-loss in 2026 hasn't come from sending to a sanctioned address — it has come from an agent being talked into signing an unlimited approve(), a setApprovalForAll(true), a Permit2 allowance, or the same drain hidden inside a multicall / Safe / ERC-4337 execute. A recipient check doesn't see any of that, because the malicious party is the spender in the calldata, not the to of the tx. (Write-up with reproduced 2026 incident shapes: https://gist.github.com/Kevthetech143/f4b940b2b31d457bd593c3d6df9f65c4)
A small, dependency-light option
chain-signer is a pip-installable, offline, no-API-key, no-network static decoder. preflight(tx) decodes an unsigned EVM tx and returns HIGH/MED/LOW flags for the known drain patterns (unlimited/large approval, increaseAllowance, setApprovalForAll, ERC-20 transferFrom, ERC-721/1155 safeTransferFrom, ERC-2612/DAI/Permit2 permits, proxy upgradeTo, EIP-7702 delegation, and drains nested in multicall / Multicall3 / Safe multiSend / 4337 execute). It's a static complement to recipient screening and to simulation — not a replacement — and it runs in-process with no external call.
Proposed shape (opt-in wrapper, verified against coinbase-agentkit==0.7.4)
from chain_signer import preflight
from web3.types import TxParams
from coinbase_agentkit.wallet_providers import EthAccountWalletProvider # or CdpEvmWalletProvider
class PreflightBlocked(Exception): ...
def preflight_guard(tx: dict, *, on_block: str = "raise"):
report = preflight(tx) # offline, no key, no network
highs = [f for f in report.get("risk_flags", []) if f.get("severity") == "HIGH"]
if highs and on_block == "raise":
raise PreflightBlocked("blocked before signing: " + ", ".join(f["code"] for f in highs))
return None if highs else tx
class GuardedEthAccountWalletProvider(EthAccountWalletProvider):
def send_transaction(self, transaction: TxParams):
preflight_guard(dict(transaction), on_block="raise") # raises BEFORE sign + broadcast
return super().send_transaction(transaction)
Behavior (real provider instantiated, send_transaction called on a malicious unlimited approve() — raised before any broadcast):
BLOCKED pre-broadcast: chain-signer blocked a HIGH-risk tx before signing: unlimited_approval
Off by default; zero behavior change unless a user opts in.
Honest limits (stated up front)
This is static decoding, so it won't catch a novel/obfuscated drain it can't decode (those get a LOW "unknown" flag, not a block); it's EVM-only; and it does not stop a redirected legitimate transfer (moving real funds to an attacker) — that's a recipient-allowlist / value-cap concern, which AgentKit's policy layer already addresses and which chain-signer's separate check_action gate also covers. Best used alongside recipient screening + simulation for high-value actions.
Happy to open a PR adding this as a documented optional example if the team thinks it fits, or to just leave it here as a pattern for anyone who wants it.
- 主要言語
- TypeScript
- スター
- 1.3k
- フォーク
- 871
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coinbase/agentkit のほかの issue
-
Python: Permit2 approval in CdpSmartWalletActionProvider.swap always reports failure (integer vs string receipt status)対応中かも @0xLittleDream が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
Moonwell redeem fails on Base Sepolia and uses 18 decimals for cbBTC対応中かも @sebxt が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
coinbase/agentkit#1578 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
ERC20 transfer reports "Transferred" when the transaction reverts (receipt status ignored)対応中かも @AgenticFinanceGraph が 15 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
coinbase/agentkit#1558 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[TypeScript] `ViemWalletProvider` rejects a wallet client from a newer viem than the exactly pinned one (TS2345, `tokens` missing on `Client`)対応中かも @PrabalParihar が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
coinbase/agentkit#1532 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
coinbase-agentkit 0.7.x fails on fresh install: imports solana.rpc.api, which solana>=0.37 removed対応中かも @JulienKervarrec が 34 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
coinbase/agentkit の issue をすべて見る
似ている issue
-
area: server priority: P3 type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
appandflow/stim#4538 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Published Docker images lack the redis extra: HEADROOM_COMPRESS_SESSION_STORE stops startup対応中かも @AlessandroSpallina が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
headroomlabs-ai/headroom#4513 ·
メンテナーはふだん 1 日以内に返信
-
bug extension extension: obsidian platform: Windows
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
raycast/extensions#32838 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
copy design-review mac P3
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
tosunlab/hisarapp-core#510 ·
-
bug priority-medium to-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信