Skip to content

Account-dir carve-out misses the keyring key, auth profiles and the Claude Code full-access toggle #7246

Description

@mysma-9403

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 off is_path_string_allowed returns 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_write both 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_MODE env 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.bak and claude_code_settings.json in the account dir are refused by is_path_string_allowed, validate_path and validate_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_internal still 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

  1. added
    priority: p2
    on Oct 9, 2026
  2. tinysweeper commented on Oct 9, 2026

    @tinysweeper

    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.

  3. added theissue type on Oct 9, 2026
  4. mysma-9403 commented on Oct 9, 2026

    @mysma-9403
    ContributorAuthor

    The other outcome of that audit is #7245 — unrelated as code.

  5. M3gA-Mind commented on Oct 19, 2026

    @M3gA-Mind
    Collaborator

    Thanks, this checks out against current main. The account-dir carve-out in security/policy/path_checks.rs still covers only config.toml. auth-profiles.json, config.toml.bak and claude_code_settings.json all 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_key remains 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.

  6. M3gA-Mind commented on Nov 16, 2026

    @M3gA-Mind
    Collaborator

    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:

    • credential profiles are now in auth-profiles/secrets.enc (auth-profiles.json is only imported);
    • the Claude Code full-access toggle now lives in the profile's storage.db, which isn't reserved either.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions