feat: add fail-closed mount-free transport for local-code Docker scans - #1099
feat: add fail-closed mount-free transport for local-code Docker scans#1099manideep-malyala wants to merge 2 commits into
Conversation
…ls directly into LitellmModel instead of mutating global module state
Greptile SummaryThis PR adds an opt-in mount-free transport policy for local-code Docker scans, backend capability registration, transport-aware prompts and run metadata, and per-model LiteLLM endpoint configuration.
Confidence Score: 4/5The mount-free feature should not merge until symlink-containing local projects can be transferred without aborting sandbox startup. Requiring mount-free transport sends unmodified source trees through the SDK LocalDir materializer, which rejects symlinks and prevents common local-code scans from starting. Files Needing Attention: strix/runtime/session_manager.py, tests/test_mount_free.py Important Files Changed
|
- Add require_mount_free config field (env: STRIX_REQUIRE_MOUNT_FREE) to RuntimeSettings to enforce mount-free transport. - Enforce fail-closed in session_manager.create_or_reuse: raises RuntimeError if the selected backend does not support mount-free transport. - Add backend_supports_mount_free() to backends.py and _MOUNT_FREE_BACKENDS registry; extend register_backend() with supports_mount_free kwarg (default True). - Update AI agent prompt in inputs.py to accurately describe the transport mode (bounded snapshot vs live mounted directory). - Record transport field (bind-mount or mount-free) in run.json via state.py for downstream security auditing. - Add test_mount_free.py with fail-closed coverage (931 tests pass). Closes usestrix#1080
4e5f875 to
0c69014
Compare
Summary
Implements #1080 — adds a
require_mount_freeconfiguration flag (env:STRIX_REQUIRE_MOUNT_FREE) that enforces mount-free (bind-mount-free) transport for local-code Docker scans.When enabled, Strix guarantees that no host directories are bind-mounted into the scanning container. Local sources are transferred via the Manifest upload path, keeping the container fully isolated from the host filesystem. A symlink-safe tree walker ensures projects containing symlinks (e.g.
node_modules,venv, tool wrappers) are transferred without aborting sandbox startup.Changes
strix/config/settings.py: Addedrequire_mount_freeboolean field toRuntimeSettings(env:STRIX_REQUIRE_MOUNT_FREE, defaultFalse).strix/runtime/backends.py: Added_MOUNT_FREE_BACKENDSregistry andbackend_supports_mount_free()helper. Extendedregister_backend()withsupports_mount_freekwarg (defaultTrue).strix/runtime/session_manager.py: Fail-closed enforcement increate_or_reuse— raisesRuntimeErrorif the backend does not support mount-free transport. Added_symlink_safe_dir_entry()which walks the source tree, resolving symlinks intoFile/Direntries so the SDKLocalDirsymlink rejection is bypassed entirely. Dangling symlinks are skipped with a warning rather than aborting.strix/core/inputs.py: Agent system prompt dynamically adapts — describes sources as a "bounded snapshot, isolated from the live host system" when mount-free is active.strix/report/state.py: Records atransportfield ("bind-mount"or"mount-free") inrun.jsonfor downstream security auditing.tests/test_mount_free.py: New test validating the fail-closed guarantee when a backend without mount-free support is used with the flag enabled.Testing