GlossaryLast checked 16 October 2026 with AI-assisted research. Editor: Akshay Dubey.MethodologyCorrections log
API key
An API key is a static credential, a long random string, that an application presents to authenticate to a service or API. It is not an identity: it acts as whichever identity it was issued to (an application, a user, a service account or a whole tenant) with whatever access the key is scoped to. Because it is a long-lived secret carried in requests, an exposed key grants that access to anyone who finds it.

Why API keys sprawl and leak

API keys are the path of least resistance: generate a key, paste it into config, ship. That ease is the problem. Keys end up hardcoded in source, baked into container images, pasted into chat and ticketing tools, and copied across environments. A leaked key is usable immediately by anyone, with no second factor in the way.

Managing API keys

  • Get them out of code. Store keys in a managed vault, never in source or config.
  • Scope tightly. Issue keys with the narrowest permissions and resource scope possible.
  • Rotate, or replace. Rotate keys on a schedule, and where the platform supports it, replace static keys with short-lived tokens.
  • Scan continuously. Run secret scanning across code, logs, and collaboration tools to catch exposed keys fast.
  • Attribute ownership. Know which workload and which human each key belongs to so you can revoke confidently.

For the step-by-step programme (inventory by issuer, binding each key to an identity and an owner, replacement with short-lived credentials, expiry and retirement), see the API key governance playbook. Related terms: secret and OAuth token.

Frequently asked questions

What is an API key?

An API key is a static credential that an application presents to authenticate to a service or API. It acts as the identity it was issued to and grants whatever access it is scoped to. Because it is a long-lived secret, anyone who obtains the key can use it directly, with no additional authentication factor.

Why are API keys a security risk?

Because they are easy to create and easy to leak. Keys frequently end up hardcoded in source code, container images, logs, and chat tools, and a leaked key is immediately usable by anyone who finds it.

How should API keys be managed?

Keep them out of code by storing them in a managed vault, scope each key to the minimum access needed, rotate them on a schedule or replace them with short-lived tokens, run continuous secret scanning to catch exposures, and attribute each key to a workload and human owner so it can be revoked confidently.

Is an API key a non-human identity?

No. An API key is a credential. It proves an identity, such as an application, an IAM user, a service account or a whole SaaS tenant, and carries that identity's access. Governance (owner, purpose, review) attaches to the identity; rotation, expiry and storage attach to the key.

Sources

  • OWASP Non-Human Identities Top 10 (2025), owasp.org
  • OWASP NHI Top 10 (2025), full risk list, owasp.org
  • NIST SP 800-53 Rev. 5, Security and Privacy Controls for Information Systems and Organizations (AC-2, AC-6, IA-5), csrc.nist.gov

Where a primary URL is not shown, we have not confirmed the figure against the publisher’s own document and say so on the page rather than linking a secondary source that paraphrases it. Paywalled standards (ISO/IEC, AICPA) are cited by clause and not linked. Corrections welcome: report an error.

Disclosure. This reference is free. No vendor pays for coverage, placement, or favourable treatment. HumanAudit Inc., which publishes this site, sells ISO/IEC 42001 documentation and plans NHI governance documentation packs, including an RFP kit that does not name, rank or recommend any vendor; it builds and sells no NHI scanner and no NHI discovery, monitoring or security tool (see About). Links to its offers appear in the header, in the site footer and in one marked box on guide pages; company profiles carry none. See our methodology, sourcing standards and corrections policy.

Page history
Migrated from nhimanagement.com on 7 October 2026. The earlier review date was not recorded; it is being re-verified under this site's methodology. Errors: corrections log.
Monthly change log

Know when the NHI landscape changes.

One email a month from this reference: new deals, standards status changes and corrections. No sponsored content. Unsubscribe from any email.

We first email you a link to confirm. Privacy policy.