feat(vfox): allow plugins to request env var redaction via MiseEnvResult#8166
feat(vfox): allow plugins to request env var redaction via MiseEnvResult#8166
Conversation
Adds a `redact` field to `MiseEnvResult` that plugins can set to `true` to indicate their env vars contain sensitive values and should be redacted by default. The user's explicit `redact` setting in mise.toml takes priority. This enables secret-management plugins like fnox-env to have their env vars automatically redacted without requiring manual configuration. Closes jdx/fnox#280 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @jdx, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant enhancement to the 'vfox' plugin system by enabling plugins to declare whether their environment variables should be redacted by default. This feature allows for more secure handling of sensitive information, such as API keys or tokens, by automatically obscuring them in output unless explicitly configured otherwise by the user. It streamlines the integration of secret management tools and improves the overall security posture of 'mise' environments. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a redact field to MiseEnvResult, allowing vfox plugins to request redaction of their environment variables by default. The implementation is clean and logical, correctly prioritizing user configuration in mise.toml over the plugin's preference. The changes are consistently applied across the Rust code and the Lua type definitions. The logic for parsing the new field from Lua and the updated environment resolution in module.rs are both well-executed. Overall, this is a solid feature addition that improves secret management capabilities for plugins.
There was a problem hiding this comment.
Pull request overview
This PR extends the vfox env hook contract to let plugins request automatic environment-variable redaction, and wires that preference into mise’s env-module directive resolution with user-configured redaction intended to take precedence.
Changes:
- Add
redactto vfoxMiseEnvResult/ miseMiseEnvResponseso plugins can request default redaction. - Update env module resolution to prefer a user-provided
redactsetting over the plugin’sredactpreference. - Update Lua type definitions to document the new
redactfield.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/plugins/vfox_plugin.rs |
Propagates redact from vfox hook result into mise’s internal env response. |
src/config/env_directive/module.rs |
Applies redaction based on user override vs plugin preference when ingesting module env vars. |
src/config/env_directive/mod.rs |
Passes redact: Option<bool> through to module resolution (instead of forcing a default). |
crates/vfox/types/mise-plugin.lua |
Documents redact? in the MiseEnvResult Lua type. |
crates/vfox/src/hooks/mise_env.rs |
Adds redact to MiseEnvResult and parses it from Lua extended results. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // User's explicit redact setting takes priority, otherwise use plugin's preference | ||
| let should_redact = redact.unwrap_or(response.redact); | ||
| for (k, v) in response.env { | ||
| if redact { | ||
| if should_redact { |
There was a problem hiding this comment.
The override logic here depends on redact being populated from the user’s mise.toml, but module directives currently only extract tools into EnvDirectiveOptions (the redact key remains inside the plugin options table). As a result, redact will always be None for EnvDirective::Module, so users won’t be able to force redaction on/off or override a plugin’s redact=true preference as described. Consider parsing/removing a top-level redact boolean from the module’s TOML table (similar to tools) into EnvDirectiveOptions.redact, so redact = true/false works and correctly takes priority over the plugin’s preference.
| #[derive(Debug, Default)] | ||
| pub struct MiseEnvResult { | ||
| /// Environment variables to set | ||
| pub env: Vec<EnvKey>, | ||
| /// Whether this module's output can be cached | ||
| /// Defaults to false for backward compatibility | ||
| pub cacheable: bool, | ||
| /// Files to watch for cache invalidation | ||
| pub watch_files: Vec<PathBuf>, | ||
| /// Whether the plugin wants its env vars to be redacted | ||
| /// When true, mise will redact these values unless the user explicitly opts out | ||
| pub redact: bool, |
There was a problem hiding this comment.
Adding a new public field to MiseEnvResult is a breaking change for downstream crates that construct the struct with a literal or pattern-match it exhaustively. If vfox is intended to be a stable public API, consider marking MiseEnvResult as #[non_exhaustive] and/or providing constructors/accessors to avoid future breaking additions, and ensure the crate versioning/release notes reflect the breaking change.
| @@ -87,11 +91,20 @@ | |||
| )) | |||
| })? | |||
| .unwrap_or_default(); | |||
| let redact: bool = table | |||
| .get::<Option<bool>>("redact") | |||
| .map_err(|e| { | |||
| LuaError::RuntimeError(format!( | |||
| "Invalid 'redact' field in MiseEnv result: expected boolean. Error: {e}" | |||
| )) | |||
| })? | |||
| .unwrap_or(false); | |||
There was a problem hiding this comment.
There are unit tests for other hook result parsers in crates/vfox/src/hooks/ but none for MiseEnvResult::from_lua. Since this change adds new parsing logic and error messaging for the redact field (and alters extended-format detection), please add tests covering: default redact=false when omitted, redact=true when provided, and invalid types producing the expected runtime error.
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.13 x -- echo |
23.9 ± 0.5 | 23.2 | 29.0 | 1.00 |
mise x -- echo |
24.0 ± 0.4 | 23.4 | 26.7 | 1.01 ± 0.03 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.13 env |
23.6 ± 0.8 | 22.8 | 30.3 | 1.00 |
mise env |
24.0 ± 0.9 | 23.0 | 30.3 | 1.02 ± 0.05 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.13 hook-env |
24.4 ± 0.5 | 23.4 | 26.6 | 1.01 ± 0.03 |
mise hook-env |
24.3 ± 0.4 | 23.6 | 29.1 | 1.00 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.13 ls |
22.3 ± 0.3 | 21.7 | 23.9 | 1.00 |
mise ls |
22.5 ± 0.3 | 21.7 | 24.2 | 1.01 ± 0.02 |
xtasks/test/perf
| Command | mise-2026.2.13 | mise | Variance |
|---|---|---|---|
| install (cached) | 129ms | 128ms | +0% |
| ls (cached) | 80ms | 79ms | +1% |
| bin-paths (cached) | 84ms | 82ms | +2% |
| task-ls (cached) | 808ms | 827ms | -2% |
### 🚀 Features - **(vfox)** allow plugins to request env var redaction via MiseEnvResult by @jdx in [#8166](#8166) - add a default_host setting for rust by @aacebedo in [#8154](#8154) - add github_content package support for aqua backend by @risu729 in [#8147](#8147) - support devEngines.runtime in deno by @risu729 in [#8144](#8144) ### 🐛 Bug Fixes - **(asset_matcher)** penalize vsix files by @risu729 in [#8151](#8151) - **(edit)** strip formatting whitespace from TOML values in `mise edit` by @jdx in [#8162](#8162) - **(install)** improve --locked support for python and ubi backends by @jdx in [#8163](#8163) - **(npm)** suppress npm update notifier while npm install by @risu729 in [#8152](#8152) - **(schema)** add task_templates, extends, and timeout by @risu729 in [#8145](#8145) ### 🚜 Refactor - **(registry)** remove [key=value] options syntax from backends by @risu729 in [#8146](#8146) ### 📚 Documentation - **(settings)** remove wrong tip for github_attestations by @risu729 in [#8158](#8158) ### Chore - **(release-plz)** delete embedded plugins directory before update by @risu729 in [#8149](#8149) - adds necessary env var to the mcp help message in cli by @joaommartins in [#8133](#8133) ### New Contributors - @joaommartins made their first contribution in [#8133](#8133) ## 📦 Aqua Registry Updates #### New Packages (5) - [`containers/podlet`](https://github.com/containers/podlet) - [`hickford/git-credential-azure`](https://github.com/hickford/git-credential-azure) - [`hickford/git-credential-oauth`](https://github.com/hickford/git-credential-oauth) - [`kovetskiy/mark`](https://github.com/kovetskiy/mark) - [`openbao/openbao/bao`](https://github.com/openbao/openbao/bao)
### 🚀 Features - **(vfox)** allow plugins to request env var redaction via MiseEnvResult by @jdx in [jdx#8166](jdx#8166) - add a default_host setting for rust by @aacebedo in [jdx#8154](jdx#8154) - add github_content package support for aqua backend by @risu729 in [jdx#8147](jdx#8147) - support devEngines.runtime in deno by @risu729 in [jdx#8144](jdx#8144) ### 🐛 Bug Fixes - **(asset_matcher)** penalize vsix files by @risu729 in [jdx#8151](jdx#8151) - **(edit)** strip formatting whitespace from TOML values in `mise edit` by @jdx in [jdx#8162](jdx#8162) - **(install)** improve --locked support for python and ubi backends by @jdx in [jdx#8163](jdx#8163) - **(npm)** suppress npm update notifier while npm install by @risu729 in [jdx#8152](jdx#8152) - **(schema)** add task_templates, extends, and timeout by @risu729 in [jdx#8145](jdx#8145) ### 🚜 Refactor - **(registry)** remove [key=value] options syntax from backends by @risu729 in [jdx#8146](jdx#8146) ### 📚 Documentation - **(settings)** remove wrong tip for github_attestations by @risu729 in [jdx#8158](jdx#8158) ### Chore - **(release-plz)** delete embedded plugins directory before update by @risu729 in [jdx#8149](jdx#8149) - adds necessary env var to the mcp help message in cli by @joaommartins in [jdx#8133](jdx#8133) ### New Contributors - @joaommartins made their first contribution in [jdx#8133](jdx#8133) ## 📦 Aqua Registry Updates #### New Packages (5) - [`containers/podlet`](https://github.com/containers/podlet) - [`hickford/git-credential-azure`](https://github.com/hickford/git-credential-azure) - [`hickford/git-credential-oauth`](https://github.com/hickford/git-credential-oauth) - [`kovetskiy/mark`](https://github.com/kovetskiy/mark) - [`openbao/openbao/bao`](https://github.com/openbao/openbao/bao)
## Summary - Sets `redact = true` in the `MiseEnv` hook response so fnox secrets are automatically redacted in mise output - fnox secrets are sensitive by definition, so this should be the default behavior - Users can still override with `redact = false` in their `mise.toml` module config Depends on jdx/mise#8166 for the `redact` field to be recognized by mise. Closes jdx/fnox#280 ## Test plan - [ ] Verify fnox env vars are redacted in `mise env` output after updating both mise and this plugin - [ ] Verify user can override with `[env._.modules.fnox-env] redact = false` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
redactfield toMiseEnvResultthat plugins can return from theirMiseEnvhookredact = true, mise will automatically redact all env vars from that module unless the user explicitly setsredact = falsein theirmise.tomlredactsetting inmise.tomlalways takes priority over the plugin's preferenceThis enables secret-management plugins like
fnox-envto have their environment variables automatically redacted without requiring manual configuration.Closes jdx/fnox#280
Test plan
redact = truein mise.toml) still worksredact = truecauses env vars to be redacted by defaultredact = truewithredact = falsein mise.tomlredactdefault tofalse(backward compatible)🤖 Generated with Claude Code
Note
Medium Risk
Changes default redaction behavior for module-provided env vars, which can alter what users see in output and may mask values unexpectedly if plugins start setting
redact = true.Overview
Adds a new
redactboolean to vfoxMiseEnvResult/MiseEnvResponseand Lua type definitions, and extends Lua deserialization to accept it in the hook’s extended return format.Updates env module resolution so module redaction is decided as
mise.toml’s explicitredactoption when set, otherwise the plugin’sredactpreference; affected env keys are added to the global redaction list accordingly.Written by Cursor Bugbot for commit d0f4f86. This will update automatically on new commits. Configure here.