Join our Newsletter — 33% off our NHI Course

How did Codex push secrets into model context boundaries?

 

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

TL;DR: Akeyless argues that coding agents can widen secrets exposure across files, logs and model context because access review and rotation assume credentials stay visible and auditable. Governance has to treat agent-assisted development as a runtime access problem, not only a storage problem.

Editorial analysis by NHI Mgmt Group, based on content published by Akeyless: “Akeyless Brings Secretless Access to OpenAI Codex”.

Key questions

Q: Why do coding agents increase secrets risk in ways normal developer automation does not?

A: Coding agents can inspect files, run commands, read output and move across multiple tools within one task, which makes secret exposure much broader than a single automated step.

Q: What are the signs that model-context secrets governance is failing?

A: Common warning signs include secrets appearing in generated code, terminal output, copied files, CI logs or redacted results that still reveal sensitive structure.

Q: How should security teams prevent coding agents from exposing secrets in generated output?

A: Place secrets detection at the agent request and response path so exposure is intercepted before delivery.

Practitioner guidance

  • Enforce secretless model context Keep secret values out of prompts, generated code, terminal output and local files that the coding agent can observe.
  • Broker runtime access through a control layer Route database, cloud and deployment access through an access broker that injects credentials at execution time and returns only the result.
  • Replace plaintext environment files with governed references Move .env values, shell exports and config file secrets into centrally managed references so developers and agents cannot copy raw credentials into workspaces.

Bottom line: Codex-style coding agents create a new governance boundary because secrets can leak through model context even when they are not stored in the agent itself.

Glossary terms: Model Context Protocol, Just-in-time secret injection, Runtime authority, Secret Context

What's in the full announcement

Akeyless's full article covers the operational detail this post intentionally leaves for the source:

  • Step-by-step MCP server workflow for injecting secrets into child processes without exposing them to Codex
  • Configuration guidance for authentication, environment organisation and RBAC in production deployments
  • Runtime Authority examples for querying PostgreSQL and other live systems without sending credentials to the agent
  • Repository examples for scanning exposed secrets and migrating them into Akeyless-managed references

👉 Read Akeyless's analysis of OpenAI Codex and secrets governance →

Explore further

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


This topic was modified 2 weeks ago by NHI Mgmt Group

   
Quote
(@mr-nhi)
Member Moderator
Joined: 7 months ago
Posts: 21330
 

Model context is now part of the credential boundary: Traditional secrets governance assumed the main risk was where a secret was stored. That assumption breaks when a coding agent can read, transform and replay workspace data in the course of ordinary tasks. The implication is that governance has to treat prompt-visible context, not just vault storage, as a control surface.

A few things that frame the scale:

  • Internal repositories are 6x more likely to contain secrets than public ones (32.2% vs 5.6%), contradicting the assumption that private repos are safe, 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 when an AI agent needs access to a database or cloud service?

A: Teams should broker the action through a server-side authority layer so the agent receives the result, not the credential. That approach reduces standing exposure and keeps database passwords, cloud keys, and service tokens inside the governed boundary instead of inside the model session.

👉 Read our full editorial: OpenAI Codex and secrets governance: why model context matters



   
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.