What Matters
An API key does not need withdrawal permission to cause a serious loss. A compromised trading key can place reckless orders, churn fees, concentrate a portfolio, manipulate thin pairs, close hedges, or exhaust margin. The correct security question is not merely whether withdrawals are disabled. It is whether the bot’s authority, capital, network location, vendor access, logging and revocation path are all bounded.
DN Evidence Block
Reviewed: 17 November 2026. Primary evidence: current API-security and permission documentation from OKX, Bybit, Bitget and Kraken; current DN research on bot fail-safes, observability and transaction permissions.
Boundary: exchange interfaces, permission names and key-expiry rules change. Verify the current settings inside the exchange before connecting any third-party service. No exchange or bot platform paid for inclusion.
The API Key Is a Delegated Authority Record
Third-party trading tools often ask users to create an exchange API key and paste a public key, secret and sometimes a passphrase into the vendor’s interface. That credential may be able to read balances, place and cancel orders, change account settings, transfer funds between internal accounts or withdraw assets, depending on the exchange and selected permissions.
Official documentation makes the risk concrete. OKX separates Read, Trade and Withdraw permissions and recommends IP binding. Bitget separates read-only, trade, transfer and withdraw permissions and states that secrets and passphrases should not be disclosed. Kraken describes API keys as effectively equivalent to account credentials for the actions granted. Bybit now offers AI subaccounts with scoped permissions and separate configuration.
The safest design treats the key as a capability token. It should carry only the minimum authority needed for one job, over one limited pool of capital, from one expected network location, for a defined period.
Eight Security Risks
| Risk | What can go wrong | Strong control | Residual risk |
|---|---|---|---|
| 1. Withdrawal or transfer authority | A compromised vendor or credential can move assets away from the intended trading account. | Disable withdrawals and unnecessary internal transfers; use a dedicated subaccount. | Trading losses remain possible even with withdrawals disabled. |
| 2. Over-broad trade permission | The bot can open leverage, trade illiquid pairs, cancel protective orders or alter positions outside the strategy. | Restrict products, pairs and capital through a subaccount and external risk gateway. | Many exchanges do not provide pair-level API permissions. |
| 3. No IP allowlist | Stolen credentials can be used from an unexpected server or country. | Bind the key to fixed vendor or self-hosted IP addresses where supported. | A compromised allowed server can still use the key. |
| 4. Vendor secret storage | Keys leak through plaintext databases, logs, support exports, browser storage or source repositories. | Use encrypted secret storage, strict access controls, redacted logs and documented deletion. | The user cannot independently verify every vendor control. |
| 5. Malicious or faulty order logic | A bug, poisoned prompt or compromised update places valid but harmful orders. | Enforce position, leverage, loss, order-frequency and notional limits outside the model. | Limits can reduce rather than eliminate loss. |
| 6. Main-account blast radius | One bot can affect unrelated holdings, collateral or hedges. | Use a separate subaccount funded only with the strategy’s risk budget. | Cross-margin and shared collateral can reconnect risks if enabled. |
| 7. Stale or orphaned keys | An old integration remains active after a trial, employee departure or vendor migration. | Inventory, rotate and revoke keys on a fixed schedule and at every ownership change. | Revocation may be delayed during an account-access incident. |
| 8. Weak incident evidence | The user cannot distinguish vendor action, account compromise, strategy logic or manual intervention. | Preserve key ID, request ID, IP, order ID, timestamps, strategy version and outcome receipts. | Exchange and vendor logs may have different clocks or retention periods. |
1. Withdrawal Permission Is an Obvious Red Line
A normal trading bot almost never needs the ability to withdraw assets to an external address. Kraken’s own API guidance notes that a trading key would ordinarily need order permissions but almost certainly not Withdraw Funds. OKX and Bitget expose withdrawal as a separate permission. The default control is therefore simple: do not grant it.
Internal transfer permission also deserves scrutiny. A bot may claim it needs to move funds between spot, funding, futures or unified accounts. That may be operationally useful, but it increases the accessible balance. Where possible, pre-fund the exact trading subaccount instead.
2. Trade Permission Can Still Destroy Capital
Withdrawal-disabled is not the same as safe. A trade-capable key can buy a thin asset at an extreme price, repeatedly cross the spread, open an oversized leveraged position or close a hedge. A malicious actor may also trade against another controlled account, using bad fills to transfer value indirectly.
Exchange permissions are usually coarse. The external bot or risk gateway should therefore enforce maximum position, maximum order size, allowed instruments, leverage, daily loss, daily volume and order-frequency limits. Prompt instructions are not enforcement.
3. IP Allowlisting Reduces Credential Portability
OKX says IP addresses help secure API keys and supports linked allowlists. Bitget strongly recommends binding API keys to an IP address. An allowlist means a stolen key is less useful from an arbitrary machine. It is particularly valuable when a bot runs on a fixed VPS or a vendor publishes dedicated outbound addresses.
It is not a complete solution. If the allowed server is compromised, the attacker inherits the permitted network location. Treat IP binding as one layer alongside narrow permissions, capital isolation and monitoring.
4. Ask How the Vendor Stores Secrets
A polished interface does not prove secure key handling. Before connecting, ask whether credentials are encrypted at rest, which personnel or services can decrypt them, whether secrets enter logs, how backups are protected, how deletion is verified and whether the company has an incident-response process.
A vendor that cannot explain the boundary between its application, secret manager and execution workers should not receive a production trading key.
5. Separate the Model From the Risk Gateway
An LLM or adaptive strategy can propose an order. A deterministic risk layer should decide whether the order is permitted. The gateway should validate symbol, side, quantity, price distance, leverage, position impact, remaining loss budget and account state before submission.
This is one of the central lessons in DN’s Crypto Trading Bot Fail-Safe Benchmark and Agent Transaction Permission Risk Index: model intelligence does not replace external authority controls.
6. Use a Dedicated Subaccount
Subaccounts create a clearer capital boundary. Bybit’s AI Subaccount documentation explicitly separates AI-agent access and allows permission management from the main account. Bitget documentation says subaccounts can create and manage their own API keys while the main account retains control.
Fund the subaccount with the maximum amount the strategy may lose. Avoid shared collateral, automatic top-ups and cross-margin links unless they are essential and explicitly modelled.
7. Rotation Is an Operating Process
Keys should be rotated after suspected exposure, vendor changes, employee departures, infrastructure migrations and on a periodic schedule. The replacement process must include revoking the old key, updating the secret manager, testing the new key in a restricted environment and confirming that no stale worker continues sending requests.
OKX’s API agreement specifically calls for minimum permissions, IP allowlisting, encrypted storage and prompt rotation after suspected compromise. Those are reasonable baseline requirements for any connected bot.
8. Build an Incident Record Before the Incident
Logs should capture the strategy decision, model and prompt version where relevant, risk checks, API-key label, source IP, request timestamp, exchange order ID, fill events and resulting position. Secret values must never appear in logs.
When an unknown order appears, the response sequence is: stop the bot, revoke or disable the key, cancel open orders, assess positions and margin, preserve logs, rotate credentials, review account sessions and only then reconnect with reduced authority.
DN Rule
A third-party bot should never receive more authority or capital than the exact strategy needs. Use a dedicated subaccount, disable withdrawals, bind IP addresses, enforce deterministic limits and make revocation possible without the vendor’s cooperation.
DN Exchange API Exposure Score
Score one planned connection. Lower is safer. A low score does not prove that the vendor or strategy is trustworthy.
Editorial screening tool; not a penetration test, vendor audit or guarantee.
Worked Example
A user connects a bot to a main unified account holding spot assets and derivatives collateral. Withdrawals are disabled, but the key can trade every instrument and the vendor does not support fixed IP addresses. The account has no daily loss cap outside the bot.
This is still a high-risk setup. The better design creates a subaccount, transfers only the strategy budget, disables automatic top-ups, restricts the key to trading, binds it to known IPs, and runs a separate process that rejects oversized orders and pauses after a daily loss threshold.
Commercial Paths and Disclosure
Readers comparing connected automation can review DN’s 3Commas vs Cryptohopper vs Pionex vs Bitsgap comparison. DN has affiliate relationships with 3Commas, Pionex, Bitget and OKX. These links do not alter the security criteria above.
A Withdrawal-Disabled Key Can Still Lose Money
Disabling withdrawals is essential, but it is not a complete control. A compromised trading key may still place market orders at poor prices, churn the account through fees, concentrate capital in an illiquid asset, remove protective orders, increase leverage or deliberately trade against an attacker-controlled account. On a thin market, the attacker may not need to withdraw from the victim account at all: value can be transferred through adverse execution.
That is why a safe design combines permission restriction with market and account controls. Use a dedicated subaccount, a maximum position size, a leverage ceiling, an allowlist of instruments, daily loss limits and a separate risk process that can cancel orders or revoke the key. These limits should be enforced outside the language-model prompt. A prompt is guidance; an exchange permission, subaccount balance and independent kill switch are controls.
Where the Secret Lives Determines the Blast Radius
| Credential location | Operational benefit | Main risk | Minimum control |
|---|---|---|---|
| User device | Secret need not be stored by a SaaS vendor | Malware, browser extensions and local logs may expose it | Encrypted local storage, device security and short-lived sessions |
| Vendor cloud | Reliable automation and centralized operations | A vendor breach can expose many customers at once | Envelope encryption, key separation, audited access and rotation |
| Self-hosted VPS | More control over network and deployment | Misconfiguration, weak patching or exposed environment files | Secret manager, firewall, least privilege and monitored access |
| Hardware-backed or delegated signer | Policy can be separated from raw credentials | Integration complexity and false assumptions about what the signer enforces | Explicit transaction policy, revocation and recovery testing |
Do not accept “encrypted at rest” as a complete answer. Ask who can decrypt the key, whether application workers ever receive the plaintext, how support staff access is controlled, whether secrets appear in debugging tools, how backups are handled and how quickly one customer can rotate a credential without affecting others.
Order-Safety Controls the Bot Should Not Own
The same process that generates a trade should not be the only process allowed to approve it. A stronger architecture places a deterministic gateway between the agent and the exchange. The gateway checks instrument, side, size, price distance, leverage, account equity, realized loss, open-order count and whether the market is currently allowlisted.
- Price collars: reject orders too far from a trusted reference price.
- Notional caps: limit value per order, position and day.
- Leverage caps: block strategy requests above the account policy.
- Concentration caps: prevent one asset or correlated group from dominating the account.
- Duplicate suppression: stop retries from creating multiple orders after an uncertain response.
- Loss circuit breaker: halt new risk after a daily or rolling drawdown threshold.
A vendor dashboard may display these controls, but the user should verify where they are enforced. A visual setting that only changes prompt instructions is weaker than a server-side rule that rejects the API request.
Incident Response: The First 15 Minutes
- Disable or delete the API key at the exchange. Do not wait for the bot vendor to respond.
- Cancel open orders and reduce unintended exposure. Preserve screenshots and exports before changing anything that may be needed for investigation.
- Check withdrawal addresses, login history, subaccount transfers and key changes. A trading incident may be part of a broader account compromise.
- Export trades, orders, fills, API logs and timestamps. Record the timezone and the first known suspicious event.
- Rotate related secrets. Revoke webhooks, cloud tokens and reused credentials, not only the exchange key.
- Reconnect only after the cause is understood. Create a new restricted key rather than re-enabling the old one.
A good bot service should make this process easier by exposing immutable action receipts, source IPs, strategy versions, user approvals and idempotency identifiers. “The AI decided” is not an incident record.
Vendor Due-Diligence Questions
- Can the platform operate with withdrawals and internal transfers disabled?
- Does it support exchange subaccounts and IP allowlisting?
- Where are secrets decrypted, and which staff roles can access them?
- Are user keys isolated from one another cryptographically and operationally?
- Can every order be tied to a strategy version, input and approval?
- What happens when the exchange times out after accepting an order?
- How are abnormal orders, repeated failures and rapid position changes detected?
- Can the user revoke access immediately without contacting support?
- Has the vendor published an incident-response and disclosure process?
Worked Scenario: A Safe Pilot
A user wants to test a third-party AI bot on one exchange. Instead of linking the main account, the user creates a subaccount containing only the pilot capital. The API key can read balances and place spot orders, but cannot withdraw, transfer, use margin or trade derivatives. The key is restricted to the vendor’s documented IP addresses. The strategy can trade only two liquid pairs, with a fixed maximum order size and a daily loss breaker enforced by a separate gateway.
The user runs the system in paper mode first, then in live mode with a small balance. Every order is reconciled against the exchange after submission. If the vendor becomes unavailable, the user can revoke the key directly at the exchange and still access the account. This design does not make the strategy profitable; it limits how much a software or credential failure can damage.
Related DN Research
- Exchange API Change Impact Register — what an agent deployment must recheck when an exchange changes its API.
- Crypto Exchange API Latency Benchmark 2027 — why speed, rate limits and reliability need separate evidence.
- AI Trading Bot Logs — the records required to reconstruct why an order was placed.
Methodology and Limitations
DN mapped official exchange permission models against eight failure domains: asset movement, order authority, network restriction, secret custody, risk enforcement, capital isolation, lifecycle management and forensic evidence. We did not penetration-test the exchanges or bot vendors. Documentation describes available controls, not their implementation quality in every account or region.
Frequently Asked Questions
Is a bot safe if withdrawals are disabled?
No. It cannot directly withdraw through that key, but it can still cause trading losses, fees, liquidation or harmful portfolio changes.
Should a trading bot use my main exchange account?
Prefer a dedicated subaccount funded only with the strategy’s risk budget.
Does IP whitelisting make a key safe?
It reduces where the key can be used, but a compromised allowed server can still act.
How often should API keys be rotated?
Rotate after any suspected exposure or operational change and on a documented periodic schedule appropriate to the risk.
What should I do after seeing an unknown order?
Stop automation, revoke the key, cancel orders, assess positions, preserve evidence and rotate credentials before reconnecting.
Primary Sources
- OKX API FAQ
- OKX API Guide: permissions and security
- OKX API Agreement
- Bybit API Key Guide
- Bybit AI Subaccount
- Bitget REST API and permissions
- Kraken API Key Security
Commercial disclosure: DN may earn compensation from the affiliate links above. No platform paid for inclusion or editorial treatment.




