Skip to content

[sec-bus] adopt TinySecurity secret cipher and keyring APIs - #692

Merged
senamakel merged 509 commits into
epic/8369-security-migrationfrom
sec-656-secret-cipher
Oct 27, 2026
Merged

senamakel merged 509 commits into
epic/8369-security-migrationfrom
sec-656-secret-cipher

Conversation

@senamakel

@senamakel senamakel commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Closes #656

Summary

Migrates OpenHuman's security secret storage, key access, and consent flows to TinySecurity's crypto/keyring APIs. Propagates the async credential APIs through core, embed, TinyHumans, RPC, and the desktop host, and updates the required fork gitlinks.

Closes #656
Part of tinyhumansai#8369

Fork dependencies

Merged into the epic/8369-security-migration branches on senamakel forks:

Validation

Passed locally:

  • cargo test -p openhuman --lib --no-run --all-features --offline
  • Product feature check without security-module
  • cargo test -p openhuman --lib --all-features --offline security::secret_storage::encrypted_store::tests (5 passed)
  • TinyBus module suite (872 passed, 56 ignored)
  • Fork pre-push checks: formatting, frontend lint, TypeScript compile, strict Rust Clippy, and UI token scans

TinySecurity v0.18.2 is published with all 16 platform archives and checksum.toml. The release workflow's final loader check failed because its shell parser read both archive and embedded-library digests for the same archive name; the Ubuntu archive SHA-256 matches the [sha256] manifest entry. OpenHuman's hosted PR checks are validating the published module.

The embed profile-turn runtime test requires TinySecurity to be loaded; in a standalone test process without that module, its fail-closed input screen holds the turn before inference.

senamakel and others added 30 commits October 27, 2026 02:03
Several call sites now await the session host, credential, and model
constructors that became async, and a duplicated await in the inference
status path was removed.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The provider key helpers now await the credential lookup instead of
calling it synchronously, and their callers in the Jev and planner
config builders were updated to await the results. This aligns the
config assembly with the async key resolution path.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The computer config tests now call the async module_config and billing_route helpers with .await and are marked with tokio::test, matching the helpers' new async signatures.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Bump the vendored tinybus submodule to its latest revision and
explicitly set async_module_config to None in the ops resolver so the
new field is populated.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Module config lookups now run through the async resolver hook instead of the
synchronous one, so config sources that need to await can be supported. The
sync `module_config` path is replaced by an async variant and the resolver
wires the async hook while leaving the sync hook returning null.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The module config callback is now asynchronous, so load_enabled and the
computer callback load path await it instead of passing a future where a
value is expected. This keeps configured modules loading with their host
config after the callback became async.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The module config helpers now await the proxy policy and the stored Composio
API key instead of calling them synchronously, so the call chain from
ensure_routed down to route_config is async throughout. This lets the
keychain-backed lookup run without blocking the runtime.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The connector module config tests now await module_config and
module_config_with_proxy, and the test functions are marked with
tokio::test so they can run on the async runtime.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The search module's configuration helpers now await credential resolution
instead of calling the synchronous variant, so the functions that build the
module config and tool specs became async and their callers await them.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The search config tests now await module_config and configured_tool_specs, which became async, so the test functions were switched to tokio::test with async bodies.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The search tool builder now awaits the module config lookup, so it
becomes async and its callers and tests were updated to await it. This
keeps the verified loader's async config resolution consistent across
the search and module paths.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Search module configuration is now resolved asynchronously, and the
backend credential is only read when the module or its tools are
actually requested. Tests and docs were updated to match the new
signatures.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The no-modules stub for build_search_tools now returns a future so it
matches the signature of the real implementation, letting callers await it
regardless of whether the modules feature is enabled.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The ModelFactory::build trait method is now async, so the one-shot
builder and the native cloud tests await it. The affected test helper
and its callers were converted to async to match.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The module loading and configuration helpers now return boxed futures instead of being async fns, so callers can hold the future without borrowing the config and id for the whole call. Behaviour is unchanged.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The resolver now builds linked factories into a shared LinkedRegistry and
passes an explicit SearchPathConfig, so module search paths honour the
OPENHUMAN_MODULE_PATH environment variable and the openhuman/modules
subdirectory. The chat model factory also drops the ?Send bound on its
async trait impl to match the updated trait signature.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reindented the bodies of the module load and search helper functions to
restore consistent indentation after earlier edits. No behaviour change.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The module config lookup closure now clones the config and returns a future so it can be awaited inside the loader, and the search path helpers are called without the now-unused config argument. This keeps the loader working with the async callback signature and removes the redundant parameter.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated call sites to await the now-async model factory, turn model
builder, session host, and STT provider constructors, and fixed a
borrowed id in the module config closure. Removed an unused search path
config binding.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The async_trait attribute on the ModelFactory implementation now uses
?Send so the generated futures no longer require Send bounds, matching
the single-threaded usage of this factory.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The turn model builder became async, so the existing tests now await the
build and build_summarizer calls before asserting on the returned models.
This keeps the test suite compiling and exercising the same behaviour.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The native turn model builder now returns a future, so the tests await the
build call before asserting on the resulting model set.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reorders use statements into a consistent ordering and rewraps two multi-line assert! calls to satisfy rustfmt. No behaviour changes.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The loop now calls search_paths on the host instance rather than the ModuleHost type, so the configured host's search paths are used instead of the static defaults.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The invocation storage binding now looks up the authenticated peer using the
module id rather than the module descriptor name, so bindings resolve against
the correct admitted instance when names are not unique.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The module descriptor name parameter is no longer read when serving an
invocation binding, so it is prefixed with an underscore to mark it as
intentionally unused and keep the build warning-free.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
senamakel and others added 28 commits October 27, 2026 09:51
Capture the set_credential result in a variable and print it before
asserting, so a failure shows the actual error instead of only the
panic message.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The profile turn serialization test now turns off secret encryption in its
runtime config so credentials can be stored without a keyring, and the
credential setup no longer prints its result before asserting success.

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

