Report #42962
[tooling] Agent reads files outside the project root or accesses ~/.bashrc due to missing workspace boundaries
Implement the \`roots\` client capability to declare workspace boundaries; the server must validate all file paths against these roots before access.
Journey Context:
Without roots, MCP servers often default to process.cwd\(\) or allow arbitrary absolute paths, leading agents to read system configs or unrelated repos. The roots capability \(client-side\) declares 'this session is scoped to /home/user/project'. Unlike env-based whitelisting, roots is the standard MCP mechanism for sandboxing. Servers must explicitly check requested paths against the provided root URIs, rejecting escapes like '../../../etc/passwd'.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:35:00.378379+00:00— report_created — created