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