Join our Newsletter — 33% off our NHI Course
Home› Guides› Machine Identity Naming and Tagging Standard Template
Template Non-Human Identity (NHI)

Machine Identity Naming and Tagging Standard Template

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 13 min read
On this page

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

RoleResponsibility 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 engineeringEnforce naming and mandatory tags in provisioning pipelines and cloud policy (for example Azure Policy, AWS tag policies, admission control).
NHI ownerSupplies 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]:

ComponentMeaningAllowed values (examples)
typeWhat kind of NHI it issvc 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
appThe application or service code from [CMDB]Registered application code, for example payroll, crm
functionWhat the identity does, in one worddeploy, backup, sync, read, scan
envEnvironmentprd, stg, tst, dev, sbx
regionOptional, where regional scope matterseuw, use, uks
nnInstance number01 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.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 keyStatusValue formatUsed for
nhi-ownerMandatoryEmployee ID of a named person (not an email address, to avoid personal data in tags)Reviews, incident contact, offboarding when the owner leaves
nhi-teamMandatoryTeam code from [HR or CMDB]Fallback ownership and routing
nhi-appMandatoryApplication code from [CMDB]Link to business service and criticality
nhi-envMandatoryprd, stg, tst, dev, sbxEnvironment isolation checks (NHI8)
nhi-purposeMandatoryShort free text, 100 characters or fewerReviewer context
nhi-expiryMandatoryISO date YYYY-MM-DD, at most [12] months aheadRecertification and automatic disable
nhi-cred-typeMandatoryfederated, managed, cert, secret, key, passwordPrioritising migration away from static secrets
nhi-privilegeMandatorytier0, high, standard, lowReview frequency and alert severity
nhi-data-classRecommendedClassification label from [Data Classification Policy]Data access reviews
nhi-secret-refRecommendedVault path or secret ID, never the secretRotation and leak response
nhi-sourceRecommendedPipeline or repository that created itDrift detection and rebuild
nhi-vendorMandatory for extSupplier ID from [TPRM register]Third-party offboarding (NHI3)
nhi-agent-principalMandatory for agtWhether the agent acts as itself or on behalf of usersDelegation 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.

PlatformWhere metadata livesConstraints to design for
AWSTags on IAM roles and users; enforced with tag policies and IAM conditions50 user tags per resource; key 1-128 and value 0-256 UTF-8 characters; aws: prefix reserved; keys and values case sensitive
Azure resourcesTags on user-assigned managed identities and their resource group; Azure Policy to require and inherit50 pairs; name up to 512 characters, value 256; resources do not inherit tags from the resource group without policy; < > % & \ ? / not allowed in names
Entra IDCustom security attributes on enterprise applications (service principals); owners set on the app and service principalAttribute value up to 64 characters; 50 values per object; Global Administrator cannot read them by default, so assign Attribute Assignment Reader to reviewers
Google CloudLabels on the hosting project and resources; tags where policy conditions are neededUp to 64 labels; keys and values up to 63 characters, lowercase letters, digits, underscore and hyphen only; labels cannot drive policy, tags can
KubernetesLabels and annotations on the ServiceAccount object, alongside the recommended app.kubernetes.io/name, part-of and managed-by labelsUse a domain prefix, for example nhi.[organisation].example/owner; use annotations for free text
Active DirectoryDedicated OU per tier, description, managedBy (owner) and a schema extension or [CMDB] record for the remaining fields20-character sAMAccountName; managedBy must point to a user object
Secrets, keys and certificatesVault metadata on the secret; certificate subject and SAN follow section 5; inventory record for API keys issued by SaaS vendorsMany 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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. Connect to lifecycle: use nhi-expiry to drive recertification reminders and automatic disablement, and the owner tag to route leaver tasks. See the OWASP NHI Top 10 NHI1 Improper Offboarding Guide.
  7. Use tags in detection: alert on interactive sign-in by an identity tagged as non-human, on a prd identity authenticating from a dev workload, 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-owner resolves to an active employee.
  • Number of NHIs past nhi-expiry that 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

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

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.