Skip to content

docs(erc20): add output format, error states, and workflow context to action descriptions#1237

Open
0xAxiom wants to merge 1 commit into
coinbase:mainfrom
0xAxiom:docs/erc20-action-descriptions-outputs-errors
Open

docs(erc20): add output format, error states, and workflow context to action descriptions#1237
0xAxiom wants to merge 1 commit into
coinbase:mainfrom
0xAxiom:docs/erc20-action-descriptions-outputs-errors

Conversation

@0xAxiom
Copy link
Copy Markdown

@0xAxiom 0xAxiom commented May 20, 2026

Summary

Closes #1066 — erc20 action descriptions were audited and scored C/C+ due to missing output documentation and error state coverage.

Changes per action (TypeScript + Python):

  • get_balance: Add Returns section (success format + error case); note EVM-only constraint.
  • transfer: Add Returns section; document that ERC20 transfers still require native token (ETH) for gas — agents inferring from "transfer USDC" often don't realize they need ETH in the wallet; list the two guardrail refusal conditions.
  • approve: Add workflow context explaining why approve exists (call before a DeFi protocol so its transferFrom doesn't revert); typical flow is approve → call protocol; add Returns; document overwrite behaviour and malicious-spender risk; cross-reference get_allowance.
  • get_allowance: Add workflow context (call this before approve to skip a redundant tx when allowance already covers the amount; allowance of 0 means transferFrom is blocked); add Returns; clarify the owner is always the wallet's own address.

No logic changes — descriptions only.

Testing

Descriptions are string constants; no runtime tests required. The existing test suite validates action behaviour, which is unchanged.

… action descriptions

Closes coinbase#1066 — audit flagged erc20 actions scoring C/C+ due to missing output
documentation and error state coverage.

Changes per action:
- get_balance: add Returns section (success format + error case), note EVM-only constraint
- transfer: add Returns section, document gas requirement for native token (agents need
  to know ERC20 transfers still cost ETH), list guardrail refusal conditions
- approve: add workflow context (use BEFORE calling a protocol; flow is approve → protocol
  call; without allowance transferFrom reverts), add Returns section, document overwrite
  behaviour and malicious-spender risk
- get_allowance: add workflow context (call before approve to avoid redundant tx; allowance
  of 0 blocks transferFrom), add Returns section, clarify owner is always the wallet address

Applied to both TypeScript and Python implementations.
@0xAxiom 0xAxiom requested a review from murrlincoln as a code owner May 20, 2026 00:25
@cb-heimdall
Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

Copy link
Copy Markdown

@MVPuknowme MVPuknowme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define args

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

AgentKit erc20 action descriptions audit — inputs good, outputs/errors missing

3 participants