Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/nirholas/three.ws/token-approval-safetynpx skills add nirholas/three.ws --skill token-approval-safetygit clone --depth 1 https://github.com/nirholas/three.wsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/nirholas/three.ws/token-approval-safety)<a href="https://agentmods.dev/skills/nirholas/three.ws/token-approval-safety"><img src="https://agentmods.dev/badge/skills/nirholas/three.ws/token-approval-safety.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00052 | $0.01189 |
| Opus 5 | $0.00026 | $0.00594 |
| Sonnet 5 | $0.00010 | $0.00238 |
| Haiku 4.5 | $0.00005 | $0.00119 |
Grade A, and why
token-approval-safety scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 148 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Token Approval Safety Guide
Token approvals are one of the most overlooked security risks in DeFi. This guide helps AI agents protect users from approval-related attacks.
How Approvals Work
When you interact with a DeFi protocol, you must first "approve" it to spend your tokens:
1. You call approve(spenderAddress, amount) on the token contract
2. The spender (DEX, protocol) can now transfer up to `amount` of your tokens
3. When you swap/deposit, the protocol calls transferFrom() to move your tokens
The Problem: Unlimited Approvals
Most DeFi UIs request unlimited approval (type(uint256).max):
- Saves gas on future interactions (no re-approval needed)
- But: the protocol can spend ALL your tokens FOREVER
- If the protocol gets hacked, attackers drain your tokens via the approval
Risk Levels
| Approval Type | Risk | When to Use |
|---|---|---|
| Exact amount | Low | Large deposits, untrusted protocols |
| Limited amount | Medium | Regular use with trusted protocols |
| Unlimited | High | Only with battle-tested protocols (Uniswap, Aave) |
| Permit (EIP-2612) | Medium | Gasless approvals, common in modern DeFi |
How to Check Approvals
On-Chain (Direct)
Query the token contract: allowance(ownerAddress, spenderAddress)
Tools
| Tool | URL | Features |
|---|---|---|
| Revoke.cash | https://revoke.cash | Most popular, multi-chain |
| Etherscan Token Approvals | https://etherscan.io/tokenapprovalchecker | Ethereum-only |
| Arbiscan | https://arbiscan.io/tokenapprovalchecker | Arbitrum |
What to Look For
- Unlimited approvals to contracts you no longer use
- Approvals to unknown contracts you don't recognize
- Old approvals from months/years ago
- Approvals for valuable tokens (USDC, USDT, WETH)
Revoking Approvals
Revoking sets the allowance to 0:
approve(spenderAddress, 0)
Cost: Small gas fee per revocation
When to revoke:
- After you're done using a protocol
- If a protocol announces a security incident
- During regular security checkups (monthly recommended)
- Before a token migration or contract upgrade
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 148 lines · 52 tokens per session scan A 55a909053cc4
token-approval-safety is a skill published in the GitHub repository nirholas/three.ws (110 stars, last pushed yesterday), licensed Apache-2.0. It adds 52 tokens to every session and 1,189 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
blockchain-cross-chain
Cross-chain protocols, IBC, LayerZero, Wormhole, Axelar, CCIP, bridges, atomic composability, shared sequencer, cross-chain message passing. Covers trust models (light clients, external validators, ZK proofs), bridge security, token representation (canonical, wrapped, native), relayer economics, and cross-chain…
blockchain-security
Use this skill when asked about blockchain security, smart contract auditing, DeFi threat modeling, blockchain incident response, bug bounty programs, economic security, formal verification of smart contracts, and blockchain-specific security analysis. Languages: Solidity, Python, Rust, Haskell. Covers threat modeling…
blockchain-management
Use this skill when asked about blockchain project management, DAO governance, multi-sig operations, treasury management, tokenomics design, and web3 project methodology. Languages: Solidity, TypeScript, Python. Covers DAO governance frameworks (Compound Governor, Aave, Snapshot, Tally), multi-sig wallet operations…
modernize-move
Detects and modernizes outdated Move V1 syntax, patterns, and APIs to Move V2+. Use when upgrading legacy contracts, migrating to modern syntax, or converting old patterns to current best practices. NOT for writing new contracts (use write-contracts) or fixing bugs.
write-contracts
Generates secure Aptos Move V2 smart contracts with Object model, Digital Asset integration, security patterns, and storage type guidance. Includes comprehensive storage decision framework for optimal data structure selection. Triggers on: 'write contract', 'create NFT collection', 'build marketplace', 'implement…
threejs-docs
Comprehensive Three.js reference covering core API (objects, cameras, lights, materials, geometries, renderers, scenes, textures, math, animation, audio, loaders, helpers, nodes), all addons (controls, postprocessing, loaders, exporters, geometries, shaders, WebXR, physics), TSL (Three.js Shading Language) functions…