The test no longer disables secret encryption when configuring the profile runtime, leaving only the lease TTL override.

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

The profile turn serialization test no longer stores an API key credential
after provisioning, since the scenario only exercises concurrent profile
opening and never reads the credential back. The now-unused
ProfileCredentialKind import was removed along with it.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Replace the PointedInference helper with an explicit openai-compatible DirectProfileProvider on the SaasConfig so the test exercises the same provider wiring path as production.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The profile turn serialization test now selects on the spawned chat task
alongside the arrival wait, so a task that finishes early fails with a
clear panic instead of hanging. Import ordering in the shared test helper
was also normalized.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The select branch now prints the chat task's result before panicking so the failure output shows why the chat exited early, making the intermittent test failure easier to diagnose.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The test now installs a pointed inference endpoint and stores an API key credential per provisioned profile instead of configuring a direct provider on the SaaS config, matching the current credential flow. The chat spawn no longer races the arrival wait against the task handle, so a chat that exits early surfaces as a plain wait failure rather than a custom panic.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted multi-line assert! calls into the more compact style and reordered imports to match rustfmt output. No test behaviour changed; this is purely a formatting pass over the test suites.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The encrypted store now defines its own SecretCipherOutput enum and converts the security module's output into it, so the store no longer depends on that module's type directly. Plaintext values are wrapped in Zeroizing to clear them from memory after use.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the vendored tinybus submodule to a newer upstream commit.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Replace the per-file descriptions of the delegation graph and agent-teams runtime with a link to the orchestration ownership map, clarifying that OpenHuman owns sub-agent adapters, cancellation, progress and UI projections while TinyAgents owns generic graph and task execution.

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

The delegation and orchestration sections now describe workflow, agent-team, and delegation execution as belonging to TinyAgents and TinyFlows, with OpenHuman retaining definitions, policy, adapters, and durable projections. This corrects the architecture notes to match the current split of responsibilities.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the vendored tinybox submodule to the latest upstream commit.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Bump the vendored tinybox submodule to a newer commit.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the vendored tinysecurity dependency to a newer revision.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the locked versions of the tinysecurity-approval, tinysecurity-auto, tinysecurity-bus, tinysecurity-crypto, and tinysecurity-redact crates from 0.18.1 to 0.18.2.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the vendored tinybox submodule to a newer revision.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the locked tinysecurity-approval, tinysecurity-auto, tinysecurity-bus, tinysecurity-crypto, and tinysecurity-redact packages from 0.18.1 to 0.18.2.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a test asserting the compiled TinySecurity module matches the published v0.18.2 release, covering the version, contract version, release URL, and the full set of per-host archive names and SHA-256 checksums. This guards against the registry drifting from the verified release artifacts.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the published TinySecurity module record to version 0.18.2, refreshing the release URL, archive names, and SHA-256 checksums for every supported platform so eager loading fetches and verifies the new release.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The release URL check now accepts any GitHub URL rather than requiring the tinyhumansai organization prefix, so records hosted under other accounts are no longer rejected.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
TinySecurity creates a scope from module init config that lacks an audit stream, so registering it again with RegisterApprovalScope2 failed. Preconfigured scopes now attach the persisted stream via ReplaceApprovalScope2 on first use, and initialization verifies the resulting entry is the one already held.

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

Extracted the callback-bound module check into a helper and added tinysecurity to it, so its staged release now loads via the verified local-file path instead of failing to bind its storage callback. Added a test covering the helper's membership.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The native security fixture now resolves a host key from the matrix or
uname, downloads the matching tinysecurity module asset, verifies its
SHA-256 digest, and extracts it before exporting OPENHUMAN_MODULE_PATH.
This ensures each runner tests against the correct prebuilt module
instead of relying on a vendored checkout.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel merged commit 44e92bd into epic/8369-security-migration Oct 27, 2026
18 of 19 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