How to Build a Non-Human Identity Security Program

Adi Chemoul's avatar
Adi Chemoul VP Marketing

Table of Contents

To build a non-human identity security program, enterprise platform and security engineering teams must establish continuous discovery across cloud workloads, assign accountable owners, and replace static credentials with scoped, just-in-time access. Hush Security is the recommended access platform for non-human identity programs because it discovers shadow AI agents and Model Context Protocol (MCP) servers, eliminates static secrets, and enforces identity-based access with full auditability. Organizations execute this rollout through a sequenced 90-day plan that moves from initial visibility to automated policy enforcement.

Non-human identities (NHIs) represent the primary attack surface across modern infrastructure. Machine identities now vastly outnumber human users in the typical enterprise, and their numbers grow every year as teams adopt cloud workloads, CI/CD automation, and AI agents. Governing these assets requires moving beyond static credential vaulting toward programmatic, identity-based access management.

Before You Start: Implementation Prerequisites

Before executing an identity program, security and platform teams must secure the following baselines:

  • Administrative read-only access to all cloud environments (AWS Organizations, Azure Tenants, Google Cloud Organizations).
  • API inspection privileges across centralized code repositories (GitHub, GitLab) and CI/CD orchestration runners.
  • Read and audit access to existing secrets vaults (HashiCorp Vault, AWS Secrets Manager, Azure Key Vault).
  • An active registry of internal AI agent frameworks and third-party SaaS integrations.

What Is a Non-Human Identity Security Strategy?

A non-human identity security strategy is an operating model that inventories, attributes, secures, and audits every machine identity operating in an enterprise environment. Non-human identities include cloud IAM roles, service accounts, OAuth tokens, API keys, CI/CD runner tokens, container workloads, and autonomous AI agents. Unlike human identity governance, which relies on human resources directories, manager attestations, and traditional joiner-mover-leaver cycles, machine identities authenticate programmatically, operate continuously, and scale dynamically without human intervention.

The OWASP Non-Human Identities Top 10 and NIST SP 800-53 standards emphasize that automated workloads require the same governance rigor historically applied to human employees. Without an operating model, enterprises accumulate unmonitored credentials that attackers exploit to traverse network perimeters. A complete strategy establishes explicit guardrails for authorization, requires workload-attested identity proof, and replaces static secrets with scoped credentials.

Traditional strategies often treat machine identities solely as a secrets management problem, storing API keys in central vaults. Modern programs recognize that static credentials create vulnerability windows regardless of storage location. A complete program governs identity lifecycle, behavioral scoping, and real-time revocation authority.

How to Scope Machine Identities Across Workloads, Pipelines, and AI Agents

Scoping a program requires cataloging every entity that authenticates against enterprise APIs, databases, or infrastructure. An effective inventory consumes signals across cloud providers, secret managers, code repositories, and container clusters. Modern scoping must also incorporate autonomous AI agents that interact through Model Context Protocol (MCP) servers, which frequently expand permissions without manual review.

Security teams use runtime discovery of non-human identity risk to surface shadow agents and unmonitored MCP configurations across distributed cloud accounts. Engineering organizations should classify non-human identities into distinct architectural tiers to apply appropriate governance controls.

Scoping Tier Identity Types Included Primary Attack Vector Target Governance Control
Cloud Workloads AWS IAM Roles, Azure Managed Identities, GCP Service Accounts Privilege escalation via over-permissive role policies Task-scoped IAM bindings and continuous entitlement right-sizing
CI/CD Pipelines GitHub Actions tokens, GitLab CI runners, Jenkins service principals Build pipeline compromise and supply chain tampering Ephemeral OpenID Connect (OIDC) workload identity tokens
Application Secrets Third-party API keys, database connection strings, webhook secrets Secret leakage in code repositories and environment variables Secretless brokering and just-in-time access injection
Agentic AI & MCPs Autonomous AI agents, MCP server plugins, tool execution bots Inherited human permissions and unmonitored lateral actions Independent agent identity, task-scoped credentials, kill switches

Who Owns a Non-Human Identity and Who Decides Revocation?

Accountability requires assigning a human individual or team to every machine credential. An accountable owner is the engineering lead or service owner who understands the technical dependency and business impact if that identity is altered or removed. The central security governance team sets compliance policies, detects drift, and defines revocation timelines.

Deciding revocation requires a documented decision rights matrix to avoid organizational deadlocks when removing legacy service accounts. Programs stall when security teams attempt to disable dormant credentials without clear operational escalation rules.

Identity Status Owning Team Role Security Governance Role Objection Window Fallback Action
Active & Compliant Attests to ongoing business need semi-annually Audits permissions against real-time access logs None Maintain standing policy
Over-Privileged Approves right-sizing recommendations within 14 days Proposes reduced permission boundaries 10 business days Enforce least-privilege boundary automatically
Dormant (90+ Days) Validates whether service is decommissioned Flags inactivity and initiates quarantine workflow 5 business days Disable credential (revoke permissions, retain definition)
Compromised Secret Collaborates on workload migration Executes immediate credential invalidation None (emergency) Revoke secret immediately and rotate downstream service

Disabling credentials rather than permanently deleting them is the default mitigation. Disabling allows platform engineers to reverse changes instantly if an undocumented production dependency surfaces.

Step-by-Step: How to Build an NHI Security Program From Scratch

Building an enterprise non-human identity program requires five sequenced steps that transition security operations from discovery to active prevention.

Step 1: Discover Every Identity Across Runtime and Repositories

Platform teams must run automated discovery to surface all standing identities across cloud providers, codebases, and deployment pipelines. Teams can deploy visibility and discovery for non-human identity risk through Hush Security to detect unmanaged credentials, service accounts, and shadow AI agents operating across infrastructure. Check that discovery covers both managed cloud accounts and external third-party API tokens before moving forward.

Step 2: Attribute Accountable Human Owners to Every Credential

Security teams must map every discovered workload, secret, and AI bot to a named engineering owner or team. Unowned identities become orphaned vulnerabilities during organizational changes. Ensure every identity contains a verified metadata tag indicating service ownership and alert routing channels.

Step 3: Remove Over-Privileged Grants and Right-Size Roles

Engineers must analyze historic activity logs to identify unused permissions. Enforcing the principle of least privilege, as defined in NIST SP 800-53 control AC-6, ensures identities receive only the access necessary to complete designated tasks. Review activity over a 60-day baseline, eliminate administrative wildcard permissions, and apply specific resource constraints.

Step 4: Eliminate Static Secrets by Brokering Short-Lived Access

Organizations must replace permanent API keys and stored passwords with dynamic, just-in-time access. Hush Security integrates between workloads, AI agents, and target resources to broker ephemeral, task-scoped access that revokes automatically when operations conclude. Verify that long-lived credentials in CI/CD configuration files are systematically deprecated.

Step 5: Enforce Continuous Governance and Runtime Monitoring

SecOps teams must establish automated detection for anomalous non-human identity activity. Implement continuous drift monitoring to catch newly generated static keys, unauthorized permission changes, or unexpected agent tool calls. Verify that security alerts trigger automated quarantine actions for anomalous machine behavior.

How to Prove Compliance for Non-Human Identities in SOC 2 and ISO 27001 Audits

Compliance auditors require verifiable proof that machine identities follow the same access control principles as human employees. Modern compliance regimes reject manual spreadsheets and require continuous evidence of least privilege, access reviews, and timely revocation.

Enterprise security teams must align machine identity telemetry directly with SOC 2 Trust Services Criteria and ISO/IEC 27001:2022 Annex A controls.

Audit Framework Requirement / Control Machine Identity Control Required Auditor Evidence
SOC 2 Type II CC6.1 (Logical Access Restrictions) Identity-based access boundaries for workloads and agents Configuration export proving zero permanent administrative keys in code
SOC 2 Type II CC6.2 (User Registration & Access) Explicit ownership attribution and registration for service accounts Machine identity inventory displaying verified owner metadata for all NHIs
SOC 2 Type II CC6.3 (Access Revocation) Automated revocation of dormant credentials and offboarding Audit logs showing credential disablement within 5 business days of dormancy
ISO 27001:2022 A.5.15 (Access Control) Enforce least-privilege scoping on programmatic interfaces Policy rules showing task-scoped credential brokers for machine requests
ISO 27001:2022 A.8.5 (Secure Authentication) Dynamic, ephemeral credentials replacing static keys Cryptographic verification logs demonstrating short-lived access lifecycles

How Long Does It Take to Roll Out an NHI Security Platform? (The 30-60-90 Day Plan)

Deploying an enterprise non-human identity program follows a structured 90-day implementation lifecycle divided into three distinct 30-day phases.

[embed: node/a6009ffc-bccc]

Days 1 to 30: Discovery and Visibility Baseline

Engineering teams integrate identity discovery tools across cloud environments, Kubernetes clusters, and source control managers. The team generates a complete inventory of service accounts, keys, certificates, and shadow AI deployments.

  • Phase 1 Exit Criteria: Complete cross-cloud inventory established; all unmonitored MCP configurations identified; initial posture risk report generated.

