Skip to the content
AI and Cybersecurity Learning and Practice Center Test automation Open the Learning Center

Best practiceRunning agents

Give agents their own identity with the least privilege

OWASP ASI03OWASP LLM06

Agents that borrow a human's token inherit every permission that human has. Salesloft Drift tokens raided hundreds of Salesforce tenants; CI agents with repository secrets leaked them. A scoped, short-lived identity turns a hijack into a contained event.

What to do

  1. Create a service identity per agent and per environment; never reuse a person's session or a shared admin key.
  2. Scope tokens to the repositories, buckets, tables and actions the job needs; prefer read-only until a write is proven necessary.
  3. Use short-lived credentials (OIDC, workload identity, STS) so a leaked token expires on its own.
  4. Log every action under the agent's identity so a hijack is attributable and revocable.

Sources

Check your own AI plan against the practices: Plan check