Repository navigation
feat(kits): add a built-in mise kit - #23
Merged
Merged
Conversation
A user-defined kit can use `{kit_state}` only in `env`; `read`/`write`
don't expand it. `expand_all` recorded the directory in `state_dirs`,
but only the launcher's anchor check reads that field. Nothing created
the directory or added it to the agent's write grants. So the documented
`BAZEL_OUTPUT_USER_ROOT = "{kit_state}/out"` example pointed the agent
at a directory it could neither create nor write.
The directory now goes into `write` too, like an isolated built-in's
subdirectories. That puts it through the same anchor and filtered-PATH
checks, and the launcher creates it with mode 0700.
Lets an `airlock run` agent use tool versions the user already installed with mise: the shims on PATH, the project's `[tools]` and `[env]`, and the global config. Without the kit, mise inside the sandbox can't read its installs or config at all. The kit reads mise's data, config and state dirs in both modes. It honors `MISE_*_DIR` and then `XDG_*_HOME`, as mise does. The two modes differ only in `MISE_CACHE_DIR`. Installs and shims are never writable because the user's shell runs them. The state dir isn't writable either: it holds `mise trust` decisions, and an agent that could write it could trust a hostile `mise.toml` that the user's shell then applies on `cd`. mise works with a read-only state dir. The only side effect is a "tracking config" warning for a project the user has never run mise in. Checked end to end with `airlock run --kit mise` on macOS: - Shims resolve, and `[env]` applies. - The isolated cache is writable. - Writes to installs, shims and state are denied, and so is `mise trust`. - Shared mode writes the real cache.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a built-in
misekit so anairlock runagent can use tool versions you've already installed with mise. It also fixes a bug in custom kits: the{kit_state}directory was never writable.mise kit
MISE_DATA_DIR(installs, shims, plugins)MISE_CONFIG_DIRMISE_STATE_DIRmise trustdecisions, and a writable one would let the agent trust a hostilemise.tomlMISE_CACHE_DIR{kit_state}/cache, shared: the real cacheEach path honors
MISE_*_DIR, thenXDG_*_HOME, then mise's defaults (on macOS the cache is~/Library/Caches/mise). The agent can'tmise installormise trust, so a project'smise.tomlworks for the agent only after you've trusted it yourself. SECURITY.md covers the risk of shared mode: the agent could poison cachedexec()template output.Fix: custom kits'
{kit_state}is now writable{kit_state}was expanded inenv, but the directory was neither created nor added to the agent's write grants. As a result, the README'sBAZEL_OUTPUT_USER_ROOT = "{kit_state}/out"example pointed the agent at a directory it couldn't write. The directory now goes intowrite, so it passes the same anchor checks as every other write path.Testing
cargo test < /dev/null(full suite, run outside the sandbox),cargo clippy --all-targetsandcargo fmt --checkall pass.MISE_*/XDG_*overrides, and a check that installs and state are never writable.airlock run --kit mise:[env]applies.mise trust.{kit_state}/outis writable.🤖 Generated with Claude Code