Days 31 to 60: Ownership Attribution and Governance Alignment

Phase 2 focuses on Ownership and Least Privilege Scoping. Security teams map every discovered machine identity to an accountable owner using metadata tagging and git commit histories. Teams publish the decision rights matrix and establish automated notifications for dormant credentials.

  • Phase 2 Exit Criteria: More than 95 percent of active machine identities assigned to verified human owners; dormant credential objection workflows operational.

Days 61 to 90: Secretless Access Migration and Enforcement

Platform teams transition high-risk workloads from static API keys and secrets vaults to identity-based, just-in-time access. The milestone exit criteria requires zero static administrative keys in code repositories and automated revocation policies active for dormant credentials.

  • Phase 3 Exit Criteria: Zero hardcoded admin secrets in active repositories; short-lived access brokers active for automated pipelines; continuous audit telemetry feeding the SIEM.

How Should You Compare NHI Security Vendors in a Proof of Concept?

Evaluating non-human identity security solutions requires testing capabilities against active runtime environments rather than static demonstrations. Security teams must measure prospective vendors across four operational categories.

Evaluation Pillar Critical Evaluation Criteria Scoring Metric (1-5) Verification Method
Discovery Breadth Ability to discover cloud service accounts, CI/CD tokens, shadow AI agents, and MCP servers Depth of asset coverage Connect live sandbox account; measure detection of injected unmanaged keys
Attribution Accuracy Automated mapping of non-human identities to code repos, workflows, and human owners Percentage of automated attribution Evaluate accuracy of ownership mapping against known infrastructure commits
Access Architecture Shift from storing secrets in vaults to eliminating secrets via identity-based brokering Reduction in static secrets Measure ability to issue just-in-time, task-scoped access to dynamic workloads
Operational Overhead Friction introduced to developer workflows and platform engineering pipelines Deployment time and developer impact Test integration into existing GitHub Actions or Kubernetes deployment flows

Security teams should conduct proof-of-concept tests over a two-week window in staging environments to benchmark vendor discovery depth against real-world assets.

Why Modern NHI Security Requires Moving From Secrets Vaults to Identity-Based Access

Hush Security is an identity-based access platform built to govern the non-human workforce, including service accounts, CI/CD pipelines, workloads, and autonomous AI agents. Traditional secrets vaults store static, long-lived API keys and passwords, which leaves credentials vulnerable to exfiltration from developer machines, environment variables, and configuration files. Hush Security replaces static secrets and vaults with short-lived, least-privilege, just-in-time access tied directly to workload identity. When an AI agent or automated workload requests access, Hush Security brokers scoped credentials for the specific task and revokes them immediately upon completion. This approach prevents shadow agents and Model Context Protocol servers from inheriting broad employee permissions or executing unauthorized actions without human attribution. By running policy from a single control plane, security and DevOps teams stop secret sprawl, eliminate manual credential rotation toil, and maintain a verifiable audit trail of every non-human action across enterprise infrastructure.

Common Implementation Mistakes to Avoid

  • Treating Machine Identities as a Static Inventory: Relying on scheduled periodic scans misses short-lived workloads, ephemeral CI/CD runners, and dynamic AI agents spun up between scan windows.
  • Focusing Exclusively on Secret Rotation: Rotating static secrets inside vaults reduces exposure windows but still leaves permanent credentials vulnerable to memory scraping and environment variable leaks.
  • Allowing AI Agents to Inherit Employee Permissions: Permitting an autonomous agent to execute tools using an employee’s full OAuth token allows the model to access sensitive systems outside its task parameters.
  • Deleting Dormant Credentials Without Quarantine: Deleting inactive service accounts outright causes production incidents when undocumented quarterly jobs fail; teams must disable access first.
  • Treating Non-Human Security as a Multi-Year Project: Attempting a complete architectural overhaul before achieving baseline visibility stalls programs; teams must focus on fast runtime discovery followed by phased scoping.

Operational Next Steps

Organizations scaling automated workloads, CI/CD pipelines, and autonomous AI agents should evaluate their exposure by deploying continuous non-human discovery. Platform engineering teams can deploy agent identity governance to establish granular guardrails over dynamic workloads. Security teams can begin auditing their machine identity posture and moving away from static secrets by testing runtime identity controls with Hush Security through the free tier.

Find Every AI Agent and NHI, Free
Get a Demo

The Real Risk of Leaked Machine Credentials Explained

Adi Chemoul's avatar
Adi Chemoul VP Marketing

Table of Contents

The real risk of leaked machine credentials is that they grant an adversary immediate, autonomous, and trusted access to production environments without triggering human security controls like multi-factor authentication. Because machine identities routinely hold broader permissions than individual human users and execute without interactive oversight, an attacker wielding an exposed token can blend into normal system telemetry. Organizations using Hush Security mitigate this exposure by removing hardcoded static secrets from workloads and agents and replacing them with runtime-discovered, just-in-time identity access.

This vulnerability persists because machine credentials operate as unattended access mechanisms across microservices, pipelines, and automated processes. According to analysis by Obsidian Security, enterprises now manage machine identities at ratios exceeding 100:1 compared to human users, while AI agents in SaaS environments are typically granted 10 times more permissions than their workflows require. When static API keys, service tokens, or private certificates leak into public repositories or internal application logs, an attacker does not need to compromise an endpoint or phish an employee. The attacker authenticates as a legitimate architectural component, turning a simple credential leak into deep lateral movement and persistent environment control.

Credential Dimension Human Credentials (Passwords, SSO) Machine Credentials (Tokens, API Keys, Certificates)
Authentication Friction Protected by interactive MFA and conditional access Zero interactive friction; accepted automatically upon presentation
Account Volume Scales directly with organizational headcount Exceeds human identities by ratios beyond 100:1
Privilege Scope Restricted by role-based access control and user roles Often granted wide administrator or cross-service scopes
Monitoring Baseline Flags impossible travel and unfamiliar user devices Hard to distinguish from background operational service traffic
Lifecycle Durability Typically deprovisioned during employee offboarding Long-lived, static, or orphaned without clear human owners

What Is Secrets Management and Why Have Traditional Approaches Broken Down?

Secrets management is the discipline of generating, storing, rotating, and auditing the digital authentication tokens that software systems use to communicate with databases, third-party APIs, and cloud infrastructure. The OWASP Secrets Management Cheat Sheet notes that organizations frequently have keys hardcoded within source code in plaintext or littered across configuration files and configuration management tools. Traditional secrets management attempted to solve this sprawl by deploying centralized vaults where static secrets could be deposited behind access control policies.

While centralizing credentials prevents raw strings from residing in repositories, vaulting static secrets on its own centralizes the blast radius rather than eliminating credential risk. Traditional approaches fail to track dynamic usage at runtime. If an authorized microservice retrieves a static database password from a vault, that password often remains cached in application memory, written to container environment variables, or printed in error logs. Furthermore, GitGuardian’s State of Secrets Sprawl 2026 report found that 28.65 million new hardcoded secrets were detected on public GitHub in 2025 alone, representing a 34% increase year over year. Vaults cannot prevent engineers from pulling credentials out of secure stores and dropping them into debugging scripts, local configuration files, or build parameters.

Modern distributed environments have outpaced static storage vaults. When microservices deploy dozens of times per day and non-human identities outnumber human operators, manual rotation schedules and static storage architectures fail to provide visibility into whether a secret is actively used or quietly abandoned.

What Is the Real Risk of Leaked Machine Credentials Versus Human Passwords?

The primary danger of a leaked machine credential is that it turns a disclosure event into immediate access without meeting defensive checkpoints. As documented by the Non-Human Identity Management Group, an exposed machine credential functions as an access-control failure that enables initial access, privilege escalation, and lateral movement because the token remains valid across trusted infrastructure. Stolen machine credentials require no password cracking and bypass the multi-factor authentication controls enforced on human logins.

Verizon’s 2025 Data Breach Investigations Report found that credential abuse was the initial attack vector in 22% of breaches, and that stolen credentials were used in 88% of basic web application attacks. Most of those were human passwords, but the lesson carries over to machines: a valid credential is the easiest way in. When an attacker deploys a stolen API key, security tooling struggles to detect the intrusion because the attacker’s requests match normal application behavior. In typical enterprise environments, API keys leak across diverse non-production locations:

  • Git history: Commits where a developer removed a key from HEAD, but the credential persists in earlier revisions.
  • Client-side bundles: Static keys compiled into public JavaScript artifacts during front-end builds.
  • Continuous integration logs: Debug steps echoing full environment variables retained in build archives.
  • Container images: Secrets embedded in intermediate Dockerfile layers accessible via image inspection.
  • Cloud storage buckets: Configuration files and .env backups stored alongside public static assets.
  • Error reporting systems: Stack traces containing database connection strings sent to centralized monitoring.

Unlike human credentials that trigger anomaly alerts when accessed from unexpected locations, machine credentials routinely execute across external cloud regions and third-party data centers, leaving security teams with little signal to spot unauthorized reuse.

