coinbase / coinbase/agentkit

Action Provider: Token safety checks before trading (SafeAgent)

Open
#1,091 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.3k
Forks
815
Avg merge
13h 31m
Merged PRs (30d)
2

Description

## Proposal: Token Safety Action Provider

### Problem
AgentKit enables AI agents to trade crypto, but has no built-in safety checks. The legal notice states "User's exclusive responsibility" for trading risks. A safety action provider would protect users and reduce liability.

### Solution
SafeAgent action provider — agents call `checkTokenSafety` before executing any swap:

```typescript
// In an agent's trading flow
const safetyReport = await checkTokenSafety(tokenAddress, 'base');
if (!safetyReport.isSafe) {
return "Token flagged as potentially unsafe: " + safetyReport.flags.join(', ');
}
// Proceed with swap...
```

### Detection Capabilities
- Honeypot detection (DEX swap simulation)
- 17 scam pattern checks
- LP lock verification
- Owner analysis (renounced, privileged functions)
- Proxy/upgrade detection
- 6 chains: Base, Ethereum, Arbitrum, Optimism, Polygon, BSC

### Integration Options
- **MCP**: `https://cryptogenesis.duckdns.org/mcp/sse` (compatible with AgentKit MCP examples)
- **npm**: `npm install CryptoGenesisSecurity/erc-token-safety-score`
- **REST**: `GET /token/scan?address=0x...&chain=base`
- **On-chain**: Oracle on Optimism `0x3B8A6D696f2104A9aC617bB91e6811f489498047`

### Standard
ERC Token Safety Score — open standard: https://github.com/CryptoGenesisSecurity/erc-token-safety-score

Happy to build the action-provider if Coinbase is interested.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.