Skip to content

feat(sandbox): SandboxPolicy carries a seccomp profile the container engines apply #1822

Closed

Description

@dan-petty

SandboxPolicy has no way to carry a seccomp profile, so a container sandbox runs with the engine's default profile and devops sandbox audit (#698) can only report that default.

Context

#698's third part would add SandboxPolicy.seccomp_profile and render it as seccomp=<JSON> in security_opt. It was dropped from #698 by the owner's decision of 2026-10-22, for two reasons found while analysing it:

  • No command or setting builds a custom container SandboxPolicy: a search of src/ finds only DEFAULT_SANDBOX_POLICY and the host default. A new field would be unused surface until sandbox deploy, docker sandbox and test sandbox grow a --seccomp-profile option.
  • Podman accepts an inline JSON profile in the compat API only from podman PR #29726 (merged around September 2026); before it, the value is read as a file path. The workstation's Podman version has not been checked.

Proposed remedy

When a profile is wanted for a real sandbox, add --seccomp-profile <file> to the three commands above, validate the file at load (exists, is JSON, has a defaultAction, and does not allow everything by default), carry it on SandboxPolicy, and render it per engine after checking the engine version that accepts it. Until then the audit reports the engine default.

Proposed design

Problem statement

SandboxPolicy has no field for a seccomp profile. A container sandbox always runs with the engine's default profile, and devops sandbox audit (#698) can only report that default. This issue adds a --seccomp-profile option to the sandbox commands, validates the profile file, carries it on SandboxPolicy, and renders it per engine with a version check for Podman.

Acceptance criteria

  • Criterion 1: SandboxPolicy has an optional seccomp_profile field that is null by default.
    Verification: Import SandboxPolicy and confirm the field exists and defaults to None. Run: python -c "from devops_cli.sandbox.models import SandboxPolicy; p = SandboxPolicy(); assert p.seccomp_profile is None"
  • Criterion 2: sandbox deploy, docker sandbox, and test sandbox each accept --seccomp-profile .
    Verification: Run each command with --help and confirm the flag appears. Run: devops sandbox deploy --help | grep seccomp-profile
  • Criterion 3: The profile file is validated at load: it exists, is valid JSON, contains a defaultAction key, and defaultAction is not SCMP_ACT_ALLOW.
    Verification: Pass a non-existent file, a non-JSON file, a JSON file without defaultAction, and a file with defaultAction=SCMP_ACT_ALLOW. Each must produce a clear error. Pass a valid file and confirm it loads.
  • Criterion 4: For Docker, the profile renders as seccomp= inside the security_opt list.
    Verification: Build a Docker sandbox with a seccomp profile and inspect the create kwargs. Confirm security_opt contains the seccomp entry. Run the existing test at tests/test_sandbox_lifecycle.py:660 pattern with a profile set.
  • Criterion 5: For Podman, the profile renders as inline JSON when the engine version supports it (PR #29726), and as a file path otherwise.
    Verification: Mock Podman versions above and below the PR #29726 threshold. Confirm the rendered value is inline JSON for the newer version and a file path for the older version.
  • Criterion 6: When no profile is set, the existing behavior is unchanged: security_opt is ("no-new-privileges:true",) and no seccomp entry appears.
    Verification: Run the existing test at tests/test_sandbox_lifecycle.py:660 and confirm it still passes without modification.

Key questions

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/feature
    scope/security
    priority/p3-low
    source/agent
    on Oct 22, 2026
  2. dan-petty commented on Oct 24, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Priority: P2-Medium. This feature improves sandbox security but is not critical for core functionality.
    • Value: Medium. Adds security hardening capability that benefits users running sandboxes.
    • Effort: Medium. Requires changes to policy handling, validation, and engine rendering logic across multiple commands.
    • Related: feat(cli): sandbox enforcement audit declared vs engine vs enforced (devops sandbox audit) #698, which asks for a different change. Both items relate to sandbox security features; however, #698 deals with audit functionality while this candidate proposes adding seccomp profile support to SandboxPolicy.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at 4da1e34 (see proposed design in issue body).

  4. added
    priority/p2-medium
    status/ready
    value/medium
    effort/medium
    and removed
    priority/p3-low
    on Oct 28, 2026
  5. added a commit that references this issue on Oct 29, 2026
    46958d4
  6. removed
    status/ready
    on Oct 30, 2026
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

    effort/mediumpriority/p2-mediumscope/securitysource/agenttype/featurevalue/medium

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions