You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Extend the read-only library carve-out to the Cargo registry and rustup source #1624
The sandbox's read-only library carve-out covers only Go (internal/sandbox/paths.go, isWithinGoLibDirs: $GOMODCACHE / $GOPATH/pkg/mod and $GOROOT/src, added for #1020). Rust projects get no equivalent, so reading a dependency's source from the Cargo registry is denied: read to path '/home/runner/.cargo/registry/src/...' is denied by the sandbox (infer run on inference-gateway/desktop#321, week ending 2026-10-28). Reading dependency source is the same read-only need the Go carve-out already serves.
Acceptance Criteria
$CARGO_HOME/registry/src (default ~/.cargo/registry/src) and $CARGO_HOME/git/checkouts are readable without configuration, read-only, resolved from the environment the same way the Go dirs are.
The rustup toolchain source under $RUSTUP_HOME/toolchains/*/lib/rustlib/src (default ~/.rustup) is readable the same way.
Writes under those directories stay denied with the existing "read-only library directory" error.
docs/tools-reference.md sandbox section lists the Rust directories next to the Go ones.
What changed (commit c08b86fa, verified by task precommit:run - 0 issues)
internal/sandbox/paths.go - the built-in read-only library carve-out now also covers Rust, beside the existing Go one:
$CARGO_HOME/registry/src and $CARGO_HOME/git/checkouts (default ~/.cargo) - read-only
$RUSTUP_HOME/toolchains/*/lib/rustlib/src (default ~/.rustup) - read-only, matched by path shape (<toolchains>/<toolchain>/lib/rustlib/src/...) instead of listing installed toolchains, so any toolchain name works no filesystem access is added to the check
Both homes resolve from the environment exactly like the Go dirs (GOMODCACHE/GOPATH pattern), and both are compared as written and with symlinks resolved
Writes under all of them keep the existing "path ... is in a read-only library directory" error
internal/sandbox/paths_test.go - TestValidateWrite_RustLibCarveOut locks in: reads pass under default and env-resolved homes, writes are rejected, non-carved siblings stay denied (registry/cache, registry/index, lib/rustlib/<triple>/lib), and sandbox writes still work.
docs/tools-reference.md - the sandbox section now lists the Go and Rust read-only carve-out directories side by side. internal/sandbox/README.md and cspell.yaml wording/words updated.
Shortcut worth knowing: the carve-out grants every installed toolchain under $RUSTUP_HOME/toolchains/<name>/lib/rustlib/src - if a future rustup stores something there that must not be readable by default, this matcher would need tightening to known toolchains.
Activity
edenreich commentedon Oct 28, 2026
@infer can you work on this? use /ponytail:ponytail
inference-gateway-maintainer commentedon Oct 28, 2026
Model:
ollama_cloud/glm-5.3-flash· Action:v0.59.1· CLI:v0.237.0· Gateway:v0.60.1· View JobTodos
Pull Request
#1626
✅ Infer Result: Success
All done - final update of the board state and summary:
Done. PR #1626 (ready for review): #1626
What changed (commit
c08b86fa, verified bytask precommit:run- 0 issues)internal/sandbox/paths.go- the built-in read-only library carve-out now also covers Rust, beside the existing Go one:$CARGO_HOME/registry/srcand$CARGO_HOME/git/checkouts(default~/.cargo) - read-only$RUSTUP_HOME/toolchains/*/lib/rustlib/src(default~/.rustup) - read-only, matched by path shape (<toolchains>/<toolchain>/lib/rustlib/src/...) instead of listing installed toolchains, so any toolchain name works no filesystem access is added to the checkGOMODCACHE/GOPATHpattern), and both are compared as written and with symlinks resolvedinternal/sandbox/paths_test.go-TestValidateWrite_RustLibCarveOutlocks in: reads pass under default and env-resolved homes, writes are rejected, non-carved siblings stay denied (registry/cache,registry/index,lib/rustlib/<triple>/lib), and sandbox writes still work.docs/tools-reference.md- the sandbox section now lists the Go and Rust read-only carve-out directories side by side.internal/sandbox/README.mdandcspell.yamlwording/words updated.Acceptance criteria
lib/rustlib/srcreadable the same way - donedocs/tools-reference.mdlists the Rust dirs next to the Go ones - doneBookkeeping
gh project item-add/ board edits / PR / issues all succeeded; no permission escalations neededShortcut worth knowing: the carve-out grants every installed toolchain under
$RUSTUP_HOME/toolchains/<name>/lib/rustlib/src- if a future rustup stores something there that must not be readable by default, this matcher would need tightening to known toolchains.Model:
ollama_cloud/glm-5.3-flash· Action:v0.59.1· CLI:v0.237.0· Gateway:v0.60.1· Exit Code:0· Duration: 10m 5sTokens: 3,802,639 in · 35,252 out · 3,837,891 total (45 requests)
Tool calls: 68 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
inference-gateway-releaser commentedon Oct 28, 2026
🎉 This issue has been resolved in version 0.238.0 🎉
The release is available on:
Your semantic-release bot 📦🚀