Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

fix(init): align local file read policy - #1447

Merged
betegon merged 1 commit into
mainfrom
refactor/init-unified-filesystem-policy
Aug 21, 2026
Merged

betegon merged 1 commit into
mainfrom
refactor/init-unified-filesystem-policy

Conversation

@betegon

@betegon betegon commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

The agent API now gives every role the same direct filesystem tools, including package-manager metadata such as .npmrc and .yarnrc.yml. This aligns the local reader with that contract while keeping the sandbox and redaction boundary safe.

Direct reads of sensitive metadata are allowed, but aliases to sensitive targets are rejected. The normal read-files operation and startup prereads now share one safe-open primitive for containment, realpath, inode, regular-file, stability, and descriptor handling, so prereads cannot bypass the policy.

This is the paired CLI change for getsentry/cli-init-api#244. The API should deploy first; the existing CLI remains compatible until this reaches users.

Test plan

  • filesystem and preread regressions: 35/35 passed
  • all init library tests: 532/532 passed
  • CLI typecheck: passed
  • Biome on changed files: passed
  • full unit suite: 9,218 passed; the same 8 environment-sensitive failures reproduce on clean origin/main (Europe/Madrid date assertions and Bash 3.2 completion simulation)
  • paired local Next.js sentry init: completed, installed and verified @sentry/nextjs, and bun run build passed

Security coverage includes direct V1/V2 reads, same- and cross-format sensitive symlink aliases, parent-directory symlinks, prereads, FIFOs, oversized files, containment, inode stability, and repeated TOCTOU stress.

Allow direct reads of repository metadata while sharing one safe-open policy with workflow prereads. Reject sensitive symlink targets so server-side format-aware redaction cannot be bypassed.
@vercel

vercel Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cli Ready Ready Preview Aug 21, 2026 8:56am

Request Review

@betegon
betegon marked this pull request as ready for review August 21, 2026 10:03
@betegon
betegon merged commit 4dd6653 into main Aug 21, 2026
31 checks passed
@betegon
betegon deleted the refactor/init-unified-filesystem-policy branch August 21, 2026 10:36

This branch was successfully deployed

1 active deployment
Preview — 6966811d Deployed Aug 21, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant