# How to give custom AI agents their own service identity

DevFeed: [How to give custom AI agents their own service identity](<https://devfeed.tech/articles/how-to-give-custom-ai-agents-their-own-service-identity-122906.md>)

Original publisher: [Read original article](<https://nirmata.com/2026/11/09/service-identities-for-custom-ai-agents/>)

Author: Ritesh Patel

Published: 2026-11-09T09:41:36.137587Z

Content type: tutorial

Language: en

Sources: [Nirmata](<https://devfeed.tech/sources/nirmata.md>)

Topics: [Authentication](<https://devfeed.tech/topics/authentication.md>), [least privilege](<https://devfeed.tech/topics/least-privilege.md>)

Tags: [account](<https://devfeed.tech/tags/account.md>), [agent](<https://devfeed.tech/tags/agent.md>), [agents](<https://devfeed.tech/tags/agents.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [ai-governance](<https://devfeed.tech/tags/ai-governance.md>), [api](<https://devfeed.tech/tags/api.md>), [app](<https://devfeed.tech/tags/app.md>), [audit](<https://devfeed.tech/tags/audit.md>), [authentication](<https://devfeed.tech/tags/authentication.md>), [authorization](<https://devfeed.tech/tags/authorization.md>), [credentials](<https://devfeed.tech/tags/credentials.md>), [custom](<https://devfeed.tech/tags/custom.md>), [github](<https://devfeed.tech/tags/github.md>), [github-apps](<https://devfeed.tech/tags/github-apps.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [identity](<https://devfeed.tech/tags/identity.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [rbac](<https://devfeed.tech/tags/rbac.md>), [secrets-management](<https://devfeed.tech/tags/secrets-management.md>), [service](<https://devfeed.tech/tags/service.md>), [tokens](<https://devfeed.tech/tags/tokens.md>)

## AI overview

Give each agent a distinct identity and narrow its grants: use a per-agent Kubernetes service account bound to a narrow Role, or a GitHub App when the agent acts on GitHub. Kubernetes projected tokens can be audience-scoped and rotated; applications must reload them, and services should validate them with TokenReview and check the audience. GitHub installation tokens expire after one hour and can be restricted by repository and permission, but omitted restrictions leave the app's full granted access. Neither identity records which person delegated a task, so keep an audit record linking the agent, task, person, tool call, target, and time. The excerpt notes that its manifests have not been run on a cluster.

## Source excerpt

Give each custom AI agent its own service account or GitHub App identity, narrow its grants, use short-lived tokens, and log the person each agent acted for.