Conversation
dwt
approved these changes
Apr 2, 2026
Collaborator
dwt
left a comment
There was a problem hiding this comment.
This does work fine for my use case (nix provided multi call binaries) and the code does look decent - I would say go ahead, it's definitely better than #96.
The sandbox still taking a second to boot seems a bit slow to me, but is probably bearable. Building a new sandbox per command in a n agent shell probably feels sluggish already using this though.
I would say: better than right now, and we can optimize later?
Contributor
Author
|
Yep will definitely need to optimize further, will do that in a later PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduce WSL startup latency in runtime exec deny multicall detection by replacing exhaustive PATH scans with bounded relevant-alias probing, then narrowing that work further by filesystem device while still preserving cross-device symlink alias detection.
Changes
/mnt/*mounts, while still following cross-device symlink aliases when they resolve back to a relevant target device.Benchmarks
Hyperfine comparison on WSL for the two commits on this branch (30 runs):
18cf2c1: bounded relevant-name probing, before device-aware bucketing1b3cf82: device-aware probing and cross-device symlink fallbackWe probably still need further optimizations on Linux/WSL, but this solves the hanging issue.
Additional Notes
This change intentionally favors bounded, policy-relevant alias detection over exhaustive alias discovery. In practice, that means diagnostics now report the relevant aliases we detect (for example critical commands and denied names), rather than every possible alias on the system. The tradeoff is that some non-critical aliases of the same binary may no longer appear in warnings, but the sandbox behavior remains conservative: the denied target is still blocked by default, and the critical shared-binary cases still trigger warnings and opt-out guidance.
A narrower WSL-specific workaround like skipping
/mnt/*during scanning (similar to PR 96) may be is less ideal because it special-cases one environment rather than fixing the underlying algorithm. It also changes behavior based on path prefix heuristics, whereas this change reduces the search space in a more general and principled way.