safe_run

safe_run is a skill for Claude Code, Codex from isLinXu/crablet. It costs 11 tokens per session (481 once invoked), scanned A, original, MIT.

A skill for running shell commands inside an isolated Docker container, a lightweight environment separated from the main computer.

In plain words
What is it for?
Use it to execute command-line tasks with limits on network access, memory, and CPU.
Why use it?
It reduces the risk that a command will affect the host system and disables network access by default.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to execute command-line tasks with limits on network access, memory, and CPU.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/islinxu/crablet/safe_run
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 isLinXu/crablet --skill safe_run
Clone the repo
git clone --depth 1 https://github.com/isLinXu/crablet

Made for: Claude Code, Codex.

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 safe_run

README.md
[![agentmods](https://agentmods.dev/badge/skills/islinxu/crablet/safe_run/github.svg)](https://agentmods.dev/skills/islinxu/crablet/safe_run)
Your own site
<a href="https://agentmods.dev/skills/islinxu/crablet/safe_run"><img src="https://agentmods.dev/badge/skills/islinxu/crablet/safe_run/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 safe_run

Your own site · 80×15
<a href="https://agentmods.dev/skills/islinxu/crablet/safe_run"><img src="https://agentmods.dev/badge/skills/islinxu/crablet/safe_run.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 481 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 39
    Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.
    Fix: Pin the image: image:tag or image@sha256:abc123
How audits are shown
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.00011 $0.00481
Opus 5.5 $0.00004 $0.00192
Sonnet 5.5 $0.00002 $0.00096
Haiku 4.5 $0.00001 $0.00048

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

Security

Grade A, and why

safe_run scanned grade A with 1 finding 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 1mo 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.

Runs shell commandslowCapability

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

result = subprocess.run(
crablet/skills/safe_run/SKILL.md · 72 lines

What it actually says

Safe Run Skill

This skill executes shell commands inside an isolated Docker container to prevent harm to the host system.

Tools

run_command

Executes a command in a sandboxed environment.

  • command (string): The shell command to execute.

Implementation

import subprocess
import shlex

def run_command(command: str) -> str:
    """
    Executes a command inside an ephemeral Docker container (alpine).
    The container is removed immediately after execution (--rm).
    Network access is disabled by default (--network none) for security,
    unless explicitly needed (can be configured).
    """
    
    # Security: Use shlex to quote the user command to prevent injection outside the container command
    # However, since we are passing the whole string to /bin/sh -c inside docker, 
    # we need to be careful. Ideally we pass it as a single argument.
    
    # Docker command structure:
    # docker run --rm --network none alpine /bin/sh -c "command"
    
    docker_cmd = [
        "docker", "run", "--rm",
        "--network", "none",  # Disable network for SSRF prevention
        "--memory", "128m",   # Limit memory
        "--cpus", "0.5",      # Limit CPU
        "alpine:latest",      # Use lightweight image
        "/bin/sh", "-c", command
    ]
    
    try:
        # Run docker command
        result = subprocess.run(
            docker_cmd,
            capture_output=True,
            text=True,
            timeout=30 # Hard timeout of 30 seconds
        )
        
        if result.returncode != 0:
            return f"Error (Exit Code {result.returncode}):\n{result.stderr}"
            
        return result.stdout if result.stdout else "(No output)"
        
    except subprocess.TimeoutExpired:
        return "Error: Command execution timed out (30s limit)."
    except Exception as e:
        return f"System Error: {str(e)}"

# Register the tool
register_tool("run_command", run_command)
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. 1mo ago First seen · 72 lines · 11 tokens per session scan A bbbae963c740

Subscribe to this mod's changes

safe_run is a skill published in the GitHub repository isLinXu/crablet (55 stars, last pushed 1mo ago), licensed MIT. It adds 11 tokens to every session and 481 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

hardening-docker-containers-for-production

Hardening Docker containers for production involves applying security best practices aligned with CIS Docker Benchmark v1.8.0 to minimize attack surface, prevent privilege escalation, and enforce leas.

xalgorix/xalgorix · 43 tokens

scanning-docker-images-with-trivy

Trivy is a comprehensive open-source vulnerability scanner by Aqua Security that detects vulnerabilities in OS packages, language-specific dependencies, misconfigurations, secrets, and license violati.

xalgorix/xalgorix · 42 tokens

implementing-container-image-minimal-base-with-distroless

Reduce container attack surface by building application images on Google distroless base images that contain only the application runtime with no shell, package manager, or unnecessary OS utilities.

xalgorix/xalgorix · 45 tokens

performing-docker-bench-security-assessment

Docker Bench for Security is an open-source script that checks dozens of common best practices around deploying Docker containers in production. Based on the CIS Docker Benchmark, it audits host confi.

xalgorix/xalgorix · 44 tokens

release-ota-promote

Publish signed Electron UI/daemon bundles to a local OTA feed with atomic manifest switch and digest readback, while dry-running the K8s drainrespawn rollout. Prod is refused before writes; feed publication is not client apply.

Prismer-AI/PrismerCloud · 52 tokens

ecspresso

ECS deployment tool - deploy, manage, and troubleshoot ECS services.

kayac/ecspresso · 17 tokens