AI CodeOps

Least privilege

Least privilege means each person, service or agent gets only the access its task needs. Why it matters more with AI agents, and how AI CodeOps applies it.

Least privilege is the security principle that each entity, whether a person, a service or an AI agent, is granted only the access it needs to do its job. NIST's glossary words it as "the minimum system resources and authorizations that the entity needs to perform its function" (NIST CSRC).

What it is

In practice it means:

  • Narrow roles: give people the role their work needs, not admin by default.
  • Scoped credentials: API keys and tokens limited to specific permissions, addresses and lifetimes.
  • Separation of duties: the person who makes a change isn't the only one who can approve it.
  • Minimal tools for agents: an agent gets the tools its step needs and nothing else.

Why it matters

Access that isn't granted can't be misused, whether by an attacker with a stolen token or by an agent following an injected instruction. OWASP lists least privilege among the main mitigations for prompt injection.

In AI CodeOps

  • Roles: nine built-in roles, including four limited to one area each (Security Admin, DevOps Admin, Billing Admin, Secret Manager). Developers can run sessions but can't approve them.
  • API keys: a key can be scoped to listed permissions, an IP allowlist and an expiry date. Key scoping depends on your plan.
  • Agents: each agent is offered only the tools its permissions allow, and policy rules can deny MCP tools, commands, pull requests and deploys.

Frequently asked questions

Does least privilege apply to AI agents?

Yes, and more so. An agent can be steered by text it reads, so the tools and credentials it holds set the limit on what a bad instruction can do.

Can a CI key start AI sessions over MCP?

Only if its scope lists that permission. A key with no scope can't start sessions from the MCP server.