Skip to content

feat(sandbox): apply per-process CPU/memory/file-size rlimits inside bubblewrap - #25

Merged
1998x-stack merged 7 commits into
mainfrom
feat/phase5-bwrap-resource-limits
Oct 28, 2026
Merged

1998x-stack merged 7 commits into
mainfrom
feat/phase5-bwrap-resource-limits

Conversation

@1998x-stack

Copy link
Copy Markdown
Owner

Build on #24 with explicit Linux subprocess resource ceilings using trusted util-linux prlimit inside the isolated mount namespace.

  • sandbox_cpu_seconds (default 30), sandbox_memory_mb (default 1024 MiB), and sandbox_file_mb (default 32 MiB) exposed via AgentConfig and CLI flags.
  • Strict integer validation and bounds; require prlimit from system paths, refuse to execute if unavailable. No execution fallback.
  • Apply --cpu, --as, --fsize through an exec argv wrapper; untrusted command text remains the final /bin/sh -c argument, not part of flags.
  • Parameterized tests for invalid caps, exact argv, and missing prlimit; retain optional real namespace smoke.

Scope caveat: RLIMIT_CPU and RLIMIT_AS are per process, NOT aggregate cgroup quotas; the existing executor timeout still controls wall-clock duration. This does not provide a complete multi-process memory/CPU quota or a kernel security boundary.

@1998x-stack
1998x-stack merged commit 7d221e1 into main Oct 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant