When a service account is called svc-test2 and carries no owner, purpose or expiry, nobody can tell whether it is safe to rotate, restrict or delete, so it is left alone for years. This template is a standard for naming non-human identities (service accounts, service principals, managed identities, IAM roles, API keys, certificates, Kubernetes service accounts and AI agent identities) and for the metadata every one of them must carry. It is written to be adopted as-is, with [Organisation] placeholders, and mapped to the tag and attribute limits of AWS, Azure, Google Cloud, Entra ID and Kubernetes. It is for IAM, platform and cloud engineering teams who create machine identities, and for the governance teams who review them. It complements the NHI Ownership Guide, which covers what owners are accountable for; this standard covers how that accountability is recorded on the identity itself.
How to use this template
- Replace text in square brackets, such as [Organisation], [IAM team] and [CMDB], with your own terms and systems.
- "Must" is mandatory; "should" is recommended where a documented exception may be justified.
- Adopt sections 5 and 6 first. They give the most value: a predictable name and four mandatory tags (owner, purpose, environment, expiry) make every other control easier.
- Apply the standard to new identities from the adoption date, and to existing identities through the backfill plan in the implementation guidance. Do not rename live identities without a change record: renaming can break scripts, policies and audit continuity.
- Check the platform limits in section 7 before choosing tag keys. A key that is valid in AWS may be invalid in Google Cloud, where label keys must be lowercase.
- Review the standard at least annually and whenever a new identity platform, such as an AI agent identity service, is adopted.
1. Purpose
This standard sets how non-human identities (NHIs) at [Organisation] are named and what metadata they must carry, so that every NHI can be traced to an accountable owner, a business purpose, an environment and a review or expiry date. It supports inventory (NIST SP 800-53 CM-8 and CM-8(4) Accountability Information), identifier management (IA-4), account management (AC-2) and the NIST CSF 2.0 outcomes ID.AM-02 and PR.AA-01. It directly reduces the OWASP Non-Human Identities Top 10 2025 risks NHI1 Improper Offboarding, NHI8 Environment Isolation, NHI9 NHI Reuse and NHI10 Human Use of NHI, all of which are hard to detect when identities are anonymous.
2. Scope
This standard applies to every identity that authenticates without a human present, in every environment, including:
- Directory service accounts in Active Directory, including gMSA and dMSA accounts, and Linux service accounts with keytabs.
- Entra ID app registrations, service principals and managed identities; AWS IAM roles and IAM users used by workloads; Google Cloud service accounts.
- Kubernetes service accounts and workload identities in CI/CD systems.
- API keys, personal access tokens used by automation, OAuth clients, SSH keys and X.509 certificates issued to workloads.
- AI agent identities, including agent identities issued by identity platforms and identities used by MCP servers and tools.
- Third-party integrations that hold credentials into [Organisation] systems.
Human user accounts, including privileged admin accounts, are covered by [Account Management Standard] and are out of scope, except that an identity named or tagged as non-human must not be used interactively by a person.
3. Definitions
- NHI: any identity, credential or account used by software, a device or an AI agent to authenticate.
- Name: the primary identifier of the NHI on its platform (sAMAccountName, display name, role name, service account ID). Names are hard or impossible to change and must hold only facts that stay constant for the life of the identity.
- Tag: a key and value pair attached to the NHI or its hosting resource (AWS tags, Azure tags, Google Cloud labels and tags, Kubernetes labels and annotations, Entra custom security attributes). Tags hold facts that may change.
- Owner: the named individual accountable for the NHI. A team or distribution list may be recorded as the operating team, but never instead of a person.
- System of record: [CMDB or NHI inventory], which holds the authoritative copy of the metadata and is reconciled with platform tags.
4. Roles and responsibilities
| Role | Responsibility under this standard |
|---|---|
| [IAM team] | Owns this standard, the allowed values lists and the exceptions register; publishes the naming lint rules for pipelines. |
| Platform and cloud engineering | Enforce naming and mandatory tags in provisioning pipelines and cloud policy (for example Azure Policy, AWS tag policies, admission control). |
| NHI owner | Supplies accurate metadata at creation, keeps it current on change, and confirms it at each review. |
| [Security operations] | Uses tags in detection and triage; reports untagged or non-compliant identities seen in telemetry. |
| [Governance or audit] | Measures compliance and samples identities against the system of record. |
5. Naming convention
5.1 Every NHI name must follow this pattern, using lowercase and hyphens where the platform allows:
<type>-<app>-<function>-<env>[-<region>]-<nn>
5.2 Components must use values from the allowed lists maintained by [IAM team]:
| Component | Meaning | Allowed values (examples) |
|---|---|---|
| type | What kind of NHI it is | svc directory service account, gmsa, sp service principal, id managed identity, role IAM role, sa cloud or Kubernetes service account, key API key, crt certificate, agt AI agent, ext third-party integration |
| app | The application or service code from [CMDB] | Registered application code, for example payroll, crm |
| function | What the identity does, in one word | deploy, backup, sync, read, scan |
| env | Environment | prd, stg, tst, dev, sbx |
| region | Optional, where regional scope matters | euw, use, uks |
| nn | Instance number | 01 to 99 |
5.3 Examples: svc-payroll-sync-prd-01, id-crm-read-stg-euw-01, agt-support-triage-prd-01, role-ci-deploy-prd-01.
5.4 Names must not contain personal names, email addresses, secrets, ticket numbers or any confidential information. Microsoft, AWS and Google all warn that names, tags and labels are not treated as protected data and are exposed in cost reports, deployment histories and logs.
5.5 Names must hold only facts that do not change. Owner, cost centre, data classification and review dates belong in tags (section 6), because most platforms cannot rename an identity without recreating it.
5.6 Where a platform limits length or characters, components must be shortened from the right (drop region, then shorten function) and hyphens removed only where they are not permitted. Active Directory sAMAccountName is limited to 20 characters, so directory names need the shortest codes.
5.7 Each NHI must serve one application and one environment. A name that would need two app codes or two environments indicates a shared identity and requires an exception approved by [Head of IAM] with a remediation plan (section 8).
6. Mandatory and recommended metadata
6.1 Every NHI must carry the mandatory tags below at creation. Provisioning must fail if a mandatory tag is missing or holds a value not on the allowed list.
| Tag key | Status | Value format | Used for |
|---|---|---|---|
nhi-owner | Mandatory | Employee ID of a named person (not an email address, to avoid personal data in tags) | Reviews, incident contact, offboarding when the owner leaves |
nhi-team | Mandatory | Team code from [HR or CMDB] | Fallback ownership and routing |
nhi-app | Mandatory | Application code from [CMDB] | Link to business service and criticality |
nhi-env | Mandatory | prd, stg, tst, dev, sbx | Environment isolation checks (NHI8) |
nhi-purpose | Mandatory | Short free text, 100 characters or fewer | Reviewer context |
nhi-expiry | Mandatory | ISO date YYYY-MM-DD, at most [12] months ahead | Recertification and automatic disable |
nhi-cred-type | Mandatory | federated, managed, cert, secret, key, password | Prioritising migration away from static secrets |
nhi-privilege | Mandatory | tier0, high, standard, low | Review frequency and alert severity |
nhi-data-class | Recommended | Classification label from [Data Classification Policy] | Data access reviews |
nhi-secret-ref | Recommended | Vault path or secret ID, never the secret | Rotation and leak response |
nhi-source | Recommended | Pipeline or repository that created it | Drift detection and rebuild |
nhi-vendor | Mandatory for ext | Supplier ID from [TPRM register] | Third-party offboarding (NHI3) |
nhi-agent-principal | Mandatory for agt | Whether the agent acts as itself or on behalf of users | Delegation and audit |
6.2 Tag keys must be lowercase with hyphens and the nhi- prefix. Lowercase is required because Google Cloud label keys accept only lowercase characters, and AWS treats Owner and owner as different keys.
6.3 Tag values must never contain a secret, a password, a personal email address or other personal data.
6.4 The system of record holds the authoritative metadata. Platform tags must be reconciled with it at least [weekly], and a mismatch is treated as a finding.
6.5 When the owner leaves or changes role, the joiner, mover and leaver process must raise a task to reassign nhi-owner within [10] working days. An NHI without a valid owner is disabled after [30] days.
7. Platform mapping
7.1 Where the identity object itself cannot hold tags, the metadata must be recorded on the closest object that can, and in the system of record.
| Platform | Where metadata lives | Constraints to design for |
|---|---|---|
| AWS | Tags on IAM roles and users; enforced with tag policies and IAM conditions | 50 user tags per resource; key 1-128 and value 0-256 UTF-8 characters; aws: prefix reserved; keys and values case sensitive |
| Azure resources | Tags on user-assigned managed identities and their resource group; Azure Policy to require and inherit | 50 pairs; name up to 512 characters, value 256; resources do not inherit tags from the resource group without policy; < > % & \ ? / not allowed in names |
| Entra ID | Custom security attributes on enterprise applications (service principals); owners set on the app and service principal | Attribute value up to 64 characters; 50 values per object; Global Administrator cannot read them by default, so assign Attribute Assignment Reader to reviewers |
| Google Cloud | Labels on the hosting project and resources; tags where policy conditions are needed | Up to 64 labels; keys and values up to 63 characters, lowercase letters, digits, underscore and hyphen only; labels cannot drive policy, tags can |
| Kubernetes | Labels and annotations on the ServiceAccount object, alongside the recommended app.kubernetes.io/name, part-of and managed-by labels | Use a domain prefix, for example nhi.[organisation].example/owner; use annotations for free text |
| Active Directory | Dedicated OU per tier, description, managedBy (owner) and a schema extension or [CMDB] record for the remaining fields | 20-character sAMAccountName; managedBy must point to a user object |
| Secrets, keys and certificates | Vault metadata on the secret; certificate subject and SAN follow section 5; inventory record for API keys issued by SaaS vendors | Many SaaS API keys accept only a free-text label, so the system of record is authoritative |
8. Exceptions
8.1 Exceptions must be requested through [exceptions process], approved by [IAM team] and recorded with an expiry no later than [6] months.
8.2 Legacy identities whose names cannot change without outage are exempt from section 5 only. They must carry all mandatory tags from section 6.
9. Compliance and review
9.1 Compliance is measured monthly and reported to [governance forum] using the metrics in the implementation guidance.
9.2 Non-compliant NHIs found after the backfill deadline are disabled following owner notice, except tier0 identities, which are escalated to [Head of IAM].
9.3 This standard is reviewed at least annually by [IAM team].
Implementation guidance
A naming standard only works when the pipeline refuses identities that break it. The rollout order that causes least disruption:
- Agree the allowed lists: app codes from the CMDB, environment codes, privilege tiers and credential types. Publish them as a machine-readable file the pipelines read.
- Enforce in audit mode: deploy Azure Policy with the Audit effect, AWS tag policies with reporting only, and Kubernetes admission rules in warn mode. Measure how many new identities would fail for two to four weeks.
- Fix the creation paths: update Terraform modules, service account request forms and agent registration flows so the mandatory tags are required fields. Most failures in audit mode come from a handful of templates.
- Switch to deny for new identities: move policy effects to Deny for new creations in production first, then lower environments. Keep a documented break-glass path. Roll back by returning the effect to Audit, not by deleting the policy.
- Backfill existing identities: start with tier0 and high privilege NHIs, then those with static secrets. Use sign-in and usage logs to infer owners where nobody claims the identity; the NHI Ownership Attestation Campaigns Guide covers running the claim campaign.
- Connect to lifecycle: use
nhi-expiryto drive recertification reminders and automatic disablement, and the owner tag to route leaver tasks. See the OWASP NHI Top 10 NHI1 Improper Offboarding Guide. - Use tags in detection: alert on interactive sign-in by an identity tagged as non-human, on a
prdidentity authenticating from adevworkload, and on identities past expiry still authenticating.
Small versus large organisations: a small team can keep the metadata in a spreadsheet-backed inventory and enforce only the four core tags (owner, app, env, expiry). A large estate needs the full set, a system of record with API reconciliation and policy enforcement on every cloud.
Metrics that show it is working:
- Percentage of NHIs with all mandatory tags, by platform (target above 95 percent for production).
- Percentage of NHIs whose
nhi-ownerresolves to an active employee. - Number of NHIs past
nhi-expirythat still authenticate. - Policy denials per week for new identities, which should fall as templates are fixed.
- Mismatches between platform tags and the system of record found at reconciliation.
Common failure patterns: putting the owner's email or name in the identity name, so it is wrong after the first reorganisation; mixed-case keys that split one tag into three in AWS reports; relying on Azure resource group tags that resources do not inherit; recording a team mailbox as the owner so nobody is accountable; and enforcing in production only, leaving test identities with production access unlabelled. Anonymous, long-lived credentials are a recurring theme in incidents such as the Okta Support System Breach, where a service account credential ended up outside the controls meant to govern it.
For agent identities see the Microsoft Entra Agent ID Guide.
Standards and references
- OWASP: Non-Human Identities Top 10
- NIST: SP 800-53 Rev. 5
- Microsoft Learn: Define your naming convention
- Microsoft Learn: Use tags to organise your Azure resources
- Microsoft Learn: What are custom security attributes in Microsoft Entra ID?
- AWS: Best practices and strategies for tagging
- Google Cloud: Labels overview
- Kubernetes: Recommended Labels
This template is provided for guidance and must be adapted to your organisation. Related NHI Mgmt Group resources: NHI Ownership Guide · Service Account Inventory Template · NHI Governance Maturity Model · OWASP NHI Top 10 NHI9 NHI Reuse Guide