{"record":{"id":"6f9ffb066b5e1ee7","repo":"jdx/mise","slug":"trust-the-configuration-before-using-its-encryptio","errorCode":null,"errorMessage":"trust the configuration before using its encryption recipients: {}","messagePattern":"trust the configuration before using its encryption recipients: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/config.rs","lineNumber":45,"sourceCode":"    pub origin: Option<OriginTomlConfig>,\n    #[serde(default)]\n    pub encryption: Option<FileEncryptionConfig>,\n}\n\n/// Public recipients shared by every encrypted dotfile.\n#[derive(Debug, Clone, Deserialize, Default)]\n#[serde(deny_unknown_fields)]\npub(crate) struct FileEncryptionConfig {\n    #[serde(default)]\n    pub recipients: Vec<String>,\n}\n\npub(crate) fn file_recipients() -> Result<Vec<String>> {\n    let mut recipients = Vec::new();\n    for (path, layer) in layers()? {\n        if let Some(encryption) = layer.encryption {\n            if !crate::config::config_file::is_trusted(&path) {\n                eyre::bail!(\n                    \"trust the configuration before using its encryption recipients: {}\",\n                    display_path(&path)\n                );\n            }\n            recipients = encryption.recipients;\n            if recipients.is_empty() {\n                eyre::bail!(\n                    \"[history.encryption].recipients must not be empty; configure recipients before capturing encrypted files\"\n                );\n            }\n        }\n    }\n    Ok(recipients)\n}\n\n/// `[history.origin]`.\n#[derive(Debug, Clone, Deserialize, PartialEq, Eq)]\n#[serde(deny_unknown_fields)]","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/config.rs#L27-L63","documentation":"file_recipients collects encryption recipients from history config layers. Before using a layer's [history.encryption].recipients, it requires the config file to be trusted (mise trust). Untrusted config files are treated as untrusted input, so their recipient list is refused to prevent an attacker-controlled config from silently redirecting encrypted data.","triggerScenarios":"Any operation that resolves encryption recipients (e.g. encrypted history capture) while a config file defining history.encryption.recipients has not been marked trusted via `mise trust`.","commonSituations":"Cloning a repo with a mise.toml containing encryption recipients and running a history command before trusting it; mise prompting for trust after a config file changed; fresh CI checkouts where trust was never granted.","solutions":["Run `mise trust <path-to-config>` for the config file named in the error, then retry","Check `mise trust list` / trust status to confirm which files are untrusted","In CI, provision trust non-interactively (trust the checked-out config path as a setup step) before commands that use encryption"],"exampleFix":"# before\n$ mise run build\n# trust the configuration before using its encryption recipients: /repo/mise.toml\n\n# after\n$ mise trust /repo/mise.toml\n$ mise run build","handlingStrategy":"validation","validationCode":"mise trust list 2>/dev/null | grep -q \"$(pwd)/mise.toml\" || mise trust \"$(pwd)/mise.toml\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Trust newly cloned configs before running history/encryption commands","Add `mise trust` to repo setup scripts and CI bootstrap steps","Re-trust after intentionally editing a trusted config; expect the trust prompt"],"tags":["trust","encryption","config","security"],"backgroundTag":"authentication-required","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}