Give every credential an AI agent uses a named owner and a plan to expire or revoke it. Suppose a support agent uses a billing API key with write access from a departing teammate's .env.local file. Who else has the key, and who should revoke it? Keys can also leak in workflow logs. A GitHub security advisory explains how the compromised tj-actions/changed-files action exposed secrets there.
This guide explains what non-human identities are, five ways to secure them, and where Vercel can replace stored keys with short-lived credentials.
Copy link to headingWhat is a non-human identity?
A non-human identity (NHI) is a digital identity for software, such as a service, pipeline, or AI agent. A credential proves the identity. An access policy determines what it can do. The OWASP NHI project from the Open Worldwide Application Security Project (OWASP) covers identities that applications, workloads, APIs, bots, and automated systems use.
An identity represents the caller, such as a continuous integration and continuous delivery (CI/CD) job, a microservice, or an agent. The caller proves its identity with a credential, such as an API key or signed token. With a shared credential, you can't tell from the credential alone which workload made a request. If an attacker compromises a single workload, they can use its credentials and permissions. Revoking a shared credential can interrupt every workload that uses it.
Copy link to headingWhat are the differences between human and non-human identities?
A person typically has a manager and an HR record. When they leave, their departure starts the offboarding process. Service accounts need a named owner and a separate offboarding process.
Here's how human and non-human identities compare:
Without a rule for when to review or retire it, a non-human identity can stay active long after its workload or owner is gone.
Copy link to headingWhy do non-human identities matter?
Non-human identities can pile up and retain production access long after their workloads no longer require it. Here's where that causes problems:
Scale: A single application can have separate identities for its build pipeline, runtime services, and integrations.
Breach share: In the 2026 Verizon DBIR, attackers first gained access through credential abuse in 13% of the breaches studied.
Agent growth: A new agent can bring more workload identities, provider integrations, and user authorizations to track.
Orphaned access: The OWASP offboarding guidance recommends reviewing identities tied to departing employees and retiring those the organization no longer needs.
Name an owner for each new agent's machine access and decide how to revoke it when it is no longer needed.
Copy link to headingCore components of non-human identity security
To assess an identity's risk, consider what kind of identity it is, which permissions it uses, how long its credentials last, and who owns it.
Copy link to headingTypes of non-human identities
A service account runs nightly database exports, a microservice sends a static API key to a payments API, and an integration posts to chat with an OAuth token. Serverless functions that query a cloud database count too. Containers carry workload identities, a CI/CD pipeline assumes a cloud role on every merge, and a dependency-update bot opens pull requests.
A coding agent that reads logs and proposes fixes may look like a bot, but it can choose which tools to use at runtime. Give it access only to the operations its task requires.
Copy link to headingAI agents as non-human identities
Choose whose permissions the agent uses for each action: its own under workload authority, or a person's under delegated authority. An agent acting for a person can't exceed that person's permissions. Vercel Agent, for example, can inspect a failed deployment with read-only access. To redeploy the last known-good build, it asks an authorized user to approve a plan. Elevated access ends when the plan finishes or someone cancels it. The token exchange standard, OAuth 2.0 Token Exchange (RFC 8693), defines an optional act claim to identify the actor in a delegation chain.
On Enterprise, an app protected by Vercel Passport can forward visitor identity to your backend. The app still decides what the visitor can do. The Passport token alone doesn't grant provider access. With a compatible identity provider and supported service, Vercel Connect's Enterprise-Managed Authorization (public beta) can exchange the signed-in user's identity for a separate token limited to approved scopes and the user's existing service permissions.
Copy link to headingLong-lived secrets vs short-lived credentials
A key with no expiration date can work until someone revokes or deactivates it. OWASP lists long-lived secrets as its seventh NHI risk. A stolen short-lived credential stops working when it expires.
In OIDC workload federation, the platform running the code issues a signed JSON Web Token (JWT). The issuer (iss) names who issued the token, the subject (sub) identifies the workload, and the audience (aud) identifies the intended recipient. The receiving service verifies the signature against the issuer's published keys and checks the claims against its trust policy. It can then issue a temporary credential through OAuth token exchange or its federation API. A compromised workload can still request new tokens, so limit what each token allows.
Copy link to headingOwnership and the identity lifecycle
The application team owns each agent identity. The platform team runs federation, and the security team sets access policy. Assign one owner to oversee setup, access reviews, credential rotation, and retirement.
Use this table as a starting point for assigning ownership:
If the provider supports federation, start with long-lived keys that grant the most access or are most likely to leak.
Copy link to heading5 best practices to secure non-human identities for platform and AI teams
These practices draw on the OWASP Top 10 and relevant guidance from the National Institute of Standards and Technology (NIST).
Copy link to headingAssign a named owner to every identity
An identity can lose its owner when its creator changes teams. During employee offboarding, OWASP recommends retiring unused identities. For those still in use, transfer ownership and rotate credentials the departing employee could access. On Pro and Enterprise, team Owners can use Connector Permissions to restrict connector creation and management to people with the Owner role or Connector Manager permission. Name an application owner at setup to review, hand over, or retire the connector.
Copy link to headingReplace stored keys with federated short-lived tokens
Copied keys can end up in repositories, chats, and CI settings. Every copy works while the key is valid. To reduce secret leakage, use credentials your code can request on demand. Vercel recommends that teams replace static credentials with short-lived ones where supported. A leaked token stops working when it expires. Without federation, schedule rotation based on what each key can access and how exposed it is.
Copy link to headingGive each agent its own scoped credentials
When you add a tool to an agent, check which operations the tool needs. Give each agent its own credential so you can tell which agent acted and revoke its access without affecting the others. If the support agent only needs to look up charges, give it a restricted Stripe key with read-only access to charges. Vercel Connect creates and stores the key. You can rotate it without redeploying. The agent still gets an API key at runtime, so limit what it can do and rotate it on a schedule.
Copy link to headingSet rotation intervals and retirement criteria
Set a rotation schedule before an incident. The NIST key guidance ties a cryptographic key's lifetime to its type and risk. For example, set federated tokens to expire within hours and rotate static keys every 90 days, or immediately if you suspect exposure. Retire identities their workloads no longer need. Review identities that have no owner or have been unused for 90 days.
Copy link to headingInventory and monitor machine access continuously
If you don't track how an identity is used, you can miss misuse. Record its owner, when it was last used, and what access it has. If your logs or metrics show which permissions it uses, record those too. Flag identities that span environments. OWASP recommends separate environment identities to keep test credentials out of production. Use Vercel Environments to isolate credentials and give them restricted access.
Copy link to headingHow Vercel replaces stored keys for non-human identities
Vercel can replace stored keys if the provider supports federation or short-lived access. For keys you still need, Vercel offers ways to store them centrally and limit where code can read them.
Copy link to headingOIDC federation removes stored cloud keys
Cloud access keys in environment variables can outlive the projects that needed them. With Vercel OIDC federation, a build or Vercel Function can exchange a short-lived JWT for temporary access to a supported cloud service. Builds read it from VERCEL_OIDC_TOKEN. Functions get it in the x-vercel-oidc-token header. The OIDC token reference lists the lifetimes: one hour for builds, two hours for preview and production Functions, and 12 hours for development tokens.
The subject takes the form owner:[TEAM_SLUG]:project:[PROJECT_NAME]:environment:[ENVIRONMENT]. A trust policy can use it to give production a role that preview can't use. OIDC federation is available on all plans. Vercel recommends the Team issuer mode under Settings > Security. Use an access token for external CLI deployments. Vercel’s inbound OIDC policies cover built-in apps such as Turborepo Remote Cache and Vercel Container Registry.
Copy link to headingVercel Connect brokers scoped provider tokens at runtime
Calling third-party APIs can mean storing more secrets in an agent's deployment. On Vercel, the Vercel Connect SDK uses the deployment's OIDC token. Connect checks that the project and environment have permission to request tokens. In supported OAuth flows, the app gets a short-lived access token. Connect refreshes it if the provider supports refresh. API-key connectors store long-lived keys and can return them to the app at runtime.
This Slack token request uses an app subject and asks for the chat:write scope:
import { getToken } from '@vercel/connect';
const token = await getToken('slack/mybot', { subject: { type: 'app' }, scopes: ['chat:write'],});The Slackbot walkthrough shows how to set up the connector. Use the app subject to act as the app or a user subject for an authorized user if the connector supports it. An app token identifies the whole app. If agents share a deployment, authorize and log their actions separately. The Observability tab logs token requests and revocations. The Connect revoke command requests revocation of every token the connector issued when you run vercel connect revoke-tokens <connector-id-or-uid> --all-tokens using the Vercel CLI. If the provider doesn't support revocation, a token can still work until it expires.
Copy link to headingSandbox keeps agent-generated code away from your secrets
Agent-generated code is untrusted, even when it needs to call authenticated APIs. With Vercel Sandbox isolation, code runs in Firecracker microVMs without inheriting the app's environment variables. Each agent can have its own Linux user. Notion Workers uses Sandbox to run custom code in isolation. The firewall uses credentials brokering to add credentials to matching HTTPS requests, so a Worker can call a service without reading the key. Code can read any copy you pass through the SDK's env option.
Code can still make any request the brokered credential allows. Limit the credential to the operations the code needs. With Sandbox network policies, you can allow all traffic (allow-all, the default), block it (deny-all), or allow specific domains or IP ranges. You can change the policy while the sandbox runs. Use domain rules for HTTPS requests that need brokering. Those rules don't broker credentials for Postgres connections or for traffic sent directly to an allowed IP range.
Copy link to headingSecret variables and audit trails protect the keys that remain
Anyone who can read a stored key can copy it. In Vercel, choose Config or Secret when you add an environment variable. You can't read a Secret value back after you save it. The Vercel CLI stores new Production and Preview variables as Secret by default. Build log redaction masks matching Secret values of 32 characters or more. It always masks VERCEL_OIDC_TOKEN.
The Activity Log records team and project changes on all plans. On Enterprise, Audit Logs add exports for the last 90 days and support for Audit Log Drains. For Vercel Agent, the team activity history shows when a session starts, when a plan requests elevated access, and who approves it in the dashboard.
Copy link to headingMove your agents off long-lived keys on Vercel
When you create an agent identity, record its owner and how long its credentials last. Review those details when access changes. Where you start depends on your stack and which providers support federation.
Pick one key in an existing project. Use OIDC federation if the service can trust the workload's identity. Use Vercel Connect if the service needs a provider credential that Connect supports. If the app still needs to store a key directly, use Secret environment variables.
Choose the controls that fit the service and the credential:
OIDC federation: Replaces stored cloud keys for supported providers with tokens that identify the project and environment.
Vercel Connect: Provides credentials on request and logs token requests for each connector. API-key connectors store long-lived keys centrally.
Sandbox credential brokering: Keeps secrets it adds to requests outside the microVM that runs the generated code.
Secret environment variables: Hide values after saving and mask matching values of 32 characters or more in build logs.
Vercel AI Gateway and Blob: A deployed agent can use its project's OIDC token to authenticate to Gateway without an API key. The AI SDK uses OIDC when neither
apiKeynorAI_GATEWAY_API_KEYsupplies a key. If the project uses Blob, upgrade Blob authentication to OIDC to replaceBLOB_READ_WRITE_TOKEN.
Name the person who will test the replacement in preview and production. Have them revoke the old key at the provider, confirm it no longer works, and remove any stored copies.
Copy link to headingFrequently asked questions about non-human identity
Copy link to headingWhat are the three types of identity?
There's no standard list of three types. One way to group identities is by people, workloads, and devices. The NIST glossary definition of a non-person entity also includes hardware and information artifacts.
Copy link to headingIs a machine identity the same as a non-human identity?
The terms often overlap, but different definitions draw the line in different places. The OWASP NHI project, for example, treats workload identities as one type of non-human identity. Spell out which identities you track so you don't miss devices or workloads.
Copy link to headingDoes MFA apply to non-human identities?
Interactive multi-factor authentication (MFA) is designed for people. NIST's Digital Identity Guidelines don't specifically cover machine-to-machine authentication. Machines can use controls such as tokens bound to mutual Transport Layer Security (mTLS) certificates, Demonstrating Proof of Possession (DPoP), workload attestation, and short-lived federated tokens.
Copy link to headingCan a person use a service account's credentials?
People shouldn't use shared service credentials for routine access. OWASP lists human credential sharing as its tenth NHI risk because a shared machine credential can hide who took an action. Use individual identities and require audited, time-limited approval for elevated access.