Tree sync b41c75a578f9 → 02d9359435d0 (still 0.2.112): sandbox profiles now keep the agent in-process by refusing shared leader mode, with matching docs and a new subagent depth env var.
Changelog
[changed] When a non-off sandbox profile is requested (CLI, GROK_SANDBOX, config, or managed policy), the agent runs in-process and refuses shared leader mode so tool calls are not delegated elsewhere. Startup prints a one-line note if leader would otherwise have been on.
[changed] If a built-in sandbox profile fails to apply, Grok still refuses the leader (tools stay local), warns, and continues without enforcement per platform support.
[changed] With a non-off sandbox profile requested, grok workspace start, restart, and resume are unavailable; pause, stop, and status still work. Disable the profile at its source to use the refused commands.
[new] GROK_SUBAGENTS_MAX_DEPTH controls maximum subagent nesting depth.
Agent & tools
Leader mode (--leader / --no-leader) is incompatible with an active non-off sandbox profile; sandbox enforcement keeps tools in the local process.
Workspace lifecycle commands that need a shared leader path are gated while sandbox is requested.
Docs
Sandbox guide: documents in-process behavior under a requested sandbox profile, leader refusal, failed-profile warning path, and which workspace commands remain available.
Agent mode guide: --leader / --no-leader flag table notes that leader mode is refused when a non-off sandbox profile is requested, with a link to the sandbox guide.
Under the hood
Subagent soak coverage moved under the tools crate; added leader sandbox confinement tests and plan-exit batch barrier session tests.
Lockfile and version.json point at this tree revision.
Upgrade notes
If you rely on shared leader mode, leave the sandbox profile off (or unset the source that selects it). A requested non-off profile forces local in-process tools.
Optional: set GROK_SUBAGENTS_MAX_DEPTH when you need an explicit cap on subagent nesting.