What the wallet makers say
- MetaMask: "Never share your SRP or private keys with anyone." Anyone who has either can remove tokens from your accounts. It also says not to store your phrase in cloud storage or a password manager (MetaMask Help Center).
- Ledger: "Never enter your Secret Recovery Phrase into Ledger Wallet, any software application, website, or computer." If you are asked to share it in any way, it says, it is a scam (Ledger Support).
A chat box, an .env file, an MCP config and a prompt are all "software" in that sentence. An agent also reads what you give it, and a prompt-injected agent may pass it on.
Where keys leak with agents
- You paste a phrase into a chat to "set up" a wallet.
- A private key sits in
.env, a config file or an MCP server'senvblock, and the agent or a server reads it. See Can AI coding agents read my .env file?. - A crypto MCP server asks for a key in its config. Google Cloud's web3 team notes that most crypto MCP servers today only work if you configure them with a private key (Google Cloud blog).
- A "support" message, a fake app or a letter asks you to verify your phrase.
Three safer setups
Google Cloud's post describes three models. In plain terms:
- The agent crafts, you sign. The agent builds an unsigned transaction and hands it back. Your own wallet shows what it does, and only you approve it. This is the one Google calls fundamentally more secure for most uses.
- The agent has its own wallet. It holds its own key, and you send it a small, fixed amount. If it makes a mistake, is tricked or its host is hacked, the loss stops at that balance. The post lists performance, malice and host-security risks, so keep the amount small.
- You hold the key on your own machine. The post says this is very high risk, because a compromised machine or erratic agent behavior can cost real money, and recommends it for tests only.
Never use your main wallet or your recovery phrase for any of them.
A short checklist
- Keep the recovery phrase offline, on paper, in a place only you can reach. Never type it into a computer, chat or config.
- Use a hardware wallet for anything of value. MetaMask's guide points to hardware wallets as a safer way to store tokens.
- Give an agent a separate wallet with a small balance, or use the crafts-you-sign pattern.
- Keep any key file out of the agent's reach, with the deny rules from the .env walkthrough.
- Review token approvals now and then. Ledger's scam guide lists malicious token approvals, address poisoning and clipboard hijacks as common ways wallets get drained.
- Read every transaction your wallet shows before you sign, however the agent describes it.
If you already pasted a phrase or key
Treat that wallet as compromised. Create a new wallet with a new recovery phrase, move your assets over, and stop using the old one. A secret that was typed into a chat, a repo or a config file cannot be un-shared. If it was an exchange or API key, revoke it and issue a new one.
This is education, not financial advice.
Quick follow-ups
Can I give an AI agent a private key if it is only for testing?
Google Cloud's web3 team says the self-hosted model, where the key sits in your own environment, is a very high risk and recommends it only for tests. Use a throwaway wallet with test funds, never one that holds real assets.
What if an app or support agent asks for my seed phrase?
It is a scam. MetaMask and Ledger both say their support will never ask for it, and that you should never share it with anyone.
Is there a safe way to let an agent pay for things?
Give it its own wallet with a small balance, or have it prepare transactions that you approve in your own wallet. Keep the amount small enough that losing it is acceptable.
Sources
- MetaMask: How to secure your Secret Recovery Phrase and password
- Ledger Support: Scams targeting crypto holders
- Ledger Academy: What is a seed phrase?
- Google Cloud: Using MCP with Web3
- MCP: Local Server Security
See also the glossary and the other questions.
