---
title: Keep API keys safe
description: "A bot needs to place orders; it never needs to move funds. That distinction is the whole security model. ## Rules that matter - **Never enable withdrawals.** Rulemancer refuses such keys, and an exchange key without withdrawal permission cannot empty…"
url: "https://rulemancer.com/blog/docs/api-key-safety/"
updated: "2026-11-25"
category: "Exchanges & API keys"
---

# Keep API keys safe

A bot needs to place orders; it never needs to move funds. That distinction is the whole security model.

## Rules that matter

- **Never enable withdrawals.** Rulemancer refuses such keys, and an exchange key without withdrawal permission cannot empty an account.
- **Bind to an IP** where the exchange allows it. A stolen key used elsewhere simply fails.
- **One key per purpose.** A separate key per platform makes revocation surgical.
- **Rotate every few months.** Create the new key, connect it, confirm a fill, then delete the old one.

## If a key leaks

1. Revoke it at the exchange first — that is immediate.
2. Cancel open orders it placed.
3. Disconnect it in Rulemancer so the bot stops retrying.
4. Check trade history for orders you did not write.
5. Create a new restricted key and reconnect.

## How keys are stored

Keys are encrypted at rest with the platform's application key and never displayed again after saving. They are not written to logs. For the longer version, read [trade-only API keys](/blog/trade-only-api-keys).

## Related reading

- [Trade-only API keys: connect an exchange without handing over your funds](https://rulemancer.com/blog/trade-only-api-keys/)

[All documentation](https://rulemancer.com/blog/docs/)  ·  [Start free](https://rulemancer.com/register)
