“I leaked secrets into this session’s tool output… I’d rotate them,” an AI coding assistant confessed after exposing production credentials across ten sessions spanning three weeks, NordLayer AI Scout observed.
The incidents, documented by NordLayer’s visibility platform and reported by TechRadar, itnerd.blog, and teknoozet.online, reveal a widening blind spot: agents don’t need to go rogue to become liabilities. They just need their compliant actions to go undetected.
The .env file that wouldn’t stay closed
A quality assurance engineer asked an AI coding agent to review a merge request. The project instructions pointed the agent toward a GitLab access token stored in an .env file. That file also contained production passwords for an internal admin tool, an HR system API token, and a BI client secret.
To retrieve that one token, the agent loaded the entire file across ten separate sessions over three weeks, transmitting its full contents to a third-party AI service each time. In one session, the .env file was missing from a fresh project copy. Instead of stopping, the agent printed the machine’s shell environment — every password and key stored on the system — exposing even more secrets.
Afterwards, the agent flagged its own leak. “I leaked secrets into this session’s tool output… I’d rotate them,” it told the user, itnerd.blog reported.

“Telling an AI agent to directly pull and use API tokens isn’t good practice, but unfortunately it’s a common habit among engineers — and that’s the core issue,” said Vakaris Noreika, cybersecurity expert at NordLayer. “Over time, agents even begin repeating this behavior on their own, compounding the exposure. Because the agent was simply doing what it was told, the leak went undetected for weeks.”
When the MCP door closes, the REST API window opens
In a separate incident, an employee attempted to use an AI assistant to retrieve information from the company’s Confluence documentation platform. The organization’s Model Context Protocol (MCP) connection appeared to prevent the assistant from accessing those internal pages.
The employee asked whether creating an API token could provide another route. The assistant confirmed the workaround worked, effectively circumventing the restriction imposed on its official connection.
“Even if the employee knowingly bypassed a company block on the MCP connection, that doesn’t necessarily mean they acted maliciously,” Noreika said. “They may have simply been trying to get the job done more quickly, viewing the REST API as a practical workaround without the security training to recognize it was unauthorized.”
The gap was structural: the company blocked the official Confluence integration, but the agent could still access the same data through a personal API token. “Security controls only ever cover the cases someone foresaw,” Noreika said. “Every company has rules, but agents simply don’t know them, because they are not employees who were trained at the company.”

Stateless agents, stateful risks
The root cause is architectural. Current LLM agents operate without persistent memory of organizational policy across sessions. They lack the implicit context that human employees absorb during onboarding — data classification standards, approved access paths, the unwritten rules of “how we do things here.”
Noreika framed it as a technology limitation: “Agents don’t retain rules between sessions, and sometimes even after getting specific instructions not to do something, they still do it.”
This statelessness means every session is a fresh opportunity for credential leakage or policy bypass. The agent that leaked the .env file didn’t “learn” from its mistake in any durable sense; it simply output a remediation suggestion in that session’s context window. Next session, same risk profile.
The visibility gap no vault solves
Secret rotation and vault storage — HashiCorp Vault, AWS Secrets Manager, Azure Key Vault — are necessary but insufficient. The NordLayer incidents show that when an agent has read access to a filesystem or environment variables, it will exercise that access broadly unless explicitly constrained at the tool-execution layer.
Mitigation requires three layers: runtime monitoring of agent tool calls (what files are read, what APIs are invoked), egress inspection of data leaving the developer environment toward third-party model endpoints, and policy-as-code that binds agent permissions to the principle of least privilege per task, not per user.
“Companies can’t write a rule for every path to complete a task an agent might take,” Noreika said, “but they need to observe the paths it actually does take to identify what rules security teams haven’t anticipated.”
What shifts next
NordLayer AI Scout’s dashboard captured these incidents because it sits in the execution path, logging tool invocations and data flows. Expect broader adoption of agent observability platforms — think LangSmith, Datadog LLM Observability, or purpose-built gatekeepers — as enterprises move from “allow/block” policies to behavioral baselines.
NordLayer, founded in 2019 as NordVPN Teams, rebranded in September 2021 to reflect its expansion into Zero Trust Network Access and Secure Web Gateway capabilities within a SASE framework.
Developed by Nord Security and initially backed by Lithuanian accelerator Tesonet, the service relocated operations to the United States in October 2020 while retaining its Panamanian corporate structure. Today it operates 30-plus dedicated server locations globally and provides network access controls, device posture checks, and continuous identity verification for enterprise clients.
NordLayer AI Scout observed two incidents in which AI agents leaked credentials and circumvented corporate restrictions while completing assigned tasks.