API Key Security for Trading Bots - The Hard Lesson
Short answer: Trade-only keys do not make you safe - the 3Commas victims had withdrawals disabled and were still drained via illiquid-pair wash trading. What protects you: IP-whitelisted keys, one per service, rotation on any warning, low working balances, and custody models where keys never leave your control.
In late 2022, roughly 100,000 API keys leaked from 3Commas - at the time one of the largest cloud bot platforms [1]. Attackers drained accounts whose keys had withdrawal permissions correctly disabled, by trading illiquid pairs against their own orders. Every structural lesson about connecting bots to exchanges comes from that incident, and this guide is those lessons.
table of contents
Trade-only keys do not make you safe
The community data-breach thread documents the shape of it: keys for Binance and KuCoin accounts surfaced in a leaked database, and the exploit did not need withdrawal rights [1]. Instead, attackers sold victims' BTC for USD and used the USD to buy worthless low-cap tokens at inflated prices - tokens the attackers themselves had listed on the other side of the trade. Losses ran to six figures per account [2].
The mechanism generalizes: any key that can place orders can move your money at market prices. "Trade-only" limits the attack surface; it does not close it. The only settings that actually stop the wash-trading exploit are exchange-side frictions the attacker cannot trade around.
The checklist that does protect you
- Whitelist the bot platform's IP range on the key, at the exchange. A leaked key under a strict IP whitelist is dead on arrival outside that range.
- Use one key per service, never reuse - the blast radius of any single leak stays one platform.
- Rotate keys on any suspicious activity - immediately, not after the vendor's email [3].
- Prefer OAuth fast-connect where the exchange offers it: the exchange can then revoke centrally, platform-wide, in one action.
- Keep working balances low; bots need trading capital, not your savings. What sits on an exchange connected to a third party is exposed capital.
- Prefer custody models where keys never leave your control - exchange-native bots or self-hosted setups. The self-hosted vs. cloud guide maps that trade-off fully.
The API key security check walks your current setup against this list interactively.
Vendor transparency is a security feature
The timeline matters as much as the leak. Community threads documented a breach pattern through late 2022 while the vendor denied a compromise; the admission came only after the leaked database surfaced publicly, with the blunt community summary "DELETE YOUR KEYS NOW" [3]. Users who had rotated keys on the first reports kept their money; users who waited for official confirmation did not [2].
When you evaluate any bot platform, look for how it handled incidents: disclosure speed, post-mortems, whether security teams respond before public pressure. We track exactly that in our incident archive and factor it into every safety score in the bot comparison. A vendor's incident history is a security feature you cannot configure yourself.
Custody model beats configuration
| Custody model | Where your keys live | Vendor breach scenario |
|---|---|---|
| Exchange-native bots | Never leave the exchange | Eliminated |
| Self-hosted bots | Your machine or VPS | Eliminated (your opsec instead) |
| Cloud platforms (API key) | Vendor infrastructure | The 2022 scenario [1] |
| Pooled copy-trading | Provider custody | Different failure modes - see scam patterns |
The configuration checklist protects the cloud model; the custody choice removes the scenario. Live platforms by custody, from our database:
| Bot | Category | Custody | Score |
|---|---|---|---|
| Freqtrade | Self-hosted | Self-hosted | 8.0/10 |
| Pionex | Exchange-native | Exchange-held | 7.4/10 |
| Bitsgap | Cloud platform | Your keys (API) | 7.6/10 |
| Zignaly | Copy trading | Pooled | 7.6/10 |
Live values from our database - details, fees and incidents in each review.
If something looks wrong, the order of operations
- Revoke the key first - at the exchange, not at the bot platform; exchange-side revocation cannot be delayed or softened by anyone else.
- Then check trade history for wash-trading patterns: unfamiliar pairs, sells into thin order books, round amounts of low-cap tokens [1].
- Then document everything - timestamps, transaction IDs, screenshots - while the exchange's support process, and possibly law enforcement, still benefit from fresh evidence.
- Only then contact the bot vendor - after your keys are already dead.
FAQ
Is it safe to give a trading bot my API keys?
Risk is never zero with third-party platforms - 100,000 keys leaked from one vendor in 2022 [1]. Minimize it: IP-whitelisted trade-only keys, one key per service, low exchange balances, and prefer custody models where keys stay with you (exchange-native or self-hosted).
What happened in the 3Commas leak exactly?
See the full timeline in our incident archive: roughly 100k API keys leaked between October and December 2022, exploited via illiquid-pair wash trading, six-figure individual losses [2], and a vendor admission that came only after the database surfaced publicly [3].
Does disabling withdrawal permissions make a key safe?
No - that is the 2022 lesson. Every victim's key was trade-only. Any key that can trade can drain you on a thin market: sell your BTC into the attacker's inflated illiquid token, and the "trade" completed the theft at market prices.
What is IP whitelisting and why does it matter?
An exchange-side restriction that the key only works from specified IP addresses. A leaked key with a strict IP whitelist is worthless to anyone outside the whitelist - it is the single highest-value setting for third-party bot connections.
Which custody model is safest for keys?
Exchange-native bots (keys never leave the exchange) and self-hosted bots (keys stay on your machine). Both eliminate the vendor-breach scenario entirely; the trade-offs are covered in the self-hosted vs. cloud guide.
Sources
- Reddit - Data breach: 100,000 Binance and KuCoin API keys linked to 3Commas - accessed 2026-09-03
- Reddit - Lost $145k due to 3Commas API breach (victim report) - accessed 2026-09-03
- Reddit - 3Commas officially admits API leak ("DELETE YOUR KEYS NOW") - accessed 2026-09-03