Skip to content
Preptima
hardScenarioDesignMidSeniorStaff

A customer's API token turns up in a public repository. What do you do in the next hour, and what in your token design decides how bad this is?

7 min readUpdated 2026-08-15Target archetype: Big Tech, Enterprise Captive, Product Startup

Answer

Short answer

The damage is fixed before the leak by three earlier decisions: whether the token can be revoked and how fast that takes effect, how narrowly it was scoped, and whether your audit trail can attribute actions to that specific credential rather than only to the tenant.

Keep api tokens explicit in the answer because that is the concept the interviewer is actually trying to test.

Was this answer helpful?

Likely follow-ups

  • Your tokens are signed and self-contained with a 24-hour lifetime and no revocation list. What can you do in the next five minutes?
  • How do you rotate a customer's credential when their integration has no mechanism for picking up a new one without downtime?
  • Which operations would you require a second factor or a separately signed request for, whatever the token says?
  • How do you scope tokens so that a leak cannot delete data, without forcing customers to manage ten of them?

Related questions

Further reading