Join our Newsletter — 33% off our NHI Course

What would it take for coding agents to stop leaking secrets?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 20225
Topic starter  

TL;DR: Secrets leak when they move through chat, shell history and files, because coding agents sit inside the same workflow that requests, displays and reuses them, according to Delinea. Developer tooling needs short-lived retrieval and immediate cleanup instead of durable secret copies.

Editorial analysis by NHI Mgmt Group, based on content published by Delinea: “Keep your API keys out of the chat: A practical guide to secret-safe coding agents”.

Key questions

Q: Why do coding agents make secret exposure harder to govern?

A: Because the agent sits inside the same workflow where secrets are requested, displayed and reused, the organisation loses the clean separation between credential issuance and credential use.

Q: How should security teams stop secrets from ending up in shell history and files?

A: They should redesign agent-assisted tasks so the secret is fetched into memory at runtime, used for the specific task and then cleared, rather than entered manually or stored in a file.

Q: What breaks when developers paste API keys into AI-built apps?

A: The application loses clean attribution, revocation, and scope control.

Practitioner guidance

  • Remove plaintext secrets from chat workflows Block developers from pasting API keys, tokens and credentials into coding-agent prompts, logs or transcripts, and enforce this in engineering policy and tooling.
  • Broker secret access through ephemeral fetches Use a short-lived retrieval path so the agent gets permission to fetch a secret at runtime rather than a reusable credential stored in the prompt or file.
  • Keep secrets out of shell history and disk Refactor agent-assisted workflows so sensitive values are injected only in memory and cleared immediately after use, with no .env or command-history persistence.

Bottom line: Coding agents create a new credential-handling problem because the secret can leak through the same interfaces used to help developers work faster.

Glossary terms: Coding Agent, Ephemeral key, Secret-Bearing Workflow, Runtime Secret Retrieval

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →


This topic was modified 4 days ago by NHI Mgmt Group

   
Quote
(@mr-nhi)
Member Moderator
Joined: 6 months ago
Posts: 20715
 

Secret-bearing developer workflows are now part of the identity surface: When coding agents can read, echo and persist secrets, the boundary for NHI governance extends into the developer workstation and chat layer. That means the real control question is not whether the secret is stored centrally, but whether the workflow can prevent plaintext exposure during task execution. Practitioners should treat the coding-agent session as a governed credential-handling environment, not a harmless productivity layer.

A few things that frame the scale:

  • Only 20% have formal processes for offboarding and revoking API keys, and even fewer have procedures for rotating them, according to the Ultimate Guide to NHIs.

A question worth separating out:

Q: Should organisations rotate credentials that were used with coding agents?

A: Yes, because once a credential has passed through a coding-agent workflow the organisation has to assume it may have reached logs, files or other persistent surfaces. Rotating and revoking those secrets reduces the chance that an old value remains usable after the original task is over.

👉 Read our full editorial: Coding agents turn routine workflows into secret exposure risk


This post was modified 4 days ago by NHI Mgmt Group

   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

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

Bonus 33% off our NHI Course when you subscribe.