New Report Finds 315,000 AI Agent Reasoning Blocks Leak Secrets
Serge Bulaev
A new survey suggests that many AI agent logs may leak secrets, such as passwords and API keys, through hidden reasoning blocks, even if visible text is redacted. Researchers found over 1,000 leaks in more than 300 sessions, exposing many credentials and personal data. These leaks appear to allow attackers to use secrets quickly and could lead to high costs and security risks. Experts recommend reducing what is saved in logs and treating hidden reasoning blocks as very sensitive. It is unclear if new security steps will fully stop these leaks, but ongoing checks are expected to help.

A new large-scale scan reveals a critical vulnerability where AI agent reasoning blocks leak secrets like API keys and passwords, undermining the security practice of redacting only visible text. Researchers analyzed 6,708 public agent session traces from GitHub and Hugging Face, decoding approximately 315,000 hidden reasoning blocks to uncover widespread credential and personal data exposure.
The study reported 1,028 leaked blocks across 328 sessions, alongside broader counts of 704 distinct privacy artifacts in genuine sessions. The exposed data included 62 API keys, 33 passwords, 24 access tokens, seven private keys, and around 30 personal email addresses. In one case, a recovered OpenAI key remained active for weeks, highlighting the persistent danger of a single leaked static credential.
The Amplified Danger of Leaked AI Agent Secrets
AI agent reasoning blocks are a security risk because they contain internal deliberations, including credentials, in an encrypted but decodable format. Even if visible logs are sanitized, these hidden blocks can be extracted from public code repositories, exposing secrets that attackers can weaponize at machine speed.
Once a secret is exposed, adversaries can exploit it with automated efficiency. An Auth0 analysis highlights that leaked API keys enable high-volume, unattributed requests that mimic legitimate automation. The exposure of a private key is even more severe, potentially granting irreversible signing authority that is far more difficult to revoke than a stolen token.
Recent real-world incidents validate the report's warnings. Wiz researchers discovered a misconfigured database for the social-agent project Moltbook that exposed 1.5 million authentication tokens and plaintext OpenAI keys. In a related trend, a Help Net Security report cited GitGuardian's discovery of 28,649,024 newly leaked secrets in public GitHub commits during 2025 - a 34% increase year-over-year. Industry reports indicate that AI-service leaks have grown significantly in that period, with some incidents costing victims substantial daily fees in abuse costs.
Immediate Technical Risks from Exposed Reasoning Blocks
- Replay: Decoded reasoning blocks can be re-injected to resume or fork an agent run.
- Lateral movement: Exposed multi-service keys provide access to SaaS, storage, and CI pipelines.
- Cost explosion: Cloud and LLM billing can spike before monitoring detects rogue usage.
- Data compromise: Private keys enable signing, code pushes, or wallet transfers that are difficult to reverse.
Best Practices for Mitigating AI Log Leaks
Security guidance increasingly converges on a core principle: minimize what enters logs in the first place. Experts advise the following layered controls:
- Sanitize Before Logging: Redact secrets in-memory so raw keys never touch the disk.
- Record Metadata, Not Raw Prompts: Use request IDs, policy outcomes, and hashed references instead of full agent conversations.
- Split Telemetry: Route any remaining sensitive data to short-retention, access-controlled storage.
- Disable Verbose Logging in Production: Require time-limited, audited overrides for capturing full traces.
- Continuously Scan: Monitor agent repositories and log pipelines for credential patterns.
The report's authors emphasize that hidden reasoning blocks must be treated as highly sensitive objects, not as simple debugging data. Masking visible chat is insufficient because it leaves intact ciphertext that adversaries can decode offline - a threat now proven at scale. These findings signal a necessary industry shift toward minimizing chain-of-thought storage, enforcing stricter credential rotation, and adopting structured logging that forbids free-form text. Ongoing monitoring will reveal if these countermeasures can reverse the rising trend of secret leaks.