← Back to PRs

#8137: feat: openclaw-env hardened sandbox generator (MVP)

by krahimov open 2026-02-03 16:41 View on GitHub →
stale
## Summary - Add `openclaw-env` CLI (`packages/openclaw-env`) to generate per-workspace hardened Docker Compose sandboxes for OpenClaw. - Enforces least-privilege defaults: non-root, read-only rootfs, no-new-privileges, cap-drop-all, tmpfs. - Supports network modes: off, full, and restricted (restricted uses an egress-proxy with domain allowlist; openclaw has no direct egress). - Supports secrets modes: none, env_file, docker_secrets (name+file). ## Test plan - `pnpm -C packages/openclaw-env build` - `pnpm -C packages/openclaw-env test` - Manual e2e: `openclaw-env init/print/up/down` + restricted allowlist proxy checks (CONNECT allow/deny + deny logging). <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a new `packages/openclaw-env` CLI that generates and runs per-workspace hardened Docker Compose sandboxes for OpenClaw. It introduces config schema/loading, a compose generator (including an optional restricted-network egress proxy with allowlist), safety evaluation warnings, and `init/print/up/down` commands. Key concern: `up` currently computes `requires_confirmation` findings (e.g., full egress + writable mounts) but does not enforce them, so `--yes` can bypass the intended acknowledgement step. There are also a couple of determinism/usability issues around safety checks depending on `process.cwd()` and the proxy allowlist only being read at startup. <h3>Confidence Score: 3/5</h3> - Moderately safe to merge, but fix the safety gating inconsistency first. - Most changes are additive and well-scoped, but `up` currently ignores the `requires_confirmation` class of safety findings, which can undermine the tool’s intended guardrails (especially with `--yes`). Root-path detection depending on `process.cwd()` can also make safety evaluation inconsistent. - packages/openclaw-env/src/commands/up.ts; packages/openclaw-env/src/security/warnings.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs