Rust and sandboxing

Cursor Sandbox seems to prevent the agent from running builds and tests within the project folder. It sets some strange paths to cargo and Rustup that mess-up builds and test e.g.

CARGO_HOME=/var/folders/hn/wdy07sqd1v90scl5sfqzpcrm0000gn/T/cursor-sandbox-cache/b6b078f0b21d14db14773760801acde1/cargo
RUSTUP_HOME=/var/folders/hn/wdy07sqd1v90scl5sfqzpcrm0000gn/T/cursor-sandbox-cache/b6b078f0b21d14db14773760801acde1/rustup

If I ask the agent to use correct values for these variables things work. Like I have a cursor rule to use commands like “RUSTUP_HOME=/Users/test/.rustup CARGO_HOME=/Users/test/.cargo /Users/test/.cargo/bin/cargo test“. That is a workaround but it takes some token tax on all requests.

Can I configure the agent sandbox to allow cargo commands?

I love the idea of sandboxing and added security

2 Likes

I second this. For some reason Sandbox sometimes cannot even find Rust, so it has to manually run rustup default stable every once in a while. And the sandbox might have a different arch than my macbook or something, because I notice that it has to do nearly a full recompile everytime in the sandbox and/or my local environment if I switch between the two frequently. If I run sandbox twice in a row, no full recompile. If I run local env twice in a row, no full recompile. But if I bounce between the two, semi-full recompile.