{"record":{"id":"f2c800eed817f720","repo":"jdx/mise","slug":"experimental-no-age-recipients-provided-use-a","errorCode":null,"errorMessage":"[experimental] No age recipients provided. Use --age-recipient, --age-ssh-recipient, or --age-key-file","messagePattern":"\\[experimental\\] No age recipients provided\\. Use --age-recipient, --age-ssh-recipient, or --age-key-file","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/set.rs","lineNumber":452,"sourceCode":"        }\n\n        // If no recipients were provided, use defaults\n        if recipients.is_empty()\n            && (self.age_recipient.is_empty()\n                && self.age_ssh_recipient.is_empty()\n                && self.age_key_file.is_none())\n        {\n            recipients = agecrypt::load_recipients_from_defaults().await?;\n        }\n\n        // Load recipients from key file if specified\n        if let Some(key_file) = &self.age_key_file {\n            let key_file_recipients = agecrypt::load_recipients_from_key_file(key_file).await?;\n            recipients.extend(key_file_recipients);\n        }\n\n        if recipients.is_empty() {\n            bail!(\n                \"[experimental] No age recipients provided. Use --age-recipient, --age-ssh-recipient, or --age-key-file\"\n            );\n        }\n\n        Ok(recipients)\n    }\n}\n\nasync fn get_mise_toml(filename: &Path) -> Result<MiseToml> {\n    let path = env::current_dir()?.join(filename);\n    // Before the exists/does-not-exist split, so a `.tool-versions` says why it is refused instead\n    // of failing later as invalid TOML, and so a name mise cannot read back is never created.\n    crate::config::config_file::ensure_writable_as_toml(&path).await?;\n    let mise_toml = if path.exists() {\n        MiseToml::from_file(&path)?\n    } else {\n        MiseToml::init(&path)\n    };","sourceCodeStart":434,"sourceCodeEnd":470,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/set.rs#L434-L470","documentation":"`mise set --encrypt` (experimental age-based encryption) collects age recipients from --age-recipient, --age-ssh-recipient, and --age-key-file. If none of these flags supplied any recipient, encryption cannot produce a valid age header, so mise refuses to proceed. This is an experimental-gated validation of required encryption inputs.","triggerScenarios":"Running `mise set --encrypt KEY=value` (with the experimental age setting enabled) without any of --age-recipient, --age-ssh-recipient, or --age-key-file, or with flags that yield an empty recipient list.","commonSituations":"Forgetting the recipient flags on first use of encrypted env; providing only a key-file path that fails to load (so recipients stays empty); scripting the encrypt command without forwarding recipient flags.","solutions":["Pass at least one recipient, e.g. `mise set --encrypt --age-recipient age1... KEY=value`.","Use `--age-ssh-recipient ssh-ed25519 AAAA...` to encrypt to an SSH key.","Use `--age-key-file <path>` pointing at an age identity/keys file with valid recipients; verify the file loads."],"exampleFix":"// before\nmise set --encrypt DB_PASS=secret\n// error: no age recipients provided\n\n// after\nmise set --encrypt --age-recipient age1qy... DB_PASS=secret","handlingStrategy":"validation","validationCode":"test -n \"$AGE_RECIPIENT$AGE_SSH_RECIPIENT$AGE_KEY_FILE\" || { echo 'provide an age recipient flag' >&2; exit 2; }","typeGuard":null,"tryCatchPattern":"mise set --encrypt --age-recipient \"$RECIPIENT\" KEY=value || { echo 'encryption failed: check recipient/key file' >&2; }","preventionTips":["Store the recipient in a shell variable or config and always pass one of the three flags","Validate the key file loads (age-compatible format) before scripting","Remember the feature is experimental — check `mise settings get experimental`"],"tags":["cli","encryption","age","experimental"],"backgroundTag":"missing-required-flag","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"}