Skip to main content

prepare_provider_auth_dir

Function prepare_provider_auth_dir 

Source
pub fn prepare_provider_auth_dir(
    provider: &ProviderConfig,
    auth_dir: &str,
) -> Result<()>
Expand description

Prepare an isolated provider auth/config directory for use as CLAUDE_CONFIG_DIR (or a provider’s equivalent): create it, then apply every isolation guarantee that directory needs before a CLI is pointed at it.

Exists so callers cannot obtain a usable auth dir WITHOUT its isolation guarantees — the spawn paths call this instead of create_dir_all + a separately-skippable seed step. Deleting the isolation from a spawn path now means deleting the directory preparation too, which fails loudly instead of silently reopening the leak. See docs/specs/SPEC_ISOLATE_HOST_CLAUDE_MD_2026_08_31.md and docs/reports/REPORT_CLAUDE_CONFIG_DIR_ISOLATION_EVIDENCE_2026_09_01.md (the live three-arm experiment proving the leak is real and this closes it).