feat(agent): add hardened MCP toolchain shims with config isolation

Add hermit-managed shim scripts for uv/uvx/npx/node that provide
config-isolated toolchain execution for MCP servers, preventing
ambient system toolchains from leaking user config into agent
processes.

Security hardening:
- Private mktemp temp dir with cleanup trap (no predictable paths)
- Lock mutual exclusion via kill-0 + /proc start-time verification
- Atomic bootstrap recovery (staged download + validated mv)
- Desktop fail-loud validation of shim resources before env export

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This commit is contained in:
Will Pfleger
2026-07-15 18:32:06 -04:00
parent 8212a87231
commit debff9f3d8
14 changed files with 1537 additions and 12 deletions

View File

@@ -121,7 +121,9 @@ const overrides = new Map([
// record_provider param + applies persona_field_with_record_fallback. +5 lines.
// global-agent-config: spawn_agent_child loads global config and merges as
// lowest env layer (+8 lines). Queued to split.
["src-tauri/src/managed_agents/runtime.rs", 2216],
// mcp-toolchain-shims: validate_shim_resources + hardened shim env setup.
// mesh-llm: relay mesh env derivation at spawn time (+12 lines from main).
["src-tauri/src/managed_agents/runtime.rs", 2228],
// config-bridge setup-payload env-boundary fix adds readiness wiring in
// spawn_agent_child; load-bearing security fix, queued to split.
["src-tauri/src/managed_agents/config_bridge/reader.rs", 1016],