Skip to content
Back to skills

Isolated Setup Install

DSecurity

Walk an adopter through the first-time install of the secure agent setup (sandbox, approval and clean-environment layers) for Claude Code, Codex, Antigravity, Pi or Goose. Interactive throughout; never runs sudo, edits a shell rc, or overwrites settings on its own.

  • 161 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 24, 2026
securitypythongoshellbashgitsecurity

Works with

  • claude code
  • terminal
  • cli
  • mcp

Security analysis

D42/100
  • criticalModifies startup scripts or system services for persistence
  • criticalModifies startup scripts or system services for persistence
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 3 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add apache/magpie --skill isolated-setup-install --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Isolated Setup Install?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Isolated Setup Install
[![Security: D — Skills Directory](https://www.skillsdirectory.com/api/skills/apache-isolated-setup-install/badge)](https://www.skillsdirectory.com/skills/apache-isolated-setup-install)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
# SPDX-License-Identifier: Apache-2.0
# https://www.apache.org/licenses/LICENSE-2.0
name: isolated-setup-install
family: setup
mode: Meta
description: >-
  Walk an adopter through the first-time install of the secure agent
  setup (sandbox, approval and clean-environment layers) for Claude
  Code, Codex, Antigravity, Pi or Goose. Interactive throughout; never runs sudo,
  edits a shell rc, or overwrites settings on its own.
when_to_use: >-
  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.
capability: capability:platform
surface_hash: sha256:c311b3e3fb82c31d
license: Apache-2.0
measured_tokens: 5154
---

<!-- Placeholder convention (see AGENTS.md#placeholder-convention-used-in-skill-files):
     <project-config> → per file: the personal layer, else `.apache-magpie-overrides/`
     <tracker>        → value of `tracker_repo:` in <project-config>/project.md
     <upstream>       → value of `upstream_repo:` in <project-config>/project.md -->

# setup-isolated-setup-install

<!-- BEGIN MAGPIE BLOCK: sandbox-golden-rule — generated from tools/dev/blocks/sandbox-golden-rule.md -->

**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):

1. Never leave the sandbox for it: no sandbox-disabling flag, and no wider
   exclusion or allow rule proposed as the fix.
2. Look for a route that stays safe: a spelling the sandbox allows (fetch in
   the main checkout, rewrite history in a scratch clone), or a vetted
   operation that already covers it (`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.
3. If none exists, do the rest of the work, give the user the one command to
   run this time, and propose `/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.

<!-- END MAGPIE BLOCK: sandbox-golden-rule -->

## Runtime routing (run before the Claude-specific procedure)

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`](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`](../../../../docs/setup/secure-agent-setup.md),
which stays the authoritative content.

## Adopter overrides

<!-- BEGIN MAGPIE BLOCK: adopter-overrides — generated from tools/dev/blocks/adopter-overrides.md -->

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`](../../../../docs/setup/agentic-overrides.md) (committed, project-wide)
in the adopter repo, if present, and applies any agent-readable overrides it finds.
See [`docs/setup/agentic-overrides.md`](../../../../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`.

<!-- END MAGPIE BLOCK: adopter-overrides -->

---

## Snapshot drift

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`](../setup/update.md).
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](../../../../docs/quick-start/other-install-methods.md#subsequent-runs-and-drift-detection)
for the full flow.

Drift severity:

- **method or URL differ** → ✗ full re-install needed.
- **ref differs** (project bumped tag, or `git-branch`
  local is behind upstream tip) → ⚠ sync needed.
- **`svn-zip` SHA-512 mismatches the committed
  anchor** → ✗ security-flagged; investigate before
  upgrading.

---
## Golden rules

- **Do not auto-run privilege-elevating commands.** Anything that
  needs `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.
- **Do not edit shell rc files without approval.** `~/.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.
- **Do not overwrite an existing settings file silently.** If the
  user already has a project `.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.
- **The guard comes from the `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](../../../../tools/agent-guard/README.md#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.
- **Stop on the first failure.** If a step fails (manifest read
  fails, framework path wrong, an existing file conflicts in a way
  the user has not yet decided about), stop and report. Do not
  push past a failure to the next step.

## Up-front confirmations

Before walking any install step, confirm with the user:

1. **OS / distro.** macOS (Seatbelt built in, so no bubblewrap or socat),
   Ubuntu / Debian (apt), Fedora / RHEL (dnf), or Arch / NixOS / other;
   Linux installs both per the distro shortcut.
2. **Framework checkout path.** The local `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.
3. **Fresh install or re-install.** For a re-install on a partial
   existing state, the skill must enumerate the existing wiring
   (project settings.json, user settings.json, hooks dir, the
   `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.
4. **Sync repo (optional).** Whether the user maintains a
   private dotfile-style `~/.claude-config` repo per
   [Syncing user-scope config across machines](../../../../docs/setup/secure-agent-setup.md#syncing-user-scope-config-across-machines).
   If yes, install the user-scope scripts as
   [`sync-repo-scripts.md`](sync-repo-scripts.md) describes: symlinks into
   the sync repo, with one exception that is always a plain copy.

## Walk-through

Follow the canonical step list at
[docs/setup/secure-agent-setup.md → Adopter setup → Via a Claude Code prompt](../../../../docs/setup/secure-agent-setup.md#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.

### Agent harness — install `@latest`, enforce the floor

`claude-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`](../../../../tools/agent-isolation/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.

### Step P — Project-root coverage in the sandbox allowlists

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`](step-p-sandbox-allowlists.md).

### Step V — The vetted-ops split and exclusion

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`](step-v-vetted-ops.md).

### Step R — The adversarial-review exclusion

Only when the `magpie-adversarial-review` plugin is installed; otherwise
skip this step and say so.

**Full procedure:** [`step-r-adversarial-review.md`](step-r-adversarial-review.md).

### Step W — Working directories for the read block

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`](step-w-working-directories.md) describes;
**never `~/.claude/magpie`** or a parent of it in any scope.

### Step U — Host-only uv state

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](../isolated-setup-verify/manual-checks.md#check-19--host-only-uv-and-prek-state),
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`](../upgrade/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](../../../../tools/hook-manager/README.md#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`](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](../../../../docs/setup/secure-agent-setup.md#host-only-uv-state).

### Step T — Local agent settings

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](../setup/update.md#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](../setup/update.md#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.

### Steps K, L, M and B — optional extras

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](../../../../docs/setup/companion-skills.md#roborev) CLI (B) — offer B
unprompted when `command -v roborev` finds it.

**Procedures:** [`optional-steps.md`](optional-steps.md).

## After the install lands

**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*](../../../../docs/setup/secure-agent-setup.md#what-a-session-looks-like).

Say two counter-intuitive things explicitly:

- **The tag reads the settings files, not the running process.** A
  CLI flag that disables sandboxing mid-session is not visible here.
  Pair it with the bypass-warn hook, which fires per call.
- **Yellow is not a warning that something is broken.** Auto-allow is
  a deliberate, common choice; the colour distinguishes two postures
  rather than flagging a fault.

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:

```bash
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:

- With the sync repo in place, it commits and pushes what this install
  wired up (user-scope scripts, hooks, settings) for the other machines.
- Without one, it bootstraps it (clones the default private remote if it
  exists, or creates a fresh private remote and scaffolds the layout);
  say so, so a first-time operator knows what the follow-up does.
- Either way, propose the user-scope `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](../../../../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.

Files in this skill

  • SKILL.md15.6 KB
  • optional-steps.md13.6 KB
  • step-p-sandbox-allowlists.md18.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.