Repository navigation
Conversation
Add a test module covering the files-only sandbox mode, exercising its behaviour so the restriction can be verified. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
SandboxPlanOptions2.files_only lets the operator's own host-network command accept a jail that enforces only the filesystem: the plan drops the network requirement for a host-network request, and on the trusted-folder pass an executor with exact filesystem enforcement qualifies without process isolation. Refused (floor) for untrusted, SaaS or unlabelled plans and without accept_process_isolation. Co-authored-by: Medulla <medulla@tinyhumans.ai>
|
Warning Review limit reached
This review includes 6 billable files and costs up to $1.50. Or wait 58 minutes for your next included review. View limit details
|
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): Plan files-only Landlock jails for opted-in operator commands. Tiny Sweeper completed its review; deterministic results follow. Review snapshot
Completeness: Complete Features
TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Before mergeNone. How this fits togetherflowchart LR
n0["SandboxPlanOptions2<br/>changed"]:::changed
n1["SandboxPlanRequest2<br/>changed"]:::changed
n2["plan_options_have_a_pinned_wire_form<br/>changed"]:::changed
n3["minimum_isolation<br/>changed"]:::changed
n4["SandboxScope2"]:::impacted
n5["SandboxArtifact2"]:::impacted
n6["SandboxExecutor2"]:::impacted
n7["resolve"]:::impacted
n8["required"]:::impacted
n9["pick"]:::impacted
n1 -->|uses| n0
n2 -->|uses| n0
n2 -->|calls| n8
n2 -->|tests| n8
n3 -->|uses| n6
n4 -->|uses| n6
n7 -->|uses| n1
n7 -->|calls| n3
n7 -->|uses| n5
n9 -->|uses| n1
n9 -->|uses| n4
n9 -->|uses| n6
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Duplicate of #67, which covers the same files-only plan for opted-in operator commands and is further along with its openhuman integration. Closing this one so only one design lands. |
Summary
Adds
SandboxPlanOptions2.files_only, an explicit per-request opt-in for running the operator's own command under a jail that confines only the filesystem, on the host's network. This is Linux Landlock where nothing stronger can start, for example inside a Docker container whose default seccomp profile blocks user namespaces, so bubblewrap fails and Docker is unavailable.Today
requirements()always requires Filesystem and Network enforcement, and the trusted-folder pass rejects any executor withisolation: none. Landlock declares only the filesystem and no isolation, sopick()returnsunsupportedand every sandboxed shell in such a container is refused, even though the shell already asks for the host's network and gets nothing from a network rule.With
files_onlyset:NetworkPolicy::Hostrequires only the filesystem (plus any requested bounds); any other network policy keeps the network requirement;minimum_isolation: processwith the filesystem constraint alone.It is refused (
floor) withoutaccept_process_isolation, for any source other thantrusted_host, and for SaaS or unlabelled deployments and origins.validate/ConsumeSandboxPlan2re-derive the plan, so a request that does not set the option cannot reuse a files-only artifact.Related issue
None. Host side: tinyhumansai/openhuman (agent-definition opt-in
sandbox_profile = "files-only"), PR to follow.API or behavior changes
Additive contract field
SandboxPlanOptions2.files_only(default off, absent from the wire when off, so existing fingerprints and hosts are unchanged). A module older than this field rejects a request that sets it (deny_unknown_fields), so an opted-in host fails closed against an old module. No behaviour change for any request that does not set it.CONTRACT_VERSIONis unchanged on purpose: bumping it would make every host built on this contract refuse the released module.Validation
Commands actually run, with their outcome:
cargo fmt --all -- --check: cleancargo clippy --all-targets --all-features -- -D warnings: cleancargo build --all-targets --all-features: okcargo test --all-features: 1380 passed, 0 failedRUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features: okTDD:
cargo test -p tinysecurity-sandbox files_onlyfirst failed 3 of 7. The Landlock plan wasSome(Unsupported)instead of an artifact, and the two floor cases wereSome(Unsupported)instead ofSome(Floor). After the engine change all 7 pass.Tests
crates/tinysecurity-sandbox/src/files_only_tests.rs(new): an opted-in operator host-network request plans onto Landlock, getsminimum_isolation: processand[filesystem], stages, activates and validates, and does not validate for a request without the option. The same request without the option isunsupported. A request for no network is stillunsupported. A best-effort filesystem with no isolation isunsupported. Withoutaccept_process_isolationthe result isfloor, as it is for untrusted, SaaS and unlabelled plans. A kernel executor still wins.crates/tinysecurity-bus/src/sandbox_tests.rs: the pinned wire form ofSandboxPlanOptions2now includesfiles_only.Documentation
MODULE.md(executor choice section) and the newdocs/specs/sandbox-plan-files-only.md.Checklist
#[allow(...)],#[ignore], or relaxed lints: one targeted#[allow(clippy::struct_excessive_bools)]onSandboxPlanOptions2. It is commented and matches the existing one on the wire-flag struct inpolicy.rs:545. The options are independent wire flags, and merging them into an enum would break the wire form..envcontents in the diff or the description