AI Governance Institute logo
AI Governance Institute

Practical Governance for Enterprise AI

Security
SEC · SecuritySEC-004Low effortAgent-relevant

AI API Credential Management

Securely manage, rotate, and audit API keys and credentials used to access AI services and model providers.

Objective

Prevent unauthorized access to AI capabilities and associated cost liability through disciplined credential hygiene.

Maturity Levels

1

Initial

API keys are shared informally and stored in code repositories or plain text files.

2

Developing

Keys are managed individually but without a centralized store, rotation schedule, or usage auditing.

3

Defined

All AI API credentials are stored in a secrets manager, with documented rotation schedules and access controls.

4

Managed

Credential usage is monitored; anomalous spend or usage patterns trigger alerts.

5

Optimizing

Credentials are scoped to specific services and rotated automatically; compromise detection response time is measured.

Evidence Requirements

What an auditor or assessor would expect to see for this control.

  • Credential inventory listing all AI API keys, storage location, scope, and rotation schedule
  • Secrets manager access control configuration confirming developer direct production access is restricted
  • Rotation completion records showing each credential was rotated on schedule
  • Spending alert configuration and records of any alerts triggered and investigated
  • Source code repository scan results confirming no AI API keys are committed to version control

Implementation Notes

Key steps

  • Never hardcode AI API keys in application code or commit them to source control — use environment variables or a dedicated secrets manager.
  • Scope credentials to the minimum required permissions; many AI providers offer read-only or rate-limited key types.
  • Set spending limits and usage alerts on AI API accounts — compromised keys are often discovered first through unexpected billing spikes.
  • Rotate keys on a defined schedule and immediately upon any suspected compromise or personnel change.

Example Implementation

Startup using OpenAI, Anthropic, and a vector DB provider across three products

AI API Credential Inventory and Rotation Policy

ProviderKey ScopeStorageRotation ScheduleSpend Alert Threshold
OpenAIProduction (GPT-4o)AWS Secrets Manager90 days$500/day
OpenAIDevelopmentAWS Secrets Manager30 days$50/day
AnthropicProductionAWS Secrets Manager90 days$500/day
PineconeRead + write (prod index)AWS Secrets Manager90 daysN/A

Prohibited storage locations: Source code, environment files committed to git, Slack/email, shared spreadsheets

Compromise response: Immediate rotation + incident report within 1 hour of detection; notify Security Lead

Access control: Secrets Manager access restricted to CI/CD service role and designated engineering leads; no developer direct access in production

Control Details

Control ID
SEC-004
Domain
Security
Typical owner
CISO / Platform Engineering
Implementation effort
Low effort
Agent-relevant
Yes

Tags

API keyscredential managementsecretssecurity hygiene