fix(env): redact secrets in mise set listing and task-specific env#8583
fix(env): redact secrets in mise set listing and task-specific env#8583
mise set listing and task-specific env#8583Conversation
Summary of ChangesHello, 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 significantly improves the handling of sensitive information within 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 addresses secret redaction in two key areas. First, it introduces redaction for mise set output, with a --no-redact flag to bypass it. Second, it ensures that task-specific redaction patterns are correctly registered with the global redactor, fixing an issue where secrets could be exposed in task outputs. The implementation looks solid, with corresponding updates to documentation and CLI definitions. I have no specific comments on the changes.
Greptile SummaryThis PR fixes two related redaction gaps: Key changes:
One gap to address: When Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[mise set no-args] --> B[list_all]
B --> D{no_redact flag?}
D -->|false| E[config.env_results primes global redactor]
E --> F{--file or -E flag?}
F -->|yes| G[rows_from_directives\nhandles redact=true and Age inline\nNOTE: glob patterns miss external-file vars]
F -->|no default path| H[env_with_sources returns resolved values]
G --> I[config.redact applies registered patterns to each row]
H --> I
I --> J[Print redacted table]
D -->|true no-redact| K[Return raw rows without redaction]
K --> J
L[mise run task] --> M{task_cf present?}
M -->|complex path| O[TaskContextBuilder\nresolve_task_env_with_config]
O --> P[add_redactions: config redact=true keys vs config env]
P --> Q[add_redactions: config glob patterns + task redact=true keys vs full env]
M -->|simple or no task_cf| R[task.render_env in mod.rs]
R --> S[add_redactions: config glob patterns + task redact=true keys vs task_env_map]
Q --> T[Execute task - global redactor protects all output]
S --> T
|
- `mise set` (no args) now redacts values marked with `redact = true` or matching `redactions` patterns. Use `--no-redact` to show raw values. - Eagerly load env_results before listing so redactions work with `--file` and `-E` flags too. - Register task-specific env redactions (e.g. from `env._.file` in tasks) with the global redactor so they are properly redacted in task output. - Also apply config-level `redactions` patterns against task-specific env vars in both render_env and TaskContextBuilder paths. - Add e2e tests for `mise set` redaction and task-specific env redaction. Closes #5368 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5186e85 to
22f0a6b
Compare
|
bugbot run |
When --file or -E points to a file outside the loaded config hierarchy, the global redactor has no knowledge of its secrets. Fix by checking the EnvDirectiveOptions.redact field directly when building rows from directives, so redaction works regardless of whether the file is in the config hierarchy. Also always redact Age-encrypted values in directive-based listings since they are inherently secret. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.3.8 x -- echo |
23.2 ± 0.2 | 22.6 | 24.4 | 1.00 |
mise x -- echo |
23.7 ± 0.4 | 23.1 | 28.5 | 1.02 ± 0.02 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.3.8 env |
22.7 ± 0.4 | 22.0 | 26.4 | 1.00 |
mise env |
23.2 ± 0.3 | 22.6 | 26.9 | 1.02 ± 0.02 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.3.8 hook-env |
23.4 ± 0.3 | 22.8 | 25.5 | 1.00 |
mise hook-env |
23.8 ± 0.3 | 23.2 | 25.8 | 1.02 ± 0.02 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.3.8 ls |
22.7 ± 0.3 | 22.1 | 24.2 | 1.00 |
mise ls |
23.0 ± 0.2 | 22.5 | 24.3 | 1.02 ± 0.02 |
xtasks/test/perf
| Command | mise-2026.3.8 | mise | Variance |
|---|---|---|---|
| install (cached) | 150ms | 150ms | +0% |
| ls (cached) | 82ms | 82ms | +0% |
| bin-paths (cached) | 85ms | 85ms | +0% |
| task-ls (cached) | 837ms | 815ms | +2% |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Age directives default to redacting for security (matching env resolution behavior), but now correctly skip redaction when the user explicitly sets redact=false on an age directive. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
### 🚀 Features - **(github)** use release latest endpoint to get latest release by @roele in [#8516](#8516) - **(install)** add shared and system install directories by @jdx in [#8581](#8581) - **(vfox)** add provenance metadata to lockfile for tool plugins by @malept in [#8544](#8544) ### 🐛 Bug Fixes - **(aqua)** expose main binary when files field is empty and symlink_bins is enabled by @AlexanderTheGrey in [#8550](#8550) - **(env)** redact secrets in `mise set` listing and task-specific env by @jdx in [#8583](#8583) - **(prepare)** install config tools before running prepare steps by @jdx in [#8582](#8582) - **(task)** allow ctrl-c to interrupt tool downloads during `mise run` by @jdx in [#8571](#8571) - **(tasks)** add file task header parser support for spaces around = by @roele in [#8574](#8574) ### 📚 Documentation - **(task)** add property description for interactive by @roele in [#8562](#8562) - add missing `</bold>` closing tag by @muzimuzhi in [#8564](#8564) - rebrand site with new chef logo and warm culinary palette by @jdx in [#8587](#8587) ### 📦️ Dependency Updates - update ghcr.io/jdx/mise:alpine docker digest to de4657e by @renovate[bot] in [#8577](#8577) - update ghcr.io/jdx/mise:copr docker digest to eef29a2 by @renovate[bot] in [#8578](#8578) - update ghcr.io/jdx/mise:rpm docker digest to 5a96587 by @renovate[bot] in [#8580](#8580) - update ghcr.io/jdx/mise:deb docker digest to 464cf7c by @renovate[bot] in [#8579](#8579) ### 📦 Registry - fix flatc version test mismatch by @jdx in [#8588](#8588) ### Chore - **(registry)** skip spark test-tool by @jdx in [#8572](#8572) ### New Contributors - @AlexanderTheGrey made their first contribution in [#8550](#8550) ## 📦 Aqua Registry Updates #### New Packages (6) - [`bahdotsh/mdterm`](https://github.com/bahdotsh/mdterm) - [`callumalpass/mdbase-lsp`](https://github.com/callumalpass/mdbase-lsp) - [`facebook/ktfmt`](https://github.com/facebook/ktfmt) - [`gurgeous/tennis`](https://github.com/gurgeous/tennis) - [`tektoncd/pipelines-as-code`](https://github.com/tektoncd/pipelines-as-code) - [`weedonandscott/trolley`](https://github.com/weedonandscott/trolley) #### Updated Packages (2) - [`apple/container`](https://github.com/apple/container) - [`cocogitto/cocogitto`](https://github.com/cocogitto/cocogitto)
…dx#8583) ## Summary - `mise set` (no args) now redacts values marked with `redact = true` or matching `redactions` patterns in the listing output. Added `--no-redact` flag to show raw values when needed. - Task-specific env redactions (e.g. from `env._.file` or `redact = true` in `[tasks.*.env]`) are now registered with the global redactor, fixing redaction in task output. Closes jdx#5368 ## Test plan - [ ] Verify `mise set` redacts values for env vars with `redact = true` - [ ] Verify `mise set --no-redact` shows raw values - [ ] Verify task-specific `env._.file` with `redactions` patterns are properly redacted in task output - [ ] Verify existing `cargo test` passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes how environment values are displayed and how redaction patterns are registered, which could unintentionally hide/show values in CLI/task output. Core execution paths are mostly unchanged but touch global redactor behavior in tasks. > > **Overview** > **Redacts secret env values in `mise set` output by default** when listing variables, covering `redact = true`, age-encrypted entries (default redacted), and config-level `redactions` patterns; adds `--no-redact` to show raw values. > > **Fixes task output redaction for task-scoped env vars** by registering redactions resolved from task context (including `env._.file` and task-level `redactions`) with the global redactor so secrets are consistently masked in `mise run` output. > > Docs/man/usage specs and shell completion metadata are updated, and new e2e tests cover the redaction/override behavior for both `mise set` and tasks. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 860282a. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
### 🚀 Features - **(github)** use release latest endpoint to get latest release by @roele in [jdx#8516](jdx#8516) - **(install)** add shared and system install directories by @jdx in [jdx#8581](jdx#8581) - **(vfox)** add provenance metadata to lockfile for tool plugins by @malept in [jdx#8544](jdx#8544) ### 🐛 Bug Fixes - **(aqua)** expose main binary when files field is empty and symlink_bins is enabled by @AlexanderTheGrey in [jdx#8550](jdx#8550) - **(env)** redact secrets in `mise set` listing and task-specific env by @jdx in [jdx#8583](jdx#8583) - **(prepare)** install config tools before running prepare steps by @jdx in [jdx#8582](jdx#8582) - **(task)** allow ctrl-c to interrupt tool downloads during `mise run` by @jdx in [jdx#8571](jdx#8571) - **(tasks)** add file task header parser support for spaces around = by @roele in [jdx#8574](jdx#8574) ### 📚 Documentation - **(task)** add property description for interactive by @roele in [jdx#8562](jdx#8562) - add missing `</bold>` closing tag by @muzimuzhi in [jdx#8564](jdx#8564) - rebrand site with new chef logo and warm culinary palette by @jdx in [jdx#8587](jdx#8587) ### 📦️ Dependency Updates - update ghcr.io/jdx/mise:alpine docker digest to de4657e by @renovate[bot] in [jdx#8577](jdx#8577) - update ghcr.io/jdx/mise:copr docker digest to eef29a2 by @renovate[bot] in [jdx#8578](jdx#8578) - update ghcr.io/jdx/mise:rpm docker digest to 5a96587 by @renovate[bot] in [jdx#8580](jdx#8580) - update ghcr.io/jdx/mise:deb docker digest to 464cf7c by @renovate[bot] in [jdx#8579](jdx#8579) ### 📦 Registry - fix flatc version test mismatch by @jdx in [jdx#8588](jdx#8588) ### Chore - **(registry)** skip spark test-tool by @jdx in [jdx#8572](jdx#8572) ### New Contributors - @AlexanderTheGrey made their first contribution in [jdx#8550](jdx#8550) ## 📦 Aqua Registry Updates #### New Packages (6) - [`bahdotsh/mdterm`](https://github.com/bahdotsh/mdterm) - [`callumalpass/mdbase-lsp`](https://github.com/callumalpass/mdbase-lsp) - [`facebook/ktfmt`](https://github.com/facebook/ktfmt) - [`gurgeous/tennis`](https://github.com/gurgeous/tennis) - [`tektoncd/pipelines-as-code`](https://github.com/tektoncd/pipelines-as-code) - [`weedonandscott/trolley`](https://github.com/weedonandscott/trolley) #### Updated Packages (2) - [`apple/container`](https://github.com/apple/container) - [`cocogitto/cocogitto`](https://github.com/cocogitto/cocogitto)

Summary
mise set(no args) now redacts values marked withredact = trueor matchingredactionspatterns in the listing output. Added--no-redactflag to show raw values when needed.env._.fileorredact = truein[tasks.*.env]) are now registered with the global redactor, fixing redaction in task output.Closes #5368
Test plan
mise setredacts values for env vars withredact = truemise set --no-redactshows raw valuesenv._.filewithredactionspatterns are properly redacted in task outputcargo testpasses🤖 Generated with Claude Code
Note
Medium Risk
Changes how environment values are displayed and how redaction patterns are registered, which could unintentionally hide/show values in CLI/task output. Core execution paths are mostly unchanged but touch global redactor behavior in tasks.
Overview
Redacts secret env values in
mise setoutput by default when listing variables, coveringredact = true, age-encrypted entries (default redacted), and config-levelredactionspatterns; adds--no-redactto show raw values.Fixes task output redaction for task-scoped env vars by registering redactions resolved from task context (including
env._.fileand task-levelredactions) with the global redactor so secrets are consistently masked inmise runoutput.Docs/man/usage specs and shell completion metadata are updated, and new e2e tests cover the redaction/override behavior for both
mise setand tasks.Written by Cursor Bugbot for commit 860282a. This will update automatically on new commits. Configure here.