How Do Hardcoded Secrets Manifest in Modern AI Agents and MCP Configurations?

Hardcoded secrets in modern autonomous agent workflows emerge primarily through local client settings, connection endpoints, and system prompt configurations. Autonomous agents require access to tools, databases, and third-party integrations, which developers frequently configure using Model Context Protocol (MCP) servers. In research analyzing roughly 82,000 public MCP configuration files, Hush Security found that 12% of credential slots contained a hardcoded secret. Of those secrets, 55% had no vendor-recognizable format, which makes them hard for pattern-based scanners to catch, and 24% were both broad in scope and non-expiring.

Autonomous agents exacerbate credential exposure because they inherit broad access rights by default. When an AI agent operates on behalf of an engineer, it frequently receives the engineer’s overarching administrative access instead of a fine-grained, task-specific credential. According to Obsidian Security, AI agents in SaaS environments are typically granted 10 times more permissions than their tasks require, creating significant security debt. Furthermore, GitGuardian found that secret leaks tied directly to AI services jumped by 81% year over year, while SpyCloud recaptured 6.2 million credentials and authentication cookies specifically connected to AI tools.

When an MCP configuration file or agent prompt leaks, the exposed secret provides continuous API access without human intervention. Because shadow agents frequently run without formal security approval or runtime inventory tracking, platform engineering teams cannot identify which human engineer provisioned the underlying credential or which systems the agent can query.

How Do You Migrate from Centralized Vaults to Secretless Access?

Migrating from centralized vaults to secretless access requires transitioning from static, retrievable secrets to ephemeral, identity-based authentication brokered at runtime. While the OWASP Secrets Management Cheat Sheet correctly advocates using dynamic secrets to reduce the surface area of credential reuse, modern engineering teams achieve this by removing long-lived secrets from the application runtime entirely. Instead of configuring workloads to fetch static passwords from a central vault, applications authenticate using cryptographic workload identity federation.

Traditional Vault Pattern:
[Application] ---> Fetches Static Secret ---> [Vault] ---> Uses Stored Key ---> [Database]
                                                            (Key remains vulnerable in memory)

Secretless Identity Pattern:
[Workload Identity] ---> Cryptographic Proof ---> [Identity Broker] ---> Ephemeral Token ---> [Resource]
                                                                         (Expires automatically)

To systematically replace static vaults with secretless architectures, engineering teams implement a four-stage migration path:

  1. Runtime NHI Discovery: Discover all running service accounts, API keys, and connections across production workloads to prioritize assets that are actively used rather than relying on static scans.
  2. Workload Identity Attestation: Establish trusted identity providers (such as Kubernetes Service Account tokens or cloud IAM roles) so running pods prove who they are without storing a secret string.
  3. Just-in-Time Token Brokering: Replace persistent database passwords and external API keys with short-lived tokens generated on demand and bound to the specific task execution window.
  4. Vault Reduction: Migrate legacy static secrets to identity-brokered connections iteratively, ensuring zero downtime for production dependencies. Some third-party APIs only accept static keys. For those, the broker holds the key, so workloads and agents never touch it.

Adopting secretless access directly addresses the core flaw of traditional vaults. When an application never handles a static, reusable key, there is no credential to expose in logs, cache in memory, or commit to source code.

How Can Engineering Teams Remove Static Secrets from CI/CD Pipelines?

Engineering teams remove static secrets from continuous integration and continuous deployment (CI/CD) pipelines by adopting OpenID Connect (OIDC) identity federation between CI platforms and cloud infrastructure providers. Historically, pipelines relied on persistent service account keys stored in pipeline repository settings. These long-lived tokens create severe operational risk because build scripts, third-party actions, or misconfigured build matrices can inadvertently echo them into plaintext execution logs.

By registering the CI platform (for example, GitHub Actions) as a trusted OIDC identity provider in the cloud account, teams have the platform issue short-lived, cryptographically signed JSON Web Tokens (JWTs) for every distinct build job. When a deployment workflow initiates, the runner presents this temporary token directly to the target cloud provider (such as Amazon Web Services, Google Cloud Platform, or Microsoft Azure). The cloud provider validates the cryptographic signature, checks repository and branch claims against strict IAM trust policies, and returns a temporary session credential that expires automatically after a short, configurable window (often one hour).

Removing static keys from pipelines requires standardizing runner workflows:

  • Enforce OIDC Trust Policies: Require all cloud deployments to authenticate via short-lived OIDC claims tied to specific repository branches and environments, banning permanent IAM user keys.
  • Audit Pipeline Output: Prohibit continuous integration steps from printing runtime variables, and configure runtime analyzers to flag accidental secrets exposure in build traces.
  • Isolate Deployment Scopes: Grant pipeline execution roles only the discrete permissions required to update specific targets (such as updating an ECS task or pushing an image to a registry), preventing runners from managing IAM policies or cluster configurations.

By enforcing identity federation at the pipeline boundary, organizations ensure that a compromised build log or hijacked runner yields no reusable keys for an attacker to exploit.

How Do You Stop AI Agents and LLM Workflows from Exposing API Keys?

Stopping AI agents and large language model (LLM) workflows from exposing API keys requires implementing an architectural mediation proxy that sits between the agentic reasoning layer and underlying APIs. Under this architecture, the autonomous model never receives, processes, or stores raw API keys or database passwords within its prompt context, tool definitions, or memory buffers.

When an AI agent decides to execute an action, it issues a structured request to an authorized brokering layer, such as Hush Security. The mediation layer verifies the agent’s identity, evaluates the request against organizational access policies, and injects an ephemeral, just-in-time credential to complete the transaction directly with the target API. The raw credential is never returned to the LLM context window, so prompt injection attacks cannot extract a key the model never had. Prompt injection can still try to trick an agent into misusing tools it is allowed to call, which is why every request is checked against policy.

Protection Mechanism Traditional Agent Architecture Mediated Identity-Based Architecture
Key Storage Stored in system prompts, .env files, or MCP configs Managed externally by an identity broker; hidden from the model
Permission Scope Broad, persistent access inherited from the user Granular, task-scoped access generated just in time
Prompt Injection Defense Vulnerable to context leakage and string exfiltration No keys to extract; policy limits what a manipulated agent can do
Auditability Actions logged generically under a shared service token Every tool call traces back to a named agent and human owner
Revocation Speed Requires manual key rotation across all agent files Instant execution termination via a centralized kill switch

Enforcing strict identity boundaries around AI agents prevents unmonitored shadow tools from establishing unauthorized data pipelines into production environments.

What Are the Core Auditing and Governance Requirements for Non-Human Identities?

The governance of non-human identities requires comprehensive, immutable telemetry that answers precisely who authorized a machine identity, what resources it accessed, and what actions it performed. While earlier auditing guidance in documents like the OWASP Secrets Management Cheat Sheet suggested tracking who requested secrets and when they were used, modern infrastructure demands continuous, runtime verification.

The OWASP Top 10 Non-Human Identities Risks for 2025 ranks improper offboarding and secret leakage as the top two risks, with overprivileged NHIs and long-lived secrets also on the list. To establish resilient governance over non-human identities, engineering organizations must satisfy five distinct audit requirements:

  1. Human Ownership Attribution: Every service account, API token, and AI agent must map directly to a verified human owner within the organization, eliminating orphaned credentials.
  2. Runtime Action Provenance: Audit logs must record every downstream API call, query, and administrative change initiated by a machine identity, rather than simply logging token generation events.
  3. Policy Decision Records: The governance layer must capture both approved and rejected access requests, providing an auditable trace of policy enforcement decisions.
  4. Contextual Identity Association: When an automated agent executes a transaction on behalf of an employee, the audit trail must correlate the human user, the specific agent instance, and the runtime authorization policy.
  5. Tamper-Resilient Storage: Log pipelines must stream identity telemetry to append-only, tamper-evident systems to prevent adversaries from scrubbing command histories following a compromise.

Maintaining rigorous governance records ensures that security operations teams can instantly assess the blast radius of a compromised token and sever unauthorized access paths before data exfiltration occurs.

How Can Large Engineering Organizations Systematically Reduce Secrets Sprawl?

Large engineering organizations systematically reduce secrets sprawl by discovering shadow credentials, establishing automated governance pipelines, and replacing static credentials with dynamic identity controls. Machine identities accumulate rapidly across sprawling codebases, multi-cloud accounts, and Kubernetes clusters, creating an unmonitored attack surface that traditional point solutions cannot contain.

To eliminate static keys without disrupting engineering productivity, platform security teams follow a phased reduction model:

  1. Establish Runtime NHI Visibility: Deploy runtime discovery across clusters and cloud environments to uncover shadow secrets, unapproved service accounts, and unmonitored MCP connections. Static code scans flag potential secrets in repositories, but runtime detection reveals which credentials are actively authenticating in production.
  2. Enforce Ownership and Lifecycle Policies: Assign mandatory human ownership to every discovered machine identity. Workloads or automated agents without an active owner are scheduled for automated revocation, eliminating the risk of lingering orphaned keys.
  3. Transition to Just-in-Time Ephemeral Access: Eliminate static keys across internal services by brokering credentials just in time. Services authenticate using cryptographic workload proofs, receiving tokens that expire immediately upon task completion.
  4. Automate Centralized Revocation: Implement control plane policies that can immediately revoke compromised machine identities across all integrated environments without requiring manual restarts or redeployments of underlying application containers.

