Repository navigation
Description
Summary
Four files in the account dir (workspace_dir's parent) carry secrets or execution privilege but are not part of the config.toml carve-out, so a trusted root over that directory reaches them: the keyring's on-disk encryption key, the credential profiles it decrypts, the previous config, and the Claude Code full_access toggle.
Problem / Context
is_workspace_internal_path (security/policy/path_checks.rs) treats the account dir as reachable and carves out exactly one file:
if let Some(account_dir) = ws.parent() {
if check_path == account_dir.join(ACCOUNT_CONFIG_FILE) { // "config.toml"
return true;
}
}That is deliberate — #5505 added it for the autonomy policy and the folders the artifact escape guard trusts, and the_account_config_beside_the_workspace_is_internal pins that other files there stay reachable. This issue is not a request to change that model. It is that four specific siblings should join the carve-out:
| File | Why it is not agent surface |
|---|---|
.secret_key |
The keyring's on-disk encryption key (security/keyring/encrypted_store.rs:62). is_always_forbidden covers ~/.ssh, ~/.gnupg, ~/.aws and the Windows DPAPI stores, but not this one. |
auth-profiles.json |
The credential profiles that key decrypts (security/credentials/profiles.rs:41). |
config.toml.bak |
The config one save behind, written by config::schema::load::atomic_commit. It carries the same autonomy settings and files_dir_history that config.toml is carved out for. |
claude_code_settings.json |
{"full_access": true} here switches the Claude Code provider to --permission-mode bypassPermissions with no --disallowedTools, i.e. its full native toolset including Bash, WebFetch and Task (providers/claude_code/driver.rs:405-457). |
The last one is the one with an execution consequence, and it is worth being precise about why the approval gate does not catch it. That provider advertises tool_calling: false because it "executes its own native tools internally and intentionally never returns them to the harness" (providers/claude_code/mod.rs:146-152), so ApprovalSecurityMiddleware never sees those calls — it only resolves tools present in the harness tool sets. The driver also documents the containment: on macOS the Seatbelt jail walls off ~/.openhuman, and "on Linux/Windows there's no OS wall yet, so CC runs unconfined there".
Reachability, stated honestly. This needs the hardened posture to matter at all:
[autonomy] enabled = true. Off is the shipped default (config/schema/autonomy.rs), and with the policy offis_path_string_allowedreturns early before the workspace-internal check, so nothing here applies — the agent already reaches these files and much else.- plus a trusted root over the account dir, or
workspace_only = false.
So this is defence-in-depth for the configuration that opted into containment, not a bypass of the default product. I am filing it rather than leaving it because the carve-out already exists for exactly this configuration, and these four files are a strictly stronger case for it than the one file already on the list.
Scope (optional)
In scope: add the four names to the account-dir carve-out, matched by name within the account dir so every other file there stays reachable.
Not in scope, deliberately:
- Turning the account dir into a containment boundary. Tried first, and it breaks real behaviour: a turn-workspace checkout and a granted trusted root both legitimately sit beside the workspace (
write_into_the_scoped_turn_root_is_allowed,trusted_readwrite_root_allows_writeboth fail under a directory rule). - Nested state under the account dir outside the workspace. A name match does not reach it; worth a separate look if anything privilege-bearing lands there.
- The
OPENHUMAN_CLAUDE_CODE_PERMISSION_MODEenv override, which needs control of the core process environment and a restart.
Acceptance criteria
- The four files are internal —
.secret_key,auth-profiles.json,config.toml.bakandclaude_code_settings.jsonin the account dir are refused byis_path_string_allowed,validate_pathandvalidate_parent_path, including under a read-write trusted root over the account dir. - The Feature (macOS): default agent output to ~/Openhuman/Projects/ instead of hidden ~/.openhuman/ #5505 model is unchanged — other files in the account dir stay reachable;
the_account_config_beside_the_workspace_is_internalstill passes unmodified. - No capture outside the account dir — a user's own project file that happens to carry one of these names is unaffected.
- Diff coverage ≥ 80% — the implementing PR meets the changed-lines coverage gate.
Related
Found while auditing the approval-gate surface on main at 775272ffe2. The other outcome of that audit is a separate issue about auto-generated fix(security) commit messages.
Activity
tinysweeper commentedon Oct 9, 2026
Account-dir carve-out in path_checks only excludes config.toml, leaving keyring key, auth profiles, config backup and claude_code_settings. reachable by a trusted agent root under the hardened autonomy posture — a defence-in-depth gap, not a default-path bypass.
Labelled
priority: p2.mysma-9403 commentedon Oct 9, 2026
The other outcome of that audit is #7245 — unrelated as code.
M3gA-Mind commentedon Oct 19, 2026
Thanks, this checks out against current
main. The account-dir carve-out insecurity/policy/path_checks.rsstill covers onlyconfig.toml.auth-profiles.json,config.toml.bakandclaude_code_settings.jsonall sit beside it and stay reachable under a trusted root over the account dir. One small update: the secret-store key now lives in the OS keychain, and.secret_keyremains only as a legacy file that gets migrated on first use. It's still worth carving out for older installs. Agreed that this is defence-in-depth for the hardened autonomy setup, not the default path. The fix is in progress in #7248, which has review feedback to address.M3gA-Mind commentedon Nov 16, 2026
Re-checked on current main: still the case. The account-dir reservation still protects only
config.toml. #7248 is the open fix.Some paths have changed since you filed this, and the fix should cover the new ones:
auth-profiles/secrets.enc(auth-profiles.jsonis only imported);storage.db, which isn't reserved either.