Skip to main content
A remote executor runs each action with only its declared inputs. An action that reads an undeclared file, uses a tool from the host, or reaches the network fails there. A strict local sandbox build finds most of these actions before you enable remote execution. Run these checks on Linux. The macOS sandbox is less strict, so most of the flags below have no effect there.

Run the sandbox check

An action that fails here also fails under remote execution. --incompatible_sandbox_hermetic_tmp requires Bazel 7 or later. It’s the default from Bazel 8.

Run the hermetic sandbox check

The first check still mounts /usr and /lib read-only, so actions that use host system libraries or a host compiler pass it. This run hides them:
--experimental_use_hermetic_linux_sandbox exposes only declared inputs to each action. Every failure names something that the build must declare or that the remote execution image must provide. Expect failures from auto-detected host toolchains, such as the default C++ toolchain. A hermetic toolchain removes them.

Fix the common failures

To find actions that produce different outputs between builds, compare the execution logs of two clean builds with execlog-diff. Non-deterministic actions cause remote cache misses, but they don’t fail under remote execution.