Repository navigation
Description
Summary
When a Markdown file is located under a symlinked directory whose target is outside the configured project source, clicking the file link in a thread opens the right-side preview area but the file fails to load. The same behavior works when the symlink target remains inside the project root.
In full-access mode, this is unexpected because the agent can access the file through its unrestricted shell, but BB's file-preview API rejects the canonical symlink target.
Versions and environment
- BB 0.42.0
- Ubuntu 24.04.4 LTS
- Linux 6.8.0-139-generic x86_64
- Node v24.19.0
- npm 11.17.0
- Local BB server/host-daemon setup
- Reproduced with a project using full-access agent execution
Steps to reproduce
-
Create a temporary project with one directory inside the project and one directory outside it:
TMP_DIR="$(mktemp -d)" mkdir -p "$TMP_DIR/project/internal-target" mkdir -p "$TMP_DIR/outside-target" printf '# Inside\n' > "$TMP_DIR/project/internal-target/inside.md" printf '# Outside\n' > "$TMP_DIR/outside-target/outside.md" ln -s internal-target "$TMP_DIR/project/internal-link" ln -s ../outside-target "$TMP_DIR/project/outside-link"
-
Register
$TMP_DIR/projectas a local BB project. -
Using the project ID returned by BB, run:
bb project content <PROJECT_ID> internal-link/inside.md --json
This succeeds.
-
Run:
bb project content <PROJECT_ID> outside-link/outside.md --json
-
Alternatively, create a thread in the temporary project and have the agent write or reference
outside-link/outside.md, then click the Markdown file link in the thread. -
Clean up the temporary project and temporary files after testing.
Expected vs actual
Expected:
- In full-access mode, BB should allow the file preview to follow a symlink to an outside target, since the agent is explicitly operating without a filesystem sandbox; or
- BB should clearly explain that preview access is blocked because the symlink resolves outside the project root.
Actual:
Error: HTTP 400: Path
"/tmp/.../project/outside-link/outside.md" escapes read root
The corresponding API response is:
{
"code": "invalid_path",
"message": "Path \"/tmp/.../project/outside-link/outside.md\" escapes read root",
"retryable": false
}The equivalent file under a symlink whose target remains inside the project loads successfully.
Evidence
The project file-content route passes the configured project path as rootPath and sends the requested file to the host daemon:
The host daemon resolves the requested path with realpath() and rejects it if the resolved target is outside the root:
The behavior was verified against BB 0.42.0 using the minimal temporary-project reproduction above.
What you ruled out
- Not a general Markdown preview failure: a regular Markdown file previews correctly.
- Not a symlink failure in general: symlinks targeting directories inside the project root work.
- Not a missing file: the outside-target file exists and is readable directly from the host.
- Not an agent write failure: the agent can create or access the file through unrestricted shell execution.
- Not the user's project structure: the behavior reproduces with a clean temporary project.
- Related #3238 and #2602 concern skill/command discovery, not file preview.
- #3395 concerns external links inside Markdown previews, not filesystem symlink resolution.
Suggested priority and effort
Medium priority, low-to-medium effort. External symlinked folders are a common project layout, especially for shared notes, output folders, generated artifacts, and synchronized directories. There is currently no useful UI explanation or workaround beyond copying the file inside the project or changing the project boundary.
The security check should not simply be removed. A possible design is:
- in full-access mode, allow explicitly trusted project symlink targets outside the project root;
- retain the current containment behavior for constrained modes such as accept-edits;
- or allow projects to declare additional trusted filesystem roots;
- and always show a specific “preview blocked because this symlink resolves outside the project root” error when access is denied.
Privacy note: this report intentionally omits the affected project's name, actual filesystem paths, filenames, project/thread/environment IDs, research content, usernames, hostnames, and personal identifiers. The reproduction uses a synthetic temporary project.
AGENT GENERATED
Activity
bb-slop-cop commentedon Sep 10, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotApplied Type: Feature · Priority: Medium · Effort: High; labels:
ui,security. No existing classifications were replaced; final Type was read back and verified.Trusted main explicitly enforces canonical-path containment for project previews, independently of agent execution permissions (route, containment check). Extending access requires a trust-policy decision; clearer denial messaging is also a product improvement. Medium priority reflects the limited scope and available project-boundary workaround; High effort reflects the access-policy design.
No reproduction report or PR: the final Type is Feature, so the rule skips those steps. Changing this security boundary is outside simple-fix scope.