From 1f463dd7ea713da8efa057a617734dcd25cfc657 Mon Sep 17 00:00:00 2001 From: Steven Enamakel <31011319+senamakel@users.noreply.github.com> Date: Mon, 1 Jun 2026 12:07:07 -0700 Subject: [PATCH] feat(security): separate agent action sandbox from internal workspace state (#3074) --- .github/workflows/coverage.yml | 4 +- .github/workflows/pr-ci.yml | 4 +- .../settings/panels/AgentAccessPanel.tsx | 43 +++++++ app/src/lib/i18n/ar.ts | 8 ++ app/src/lib/i18n/bn.ts | 9 ++ app/src/lib/i18n/de.ts | 9 ++ app/src/lib/i18n/en.ts | 9 ++ app/src/lib/i18n/es.ts | 9 ++ app/src/lib/i18n/fr.ts | 9 ++ app/src/lib/i18n/hi.ts | 9 ++ app/src/lib/i18n/id.ts | 9 ++ app/src/lib/i18n/it.ts | 9 ++ app/src/lib/i18n/ko.ts | 8 ++ app/src/lib/i18n/pl.ts | 9 ++ app/src/lib/i18n/pt.ts | 9 ++ app/src/lib/i18n/ru.ts | 9 ++ app/src/lib/i18n/zh-CN.ts | 8 ++ src/core/jsonrpc.rs | 3 + src/openhuman/about_app/catalog_data.rs | 13 ++ .../agent/harness/session/builder.rs | 3 +- src/openhuman/agent/harness/tests.rs | 2 + .../agent/harness/tool_loop_tests.rs | 6 +- src/openhuman/approval/gate.rs | 1 + src/openhuman/channels/runtime/startup.rs | 18 ++- src/openhuman/config/mod.rs | 5 +- src/openhuman/config/schema/load.rs | 31 +++++ src/openhuman/config/schema/load_tests.rs | 2 + src/openhuman/config/schema/mod.rs | 5 +- src/openhuman/config/schema/types.rs | 7 ++ src/openhuman/credentials/ops_tests.rs | 1 + src/openhuman/credentials/session_support.rs | 1 + src/openhuman/cron/ops.rs | 12 +- src/openhuman/cron/ops_tests.rs | 1 + src/openhuman/cron/scheduler.rs | 6 +- src/openhuman/cron/scheduler_tests.rs | 59 +++++++-- src/openhuman/cron/seed.rs | 1 + src/openhuman/cron/store_tests.rs | 1 + src/openhuman/cron/tools/add.rs | 5 + src/openhuman/cron/tools/list.rs | 1 + src/openhuman/cron/tools/remove.rs | 3 + src/openhuman/cron/tools/run.rs | 6 +- src/openhuman/cron/tools/runs.rs | 1 + src/openhuman/cron/tools/update.rs | 5 + src/openhuman/inference/ops_tests.rs | 1 + src/openhuman/inference/provider/ops_tests.rs | 3 + src/openhuman/integrations/mod_tests.rs | 1 + src/openhuman/mcp_server/tools.rs | 6 +- src/openhuman/mcp_server/write_dispatch.rs | 3 +- src/openhuman/memory_archivist/tree_writer.rs | 1 + .../memory_tree/tree_runtime/engine_tests.rs | 1 + .../memory_tree/tree_runtime/store_tests.rs | 1 + src/openhuman/migration/ops.rs | 1 + src/openhuman/migrations/mod_tests.rs | 1 + src/openhuman/overlay/bus.rs | 25 +++- src/openhuman/referral/ops.rs | 1 + src/openhuman/runtime_node/ops.rs | 3 +- src/openhuman/security/live_policy.rs | 24 +++- src/openhuman/security/ops.rs | 9 +- src/openhuman/security/policy.rs | 105 +++++++++++++++- src/openhuman/security/policy_tests.rs | 112 ++++++++++++++++-- src/openhuman/service/mock_tests.rs | 1 + src/openhuman/service/ops.rs | 1 + src/openhuman/task_sources/pipeline_tests.rs | 1 + src/openhuman/task_sources/route.rs | 1 + src/openhuman/task_sources/store_tests.rs | 1 + .../tools/impl/filesystem/apply_patch.rs | 5 +- .../tools/impl/filesystem/csv_export.rs | 1 + .../tools/impl/filesystem/edit_file.rs | 8 +- .../tools/impl/filesystem/file_read.rs | 2 + .../tools/impl/filesystem/file_write.rs | 8 +- .../tools/impl/filesystem/git_operations.rs | 12 +- .../tools/impl/filesystem/glob_search.rs | 1 + src/openhuman/tools/impl/filesystem/grep.rs | 1 + .../tools/impl/filesystem/list_files.rs | 1 + src/openhuman/tools/impl/system/node_exec.rs | 4 +- src/openhuman/tools/impl/system/npm_exec.rs | 2 +- .../tools/impl/system/proxy_config_tests.rs | 1 + src/openhuman/tools/impl/system/schedule.rs | 14 +++ src/openhuman/tools/impl/system/shell.rs | 5 +- src/openhuman/tools/local_cli.rs | 1 + src/openhuman/tools/ops.rs | 20 ++-- src/openhuman/tools/ops_tests.rs | 2 + src/openhuman/update/ops.rs | 1 + src/openhuman/update/ops_tests.rs | 1 + src/openhuman/webhooks/ops_tests.rs | 1 + tests/connectivity_raw_coverage_e2e.rs | 10 +- ...mpatible_admin_round25_raw_coverage_e2e.rs | 12 +- ...ence_compatible_matrix_raw_coverage_e2e.rs | 12 +- ...erence_local_ops_piper_raw_coverage_e2e.rs | 12 +- ...local_services_round21_raw_coverage_e2e.rs | 12 +- ...nce_voice_http_round23_raw_coverage_e2e.rs | 18 ++- tests/json_rpc_e2e.rs | 1 + ...ources_closure_round23_raw_coverage_e2e.rs | 4 +- ...ources_readers_round21_raw_coverage_e2e.rs | 35 ++++-- .../memory_sync_providers_raw_coverage_e2e.rs | 1 + tests/memory_sync_round23_raw_coverage_e2e.rs | 1 + .../memory_sync_slack_bus_raw_coverage_e2e.rs | 1 + tests/memory_sync_sources_raw_coverage_e2e.rs | 22 +++- ...mory_sync_tree_round21_raw_coverage_e2e.rs | 1 + tests/memory_threads_raw_coverage_e2e.rs | 33 +++++- ...ry_tree_memory_round23_raw_coverage_e2e.rs | 12 +- .../memory_tree_sync_deep_raw_coverage_e2e.rs | 12 +- tests/memory_tree_sync_raw_coverage_e2e.rs | 14 ++- tests/near90_closure_raw_coverage_e2e.rs | 65 ++++++---- tests/owned_domain_raw_coverage_e2e.rs | 2 +- ...tool_registry_approval_raw_coverage_e2e.rs | 10 +- ...gent_credentials_state_raw_coverage_e2e.rs | 16 ++- ...ools_approval_channels_raw_coverage_e2e.rs | 8 ++ tests/tools_channels_raw_coverage_e2e.rs | 1 + ...osio_network_leftovers_raw_coverage_e2e.rs | 5 +- ...tools_composio_round22_raw_coverage_e2e.rs | 4 +- ...tools_network_channels_raw_coverage_e2e.rs | 2 + tests/worker_b_raw_coverage_e2e.rs | 2 +- 113 files changed, 956 insertions(+), 139 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 9d108d994..35a4a71b8 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -94,7 +94,9 @@ jobs: - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov - name: Run cargo llvm-cov for openhuman core - run: cargo llvm-cov -p openhuman --lcov --output-path lcov-core.info + run: cargo llvm-cov --no-fail-fast -p openhuman --lcov --output-path lcov-core.info + env: + CARGO_BUILD_JOBS: "2" - name: Upload core lcov uses: actions/upload-artifact@v5 with: diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index c1cc73945..60eedf199 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -315,7 +315,9 @@ jobs: uses: taiki-e/install-action@cargo-llvm-cov - name: Run cargo llvm-cov for openhuman core - run: bash scripts/ci-cancel-aware.sh cargo llvm-cov -p openhuman --lcov --output-path lcov-core.info + run: bash scripts/ci-cancel-aware.sh cargo llvm-cov --no-fail-fast -p openhuman --lcov --output-path lcov-core.info + env: + CARGO_BUILD_JOBS: "2" - name: Upload core lcov uses: actions/upload-artifact@v5 diff --git a/app/src/components/settings/panels/AgentAccessPanel.tsx b/app/src/components/settings/panels/AgentAccessPanel.tsx index 543c9a010..253637f43 100644 --- a/app/src/components/settings/panels/AgentAccessPanel.tsx +++ b/app/src/components/settings/panels/AgentAccessPanel.tsx @@ -319,6 +319,49 @@ const AgentAccessPanel = () => { + {/* Directory model — action sandbox vs internal state. */} +
+

+ {t('settings.agentAccess.directories')} +

+
+
+
+ + + {t('settings.agentAccess.actionSandbox')} + + + {t('settings.agentAccess.readWriteAccess')} + +
+

+ ~/OpenHuman/projects +

+

+ {t('settings.agentAccess.actionSandboxDesc')} +

+
+
+
+ + + {t('settings.agentAccess.internalState')} + + + {t('settings.agentAccess.agentBlocked')} + +
+

+ ~/.openhuman/workspace +

+

+ {t('settings.agentAccess.internalStateDesc')} +

+
+
+
+ {/* Workspace confinement — orthogonal to the tier; applies in all modes. */}