TL;DR: Secrets can leak through code review, prompt logging and model training even when teams think redaction is enough, according to Doppler’s analysis of AI workflows. Practitioners need runtime credential separation, not prompt filtering, because once secrets enter the workflow, they can be copied into logs or model behaviour.
Editorial analysis by NHI Mgmt Group, based on content published by Doppler: “Secrets in AI workflows: Preventing leaks in code review and LLM training”.
Key questions
Q: Why do redaction filters miss secrets in LLM workflows?
A: Redaction filters miss secrets in LLM workflows because they usually scan visible prompts and outputs, not every transient place data can appear, such as retrieved context, tool calls, logs, traces, embeddings, cached prompts and copied snippets.
Q: How does runtime secret injection reduce credential exposure?
A: Runtime secret injection reduces credential exposure by keeping secrets out of source code, build artefacts and long-lived environment variables, then loading them only when a workload or agent needs them.
Q: What is the safest way to keep API keys out of AI code review?
A: Keep API keys out of the source material that AI tools inspect.
Practitioner guidance
- Remove hardcoded secrets from code paths Replace embedded credentials, API keys and database strings with runtime references so AI tools only receive symbolic values.
- Treat AI prompts as disclosure surfaces Classify code review bots, chat assistants and fine-tuning jobs as places where sensitive input may be logged, retained or reused.
- Use runtime secret injection by default Keep secrets in a managed store and resolve them only when the application runs, so repository content stays non-sensitive.
Bottom line: AI-assisted development can leak credentials through prompts, logs and training data before traditional controls ever see them.
Glossary terms: Runtime Secret Injection, LLM Memorisation, Secrets Management, Prompt retention
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →
Secret leakage in AI workflows is a placement problem, not a filtering problem. The dangerous assumption is that secrets can safely exist in code until a redaction layer removes them. AI workflows break that assumption because the credential may already have entered prompts, logs or training data before the filter runs. The practical conclusion is that the security boundary must move upstream, before code ever reaches an AI system.
A few things that frame the scale:
- AI-related credential leaks surged 81.5% year-over-year in 2025, with the surrounding AI infrastructure leaking 5x faster than core LLM providers, according to the State of Secrets Sprawl 2026.
- Only 44% of developers are reported to follow security best practices for secrets management, exposing a significant developer behaviour gap, according to the State of Secrets in AppSec.
A question worth separating out:
Q: What should teams do first when a live secret is found in logs?
A: Treat it as an exposed credential, not a logging event. Revoke the secret, replace it with a narrower credential if possible, and confirm which systems accepted the old token before the revocation completed.
👉 Read our full editorial: AI code review turns secret leakage into a runtime problem