agentleFS
SperaxSperax/sperax-skills/skills/agent-wallet-security/SKILL.md

agent-wallet-security

Skill8 starsChanged 9 months agoMITView on GitHub

Security best practices for AI agents handling cryptocurrency wallets — key management, transaction signing, approval hygiene, phishing detection, and operational security. Critical for any OpenClaw agent interacting with DeFi or managing wallet operations.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When AI agents interact with crypto wallets and DeFi protocols, security becomes critical.

    line 9
  2. Distinctive:

    Recommendation: Keep agents at "Propose" level for most users.

    line 55
  3. Distinctive:

    Always verify addresses against canonical sources:

    line 80
  4. Distinctive:

    Use exact-amount approvals: when possible

    line 95
  5. Distinctive:

    Check approvals at Revoke.cash: before large deposits

    line 98
  6. Distinctive:

    Use a multisig wallet (Safe/Gnosis)

    line 147
  7. Distinctive:

    Revoke the approval immediately: if it's an approve() call

    line 164
  8. Distinctive:

    When assisting with wallet operations:

    line 170

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agent Wallet Security Guide

When AI agents interact with crypto wallets and DeFi protocols, security becomes critical. This guide covers best practices for keeping user funds safe.

Threat Model

What Can Go Wrong

ThreatImpactLikelihood
Phishing (fake protocol)Total fund lossHigh
Unlimited approval exploitToken drainMedium
Transaction manipulationSwap to wrong token/addressMedium
Private key exposureTotal fund lossLow (with proper setup)
Social engineeringUnauthorized transactionsMedium
Smart contract exploitPartial/total fund lossLow-Medium

Key Management

Wallet Architecture

Recommended setup for agent-assisted DeFi:

Cold Wallet (Hardware/Multisig)
  └── Long-term storage (>80% of portfolio)
  └── Never connected to DeFi directly

Hot Wallet (Browser/Mobile)
  └── Active DeFi operations (<20% of portfolio)
  └── Agent assists with transactions
  └── Regular approval audits

Burner Wallet (Temporary)
  └── Testing new protocols
  └── Airdrop claims from unknown sources
  └── Minimal funds

Agent Access Levels

LevelWhat Agent Can DoWhen to Use
Read-onlyView balances, track positionsPortfolio monitoring
QuoteGet prices, simulate transactionsTrade planning
ProposeBuild unsigned transactionsUser signs manually
ExecuteSubmit signed transactionsAutomated strategies

Recommendation: Keep agents at "Propose" level for most users. User should always review and sign.

Transaction Safety

Before Every Transaction

  1. Verify recipient address — check first and last 4 characters
  2. Verify contract address — match against known protocol deployments
  3. Check transaction value — confirm amount matches intent
  4. Review function call — understand what the transaction does
  5. Check gas estimate — unusually high gas may indicate a revert

Red Flags

SignalRisk
Unknown contract addressPossible scam contract
Unusually high gas estimateTransaction may fail
Approve for unlimited amountToken drain if compromised
Redirect to unexpected domainPhishing site
Urgent "act now" pressureSocial engineering
Token with transfer tax >5%Likely honeypot/scam

Address Verification

Always verify addresses against canonical sources:

ProtocolVerification Source
UniswapOfficial docs + Etherscan verified
Aaveaave.com/developers
Speraxdocs.sperax.io
Any protocolVerified contract on block explorer

Never trust: Addresses from social media, DMs, or unverified sources.

Approval Management

Best Practices

  1. Use exact-amount approvals when possible
  2. Revoke unused approvals monthly
  3. Keep a separate DeFi wallet — don't approve from your main holdings
  4. Check approvals at Revoke.cash before large deposits

High-Risk Approval Patterns

  • Approving a contract you've never interacted with
  • Approving right after clicking a link (could be phishing)
  • Approving permits (EIP-2612) — these happen off-chain and are harder to track

Phishing Detection

Common Phishing Vectors

VectorHow It WorksPrevention
Fake DEX frontendClones real UI, sends funds to attackerBookmark real URLs
Fake airdrop claim"Claim your tokens" → drains walletVerify on official channels
DNS hijackingReal domain → attacker's serverCheck SSL cert
Approval phishingSign a permit → attacker gets approvalRead what you sign
Address poisoningSends $0 from similar addressVerify full address

Verification Checklist

  • URL matches the official protocol domain exactly
  • SSL certificate is valid and from expected issuer
  • Contract address matches official deployment (check docs)
  • Transaction details match your intent
  • No unexpected approvals in the transaction

Operational Security

For Agent Operators

  1. Never store private keys in agent config — use hardware wallets or secure key management
  2. Set transaction limits — cap the amount an agent can transact
  3. Use separate wallets — different wallets for storage vs DeFi
  4. Enable alerts — get notified of all transactions
  5. Regular audits — review agent activity and approval states

For Automated Strategies

  1. Whitelist contracts — agents should only interact with pre-approved contracts
  2. Set guards — maximum trade size, maximum slippage, minimum output
  3. Time delays — non-urgent transactions can wait for human review
  4. Kill switch — ability to immediately stop agent operation
  5. Logging — record all transactions for audit trail

Multi-Sig for High-Value Operations

For significant funds:

  • Use a multisig wallet (Safe/Gnosis)
  • Require 2+ signatures for large transactions
  • Agent proposes → owners confirm

Emergency Response

If Wallet Is Compromised

  1. Immediately transfer remaining funds to a secure wallet
  2. Revoke all approvals from the compromised address
  3. Check transaction history for unauthorized activity
  4. Do NOT reuse the compromised wallet for anything
  5. Report the incident to relevant protocols

If You Signed a Malicious Transaction

  1. Check what was approved — use Etherscan/Revoke.cash
  2. Revoke the approval immediately if it's an approve() call
  3. Move tokens to a new wallet if the approval is for unlimited amount
  4. Time is critical — act within minutes

Agent Tips

When assisting with wallet operations:

  1. Always verify addresses — never trust addresses from conversation context alone
  2. Warn before approvals — explain what the user is granting access to
  3. Recommend hardware wallets for amounts >$5K
  4. Never ask for seed phrases or private keys — legitimate tools never need them
  5. Suggest Arbitrum for routine DeFi — low gas means less cost per security measure

Links

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.