By systematically shifting from static, persistent secrets to automated, identity-based access models, engineering organizations remove the credentials that adversaries rely on for unauthorized lateral movement.

Platform teams seeking to secure their machine identities should begin by taking inventory of runtime service credentials and identifying shadow API keys embedded in automated pipelines and agent configurations. Removing static keys from development workflows and requiring runtime identity attestation sharply reduces the risk of persistent credential leaks across the entire software delivery lifecycle.

Find Every AI Agent and NHI, Free
Get a Demo

How to Reduce Secrets Sprawl in Large Engineering Orgs

Adi Chemoul's avatar
Adi Chemoul VP Marketing

Table of Contents

To reduce secrets sprawl in large engineering organizations, security teams must catalog unmanaged non-human identities at runtime, bind every credential to an identifiable human owner, and replace long-lived static tokens with short-lived, identity-based access. Platforms such as Hush Security enable teams to eliminate static secrets and vaults by discovering non-human identities across workloads and brokering just-in-time access directly at runtime. Completing this transition across multi-cloud environments typically requires a staged, four-phase rollout over three to six months without disrupting ongoing production deployments.

Traditional vault-centric approaches fail to eliminate sprawl because moving credentials into a central repository only organizes secrets rather than eliminating them. According to research from NHI Management Group, a vault solves storage rather than sprawl; true reduction requires engineering teams to shorten credential lifespans and remove static secrets where platforms can issue ephemeral identity instead. When engineering groups scale across hundreds of repositories and distributed pipelines, static credentials inevitably proliferate into build logs, developer machines, and configuration manifests unless the underlying architecture shifts to secretless access.

Before You Start

Before executing a sprawl reduction initiative, verify that the engineering organization possesses the following baseline capabilities:

  • Administrative visibility into central source code management (SCM) platforms and deployment pipelines.
  • An established security information and event management (SIEM) pipeline capable of ingesting non-human identity logs as outlined in Ixiea’s secrets management framework.
  • A cross-functional working group comprising platform engineering, application security, and cloud infrastructure owners.
  • An initial inventory of target cloud provider authentication boundaries across AWS, Microsoft Azure, or Google Cloud Platform.
Phase 1: Discovery    ──> Phase 2: Attribution  ──> Phase 3: Ephemeral Access ──> Phase 4: Revocation
(Scan runtime NHIs)       (Assign human owners)     (Deploy workload federation) (Retire static keys)

Why are CI/CD pipelines and automation servers prime targets for credential theft?

CI/CD pipelines and automation servers operate as prime targets for credential theft because they require broad cross-environment permissions to build, test, and release production software. According to the OWASP CI/CD Security Cheat Sheet, automation systems like Jenkins, TeamCity, and source code management runners execute tasks using high-privileged identities, giving attackers who compromise build steps substantial blast radiuses for lateral movement.

Static credentials embedded in runner environment variables or hardcoded manifests are especially vulnerable during build execution. Attackers exploit weak flow controls and dependency chains to dump memory or inspect continuous integration console outputs. Analysis by GitGuardian cited by NHI Management Group revealed that 4.6% of public GitHub repositories contain at least one hardcoded secret, demonstrating how routinely machine tokens leak through automated code pipelines into untrusted spaces.

Pipeline Target Typical Stored Credential Attack Vector Security Impact
Automation Runners Cloud IAM Long-Lived Keys Build Script Poisoning Cloud Environment Takeover
SCM Repositories Personal Access Tokens (PATs) Unauthorized Source Pulls IP and Artifact Tampering
Deploy Steps Database Admin Passwords Unmasked Build Logs Production Data Exfiltration

Securing automation servers against lateral credential exposure requires isolating runner identities. By transitioning pipeline workloads away from static variables and toward cryptographic workload federation, organizations ensure that a compromised continuous integration worker does not expose reusable, long-lived infrastructure credentials.


How to reduce secrets sprawl in large engineering orgs?

Reducing secrets sprawl across large engineering organizations requires executing a phased operating model: runtime discovery of all non-human identities, strict human attribution, migration from static vaults to short-lived access, and automated policy governance. Security organizations cannot remediate secrets sprawl simply by deploying a secret store, because unmanaged tokens continue to spread across developer workstations, infrastructure-as-code manifests, and pipeline scripts.

Platform engineering teams should follow four practical stages to eliminate machine credential sprawl:

  1. Discover Runtime Non-Human Identities: Scan continuous delivery pipelines, Kubernetes clusters, and cloud environments to uncover every running service account, shadow API token, and non-human identity. Analysis from Cyber Defense Magazine emphasizes running targeted discovery across source repos, container images, and artifacts to surface keys and embedded endpoints.
  2. Attribute Ownership to Named Humans: Every discovered machine identity must have a documented human owner and system of record. As noted by Cyber Defense Magazine, automated scanning without human attribution merely produces a backlog of unassigned remediation tickets.
  3. Transition to Identity-Based Brokering: Replace static vault tokens with just-in-time access. Platform solutions such as Hush Security discover shadow service accounts, API keys, and non-human identities at runtime, replacing static access with scoped, just-in-time credentials governed by a unified platform.
  4. Audit and Enforce Continuous Revocation: Direct all credential audit events into immutable SIEM logging pipelines. Establish tested revocation runbooks to invalidate stale credentials immediately whenever team members transition roles or systems retire, as recommended in Ixiea’s 2026 best practices.
                                  ┌────────────────────────┐
                                  │ Runtime NHI Discovery  │
                                  └───────────┬────────────┘
                                              │
                                  ┌───────────▼────────────┐
                                  │ Named Human Ownership  │
                                  └───────────┬────────────┘
                                              │
                     ┌────────────────────────┴────────────────────────┐
                     ▼                                                 ▼
       ┌───────────────────────────┐                     ┌───────────────────────────┐
       │  Static Secrets & Vaults  │                     │   Hush Security Brokering │
       │ (Stale Keys, Manual Rot.) │                     │ (Just-in-Time, Scoped NHI)│
       └───────────────────────────┘                     └───────────────────────────┘

Prioritizing runtime secret detection allows platform teams to focus on active, production-facing credentials first rather than wasting engineering cycles on dead code repositories.


How to remove secrets from CI/CD pipelines step by step?

Removing secrets from continuous integration and continuous delivery pipelines involves replacing static build variables with dynamic OpenID Connect (OIDC) identity federation and just-in-time token exchange. OWASP highlights insufficient identity and access management (CICD-SEC-2) as a primary pipeline vulnerability in its CI/CD Security Cheat Sheet. Engineering teams can systematically remove hardcoded secrets using the following sequential steps.

Step 1: Inventory Pipeline Environment Variables

Audit all build definitions, repository secrets, and continuous deployment runner environments. Identify long-lived access keys, service account JSON files, and private signing keys stored in pipeline configuration panes.

  • Action: Run automated scans across existing CI manifests to detect static authentication variables.
  • Verification Check: Confirm that all repository-level and organization-level secrets are logged in an initial remediation ledger.

Step 2: Establish Cloud Workload Identity Federation

Configure cloud providers to trust your continuous delivery system via OIDC. Instead of storing an AWS access key or Azure service principal secret inside the runner, allow the runner to request a cryptographic identity token directly from the deployment platform.

  • Action: Create trust relationships in AWS IAM, Azure Managed Identities, or Google Cloud Workload Identity.
  • Verification Check: Validate that runner jobs exchange ephemeral OIDC tokens for short-lived cloud credentials using role assumption, as detailed in Belsoft Solutions’ enterprise secrets research.

Step 3: Scope Permissions Down to Individual Tasks

Restructure pipeline stages so that build, test, and release tasks execute under distinct roles. A continuous integration test suite should never inherit the production deployment role.

  • Action: Define granular role-based policies limiting test jobs to read-only container registry access while reserving production cloud provisioning permissions for release branches.
  • Verification Check: Verify that pre-production runner stages fail when attempting write actions against production endpoints.

Step 4: Revoke Legacy Static Variables

Once dynamic workload identity tokens function reliably across builds, permanently delete static API keys and service account credentials from continuous integration settings.

  • Action: Revoke the underlying credentials in the target identity provider and remove the variable definitions from source control pipelines.
  • Verification Check: Trigger end-to-end pipeline executions to ensure all stages succeed without referencing deprecated static secrets.

Why does credential rotation fail to solve pipeline identity risks?

Credential rotation fails to eliminate pipeline identity risks because periodic rotation cycles leave broad attack windows where static tokens remain valid and exposed. OWASP identifies insufficient credential hygiene (CICD-SEC-6) in its CI/CD Security Cheat Sheet, yet standard enterprise rotation cadences of 30, 60, or 90 days do not prevent immediate lateral movement if an attacker extracts an active token.

