defences · 4 min read
Least privilege for model keys
The single most effective control for AI infrastructure is also the oldest: give each key the least it needs.
The principle
Least privilege predates AI by decades. It applies cleanly to model keys, and almost no one follows it, because the convenient key is the broad key.
In practice
- One key per purpose. Inference, data upload, fine-tuning and administration are different jobs with different keys. - Scope to a project, not an organisation. If the provider supports project keys, use them. - Rotate on a schedule and on anomaly. A key that cannot be rotated without downtime is a key that never gets rotated. - Monitor spend and resource access per key, so an over-scoped key is visible in normal operations.
How to know
You cannot reason about a key's reach from its name. You have to exercise it. The Key Exposure check does that: it reports what each key can enumerate and whether it answers unrestricted requests, so "least privilege" becomes something you can measure instead of something you intend.