# Install AgentShield

Use this reference only when the user explicitly asks to install AgentShield or its Agent Skill.

## Preferred: npm / npx

Install the complete local product and all supported Agent Skill targets:

```sh
npx @bitslabsec/agentshield setup --target all
```

Install or refresh only the Skill:

```sh
npx @bitslabsec/agentshield skill install --target all
```

Use `--target codex`, `--target claude`, or `--target agents` only when the user named one runtime. The installer verifies `SKILL.md`, `references/api.md`, and `scripts/agentshield.mjs` before reporting success.

## Manual Skill installation over HTTPS

Canonical base URL:

```text
https://agentshield.bitslab.xyz/skills/use-agentshield/
```

Choose the destination for the user's Agent runtime:

- Codex: `~/.codex/skills/use-agentshield`
- Claude Code: `~/.claude/skills/use-agentshield`
- Compatible Agents: `~/.agents/skills/use-agentshield`

### macOS or Linux

The example below installs for Codex. Change only `target` for another runtime.

```sh
base="https://agentshield.bitslab.xyz/skills/use-agentshield"
target="${HOME}/.codex/skills/use-agentshield"
mkdir -p "$target/references" "$target/scripts" "$target/agents"
curl -fL "$base/SKILL.md" -o "$target/SKILL.md"
curl -fL "$base/references/install.md" -o "$target/references/install.md"
curl -fL "$base/references/api.md" -o "$target/references/api.md"
curl -fL "$base/scripts/agentshield.mjs" -o "$target/scripts/agentshield.mjs"
curl -fL "$base/agents/openai.yaml" -o "$target/agents/openai.yaml"
```

### Windows PowerShell

The example below installs for Codex. Change only `$target` for another runtime.

```powershell
$base = "https://agentshield.bitslab.xyz/skills/use-agentshield"
$target = Join-Path $env:USERPROFILE ".codex\skills\use-agentshield"
New-Item -ItemType Directory -Force -Path $target, "$target\references", "$target\scripts", "$target\agents" | Out-Null
Invoke-WebRequest "$base/SKILL.md" -OutFile "$target\SKILL.md"
Invoke-WebRequest "$base/references/install.md" -OutFile "$target\references\install.md"
Invoke-WebRequest "$base/references/api.md" -OutFile "$target\references\api.md"
Invoke-WebRequest "$base/scripts/agentshield.mjs" -OutFile "$target\scripts\agentshield.mjs"
Invoke-WebRequest "$base/agents/openai.yaml" -OutFile "$target\agents\openai.yaml"
```

If the Agent runtime only discovers Skills at startup, ask the user to restart it after the files are installed.

## Source fallback for the full service

When npm is unavailable but Git and Go 1.25.8+ are installed, use the repository instructions at `https://github.com/BitsLabSec/AgentShield`. Build `./cmd/server`, run it on the loopback interface, then install the Skill with the manual method above. Do not download service binaries from an unverified mirror.

## Verify

For a full installation:

```sh
npx @bitslabsec/agentshield status
```

For a manual Skill installation, verify that all five files exist, then use the bundled helper after the AgentShield service has started:

```sh
node scripts/agentshield.mjs health
```

Do not request or handle the user's wallet mnemonic, private key, password, PIN, recovery share, or AgentShield data files during installation.