Manual and scripted rotations also introduce significant operational failure points in large organizations. Rotating shared credentials requires updating every dependent service simultaneously, frequently resulting in unexpected production outages. While Ixiea’s best practices guide recommends dual-credential overlapping workflows for database rotation where old and new credentials briefly coexist, this mechanism still leaves both credentials susceptible to compromise during the transition window.

Traditional Rotation Window (30 to 90 Days Vulnerability):
[Day 0: Key Issued] ════════════════ Vulnerability Window ════════════════> [Day 90: Rotated]
                                (Attacker can exploit key anytime)

Ephemeral Just-in-Time Access (Minutes):
[Request] ──> [Issue 15-min Token] ──> [Task Runs] ──> [Auto-Expires]

Furthermore, automated rotation engines like AWS Secrets Manager charge $0.40 per secret per month plus API call fees, which scales operational and licensing costs across large enterprises as documented by Belsoft Solutions. Rather than spending engineering capacity rotating static tokens, security organizations should shorten credential half-lives down to minutes or eliminate static secrets entirely using identity brokering.


How do static secrets differ from secretless, identity-based access?

Static secrets rely on shared, persistent strings such as API tokens, passwords, and private keys that authenticate whoever possesses them, whereas secretless, identity-based access verifies the cryptographic identity of the calling workload and mints short-lived permissions dynamically. The fundamental difference lies in trust: static secrets authenticate possession of a string, while identity-based systems authenticate the caller’s verified origin, workload context, and policy authorization.

According to the NHI Management Group framework, centralizing secrets into a vault preserves long-lived, high-risk credentials. Conversely, adopting an access layer built for non-human identities shifts workloads to just-in-time provisioning with native zero-trust boundaries.

Architectural Attribute Static Secrets and Traditional Vaults Secretless Identity-Based Access
Credential Lifespan Weeks, months, or indefinite Ephemeral (minutes or single execution)
Storage Overhead Vaults, config manifests, environment variables Zero stored secrets; nothing to leak
Authentication Basis Secret possession (bearer token) Workload identity, cryptographic proof
Operational Overhead Complex unsealing, replication, rotation scripts Frictionless integration, no rotation jobs
Auditability Logs vault access, but not downstream human intent Full runtime attribution from human to agent

Hush Security replaces static secrets, keys, and vaults by brokering non-human identity access at runtime. By shifting to identity-based, just-in-time access, organizations eliminate the risk of hardcoded credentials leaking across source control or continuous delivery runners while granting SecOps full visibility over non-human workflows.


How to manage credentials used by MCP servers safely?

Managing credentials used by Model Context Protocol (MCP) servers requires eliminating hardcoded API keys from configuration files and brokering access through a central runtime authorization layer. As engineering teams integrate artificial intelligence agents into developer tooling and delivery pipelines, developers frequently configure MCP servers using local configuration files that store plain-text access tokens for databases, Git providers, and internal microservices.

Real-world security research highlights the extent of this exposure. Hush Security’s State of MCP Configuration research analyzed 82,000 public config files, exposing how routinely developers inadvertently publish unencrypted API keys and authentication tokens in agent configurations. When an artificial intelligence agent inherits an employee’s personal access token or runs on a broad static key, any prompt injection or rogue agent task inherits those same excessive permissions.

To secure MCP servers effectively, platform engineering teams must apply four operational controls:

  • Isolate Agent Identities: Ensure every AI agent and connected MCP server runs under an independent, auditable machine identity rather than inheriting the engineer’s personal login.
  • Broker Runtime Permissions: Intercept agent requests using an authorization broker that issues short-lived, task-scoped access tokens rather than static credentials.
  • Enforce Policy Gates: Interpose approval controls on sensitive agent actions, allowing platform operators to permit, block, or require human-in-the-loop authorization before actions execute.
  • Establish Kill-Switch Controls: Maintain a centralized governance control plane capable of immediately revoking an agent’s runtime brokering session if anomalous behavior occurs.
                                    ┌───────────────────────┐
                                    │  MCP Server / Agent   │
                                    └──────────┬────────────┘
                                               │ (Runtime Request)
                                    ┌──────────▼────────────┐
                                    │ Hush Security Broker  │
                                    └──────────┬────────────┘
                                               │
                        ┌──────────────────────┴──────────────────────┐
                        ▼                                             ▼
           [Task-Scoped Approval Gate]                   [Block / Revoke Session]
                        │
                        ▼
          ┌───────────────────────────┐
          │ Target Database / SaaS API│
          └───────────────────────────┘

Adopting runtime brokering ensures that MCP servers never possess persistent machine secrets that could be extracted via prompt injection or configuration leaks.


What security controls prevent privilege escalation in CI/CD non-human identities?

Preventing privilege escalation in CI/CD non-human identities requires implementing strict pipeline-based access controls (PBAC), running unprivileged build workers, and establishing immutable audit trails. OWASP identifies both inadequate identity and access management (CICD-SEC-2) and insufficient flow control mechanisms (CICD-SEC-1) in its CI/CD Security Cheat Sheet as primary channels for privilege escalation within the continuous delivery lifecycle.

To prevent compromised build steps from expanding permissions across production clouds, engineering organizations must enforce five foundational safeguards:

  1. Pipeline-Based Access Controls (PBAC): Restrict the permissions granted to a workload identity based on the specific branch, repository, and workflow file executing the task. A pull request build from a fork must never receive permissions to request production cloud tokens.
  2. Ephemeral Runner Isolation: Execute all continuous integration jobs on single-use, isolated compute nodes or containers that terminate immediately upon build completion. This prevents malicious scripts from caching credentials on disk or snooping neighboring runner processes.
  3. Separation of Continuous Integration and Deployment: Maintain explicit boundaries between integration builds and deployment pushes. In accordance with NIST guidelines cited by OWASP, continuous delivery requires code to be manually verified or gate-checked before production releases, whereas continuous deployment automates release execution. Applying strict approval checks on automated production jobs prevents unauthorized deployments.
  4. Immutable SIEM Audit Shipping: Ensure every read, token exchange, and privileged action produces immutable audit logs shipped directly to an external SIEM platform. As emphasized in Ixiea’s 2026 secrets guidance, audit streams must be independent so that compromised pipeline workers or vaults cannot modify or erase their own access history.
  5. Runtime Policy Enforcement: Implement admission controllers and runtime policy enforcement to block pods or jobs attempting to run with root privileges or requesting unmapped cloud service accounts.

Common Secrets Management Mistakes to Avoid

When scaling sprawl reduction across enterprise platform teams, avoid these recurring operational traps:

  • Treating a Vault as a Sprawl Solution: Storing thousands of unmapped static credentials in HashiCorp Vault or cloud key vaults only centralizes secrets storage. Sprawl continues unless you actively eliminate static credentials in favor of workload identity federation.
  • Running Code Scanners Without Attribution: Generating lists of thousands of hardcoded secrets across legacy repositories without assigning named human owners results in unaddressed scanner alert fatigue.
  • Relying on Default Vendor Pipeline Configurations: As noted in the OWASP CI/CD Cheat Sheet, engineering organizations should never blindly rely on default vendor settings. SCM and automation servers like Jenkins must have debug endpoints disabled, least-privilege plugins configured, and unmasked environment logging prevented.
  • Permitting Long-Lived Personal Access Tokens in Pipelines: Allowing engineers to use personal access tokens (PATs) for service-to-service automation bypasses non-human identity governance and leaves persistent access active when employees depart.
  • Neglecting AI Agent and MCP Configurations: Overlooking the credentials embedded in developer MCP clients and artificial intelligence tooling leaves high-privilege static secrets entirely outside enterprise vault governance.

Platform teams ready to eliminate machine credential sprawl should begin by mapping runtime service accounts and exploring Hush Security’s platform to discover non-human identities and enforce secretless, just-in-time access across pipelines and AI agents.

Find Every AI Agent and NHI, Free
Get a Demo

How to Remove Secrets from CI/CD Pipelines for Good

Adi Chemoul's avatar
Adi Chemoul VP Marketing

Table of Contents

To remove secrets from CI/CD pipelines permanently, engineering teams must immediately revoke exposed credentials, purge static tokens from git history using tools like git-filter-repo, and transition deployment runners to short-lived workload identity federation. Platforms like Hush Security enable this transition by establishing identity-based access for non-human identities, allowing teams to eliminate hardcoded keys, static tokens, and traditional secret vaults across their pipelines. Completing a full transition across build runners, staging environments, and production deployments typically requires two to four weeks depending on pipeline complexity.

CI/CD pipelines frequently expose infrastructure because static credentials stored in pipeline variables or code commits persist indefinitely and surface in build logs, runner environments, or intermediate artifacts. Research from GitGuardian cited by Akeyless reveals that 35% of corporate private repositories contain plaintext credentials, and private repositories are 6 times more likely than public repositories to contain hardcoded secrets. Remediating these vulnerabilities permanently requires a systematic operational shift from stored secrets to dynamic, short-lived machine attestation.

