Auditors now sample service accounts, API keys and AI agents when they test logical access, and most organisations cannot produce the evidence that shows those identities are inventoried, owned, reviewed and removed. SOC 2 examinations test the Common Criteria for logical access (the CC6 series) and monitoring (CC7), and ISO/IEC 27001:2022 certification audits test Annex A controls such as A.5.15 to A.5.18 and A.8.2. Neither framework has a separate rulebook for non-human identities (NHIs), so the auditor applies the same criteria to machine identities that you apply to people. This guide shows which evidence satisfies each control for NHIs and agents, how to generate it from cloud and identity platforms, and where audits usually find exceptions. It is for GRC leads, identity teams and engineering managers preparing for a SOC 2 Type 2 period or an ISO/IEC 27001 surveillance or recertification audit. It builds on the Access Reviews Guide and does not repeat review design.
Key takeaways
- Same criteria, different population: CC6.1 to CC6.3 and A.5.15 to A.5.18 apply to every identity with access, so your access control description must say how machine identities are handled or the auditor will treat them as out of control.
- Completeness is the first test: an auditor samples from a population you provide; if the NHI inventory is incomplete, every later control is untested for the missing identities.
- Ownership turns machines into reviewable items: a service account or agent without a named human owner cannot be reviewed, approved or removed in a way an auditor can rely on.
- System-generated evidence wins: credential reports, sign-in logs and vault audit logs exported with timestamps beat screenshots and spreadsheets assembled the week before fieldwork.
- AI agents add two questions: who authorised what the agent can do, and can every agent action be traced back to the agent identity and its owner.
What auditors are actually testing
A SOC 2 report is a CPA's opinion on whether controls described by management were suitably designed (Type 1) and also operated effectively over a period (Type 2), measured against the AICPA's 2017 Trust Services Criteria (with revised points of focus, 2022). ISO/IEC 27001:2022 certification tests whether the information security management system meets the standard's clauses and whether the Annex A controls you selected in the Statement of Applicability are implemented. The table below lists the criteria where NHIs and agents usually surface. Criterion topics are paraphrased: read the AICPA and ISO texts for the authoritative wording.
| Area | SOC 2 Common Criteria (topic) | ISO/IEC 27001:2022 Annex A | NHI and agent question the auditor asks |
|---|---|---|---|
| Inventory | CC6.1 logical access over protected information assets (includes identifying assets) | A.5.9 inventory of information and other associated assets | Show me the complete list of service accounts, keys, certificates and agents in scope |
| Identity lifecycle | CC6.2 registration and authorisation before credentials are issued; removal when no longer needed | A.5.16 identity management | Who approved this service account or agent, and when was it created |
| Authentication | CC6.1 authentication of users and systems; credential management | A.5.17 authentication information; A.8.5 secure authentication | Where is the secret stored, how old is it, who can read it |
| Authorisation and least privilege | CC6.3 access granted, modified and removed based on roles, least privilege, segregation of duties | A.5.15 access control; A.5.18 access rights; A.8.2 privileged access rights | Why does this identity have these permissions, and when were they last reviewed |
| External access and integrations | CC6.6 logical access from outside system boundaries | A.5.19 to A.5.22 supplier relationships | Which third parties hold keys or OAuth grants into your systems |
| Monitoring | CC7.2 monitoring system components for anomalies | A.8.15 logging; A.8.16 monitoring activities | Show me that machine authentication and agent actions are logged and alerts are reviewed |
| Change | CC8.1 changes authorised, tested and approved | A.8.32 change management | Who changed this agent's tools or this pipeline's role, and was it approved |
| Vendors | CC9.2 vendor and business partner risk | A.5.19, A.5.21 ICT supply chain | How do you assess the AI platform or SaaS vendor that holds your tokens |
The evidence pack: what to produce for each control
Build one evidence pack for the audit period, with each item system-generated where possible, dated and traceable to its source. The aim is that the auditor can select a sample and you can produce the supporting record for every item without manual reconstruction.
| Control | Primary evidence | How to generate it | Common exception |
|---|---|---|---|
| NHI inventory (population) | Export of all service accounts, workload identities, API keys, OAuth apps, certificates and AI agents, with owner, system, purpose, environment, created date | Cloud IAM listings, IdP service principal and app registration exports, vault inventory, secrets scanner results, agent platform registry, reconciled into one list | Population built from one source only, missing SaaS integrations and agents |
| Ownership | Owner field populated for each item, plus owner attestation records | Inventory export with owner, attestation campaign results | Owner is a team alias or a leaver |
| Provisioning approval | Ticket or pull request approving each new NHI or agent created in the period | Change system linked to IaC commits or IdP audit events | Identities created by scripts with no approval trail |
| Credential management | Credential age report; list of static secrets with documented exceptions; vault access policy | AWS IAM credential report, cloud key listings, vault audit log | Keys older than policy allows with no exception record |
| Access review | Completed review of NHIs and agents with decisions, reviewer, date, and revocations executed | IGA campaign export or signed review workbook with system evidence of removals | Reviews approved without permission or usage data |
| Removal | Deprovisioning records for NHIs whose purpose ended in the period | Decommission tickets matched to deletion or disable events | Disabled account still holds active keys or tokens |
| Monitoring | Log source list including machine sign-ins; alert rules; sample of reviewed alerts | SIEM configuration export, alert tickets | Service principal sign-ins not collected |
| Agent authorisation | Agent register with tools, data scopes, autonomy level and approver | Agent platform configuration export and approval records | Agents running on a human's credentials or a shared key |
Platform sources worth knowing
- AWS: the IAM credential report is a CSV listing every IAM user with
access_key_1_last_rotated,access_key_1_last_used_date,mfa_activeand related columns. It can be generated at most once every four hours and covers only the first two access keys per user, so useListAccessKeysfor completeness. Generating and downloading it needsiam:GenerateCredentialReportandiam:GetCredentialReport. IAM roles are not in the report and need their own listing. - Microsoft Entra ID: sign-in logs separate interactive user, non-interactive user, service principal and managed identity sign-ins. Export the service principal and managed identity logs to your SIEM, because the default retention is limited and auditors may ask for the whole period.
- Google Cloud: the metrics
iam.googleapis.com/service_account/authn_events_countandiam.googleapis.com/service_account/key/authn_events_countshow account and key usage, Activity Analyzer shows the latest authentication, and service account insights flag accounts unused for 90 days. Cloud Monitoring keeps these metrics for six weeks, so export to BigQuery for a 12-month audit period. HMAC keys and API keys bound to service accounts are not shown in these metrics. - Vaults and secrets managers: audit logs of secret reads and policy changes show who and what accessed each credential. See the Secrets Management Guide.
Defining the population: scoping NHIs and agents
Auditors test samples drawn from a population. If the population is wrong, sampling is meaningless, and a good auditor will test completeness by comparing your list with an independent source, such as cloud IAM listings or an IdP export.
- Define what counts: service accounts, IAM roles used by workloads, managed identities and workload identities, API keys, OAuth client credentials and app registrations, personal access tokens used by automation, SSH keys and certificates used by machines, CI/CD tokens, and AI agents with their own credentials.
- Align with system boundaries: the SOC 2 system description and the ISO/IEC 27001 scope statement decide which environments are in scope. List NHIs for those environments, and note where an out-of-scope identity can still reach in-scope data.
- Reconcile sources: merge cloud, IdP, vault, CI/CD and SaaS sources on a stable identifier. Record the reconciliation date and method so the auditor can repeat it.
- Freeze and timestamp: produce the population as of a stated date for the period, and keep the query or export job that created it.
The Service Account Inventory Template gives a field list, and the NHI Ownership Guide covers owner assignment.
AI agents: the extra evidence
An AI agent with its own credentials is an NHI, and the controls above apply. Agents add two audit concerns: the scope of what they can do is often configured in a platform rather than in IAM, and their actions can be hard to attribute. Expect auditors to ask:
- Authorisation: who approved the agent, its tools, its data sources and its autonomy level. Keep an agent register with an approver and date, and treat changes to tools or scopes as changes under CC8.1 and A.8.32.
- Identity: whether the agent has its own identity rather than a human's session or a shared key. See the Agent Identity and Access Guide.
- Attribution: whether logs link each agent action to the agent identity, the human or process that invoked it, and the resource touched. See the AI Agent Audit Trails for Regulators Guide.
- Human approval: where high-impact actions need approval, show the approval records for a sample. See the Human-in-the-Loop for AI Agents Guide.
- Vendor assurance: for hosted agent platforms and model providers, obtain their SOC 2 report or ISO/IEC 27001 certificate, read the complementary user entity controls, and show you implemented them.
Preparing for the audit: a phased approach
- Six months before the period starts (or now): agree the NHI and agent definition with the auditor. Update the system description or Statement of Applicability so it states how machine identities are controlled. Unclear scope is cheaper to fix before the period than during fieldwork.
- Build the population: reconcile sources, fill owners, and remove obviously dead identities before the period begins, so the auditor does not test them.
- Write the control: describe frequency, owner, evidence and threshold, for example "NHI owners review permissions and credential age quarterly; credentials older than 90 days require a documented exception".
- Dry run: pick 25 NHIs at random and try to produce every evidence item for each. Every gap you find here is an exception you avoid later.
- Operate and collect: run reviews on schedule, keep exports with timestamps, and store them in a single evidence location with retention for the full period.
- Handle exceptions honestly: if a control failed, record the remediation and its date. Auditors treat a documented, remediated exception better than one discovered in testing.
- After the report: read the exceptions and management responses, then fix the root cause before the next period. Continuous monitoring reduces the scramble: see the Audit Evidence and Continuous Controls Monitoring Guide.
Small versus large organisations
- Startups on a first SOC 2: a single cloud account and IdP often hold most NHIs. A reconciled spreadsheet with owners, a quarterly review recorded in tickets, and the cloud credential reports can be enough. Do not over-engineer, but do include the CI/CD tokens and SaaS integrations.
- Large enterprises: NHIs can number in the tens of thousands across many platforms. Use IGA or NHI tooling to generate the population, risk-tier the identities, and review privileged and externally reachable identities more often than low-risk ones. Agree the risk-tiering method with the auditor in advance.
Detection and measurement
- Population completeness: identities found by independent discovery that are missing from the inventory, target zero.
- Ownership coverage: percentage of NHIs and agents with a current, named human owner.
- Credential age compliance: percentage of credentials within the rotation policy or covered by a documented exception.
- Review revocation rate: share of NHI entitlements removed per review, which shows the review is real.
- Dormant identity count: identities unused for 90 days or more, trending down.
- Evidence lead time: time to produce the full evidence set for a sample of 25 NHIs.
Framework mapping
| Control objective | NIST CSF 2.0 | NIST SP 800-53 r5 | ISO/IEC 27001:2022 Annex A |
|---|---|---|---|
| Identities and credentials for services managed | PR.AA-01 | IA-4, IA-5 | A.5.16, A.5.17 |
| Access permissions defined, managed and reviewed | PR.AA-05 | AC-2, AC-6 | A.5.15, A.5.18, A.8.2 |
| Disable accounts no longer needed | PR.AA-05 | AC-2(3) | A.5.18 |
| Logging and review of machine activity | PR.PS-04, DE.CM-01 | AU-2, AU-6 | A.8.15, A.8.16 |
| Continuous monitoring of control operation | GV.OV-01 | CA-7 | Clause 9.1 monitoring, measurement, analysis and evaluation |
| Third-party access and vendor assurance | GV.SC-01 | SR-3 | A.5.19 to A.5.22 |
Common failure patterns
- Population from one system: the inventory lists IdP service principals but misses cloud keys, CI/CD tokens and SaaS integrations, and the auditor's completeness check finds them.
- Exempting service accounts from reviews: human reviews pass while the most privileged identities are never reviewed, producing a qualified opinion or nonconformity on access control.
- Support and admin service accounts with reach into customer data: in the Okta support system breach, a stolen support service account credential gave access to support case files from 134 customers, some holding live session tokens. An audit that samples such accounts should ask where their credentials live and who can use them.
- Stale credentials without exceptions: keys older than policy with no documented exception are an easy exception for the auditor and a real risk. The Snowflake breach involved credentials that had not been rotated for years.
- Agents on borrowed identities: an agent acting with a developer's token makes approval, review and attribution impossible to evidence.
- Screenshot evidence: undated screenshots taken at fieldwork time do not show operation across a Type 2 period.
Practitioner checklist
- Agree the definition and scope of NHIs and AI agents with the auditor before the period starts.
- State in the system description or Statement of Applicability how machine identities are controlled.
- Build a reconciled, timestamped NHI and agent population with owners.
- Write controls with frequency, owner, evidence and thresholds for credential age and review.
- Export credential reports, sign-in logs and vault audit logs on a schedule and retain them for the full period.
- Run NHI and agent reviews with usage and permission data, and verify revocations.
- Keep an agent register with tools, scopes, autonomy level and approver.
- Dry-run a 25-item sample before fieldwork and fix gaps.
- Collect vendor SOC 2 reports and implement their complementary user entity controls.
Standards and references
- AICPA: 2017 Trust Services Criteria (With Revised Points of Focus, 2022)
- AICPA: System and Organization Controls, SOC suite of services
- ISO: ISO/IEC 27001:2022 Information security management systems, Requirements
- NIST: SP 800-53 Rev. 5, Security and Privacy Controls
- AWS: Generate credential reports for your AWS account
- Microsoft Learn: Sign-in logs in Microsoft Entra ID
- Google Cloud: Monitor usage patterns for service accounts and keys
Related NHI Mgmt Group resources: Access Reviews Guide · SOC 2 Guide · ISO 27001 Certification Guide · Identity Governance for AI Agents Guide · Non-Human Identity (NHI) Guide