/magpie-setup:isolated-setup-installfrom magpie-setup
Walks adopters through first-time install of secure agent setup (sandbox, approval, clean-environment layers) for Claude Code, Codex, Antigravity, Pi, or Goose. Interactive, never runs sudo or edits shell rc.
Ships in magpie-setup. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Golden rule — a step the sandbox blocks becomes a vetted operation, never a bypass. This holds for the whole run. When anything you need to do fails on a sandbox restriction (a blocked host or transport, a read-only path, a denied credential or socket):
vetted-op-read, vetted-op,
vetted-op-tracker, vetted-op-git), launched with the literal ~ path.
Publishing a change is covered end to end by vetted-op-git:
git-worktree-add, git-fetch, git-stage, git-commit,
git-push-branch, git-pr-create. Run the checks in the sandbox first
with vetted-op-checks (git-commit refuses what they did not pass),
and never hand those steps to the user as commands to paste./magpie-setup:upstream-fix for it: a
closed-shape vetted operation (fixed argv, validated parameters, destination
from the approved policy, no repository code or configuration steering it,
behind a confirmation) or a documented in-sandbox route. Opening that PR
needs the user's go-ahead, like any other publication.Use the operator's explicitly requested runtime when supplied; otherwise use the active session's runtime. An installed executable or configuration directory alone does not select a runtime. For the routing below, treat that selection as the active harness.
Determine the active harness from the session metadata and executable.
When it is Codex, Antigravity, Pi, Goose or Copilot CLI, follow that harness's paragraph in runtime-routing.md.
When the harness is Claude Code, continue below. If the harness cannot be determined from the session or executable, stop and report that; never guess and never prompt.
This skill is the on-ramp for adopters who do not yet have the
secure setup running: a thin walkthrough over the canonical install path in
docs/setup/secure-agent-setup.md,
which stays the authoritative content.
Before running its default behaviour, this skill consults
setup-isolated-setup-install.md in the personal layer
(.apache-magpie-local/ when the project adopted Magpie, falling back to the main checkout's in a linked worktree,
or <git-common-dir>/apache-magpie/ when Magpie is only installed; applied first, wins on conflict) and
.apache-magpie-overrides/setup-isolated-setup-install.md (committed, project-wide)
in the adopter repo, if present, and applies any agent-readable overrides it finds.
See docs/setup/agentic-overrides.md for the contract.
Hard rule: agents NEVER modify the snapshot under <adopter-repo>/.apache-magpie/.
Local modifications go in the override file; framework changes go via PR to apache/magpie.
Also at the top of every run, this skill compares the
gitignored .apache-magpie.local.lock (per-machine
fetch) against the committed .apache-magpie.lock
(the project pin). On mismatch the skill surfaces the
gap and proposes
setup update.
The proposal is non-blocking: the user may defer
and run with the local snapshot for now. See
docs/setup/install-recipes.md § Subsequent runs and drift detection
for the full flow.
Drift severity:
git-branch
local is behind upstream tip) → ⚠ sync needed.svn-zip SHA-512 mismatches the committed
anchor → ✗ security-flagged; investigate before
upgrading.sudo (apt / dnf installs, system-wide writes) is printed
for the user to copy-paste into their own terminal. The skill
never invokes sudo itself.~/.bashrc /
~/.zshrc modifications (sourcing agent-iso.sh, the optional
alias claude='claude-iso') are surfaced as the exact line to
add; the user pastes it themselves. The skill confirms the rc
file path with the user first; it does not assume..claude/settings.json or a
user-scope ~/.claude/settings.json, the skill diffs the
desired merge against the existing file and asks for explicit
approval before writing. The merge carries the framework's
permissions.allow set (the read-only reads: gh reads, the
vetted-ops read dispatcher, archive / mailbox / roster MCP reads,
registry WebFetch hosts) alongside deny and ask — leaving it
out makes every skill read prompt. Only read-only entries belong in
allow. Re-installs / partial-state recoveries
are common — the skill must not blow away an unrelated
pre-existing hook or permissions.ask rule.magpie-agent-guard plugin, never from
this merge. The plugin registers the PreToolUse hook and resolves
every bundled and skill-owned guard from its own root
(tools/agent-guard → Wiring).
When the installed plugin list lacks it, propose
/plugin install magpie-agent-guard@apache-magpie. Never copy
agent-guard.py or guards.d/ into ~/.claude/scripts/, and never
add a PreToolUse entry for it: beside the plugin that runs the
guard twice. A pre-plugin setup's copy and hook (Up-front
confirmation 3) are proposed for removal once the plugin is on.Before walking any install step, confirm with the user:
magpie clone, needed for
tools/agent-isolation/pinned-versions.toml, .claude/settings.json and
the tools/agent-isolation/*.sh scripts; without one, walk them through
git clone first.magpie-agent-guard plugin or a pre-plugin hooks.PreToolUse entry +
~/.claude/scripts/agent-guard.py, shell rc) before any merge so the user knows what is being
preserved vs replaced.~/.claude-config repo per
Syncing user-scope config across machines.
If yes, install the user-scope scripts as
sync-repo-scripts.md describes: symlinks into
the sync repo, with one exception that is always a plain copy.Follow the canonical step list at docs/setup/secure-agent-setup.md → Adopter setup → Via a Claude Code prompt. Each step there maps 1:1 to a step here: read the doc, follow it, and surface each sub-step with the user; the doc's names are the source of truth.
For the verification step at the end, hand off to
setup-isolated-setup-verify rather than re-walking the checklist.
@latest, enforce the floorclaude-code is not pinned to an exact version. Install it with
npm install -g --no-save @anthropic-ai/claude-code@latest (the
command in the doc's install list) — latest always carries the newest
permission-rule / sandbox / prompt-injection fixes. The manifest's
[tools.claude-code] table in
pinned-versions.toml
declares a min_version floor, not a pin. Apply the hard gate of
setup-isolated-setup-verify check 5: read the running
version (command claude --version, which skips an
alias claude=claude-iso) and, if it is below min_version,
hard-fail — stop the install, tell the operator to upgrade to
@latest, and have them re-run. The secure setup must not be stood up
on a below-floor runtime.
The harness drops the literal . from sandbox.filesystem.allowRead, so
the project root goes in the project-local settings.local.json as an
absolute path.
This step first asks per-project or whole-user scope; the whole-user answer
overrides git's hook lookup for every repository on the machine, so it
carries a disclosure the operator has to acknowledge.
Full procedure, both scopes and both whole-user flavours:
step-p-sandbox-allowlists.md.
Only applies when the adopter routes forge operations through the
vetted-ops dispatcher: the repo has
.apache-magpie-overrides/tools/vetted-ops/config.toml, the maintainer
keeps a personal <personal layer>/tools/vetted-ops/config.toml, or the
operator asks for the dispatcher to be wired now. Otherwise skip this step
as n/a and continue: a missing policy is never a blocker for this install.
Do not create a policy the project has not asked for.
Only with the sandbox on. The allow rules and sandbox exclusions
below are a permission bypass: they let the dispatcher run without a
prompt, and outside the sandbox. They are safe only because the sandbox
confines everything else. If the sandbox is not enabled for this
session (Step P declined, or sandbox.enabled is not true in the
scope being wired), skip this step, say so, and leave every vetted
operation behind its normal prompt.
Full procedure, including Step V.1 (read-only vetted ops never prompt)
and Step V.2 (the read-only gatherer agent, Claude Code):
step-v-vetted-ops.md.
Only when the magpie-adversarial-review plugin is installed; otherwise
skip this step and say so.
Full procedure: step-r-adversarial-review.md.
Nothing extra to write: the Step P helper adds the scratch root. After Step P,
show the operator the resulting additionalDirectories list and check it as
step-w-working-directories.md describes;
never ~/.claude/magpie or a parent of it in any scope.
Excluded uvx / uv run commands, uv-launched MCP servers, hooks and the
operator's terminal run uv-managed code outside the sandbox, so none of it may
come from a directory a sandboxed command can write.
Propose only what setup-isolated-setup-verify's checker (§ The checks)
reports as not pass in check 19 (19a–19e); 19b is usually unknown, since
the sandbox cannot read ~/.config/uv/uv.toml: read it with the file-reading
tool and apply check 19's rules,
as also with no checker.
~/.local/share/uv is read-only to the sandbox (19a). The Step P
helper drops an earlier version's write; propose removing any other.
The host installs Python 3.14 and magpie-python (launcher.md).
The host gets its own uv cache (19b). Stage ~/.config/uv/uv.toml with
cache-dir = "<resolved $HOME>/.local/share/uv-host/cache"
added, keeping the rest, and give the operator the copy command:
Edit(~/.config/uv/**) keeps the agent from writing it. Never ~ (uv does
not expand it there), nor a relative path.
The sandbox cannot read that file. permissions.deny carries
Read(~/.config/uv/uv.toml) and Edit(~/.config/uv/**) (both in the
framework's .claude/settings.json, which Step 2 copies). Sandboxed
uv then keeps its default, writable cache.
Sandboxed prek gets its own home. The env entry is needed only where a
repository uses prek (a prek.toml, .pre-commit-config.yaml or
.pre-commit-config.yml, or a hook that runs it:
detection); the deny
is always kept, since the default home is per-user. The settings carry
"env": {"PREK_HOME": "~/.cache/prek-sandbox"} and permissions.deny
carries Edit(~/.cache/prek/**) (both in the framework's
.claude/settings.json): a terminal's git hooks run prek outside the
sandbox from ~/.cache/prek. The whole-user dispatcher (Step P) gives hooks
that Claude Code runs outside the sandbox a host-only home and cache root
too; if a repository sets its own core.hooksPath, propose unsetting it so
the dispatcher runs there.
Sandboxed pnpm gets its own home. permissions.deny always carries
Edit(~/.cache/pnpm/**) (in the framework's .claude/settings.json). Where a repository uses pnpm (a tracked
pnpm-lock.yaml or pnpm-workspace.yaml), propose its sandbox home as
step-u-pnpm.md describes; never where it does not.
Then hand the operator the doc's reinstall commands for a terminal, since
what the sandbox could write before may have been changed:
docs/setup/secure-agent-setup.md → Host-only uv state.
The rest of a working setup beyond the committed floor goes in
.claude/settings.local.json. Build and hand over that file exactly as
setup update → Reconcile the local agent settings
does: the MCP tools for families installed here but not adopted by the
project and, only when this project is the Magpie framework checkout,
its template (tools/agent-isolation/claude-settings.local.template.json).
Never stage that template into another project: it would widen that
project's sandbox beyond what its maintainers configured. An agent
cannot write that file, so stage it and give the user the copy command.
ASF network fragment selection: Follow
setup update → ASF network fragment selection
when building the proposed local settings. Select the reviewed ASF
fragment only for an explicitly declared ASF project. Preserve the
existing staged-copy and user-approval process. Never install ASF
network grants in user-scope settings or the shared gateway baseline.
None is needed for a working install; walk the one the operator asks
for: a hardware security key (K), the container gateway (L), the
eval-harness exclusion (M), or the exclusion for the third-party
roborev CLI (B) — offer B
unprompted when command -v roborev finds it.
Procedures: optional-steps.md.
Tell the operator what to look for in the footer, and what each state means; they see it on every render afterwards:
| Tag | Means |
|---|---|
[sandbox] green | sandboxed, and still prompting per command |
[sandbox-auto] yellow | sandboxed, not prompting per command — auto-allow; wider blast radius, which is why it is not green |
[NO SANDBOX] bold red | not sandboxed; the state this install exists to make impossible to miss |
Point the operator at the captures in What a session looks like.
Say two counter-intuitive things explicitly:
Suggest two follow-up routines the user can wire later:
setup-isolated-setup-verify — re-run after every Claude Code upgrade
or settings-file edit, to confirm no denial silently turned into an allow.setup-isolated-setup-update — periodic check for framework updates,
pinned-tool upgrade candidates, and drift of the user-scope copies.
Every skill's pre-flight proposes it once the install is recorded (below):
after an upgrade that changes the secure-setup files, and weekly otherwise.Record the install so that pre-flight knows the isolated setup is used on this machine and what it was installed against:
PYTHONPATH="$HOME/.cache/apache-magpie/preflight" \
magpie-python -P -m setup_preflight.isolated record-update
It writes only the isolated_setup block of the personal layer's
reconciled.json. Skip it when the command cannot find setup_preflight:
say that /magpie-setup:setup config installs the checker, and that the
reminders start once it is there.
Check that the vetted-ops plugin is installed. magpie-vetted-ops
is part of the baseline (Step V's rules point at its dispatcher).
If the harness's plugin listing lacks it, propose
claude plugin install magpie-vetted-ops@apache-magpie
(codex plugin add magpie-vetted-ops@apache-magpie on Codex) and run it once the operator confirms.
Where the harness has no plugin CLI, print the command instead of running it.
Always propose shared-config sync once the install lands.
Whether or not the operator already has the ~/.claude-config sync repo,
offer setup-shared-config-sync as a follow-up, so the just-installed
config does not stay machine-local:
allowRead grant for
~/.claude-config/ (merge diff and ask, as for the other
user-scope grants), read-only, never write: without it the
sandboxed agent cannot inspect the repo at all. The commit and
push stay with the operator; see
docs/setup/secure-agent-setup.md → Letting a sandboxed agent help with the sync.Surface it as an offer for the operator to accept, not an auto-run — the sync skill has its own confirmation gates before it commits or pushes anything.
guards/lefthook_hooks_path.py (opens in a new tab)optional-steps.md (opens in a new tab)runtime-routing.md (opens in a new tab)step-c-cve-tool.md (opens in a new tab)step-p-sandbox-allowlists.md (opens in a new tab)step-r-adversarial-review.md (opens in a new tab)step-u-pnpm.md (opens in a new tab)step-v-vetted-ops.md (opens in a new tab)step-w-working-directories.md (opens in a new tab)sync-repo-scripts.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
When the user wants the secure setup installed for the first time, or is working in a fresh clone or on a new machine with no wiring yet. If it is already installed, use `setup-isolated-setup-verify` to check it or `setup-isolated-setup-update` to refresh it.
Three short reads, in order
agent-setup, sandbox-install, secure-setup, first-time-install
npx claudepluginhub apache/magpie --plugin magpie-setup12 skills in this plugin
/isolated-setup-doctorProbe the secure-agent setup for restrictions that block legitimate work — SSH agent reachability, port binding, containers, the scratch directory, the signing key, `gh` outside the sandbox, `prek` and `uv` inside it, the global git hook dir. Names the troubleshooting entry and settings fix for each. Read-only./isolated-setup-updateReport drift between the installed secure setup and the framework's current one — checkout, pinned tools, user-scope script copies, denial commands, MCP checkouts. Read-only: it surfaces diffs and the user decides./isolated-setup-verifyCheck the secure agent setup against its checklist and report done, missing or partial for each item, with the evidence — paths, command output, versions. Covers Claude Code, Codex, Antigravity, Pi, Goose and Copilot CLI. Read-only.Other plugins' skills for the same job