{"record":{"id":"a4882f49bce747d1","repo":"Hmbown/CodeWhale","slug":"permission-posture-never-is-not-part-of-the-runt","errorCode":null,"errorMessage":"permission posture 'never' is not part of the Runtime product contract","messagePattern":"permission posture 'never' is not part of the Runtime product contract","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_policy.rs","lineNumber":67,"sourceCode":"        permission_posture: Option<&str>,\n        auto_approve: Option<bool>,\n    ) -> Result<Self> {\n        let parsed_mode = parse_runtime_mode(mode).ok_or_else(|| {\n            anyhow::anyhow!(\"unsupported Runtime mode {mode:?}; expected plan, act, or operate\")\n        })?;\n        let permission = match permission_posture {\n            Some(value) => ApprovalMode::from_config_value(value).ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"unsupported permission posture {value:?}; expected ask, auto-review, or full-access\"\n                )\n            })?,\n            None if parsed_mode == AppMode::Yolo || auto_approve.unwrap_or(false) => {\n                ApprovalMode::Bypass\n            }\n            None => ApprovalMode::Suggest,\n        };\n        if permission == ApprovalMode::Never {\n            bail!(\"permission posture 'never' is not part of the Runtime product contract\");\n        }\n        Ok(Self {\n            mode: visible_mode(parsed_mode),\n            permission,\n        })\n    }\n\n    #[must_use]\n    pub(crate) fn mode_setting(self) -> &'static str {\n        self.mode.as_setting()\n    }\n\n    #[must_use]\n    pub(crate) fn permission_wire(self) -> &'static str {\n        match self.permission {\n            ApprovalMode::Suggest => \"ask\",\n            ApprovalMode::Auto => \"auto_review\",\n            ApprovalMode::Bypass => \"full_access\",","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/runtime_policy.rs#L49-L85","documentation":"RuntimePolicy::new maps a configured permission posture string to an ApprovalMode, and 'never' (ApprovalMode::Never) is explicitly rejected with 'permission posture never is not part of the Runtime product contract'. The runtime must always be able to take at least some action; a posture that denies everything has no valid runtime semantics, so it is a configuration error rather than a supported mode.","triggerScenarios":"Constructing RuntimePolicy with permission_posture resolving to 'never' (via ApprovalMode::from_config_value), e.g. a config file or CLI flag setting permission/permission-posture to never while launching the runtime.","commonSituations":"Hardening pass sets permissions to the most restrictive sounding value; users assume ask/auto-review/full-access/never is a uniform ladder; copying a policy file from another tool where 'never' meant 'ask every time'.","solutions":["Change the posture to one of the supported values: ask, auto-review, or full-access.","If the goal is maximum safety, use 'ask' so every action still requires approval.","Search the config for the key that produced the value (the preceding 'unsupported permission posture' error names the raw value) and fix it at the source."],"exampleFix":"# before (config)\npermission-posture = \"never\"   # bails: not part of the Runtime product contract\n\n# after (config)\npermission-posture = \"ask\"","handlingStrategy":"validation","validationCode":"// Rust: accept only documented postures before building the policy\nconst SUPPORTED_POSTURES: &[&str] = &[\"ask\", \"auto-review\", \"full-access\"];\n\nlet posture = config.permission_posture.as_deref().unwrap_or(\"ask\");\nanyhow::ensure!(\n    SUPPORTED_POSTURES.contains(&posture),\n    \"unsupported permission posture {posture:?}; expected one of {SUPPORTED_POSTURES:?}\"\n);\nlet policy = RuntimePolicy::new(mode, Some(posture), None)?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate posture strings against the documented allowlist at config load time, not at runtime startup.","Remember 'never' is intentionally unsupported: use 'ask' for maximum restriction.","Add a config schema/lint step in CI to catch invalid enum values early."],"tags":["config","permissions","policy","rust","runtime"],"backgroundTag":"unsupported-config-value","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}