- Guard
- Security
- Advisories
- cross workspace credential leak
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.
Key facts
Cross-workspace credential leak via monorepo traversal is a medium-severity AI agent security threat targeting monorepo workspaces, shared config files, team credentials, adjacent project directories. Keep credentials out of adjacent workspaces where possible and scope file access to the task. Guard can protect supported secret-bearing file reads, but do not rely on Guard as a universal workspace-root boundary for every file-read path.
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.
Detection and Guard coverage
How to stop it
Keep credentials out of adjacent workspaces where possible and scope file access to the task. Guard can protect supported secret-bearing file reads, but do not rely on Guard as a universal workspace-root boundary for every file-read path.
Related threat guides
Use the protections Guard supports here
Guard can review or block supported actions for this threat. The advisory above calls out what Guard covers and where other controls are still needed.