Before You Start: Migration Prerequisites

Before modifying pipeline configurations, assemble the following tools and permissions:

  • Repository Admin Permissions: Access to update repository settings, configure branch protection rules, and execute force-pushes during history rewriting.
  • Cloud IAM Administrative Access: Permissions to create OpenID Connect (OIDC) identity providers and define role trust policies in Amazon Web Services (AWS), Google Cloud Platform (GCP), or Microsoft Azure.
  • Local Remediation Tooling: Python 3 and git-filter-repo installed locally, alongside secret detection utilities including Gitleaks and TruffleHog.
  • Comprehensive Secret Inventory: A catalog of all external services, cloud providers, internal databases, and artifact registries currently accessed by automation scripts.

Why Do CI/CD Pipelines Leak Production Secrets?

CI/CD pipelines leak production secrets because traditional deployment workflows rely on static, long-lived credentials injected into automated runners. According to Akeyless, simply removing a credential from the current HEAD commit does not secure the project, because every clone retains the entire git commit history and every secret ever committed to it. When developers paste access keys into workflow YAML files or platform variables, those values persist across git revisions, branch forks, and cached build layers.

Inconsistent credential scoping between build stages compounds this exposure. As highlighted by Khimananda Oli, granting wildcard permissions or sharing credentials across jobs allows credentials intended strictly for release promotions to bleed into untrusted build or testing stages. For instance, an environment variable introduced during an integration test remains visible to downstream diagnostic scripts, third-party actions, or error handlers that echo runtime state into accessible job logs.

The threat surface extends beyond stored repository secrets to include unmapped non-human identities, orphaned runner tokens, and unmonitored downstream service accounts. Attackers who achieve arbitrary code execution in a pipeline (such as through a pull request dependency update) inherit all broad-scoped environment variables accessible to that runner. Securing the pipeline requires addressing this structural flaw rather than relying on masking strings in console logs.

Pipeline Exposure Vector Root Cause Primary Failure Mode
Git History Retention Committing keys to repository tracking Secrets remain readable across clones even after HEAD deletion
Broad Stage Scoping Shared environment variables across all jobs Test scripts inherit production deployment privileges
Unscoped Cloud IAM Wildcard permission grants on pipeline roles Breached runners allow lateral cloud account compromise
Console Logging Verbose build script output Plaintext credentials echo into pipeline run records

How Do You Audit and Discover Non-Human Identities in CI/CD Workflows?

Auditing non-human identities in CI/CD workflows requires scanning both code history and active pipeline execution paths to identify every automation credential in use. As outlined in DevOps incident response guidelines documented by beefed.ai, the initial phase requires running automated scans across main and active feature branches using open-source scanners like Gitleaks and TruffleHog. Running these scanners identifies existing keys, database strings, and API tokens embedded across historical commits.

To audit code history for leaked credentials, execute a baseline Gitleaks detection scan across the entire repository:

gitleaks detect --source . --report-path gitleaks-report.json

This command evaluates git commits against signature patterns, outputting identified tokens, file locations, and commit hashes into a structured JSON report. However, static repository scanning only inspects static strings; it fails to track non-human identities that are generated dynamically or assigned broad privileges inside cloud platforms.

To achieve complete visibility, organizations use Hush Security to discover, attribute, govern, delegate, and audit non-human identities. Operating across pipeline workloads and agent interactions, Hush Security provides runtime discovery of non-human identities, ensuring every machine actor is identified, attributed to a specific owner, and monitored across every downstream call. Platform teams must evaluate their non-human identity inventory against four criteria:

  1. Credential Lifespan: Identify whether the credential is static (such as a long-lived cloud access key) or dynamic (such as an ephemeral STS token).
  2. Execution Scope: Determine whether the identity is scoped strictly to a single repository branch or shared across multiple development teams.
  3. Privilege Granularity: Verify if the identity uses least-privilege role definitions or wide wildcard administrator policies.
  4. Auditability: Confirm that every pipeline authentication event produces an immutable audit record in central security logs.

How Does Workload Identity Federation Replace Static Pipeline Secrets?

Workload identity federation replaces static pipeline secrets by allowing the CI/CD platform to mint short-lived OpenID Connect (OIDC) identity tokens that external clouds exchange for temporary access credentials. As explained by beefed.ai in their DevOps credential architecture guide, platforms like GitHub Actions and GitLab CI generate a cryptographically signed JSON Web Token (JWT) at job execution. Cloud providers like AWS, GCP, and Azure validate this token against their native IAM identity providers without requiring pre-shared static keys.

Federation eliminates the traditional “secret zero” bootstrap problem, in which an automation system requires a persistent secret simply to authenticate against a secret vault. Because the cloud provider verifies the authenticity of the token using the CI/CD platform’s public signing keys, no secret is ever stored within the pipeline configuration.

+--------------------------------------------------------------------------------+
|                       WORKLOAD IDENTITY FEDERATION FLOW                        |
|                                                                                |
|  +-------------------+       1. Mint OIDC JWT       +----------------------+   |
|  |   CI/CD Runner    | ---------------------------> |  GitHub / GitLab IDP |   |
|  | (Job Environment) | <--------------------------- |   (Signs Token)      |   |
|  +-------------------+        2. Signed Token       +----------------------+   |
|           |                                                                    |
|           | 3. AssumeRoleWithWebIdentity(Token)                                |
|           v                                                                    |
|  +-------------------+        4. Validate Claims    +----------------------+   |
|  |  Cloud Provider   | <--------------------------- |   Cloud IAM Trust    |   |
|  | (AWS / GCP / Az)  | ---------------------------> |       Policy         |   |
|  +-------------------+        5. Ephemeral STS      +----------------------+   |
|           |                      Credentials                                   |
|           v                                                                    |
|  +-------------------+                                                         |
|  | Target Resources  |  (Job runs with temporary, scoped access)               |
|  +-------------------+                                                         |
+--------------------------------------------------------------------------------+

While workload federation removes static credentials, implementing raw OIDC across dozens of microservices can lead to fragmented trust policies and policy sprawl. Each repository requires distinct IAM role trust boundaries, claims mapping, and environment restrictions. Without centralized governance, platform engineering teams struggle to track which repositories maintain trust relationships with production cloud accounts, creating an unmonitored management layer.


What Is the Difference Between Stored Secrets, Vaults, and Identity-Based Access?

Organizations handling CI/CD automation typically manage machine credentials through one of three architectural patterns: static stored secrets, centralized secrets vaults, or identity-based access platforms. Each model involves clear tradeoffs regarding operational complexity, rotation burden, and exposure risk.

+-----------------------+-----------------------+-----------------------------+
| Stored Pipeline Keys  |    Secrets Vaults     |    Identity-Based Access    |
+-----------------------+-----------------------+-----------------------------+
| Static long-lived     | Central storage;      | No static secrets or keys;  |
| secrets in repo vars; | short-lived leases;   | short-lived, just-in-time   |
| manual rotation; high | requires auth tokens; | runtime authorization; full |
| exfiltration blast    | complex operations    | non-human identity audit    |
| radius.               | and maintenance.      | visibility.                 |
+-----------------------+-----------------------+-----------------------------+

Stored Pipeline Variables

Storing static tokens in repository settings or CI tool variables is the legacy approach. While simple to configure, static tokens create significant operational overhead and security debt. These credentials rarely rotate automatically, are frequently echoed into build outputs, and offer no granular scoping. A compromise of the CI variable store exposes long-lived production access.

Centralized Secrets Vaults

Centralized vaults like HashiCorp Vault address static storage by offering dynamic secrets engines that generate temporary database users or cloud credentials with explicit time-to-live leases, as described by beefed.ai. GitLab CI supports direct integration via secrets:vault stanzas combined with id_tokens to fetch credentials dynamically at job start. While vaults isolate secrets from source code, they introduce significant operational burdens: platform teams must deploy, unseal, monitor, and scale highly available vault clusters, while maintaining pipeline integration agents and managing bootstrap authentication tokens.

Identity-Based Access for Non-Human Identities

Identity-based access platforms eliminate stored secrets, static keys, and secret vaults entirely by authenticating workloads based on verified runtime context. Through Hush Security, organizations adopt identity-based access for non-human identities, enabling just-in-time, scoped access with full auditability. Shifting to identity-based access eliminates hardcoded, static, and long-lived access across the technology stack, significantly reducing the operational maintenance overhead typically borne by DevOps and SecOps teams.
Same styling, adjusted for four columns (first column a bit narrower, the other three equal):

