Skip to content

[Request]: --pids-limit flag for container run/create #2401

Open

Description

@delgadof

Feature or enhancement request details

Add --pids-limit N (Docker-compatible) to container run and container create, setting the container cgroup's pids.max.

Use case

Untrusted workloads (for example sandboxed AI agents) need a process limit, so a fork bomb can't exhaust the VM. Today the only option is to start the container as root and have an init helper write /sys/fs/cgroup/pids.max itself before dropping privileges, which forces a privileged entrypoint.

Tested with container 1.5.0 on macOS 27.0.1.

Activity

  1. gerardrecinto commented on Oct 17, 2026

    @gerardrecinto

    Hi @crosbymichael, could I take this on? I see the recent cgroup work in containerization, so I'd first check which resource settings the current container dependency exposes and whether this needs a change in both repositories.

    I'd keep the scope to --pids-limit for run/create, persisted configuration, and applying the limit before the workload starts, with validation and a bounded integration test. What semantics would you prefer for an omitted limit, zero, and an explicit unlimited value?

    If this is available, could you assign it to me (@gerardrecinto) and confirm that a PR in this direction is welcome?

    Thanks
    Gerard Recinto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions