tool-sandboxing

tool-sandboxing is a skill for Claude Code from catpilotai/catpilot-ai-guardrails. It costs 50 tokens per session (1,571 once invoked), scanned E, original, MIT.

A set of safety rules for limiting an agent's shell, file, network, and external-action tools.

In plain words
What is it for?
Use it when building or running tools that execute commands, read or write files, access websites, deploy systems, send messages, or change databases.
Why use it?
It reduces the risk of commands escaping the workspace, accessing secrets, making unsafe network requests, or performing destructive actions without approval.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Codex; built for openclaw.

Part of the catpilot-guardrails plugin — 25 skills shipped together

Good fit Use it when building or running tools that execute commands, read or write files, access websites, deploy systems, send messages, or change databases.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/catpilotai/catpilot-ai-guardrails/tool-sandboxing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add catpilotai/catpilot-ai-guardrails --skill tool-sandboxing
Clone the repo
git clone --depth 1 https://github.com/catpilotai/catpilot-ai-guardrails

Made for: Claude Code.

Or install catpilot-guardrails, the plugin that ships this one along with the rest of its 25 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tool-sandboxing

README.md
[![agentmods](https://agentmods.dev/badge/skills/catpilotai/catpilot-ai-guardrails/tool-sandboxing/github.svg)](https://agentmods.dev/skills/catpilotai/catpilot-ai-guardrails/tool-sandboxing)
Your own site
<a href="https://agentmods.dev/skills/catpilotai/catpilot-ai-guardrails/tool-sandboxing"><img src="https://agentmods.dev/badge/skills/catpilotai/catpilot-ai-guardrails/tool-sandboxing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tool-sandboxing

Your own site · 80×15
<a href="https://agentmods.dev/skills/catpilotai/catpilot-ai-guardrails/tool-sandboxing"><img src="https://agentmods.dev/badge/skills/catpilotai/catpilot-ai-guardrails/tool-sandboxing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,571 The whole file, excluding the scripts and references it only reads on demand.
Security scan E 4 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00050 $0.01571
Opus 5.5 $0.00020 $0.00628
Sonnet 5.5 $0.00010 $0.00314
Haiku 4.5 $0.00005 $0.00157

Measured 10d ago against content hash ae423b432a1d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade E, and why

tool-sandboxing scanned grade E with 4 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

- Block access to credential and system paths (`~/.ssh`, `~/.aws`, `~/.gnupg`, `~/.kube`, `~/.config/gcloud`, `/etc/passwd`, `/etc/shadow`) even when a parent directory is allowed.

Cloud metadata endpointhighServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

- Resolve outbound HTTP hostnames via `socket.getaddrinfo` before connecting, reject private, loopback, link-local, reserved, and cloud metadata IPs (`169.254.169.254`, `metadata.google.internal`), and disable redirects

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

An agent harness that hands the model raw `subprocess.run(..., shell=True)`, `open(path)`, or `requests.get(url)` gives any prompt injection or reasoning mistake the full privileges of the host process. String-prefix che

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- Expose `subprocess.run(cmd, shell=True)` or unrestricted `open(path)` directly as an agent tool.
src/skills/agentic/tool-sandboxing/SKILL.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Baseline

Applies when: Defining, wrapping, or invoking agent tools for shell execution, filesystem reads/writes/deletes, outbound HTTP fetches, or external state changes (deployments, outbound messages, database writes).

Always:

  • Restrict shell tools to an explicit command allowlist with shell=False and an argv list; exclude commands with exec/eval flags (find -exec, awk, python -c).
  • Resolve every file path and non-flag shell argument with Path.resolve() and verify it lies inside an explicit workspace ALLOWED_DIRS set before reading or writing.
  • Block access to credential and system paths (~/.ssh, ~/.aws, ~/.gnupg, ~/.kube, ~/.config/gcloud, /etc/passwd, /etc/shadow) even when a parent directory is allowed.
  • Resolve outbound HTTP hostnames via socket.getaddrinfo before connecting, reject private, loopback, link-local, reserved, and cloud metadata IPs (169.254.169.254, metadata.google.internal), and disable redirects (allow_redirects=False).
  • Require explicit human approval ("yes") showing the exact action and parameters before any destructive, external-communication, or deployment tool call.
  • Wire deterministic runtime gates (hooks/harness/secret_gate.py, destructive_gate.py, network_gate.py, path_gate.py) at the tool boundary of Python harnesses.

Never:

  • Expose subprocess.run(cmd, shell=True) or unrestricted open(path) directly as an agent tool.
  • Rely on hostname prefix strings alone to block SSRF (127.0.0.1, ::1, 0.0.0.0, and DNS rebinding bypass string checks), or follow HTTP redirects on agent URL fetches.
  • Allow an agent tool to delete files, deploy services, or send external emails/messages without an explicit human confirmation gate.

Open the full component before acting: it has the examples, the remediation steps, and the detection patterns.

Why

An agent harness that hands the model raw subprocess.run(..., shell=True), open(path), or requests.get(url) gives any prompt injection or reasoning mistake the full privileges of the host process. String-prefix checks on paths or URLs routinely fail: symlinks and .. escape the working directory, DNS names resolve to internal RFC 1918 or link-local metadata addresses (169.254.169.254), and HTTP 302 redirects pivot a public URL into an internal service after the initial check.

Read the full file on GitHub · 138 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 138 lines · 50 tokens per session scan E ae423b432a1d

Subscribe to this mod's changes

tool-sandboxing is a skill published in the GitHub repository catpilotai/catpilot-ai-guardrails (2 stars, last pushed 8d ago), licensed MIT. It adds 50 tokens to every session and 1,571 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it E with 4 findings (reaches for credential files, cloud metadata endpoint, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-29.

Related

tool-sandboxing compared with skills from other repositories

tool-sandboxing next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tool-sandboxingcatpilotai/catpilot-ai-guardrailsSkill28d agoMITE50Claude Code
dcf-modelNousResearch/hermes-agentSkill262ktodayMITA14Claude Code, Codex
baoyu-article-illustratorNousResearch/hermes-agentSkill262ktodayMITA18Claude Code, Codex
flash-attentionNousResearch/hermes-agentSkill262ktodayMITA14Claude Code, Codex
subagent-driven-developmentNousResearch/hermes-agentSkill262ktodayMITA17Claude Code, Codex
mcporterNousResearch/hermes-agentSkill262ktodayMITA16Claude Code, Codex
mem0-vercel-ai-sdkmem0ai/mem0Skill69kyesterdayApache-2.0A146Claude Code, Codex