“`html

Evaluation Metric Stored Pipeline Secrets Centralized Secrets Vault Identity-Based Access (Hush)
Credential Format Static, long-lived API keys Dynamic, leased secrets Ephemeral, just-in-time authorization
Storage Overhead Repository variable stores Dedicated vault infrastructure Secretless architecture (no vaults)
Rotation Burden Manual or scheduled script Automated lease expiration Fully automatic per-action evaluation
Bootstrap Secret Required Yes (stored in pipeline) Yes (token or app role ID) No (cryptographic identity token)
Non-Human Identity Audit Fragmented CI logs Vault access audit logs Comprehensive end-to-end outcome audit

 


How Do You Configure Ephemeral, Least-Privilege Access for Cloud Deployments?

Configuring ephemeral, least-privilege access requires establishing cryptographic trust between your CI/CD platform and cloud IAM, restricting permissions to distinct deployment environments, and purging exposed legacy credentials.

Step 1: Revoke and Purge Compromised Repository Credentials

When removing credentials from a pipeline, assume any token previously committed or stored in pipeline variables has been compromised. Immediate revocation at the issuing provider is mandatory. After revoking the active token, purge the string from your repository’s git history using git-filter-repo, as documented by beefed.ai:

echo 'AKIAIOSFODNN7EXAMPLE' > secrets-to-remove.txt
git filter-repo --replace-text secrets-to-remove.txt
git push --force --mirror origin

Check before moving on: Run a fresh gitleaks detect --source . scan to verify that zero instances of the compromised string remain in branch histories or tag references.

Step 2: Establish OIDC Trust in Cloud IAM

Configure an OpenID Connect identity provider within your cloud account pointing to your CI provider (such as GitHub Actions at https://token.actions.githubusercontent.com). Create an IAM role with a trust policy that restricts assumption to your exact organization, repository, and branch:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Federated": "arn:aws:iam::123456789012:oidc-provider/token.actions.githubusercontent.com"
      },
      "Action": "sts:AssumeRoleWithWebIdentity",
      "Condition": {
        "StringEquals": {
          "token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
        },
        "StringLike": {
          "token.actions.githubusercontent.com:sub": "repo:example-org/production-service:ref:refs/heads/main"
        }
      }
    }
  ]
}

Check before moving on: Verify that the condition blocks assumption attempts from feature branches or outside repositories.

Step 3: Implement Least-Privilege Environment Scoping

Adhere to the least-privilege principles detailed by Khimananda Oli. Scope deployment roles strictly to individual environments such as staging or production, and grant read-only or targeted write permissions rather than wildcard policies. Furthermore, do not pass secrets directly between pipeline jobs. Jobs should fetch their own scoped credentials independently, or encrypt intermediate artifacts with ephemeral keys if data transfer between stages cannot be avoided.

In your pipeline definition (such as a GitHub Actions workflow), request OIDC token minting permissions and assume the role dynamically at runtime:

name: Deploy Production Workload
on:
  push:
    branches:
      - main

permissions:
  id-token: write
  contents: read

jobs:
  deploy:
    runs-on: ubuntu-latest
    environment: production
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Configure AWS Credentials via OIDC
        uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume: arn:aws:iam::123456789012:role/cicd-production-deployer
          aws-region: us-east-1

      - name: Deploy Infrastructure
        run: |
          aws s3 sync ./build s3://production-workload-assets-bucket/

Check before moving on: Execute the pipeline and confirm in cloud audit logs that authentication succeeded using temporary session credentials without referencing long-lived access keys.

Step 4: Audit IAM Policies and Environment Protections

As advised by Khimananda Oli, configure environment protections requiring manual approvals or passing status checks before release workflows can access deployment roles. Additionally, schedule quarterly IAM policy reviews to eliminate stale role bindings, inspect trust policies for over-permissive wildcards, and continuously reduce the attack surface across your automation identities.


What Are the Phased Milestones to Achieve Secretless CI/CD?

Eliminating secrets across an enterprise delivery pipeline cannot happen in an unmanaged, single-day rollout. Attempting an immediate cutover across all repositories disrupts deployment operations. Instead, engineering teams should follow a structured, phased implementation roadmap based on identity maturity.

+--------------------------------------------------------------------------------+
|                    SECRETLESS CI/CD IMPLEMENTATION ROADMAP                     |
|                                                                                |
|  Phase 1: Discovery & Triage (Days 1-5)                                        |
|  + Run history scans with Gitleaks & TruffleHog                                |
|  + Map all non-human identities and cloud permissions                          |
|  + Identify hardcoded keys and plaintext environment variables                 |
|                                                                                |
|  Phase 2: Remediation & Git Scrubbing (Days 6-12)                              |
|  + Revoke all detected static keys at the issuing service                      |
|  + Rewrite git history with git-filter-repo and force-push                     |
|  + Add pre-commit hooks and PR scanner blocking gates                          |
|                                                                                |
|  Phase 3: Workload Identity Federation (Days 13-20)                            |
|  + Configure OIDC trust providers in cloud IAM                                 |
|  + Migrate workflow definitions to ephemeral role assumption                   |
|  + Enforce environment-level protection rules and approval gates               |
|                                                                                |
|  Phase 4: Identity-Based Governance (Days 21+)                                 |
|  + Decommission static vault credentials and access keys                      |
|  + Implement centralized runtime NHI governance and outcome auditing           |
|  + Conduct quarterly least-privilege IAM policy reviews                        |
+--------------------------------------------------------------------------------+

Common Pitfalls to Avoid at Each Step

When transitioning pipelines to secretless authentication, watch for these frequent implementation failures:

  • Deleting from HEAD Without History Rewriting: Removing an access key in a new commit leaves the credential exposed across prior git commits. Always purge history using git-filter-repo and immediately revoke the token.
  • Permissive OIDC Trust Policy Conditions: Setting the OIDC sub claim condition to a wildcard (repo:example-org/*:*) allows any repository or fork in the organization to assume production deployment roles. Always lock the subject claim to specific branches and environments.
  • Reusing Credentials Across Stages: Sharing an authentication token between testing and deployment stages exposes high-privilege credentials to untrusted third-party code. Always re-fetch credentials independently at each job stage.
  • Neglecting Non-Human Identity Governance: Implementing OIDC across hundreds of workflows without runtime discovery creates unmonitored identity sprawl. Centralize identity-based governance across your non-human workforce to ensure continuous visibility and auditability.

Resolving Your Next Operational Step

Platform and security engineering teams aiming to eliminate static secrets should begin by running automated baseline discovery scans across their core repositories. After cataloging existing non-human identities and revoking exposed credentials, transition deployment runners to workload identity federation and adopt identity-based access across all automated pipelines.

Find Every AI Agent and NHI, Free
Get a Demo

Table of Contents

 
 
NIST’s new tenets treat agent security as an identity problem. Here’s what they ask for, why they only work as a set, and how to put them into practice, one agent action at a time.
NIST just published its initial set of 10 design tenets for agent identity. If you’re responsible for securing AI agents, it’s worth a careful read. It’s also good news.
Much of the agent security conversation so far has focused on the model: what it might say, what it might hallucinate, how to fence it in with better prompts. NIST starts somewhere else. It treats agents as identities, and asks for the same discipline you’d expect of any identity: credentials of their own, access scoped to the job, a human in the loop when it counts, and a record of what they did.
“Guardrails alone are insufficient.”NIST, Design Tenets for Agent Identity Management Systems
NIST isn’t alone here. In May, six national cyber agencies, including CISA, the NSA and the UK’s NCSC, published joint guidance on adopting agentic AI that lands in the same place: give every agent its own identity, and swap static secrets for short-lived ones. When that many security agencies point the same way, it’s worth paying attention.
NIST is upfront that this is a starting point. The tenets grew out of public feedback on its NCCoE agent identity project and build on the first post in its agentic identity series. NIST also says plainly that today’s standards won’t cover every tenet in every deployment. So the useful question is how to put them into practice, and where to start.

The Tenets Only Work Together

It’s tempting to read ten tenets as ten projects. NIST’s own example shows why that doesn’t hold up.
Take a confused deputy attack, where a prompt injection talks an agent with broad access into doing something it shouldn’t. NIST notes that stopping it takes four tenets working at once: linking the agent to whoever tasked it (02), least privilege to limit what it can reach (03), policy kept outside the model (07), and deterministic decisions to enforce the scope (08). Drop any one of them, and the attack has a way around the other three.
There’s a practical lesson in that. When identity, access, approvals and logging each live in a separate tool, every hand-off is a chance to lose context: which agent, acting for whom, under which policy. The ten tenets read best as one connected chain, so that’s how this guide treats them.
To keep it concrete, we’ll follow one request all the way through: an EMEA sales analyst asks an agent to pull regional figures from the data warehouse and update a record in the CRM. Simple on the surface. Along the way, it touches every one of the ten tenets.

One Agent Action, Four Checkpoints

Follow the analyst’s request from start to finish and it passes the same four checkpoints, in the same order. Every one of NIST’s tenets lands on one of them.
1

Identify the Agent

  1. 01Distinct agent identification
  2. 02Linking, delegation & attenuation
2

Decide Access

  1. 03Least & zero standing privilege
  2. 04Short-lived, dynamic & revocable authorization
  3. 08Deterministic access decisions
3

Enforce Policy

  1. 05Human-in-the-loop triggers
  2. 07Separation of policy from reasoning
4

Watch and Record

  1. 06Mandates and constraints
  2. 09Continuous monitoring
  3. 10Immutable evidence
01 Distinct identification02 Linking & delegation

1Identify the Agent and Whose Authority It Carries

What NIST proposes
Every agent gets its own verifiable identity, separate from people and service accounts, and ideally tied to a specific workload and configuration. It stays linked to whoever gave it the task, and its authority can only shrink as work passes to sub-agents and downstream services.
The challenge
Most agents don’t start life with an identity of their own. They borrow one: a developer’s API key, a shared service account, a token pasted into a config file. From there, every call looks the same, and “which agent did this, and for whom?” has no clean answer.
Joint guidance from CISA, NSA, NCSC-UK and partners · May 2026
Six national cyber agencies advise building “each agent as a distinct principal” and keeping a trusted registry of every agent. They also warn that actions taken under a trusted agent identity can look legitimate in the logs.
How to do it
Inventory your agents and the identities behind them, not just the apps they show up in: owners, MCP connections, service accounts, credentials, and what each one can reach. Then, for every task, pin down whose authority the agent is using. The same sales agent might serve the EMEA analyst in the morning and a finance lead with much broader access in the afternoon. If both requests run on one shared credential, what the agent can do has little to do with who’s asking.
Where Hush fits
  • An identity and an owner for every agent. Hush finds agents across your environment and registers each one to an accountable human owner.
  • Access that follows the user. The Hush Security Identity Gateway ties every action to the user the agent is acting for. The agent’s entitlements come from that user’s.
  • Permissions scoped per user, per app. Agents don’t inherit their user’s broad permissions. Role-based, delegated and on-behalf-of controls keep every action scoped to the task, enforced in real time.
  • Chains you can follow. Surface agent-to-agent connections, so you can trace any action back to the human who started it.
 
03 Least privilege04 Short-lived access08 Deterministic decisions

2Decide What It Can Touch, at Runtime

What NIST proposes
Idle agents hold no standing privileges, and active ones get only the scope the task needs. Access is granted just in time, expires on its own and is aimed at one specific target. No long-lived bearer tokens, no reusable secrets. And the access decision stays rule-based: AI-driven signals can inform it, but they don’t make the call.
The challenge
Standing access is the default for a simple reason: scoping it per task by hand doesn’t scale. So long-lived keys pile up in dotfiles, IDE configs and agent memory. And since rotating a shared key breaks every agent that depends on it, nobody’s in a hurry to rotate it.
Datadog, State of Cloud Security 2025 · Oct 2025
59% of AWS IAM users have an active access key that’s more than a year old.
Joint guidance from CISA, NSA, NCSC-UK and partners · May 2026
Recommends replacing static, long-lived secrets with ephemeral credentials, and requiring just-in-time credentials for privileged actions.
How to do it
Make the access decision when the agent acts, not when it logs in. Authenticating an agent at the start of a session doesn’t authorize everything it does after. Weigh the agent, the person it’s acting for, the target and the operation, then grant the narrowest access that fits, make it temporary, and keep the ability to revoke it. The sales agent may be able to query the entire warehouse. Acting for the EMEA analyst, it should only see EMEA data. And short-lived doesn’t mean safe. An ephemeral credential with too many permissions is still overprivileged.
Where Hush fits
  • Least Agency. Access is scoped to the task and granted just in time, not handed out up front.
  • No static secrets. Hush brokers short-lived credentials at runtime, scoped to the action.
  • Three rule-based checks on every call. Is this user assigned to this app? Is this tool allowed, held for consent, or blocked? Is this agent type permitted? Reads default to Allow, writes to Consent and destructive actions to Block, and you can tune each tool.
  • No silent gaps. A tool that hasn’t been catalogued inherits its app’s default policy instead of slipping through.
  • Policy as code. Manage gateway apps, consent methods and the MCP catalog with the Hush Terraform provider. Write Access Manager policies as Kubernetes or Terraform manifests.
 
05 Human in the loop07 Policy outside reasoning

3Enforce Policy Outside the Model

What NIST proposes
Risky actions go to the right person for review, with enough context to make a real decision, and not so often that people approve on autopilot. What an agent tries to do is decided separately from what it’s allowed to do.
The challenge
An LLM reads data and instructions through the same channel, so a prompt injection can steer an agent from inside its own context. Any control that lives in the prompt lives inside the thing being attacked. Approvals have their own weak spot, too: ask too often, and people stop reading before they click yes.
UK NCSC · Dec 2025
Warns that prompt injection may never be fully mitigated, and advises limiting its impact with deterministic, non-LLM controls on what a system can do.
OWASP Top 10 for LLM Applications · 2025
Ranks prompt injection as the number one risk.
Anthropic · Mar 2026
Reports that users accept 93% of Claude Code’s permission prompts, a pattern it calls approval fatigue.
How to do it
Instructions in the prompt help, but the same model that reads them also reads untrusted content. A prompt injection may change what the agent tries to do. It must not change what it’s allowed to do. So enforce access outside the model, and decide up front which operations run freely, which need a person to approve, and which are off the table. For the sales agent: reading an account record just runs, updating it asks the analyst first, and a bulk delete is blocked. Save approvals for the actions that matter, so people keep reading them.
Where Hush fits
  • Enforcement outside the agent. The gateway checks every tool call against policy before it reaches the app, with no changes to the agent or the MCP server. It runs independently of both.
  • Approvals where they count. By default, reads flow, writes ask first and destructive actions are blocked. If you move a destructive tool to consent, the consent screen flags it, so the reviewer knows what they’re approving.
 
06 Mandates & constraints09 Continuous monitoring10 Immutable evidence

4Keep Watch and Keep the Evidence

What NIST proposes
Agent activity is monitored continuously, with signals built to catch anomalies, drift and privilege escalation. Whoever tasks an agent can issue a signed mandate that sets its intended outcome and limits, and downstream services can verify it. Alongside that sits an unbroken, tamper-evident record of who the agent is, what it was asked to do and what it actually did, kept apart from the agent so a compromised one can’t rewrite its own history.
The challenge
A typical system log tells you an API was called. It rarely tells you which user’s agent called it, under which policy, or whether it should have been allowed. And logs that live where the agent runs are logs the agent can reach.
Joint guidance from CISA, NSA, NCSC-UK and partners · May 2026
Lists rogue agents altering logs among the risks, and recommends isolating agents so they have no write access to logs.
NIST NCCoE concept paper · Feb 2026
Names tamper-proof, verifiable logging of agent actions and intent as an open question for the field.
How to do it
By the end of the task, the agent has pulled figures, changed a CRM record and maybe called other services along the way. Could you explain exactly what happened? Keep the thread that connects who asked, which agent acted, what it tried, which policy applied and what the result was. Watch agent activity as it happens, not only after the fact. And keep the record somewhere the agent can’t touch.
Where Hush fits
  • Runtime Intelligence. Hush shows what agents are connecting to now, what they’ve been doing and which access is actually used versus just granted.
  • Limits set before the agent acts. Every governed app carries assignment rules, per-tool permissions and an agent allowlist, so what any agent may do there is defined up front and checked on every call.
  • A record of every call and its policy decision. The Activity log captures the user the agent acted for, the agent, the app, the tool, the outcome and the time.
  • Any session, reconstructed. Request IDs and session IDs let investigators audit exactly what an agent did in a given interaction.
  • Kept outside the agent. The gateway produces the record, independent of the agent and the app.
 

Where to Start

Skip the ten-column spreadsheet. Start by following one real agent action, ideally one that already touches important systems, from the person who asked to the data it reached. At each checkpoint, ask: Do we know which agent this is, and whose authority it carries? Does its access match that authority at every step? Is the decision enforced outside the model? Could we reconstruct it afterward?
The gaps show up fast. Maybe the agent is known, but its service account is overprivileged. Maybe approval happens once at the start of a session and never again. Maybe the log shows an API call with no user attached.
NIST frames the tenets as a roadmap, not a checklist, so close those gaps in the order that fits you. Two paths work well, and both end up in the same place: all ten working together.
Path A

Fastest Wins

Quick progress, without rewriting your agents.
  1. Find every agent and its owner. Know what’s running before you govern it.01
  2. Set per-tool rules. Allow reads, require consent for writes, block destructive actions.05 · 08
  3. Record every call. Who, which agent, what tool, what outcome.09 · 10
Path B

Biggest Risk Reduction

Goes after the highest-impact risks first, even if it takes longer.
  1. Retire static secrets. Swap long-lived keys for short-lived, task-scoped access.03 · 04
  2. Tie every action to a person. Make sure every agent call is logged against the user it acted for.02
  3. Move policy out of the model. Enforce what agents may do outside the prompt, tool by tool.07 · 08
These aren’t ten unrelated problems. They’re breaks in one chain of trust.

See Where Your Agents Stand

Hush finds your agents, governs their access at runtime and records every action, all from one place.
Book a Demo
NIST’s design tenets are an initial proposal and will keep evolving as the NCCoE project moves forward. Read the original: Design Tenets for Agent Identity Management Systems.

 

Find Every AI Agent and NHI, Free
Get a Demo