Skip to content

feat(sandbox): include credential denials in folder plans - #18

Merged
senamakel merged 10 commits into
epic/8369-security-migrationfrom
sec-651-tinysecurity-sandbox
Oct 25, 2026
Merged

senamakel merged 10 commits into
epic/8369-security-migrationfrom
sec-651-tinysecurity-sandbox

Conversation

@senamakel

@senamakel senamakel commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Closes #10
Part of tinyhumansai/openhuman#8369

TinySecurity contract 1.31 lets Plan2 carry trusted-host credential denials and returns their canonical paths in SandboxArtifact2.deny_read for process-level folder jails. It derives native home credential roots, rejects malformed paths and unsafe workspaces inside denied roots, and preserves canonical, pre-admitted grants in the artifact. Trusted sources may accept a process-level jail such as Seatbelt; untrusted and SaaS plans still require kernel or microVM isolation.

The existing SandboxMode::ReadOnly behavior is explicitly documented as a host-side tool filter. It maps to no sandbox backend and allows network; it makes no filesystem-confinement claim.

Validation:

  • cargo test -p tinysecurity-bus
  • cargo test -p tinysecurity-sandbox
  • cargo test -p tinysecurity-module sandbox
  • cargo check -p tinysecurity-bus -p tinysecurity-sandbox -p tinysecurity-module
  • cargo clippy -p tinysecurity-bus -p tinysecurity-sandbox -p tinysecurity-module --all-targets -- -D warnings
  • cargo fmt --all -- --check

senamakel and others added 10 commits October 25, 2026 09:51
Add a test asserting that a trusted folder plan carries pre-admitted
grants and reports credential denials, including the workspace credential
and the home .ssh directory, in its deny_read list.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Sandbox plans can now carry a list of credential paths that the host knows about, and artifacts return the canonical deny_read list for TinyBox NativeJailConfig. This lets an allow-default folder jail exclude native and host-supplied credential roots, so the contract version is bumped to 1.31.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The trusted folder plan test now reads the home directory from the
scope's paths instead of the temporary directory handle, so the
assertion exercises the same path the operator plan actually uses.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Replace the local denial count and path byte constants in the sandbox
engine and grant admission with the shared MAX_CREDENTIAL_ROOTS and
MAX_CREDENTIAL_ROOT_BYTES limits so both paths enforce the same bounds.
Add a test covering rejection of relative, oversized, and traversal
credential denial paths.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Extend the sandbox wire-shape tests to assert that credential_denials and
deny_read are omitted when unset and round-trip correctly when present, and
rename the request test to reflect the 1.30 shape it now checks.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Doc comments now render `TinySecurity` and `TinyBox` as inline code so the
product names stand out consistently. The corresponding test assertion was
switched to `assert_eq!` against an empty array for a clearer failure message.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The assertion comparing credential_denials against an empty array literal now uses an explicitly typed empty Vec so the element type is inferred correctly.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Moved the inline minimum isolation calculation out of the engine's plan
path into a dedicated function so the same logic can be reused and
tested on its own. Behaviour is unchanged.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Document that `Process` may represent trusted folder confinement such as
Seatbelt and never a kernel-isolation floor, and record that OpenHuman's
`SandboxMode::ReadOnly` is a host-side tool filter mapping to no sandbox
backend rather than a confinement claim or `Plan2` artifact.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Replace the string prefix check with a Path::is_absolute assertion so the test verifies absolute paths correctly on platforms where the separator differs.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel merged commit 7a370aa into epic/8369-security-migration Oct 25, 2026
14 of 16 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