---
title: Tip: treat exchange and trading API keys like production credentials: least privilege, IP allowlists, short lives and alerts on unusual actions | ctxsec
url: https://ctxsec.com/items/tip-scope-exchange-trading-api-keys-ip-allowlist-no-withdraw-rotate-lighter
description: "Trading API keys often sit in bot configs, CI variables and shared servers. If one leaks, an attacker can trade against you, unwind positions or use protocol features to move value out, even without withdrawal rights."
status: "guidance prompted by Lighter's Nov 16, 2026 incident (single compromised external party); the API-key cause is reported, not confirmed by Lighter"
published: 2026-11-16
---

> Trading API keys often sit in bot configs, CI variables and shared servers. If one leaks, an attacker can trade against you, unwind positions or use protocol features to move value out, even without withdrawal rights.

[← Tips & Guides](/tips) · [markdown](/items/tip-scope-exchange-trading-api-keys-ip-allowlist-no-withdraw-rotate-lighter.md)

guidance prompted by Lighter's Nov 16, 2026 incident (single compromised external party); the API-key cause is reported, not confirmed by Lighter

2026-11-16 7:34 AM ET

### Tip: treat exchange and trading API keys like production credentials: least privilege, IP allowlists, short lives and alerts on unusual actions

- **Least privilege:** issue separate keys per bot or strategy, with withdrawals off and only the actions it needs.
- **Bind them:** use IP allowlists or signed-origin restrictions where the venue supports them.
- **Store and rotate:** keep keys in a secrets manager, never in repos or chat; rotate on staff or vendor changes and after any host compromise.
- **Watch:** alert on actions a strategy never takes (closing all positions, creating pools, new sub-accounts) and on activity from new IPs.
- **Plan the kill switch:** know how to revoke every key and freeze an account in minutes.

Sources: [Lighter on X: security incident involving a single compromised external party; withdrawals and pool creation suspended (Nov 16, 2026)](https://x.com/Lighter_xyz/status/2122284181422284986)
