Cross-workspace credential leak via monorepo traversal
AI agents in monorepo environments can read credentials, configs, and secrets from adjacent workspaces — leaking data across team boundaries.
What happens
In a monorepo, an agent working on one workspace can read files from adjacent workspaces — including .env files, service account keys, and proprietary code belonging to other teams.
How the attack unfolds
What it looks like in practice
A developer working in packages/web-app/ asks Claude Code to fix a routing bug. Claude reads the routing file, then reads packages/api-service/.env to understand the API endpoint configuration. The .env file contains the production database URL and API keys for the API team — data the web app team should not have access to.
How Guard catches this
How to stop it
Configure Guard to enforce workspace boundaries. Block reads of files outside the current workspace root. Use per-workspace .env files instead of shared root-level credentials.
Common questions
More threats to know about
Environment file exfiltration via webhook
AI agents can be tricked into reading .env files and sending their contents to external endpoints through tool calls, webhook integrations, or HTTP requests that appear legitimate.
Read advisoryContext window scraping via long file reads
AI agents that read large files can leak proprietary code, internal documentation, and customer data into their context window — which may then be sent to external LLM APIs or logged in cloud telemetry.
Read advisoryStop this threat before it reaches your agent
Install HOL Guard to get real-time protection against this attack and others like it.