AAlphaBot
Blog

Hard-rejecting withdraw-enabled API ключи: the technical deep-dive

2026-05-06 · ~7 minute read

Большинство торговых платформ accept API ключи с withdraw разрешением enabled. Они show жёлтый warning banner, ask вас type "I understand" и store ключ anyways. Мы не делаем это. Если ваш ключ has withdraw разрешение, мы отклоняем это на onboarding и никогда не store это. Этот post объясняет почему, как и что alternative actually costs вам.

Threat модель в one paragraph

Любая система которая holds withdraw-enabled API ключ одна credential leak away от emptying user accounts. Leak не has быть database breach — это может быть compromised employee laptop, misconfigured backup, side-channel в third-party dependency или process-memory dump landing в unencrypted log. Каждый один из those happened к companies larger чем мы. Only дurable defence: не have ключи к anyone's funds в first place.

Как detection работает

На first authenticated вызов after user pastes ключ, мы делаем exchange-specific permission-introspection вызов. Most major venues expose либо:

  • Dedicated "query API key info" endpoint которая returns permission set как structured field, или
  • Account-info endpoint где ключ's permission scope included как part response payload.

Мы look для любого flag который grants withdraw, internal transfer, sub-account transfer out или universal transfer out — venues use разные names для same идея. Если any из those present, мы discard secret в memory immediately, return structured error к UI и никогда не write ключ к нашей database.

Почему hard-reject вместо warn

Warnings get clicked через. Мы have watched data на это for years across multiple products. Base rate из users typing "I understand" без reading единственный word выше это somewhere north из 80%. Warning который 80% users ignore не security control; это liability shield.

Hard rejection это opposite. Это put friction в right place: пользователь goes back к exchange, creates новый ключ с trade разрешением only, comes back и pastes that один. Whole loop costs пользователь maybe два minutes. Это costs attacker — в worst-case credential leak scenario — whole account.

Что warn-instead-of-reject path actually costs вам

Warn-and-store pattern looks user-friendly до вы ask: что does worst-case look like? Вы get один hostile employee, один supply-chain compromise, один side-channel в transitive dependency, один mis-scoped log и answer это withdraw-enabled ключи exactly как good как weakest person и weakest piece code который ever touched them.

Hard-rejecting flips that calculus. Even в worst-case полный database compromise, attacker walks away с read+trade ключи. Trade-only ключи can делать damage — они can blow positions, churn комиссии, dump открытые positions в illiquid пары — но they не can withdraw. Funds stay на exchange. То не zero риск но это risk вы signed up для when вы connected automated торговый agent в first place.

Что мы still не можем defend against

Мы не pretending hard rejection complete security posture. Это один control. Full set documented на нашей security page: KMS envelope encryption с per-user data ключи, decrypted секреты что live только в process memory и только для duration из API вызова, append-only hash-chained audit log, CI-tested cross-user изоляция и vulnerability disclosure программа. Hard-rejecting withdraw разрешение это just most visible piece из that stack — и easiest один к verify yourself потому что вы можете watch нас refuse withdraw-enabled ключ в real time во время onboarding.