{"record":{"id":"9bad900ddaf2fe6b","repo":"Hmbown/CodeWhale","slug":"sandbox-mode-mode-is-not-allowed-by-requirements","errorCode":null,"errorMessage":"sandbox_mode '{mode}' is not allowed by requirements ({})","messagePattern":"sandbox_mode '(.+?)' is not allowed by requirements \\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config.rs","lineNumber":11756,"sourceCode":"            .iter()\n            .any(|p| p.eq_ignore_ascii_case(&policy))\n        {\n            anyhow::bail!(\n                \"approval_policy '{policy}' is not allowed by requirements ({})\",\n                requirements.allowed_approval_policies.join(\", \")\n            );\n        }\n    }\n    if !requirements.allowed_sandbox_modes.is_empty()\n        && let Some(mode) = config.sandbox_mode.as_ref()\n    {\n        let mode = mode.to_ascii_lowercase();\n        if !requirements\n            .allowed_sandbox_modes\n            .iter()\n            .any(|m| m.eq_ignore_ascii_case(&mode))\n        {\n            anyhow::bail!(\n                \"sandbox_mode '{mode}' is not allowed by requirements ({})\",\n                requirements.allowed_sandbox_modes.join(\", \")\n            );\n        }\n    }\n\n    Ok(())\n}\n\nfn merge_features(\n    base: Option<FeaturesToml>,\n    override_cfg: Option<FeaturesToml>,\n) -> Option<FeaturesToml> {\n    match (base, override_cfg) {\n        (None, None) => None,\n        (Some(mut base), Some(override_cfg)) => {\n            for (key, value) in override_cfg.entries {\n                base.entries.insert(key, value);","sourceCodeStart":11738,"sourceCodeEnd":11774,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/config.rs#L11738-L11774","documentation":"The TUI config loader validates `sandbox_mode` against `requirements.allowed_sandbox_modes` when that list is non-empty. If the configured mode (case-insensitively compared) is not in the allowlist, loading fails with the list of permitted values. This prevents running with a sandbox mode the deployment's requirements disallow.","triggerScenarios":"Setting `sandbox_mode` (e.g. `read-only`, `workspace-write`, `danger-full-access`) to a value missing from a non-empty `requirements.allowed_sandbox_modes` list during config validation.","commonSituations":"Typo in config.toml; copy-pasting a sandbox mode from older docs; enterprise requirements files that only allow read-only modes while a user config sets workspace-write.","solutions":["Set `sandbox_mode` to one of the allowed values shown in the error message","Adjust the `requirements.allowed_sandbox_modes` allowlist if the mode is legitimately needed","Correct the value spelling in your config (comparison is case-insensitive)"],"exampleFix":"// before\nsandbox_mode = \"full-access\"\n// after\nsandbox_mode = \"workspace-write\"","handlingStrategy":"validation","validationCode":"if !requirements.allowed_sandbox_modes.is_empty()\n    && !requirements.allowed_sandbox_modes.iter().any(|m| m.eq_ignore_ascii_case(&mode)) {\n    eprintln!(\"sandbox_mode {mode} not allowed; allowed: {:?}\", requirements.allowed_sandbox_modes);\n}","typeGuard":"fn sandbox_mode_allowed(mode: &str, requirements: &Requirements) -> bool {\n    requirements.allowed_sandbox_modes.is_empty()\n        || requirements.allowed_sandbox_modes.iter().any(|m| m.eq_ignore_ascii_case(mode))\n}","tryCatchPattern":null,"preventionTips":["Use only sandbox modes permitted by your deployment's requirements file","Re-check sandbox_mode after changing environments (dev vs enterprise)","Prefer the modes listed in the error's allowlist"],"tags":["config","validation","sandbox"],"backgroundTag":"invalid-config-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}