Skip to content

[sec-bus] adopt: privacy/egress checks and browser egress host over the bus - #681

Merged
senamakel merged 19 commits into
epic/8369-security-migrationfrom
sec-651
Oct 26, 2026
Merged

senamakel merged 19 commits into
epic/8369-security-migrationfrom
sec-651

Conversation

@senamakel

Copy link
Copy Markdown
Owner

Closes #651

Summary

  • Route privacy/egress decisions and U5 provider-host classification through TinySecurity bus contracts; remove the host-owned local classification path.
  • Add TinyComputer browser egress and confidential consequence-review callbacks. Inject egress policy for the default browser as well as a configured executable, and refresh policies before their 30-second validity expires.
  • Migrate integrations, embeddings, search, turn policy, and Langfuse callers to the bus-backed checks, with fail-closed behavior at synchronous seams.
  • Add the Linux native browser-egress fixture and host callback/config coverage.

TinyComputer’s executable-plus-egress contract fix was merged first in senamakel/tinydesktop#25 at 486e56cc6e5298ac0f4d01f8443d08bfcf31cf15; this PR pins that commit.

Verification

  • Workspace and app cargo check passed; cargo check -p openhuman --features storage-sqlite,security-module passed.
  • Focused privacy tests: 11 passed. Browser callback tests: 5 passed; callback destination and default-browser config tests passed.
  • scripts/ci/security-browser-egress-fixture.sh passed: TinySecurity native fixture, browser callbacks, and TinyComputer test-connector build.
  • cargo fmt, git diff --check, and fixture shell syntax passed.

Existing repository failures

  • pnpm rust:layout reaches the inherited TinyChannels storage-schema naming violations.
  • pnpm debug rust security: 544 passed, 1 stable unrelated middleware_stop_cause failure; the same failure is present on the preceding epic base.
  • cargo check -p openhuman --no-default-features reports existing feature-gating errors in channels and secret storage.
  • Markdown Link Check reports inherited errors in untouched docs (two 404s and two 503s); the retry job marks the report ineligible.

senamakel and others added 19 commits October 26, 2026 00:46
Add a test asserting that enforce_egress rejects external Composio content
under Sensitive mode, since that mode delegates to TinySecurity which
refuses unassessed external content.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a privacy module for the egress path that inspects outbound
requests and blocks those carrying sensitive data. Tests cover the new
filtering behaviour.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a privacy_check2 client call and a privacy_check helper in the security
module so egress transfers can ask TinySecurity whether a single
host-derived descriptor is allowed. A test-only privacy port seam lets
tests stub the decision, and the egress privacy tests now exercise
allow, deny, and unavailable outcomes through it.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The egress enforcement module and its tests are deleted, along with the
re-exports that surfaced them. The local-only block is no longer applied at
egress chokepoints, so external transfers proceed regardless of privacy mode.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds a synchronous privacy_check_blocking entry point that resolves the
armed config and runs the descriptor-level privacy gate through the sync
seam, and factors privacy_check into a config-taking variant so callers
with a host-owned config can reuse it. The native egress decision path now
routes through this blocking helper instead of driving the async check
directly, letting synchronous host callbacks consult the privacy gate.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a comment explaining that the synchronous network-tool trait has no
async admission path, so its bounded bridge must refuse when no module
runtime is armed. The now-redundant assertion that the blocking bridge
returns none after a privacy port is installed was dropped, since the
comment covers the intended behaviour.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The egress privacy decision path is now async, so callers in the composio
dispatch and search tools await it rather than calling a blocking variant.
A blocking wrapper is kept for the synchronous NetGate trait, and the
privacy module's blocking path is bypassed under test to avoid deadlocking
on the async runtime.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformat the import lists in the security client, privacy tests, and
security module so they match rustfmt's ordering and wrapping. No
behaviour changes.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The egress policy check in the shared dispatcher now awaits the
local_only_search_block call, matching its async signature so non-agent
routes still enforce LocalOnly mode.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add client methods to authorize, consume, and validate browser socket
dials through TinySecurity. These wrap the confidential bus calls so
callers can obtain a one-use grant and confirm it before the selected
socket opens.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Register a new browser egress host module behind the modules and
security-module features, wiring its callback installation into the
module runtime so browser egress traffic can be intercepted when the
security module is enabled.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The browser egress host now registers a destination-only policy with
TinySecurity and records its id and generation, and authorize refuses any
target whose policy scope was not registered. The desktop proxy wires this
policy into the browser configuration so dials are validated against a live
generation instead of an unverified policy id.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The dial config now reports the policy generation under the key the host
expects, and the host refuses any authorization whose generation does not
match the generation it requested. This closes a race where a policy could
be replaced between the request and the response, letting a stale
authorization through.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a test module covering browser egress host handling so the
host-matching behaviour is exercised directly.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a classify_provider_endpoint2 method that calls the confidential
CLASSIFY_PROVIDER_ENDPOINT2 bus method with a host and returns the v2
provider endpoint response, mapping bus failures to SecurityError::Unavailable.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a helper that classifies a provider host as on-device or external via
TinySecurity's U5 endpoint classification. Failures are surfaced as errors so
callers can treat an unavailable authority as external.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…eature

The computer callback load path and its supporting helpers are now
compiled only when the security-module feature is enabled, and the
runtime cfg! check in ensure_loaded_within was replaced with cfg
attributes so the desktop branch is absent from builds without the
feature. This avoids dead code and unresolved references in
feature-disabled builds.

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