All articles
SEBI & Compliance

Are My Broker API Keys Safe? How Credentials Should Be Handled

What an API key can and cannot do, how credentials should be stored by a trading platform, the warning signs of bad handling, and what to do if you think a key has been exposed.

Arthalab9 min read
An API key lets software place orders in your account. It does not let anyone withdraw your money. That distinction defines the entire risk picture, and understanding it tells you what to protect against and what not to worry about.

What an API key can and cannot do

CanCannot
Place, modify and cancel ordersWithdraw funds from your account
Read positions, orders and balanceChange your bank details
Square off existing positionsTransfer securities out
Act within market hoursChange your broker login password
The right-hand column is the reassuring part. Money leaves a broker account through a separate, more heavily protected channel that API access does not touch.

Why that does not mean it is harmless

The left-hand column is still serious. An attacker who could place orders in your account could cause losses deliberately — opening positions you did not want, or closing ones you did. The risk is real; it is just a different risk from theft.

The three layers that protect you

Indian broker API access is protected by more than the key alone, which is why a leaked key is less immediately catastrophic here than in some other markets.
  1. The key and secret. Issued by your broker, revocable by you at any time.
  2. A registered IP address. Requests from any other address are refused, so a stolen key used from elsewhere does not work.
  3. A daily session token. It expires every day, so even a working session has a short life.

How a key could realistically be exposed

Thinking about the actual paths is more useful than general caution, because most of them are avoidable with a specific habit.
PathHow likelyThe habit that prevents it
Sent over chat or email to supportCommonNever send credentials to anyone, ever
Included in a screenshotCommonCrop or redact before sharing anything
Left in a config file on a shared machineOccasionalKeep credentials out of files you sync or share
Platform stores them poorly and is breachedRarerAsk how they are stored before entering them
Your own device is compromisedRarerStandard device hygiene; nothing platform-side helps here
The top two account for most real-world exposure and both are entirely within your control. No amount of encryption on a platform's side helps once a key has been pasted into a chat window.

How a platform should store your credentials

Four things distinguish responsible handling from careless handling, and you can ask about all of them directly.
PracticeWhat it meansWhy it matters
Encrypted at restCredentials are not stored as readable textA database leak does not immediately expose keys
Decrypted only in memory, at point of usePlaintext exists briefly, only while placing an orderReduces the window in which it can be read
Never displayed backNot shown in the interface, including to staffRemoves screenshots and support chats as a leak path
Not loggedCredentials never appear in application logsLogs are copied and retained far more widely than databases
On Arthalab, broker credentials are encrypted at rest and decrypted in memory only at the moment an order is placed. They are never shown back in the interface, including to admin users — the admin panel can show a connection's network settings but not its key, secret, access token or client ID.

Warning signs

Signals that a platform is handling credentials badly, in rough order of seriousness.
  • It asks for your broker login password rather than API credentials you generated. There is no legitimate reason for this.
  • It displays your API key back to you in full. If the interface can show it, so can anyone who gains access to the interface.
  • Support asks you to send credentials over chat or email. Both are stored, forwarded and backed up in ways nobody controls.
  • It claims to automate your daily broker login. That requires storing your password.
  • It cannot tell you how credentials are stored. A vendor that has thought about this can answer in a sentence.

What you should do

  • Generate API credentials yourself, in your broker's own portal
  • Whitelist a dedicated IP address rather than a broad range
  • Never send credentials over chat, email or screenshots
  • Revoke and regenerate the key if you suspect exposure
  • Review your broker's active API apps periodically and remove unused ones
  • Keep your broker login password separate and never share it

The periodic check worth doing

The fifth item is the one people skip. API apps accumulate — created for a platform you trialled once, left active years later. An unused app is a credential you are not watching.

If you think a key has been exposed

1

Revoke it in your broker's portal first

This is the action that actually stops it working. Do it before anything else.
2

Check your order book and positions

Look for anything you did not place. The order book is the record that matters here.
3

Tell your broker

They can advise on whether further action is needed and have visibility you do not.
4

Generate fresh credentials

A new key and secret, entered into your platform.
5

Re-whitelist and validate

Run validation to confirm the new setup works before relying on it.

Using several platforms at once

If you trial or run more than one platform, each is another place your credentials exist. That is manageable, with one practice.
Where your broker allows multiple API apps, create a separate one per platform. The benefit is isolation: you can revoke one platform's access without disrupting the others, and if something goes wrong you know which set of credentials was involved.

Why one app per platform matters

Reusing a single app across platforms removes that ability. Revoking becomes all-or-nothing, and attributing unexpected activity becomes guesswork.

What a platform cannot protect you from

Being clear about the boundary matters as much as the protections themselves.
  • A compromised machine. If your own device is compromised, anything you can see can be seen.
  • Credentials you shared. No storage practice helps once a key has been sent to someone.
  • A strategy that loses money. Security and performance are unrelated questions.
  • Your broker's own security. That relationship is between you and them.

The short version

  • An API key can place orders but cannot withdraw funds
  • Three layers protect you: the key, the registered IP, and daily session expiry
  • Credentials should be encrypted at rest and never displayed back
  • A request for your broker password is a reason to stop, always
  • If exposed, revoke first and check the order book second
  • Review and remove unused broker API apps periodically
The whitelisting step is the one that does most of the work here. Setting it up correctly takes a few minutes and is what makes a leaked key substantially less useful.

Frequently asked questions

Most often by being sent over chat or email, or included in an unredacted screenshot. Both are entirely within your control, and no amount of platform-side encryption helps once a key has been pasted somewhere.

No. Where your broker allows several, create one per platform. That lets you revoke a single platform's access without disrupting the others, and makes unexpected activity attributable.

Each is another place your credentials exist, which is manageable with separate API apps. The real risk is running two platforms live against the same broker account, where neither knows what the other has placed.

Not necessarily. The key alone is not enough — requests also have to come from your registered address within a valid daily session. That is precisely why those requirements exist.

No. API access covers order placement and account reading. Funds leave a broker account through a separate channel that API credentials do not reach.

Place or close orders in your account, which could cause losses. They would also need to be sending requests from your registered IP address and within a valid daily session, which is what makes a stolen key much less useful on its own.

No. If the interface can display it, anyone who gains access to the interface can read it. Not displaying it back is a basic expectation.

No, and no legitimate platform needs it. API credentials that you generate and can revoke are the correct mechanism. A password request is a reason to stop.

Revoke it in your broker's portal first, then check your order book for anything you did not place, then tell your broker and generate fresh credentials.

No. They are encrypted at rest and never shown back in the interface, including to admin users. The admin panel can show a connection's network settings but not its key, secret, token or client ID.

There is no fixed schedule, but reviewing your broker's active API apps periodically and removing unused ones is worth doing. An app created for a platform you trialled once is a credential you are not watching.

Each additional platform is another place your credentials exist. Use separate API apps per platform where your broker allows it, so you can revoke one without disrupting the others.

Start with a free 3-day trial

Build a strategy, backtest it and run it on paper — no broker, no IP and no money needed to try it.

Ask us on Telegram
Are My Broker API Keys Safe? How Credentials Should Be Handled | Arthalab — Algo Trading India