untrusted-code-safety
БесплатноБез исполняемых скриптовНе проверенZero-trust procedure for reviewing or running code from an unknown source. Use when reviewing, vetting, cloning, installing, or running code from an untrusted…
от j3ffyang341 установка в других каталогахОб этом скилле
Untrusted code safety
A zero-trust procedure for handling code you do not control. It records the standing contract the user requires, then the workflow to honor it. When in doubt, stop and ask — never assume.
Standing contract (hard boundaries — never cross)
/tmpis the only workspace for untrusted code. Never let it read, collect, or send data from this machine outside/tmp.- Never read the user's personal files outside the sandbox — their code, API keys, credentials, SSH/GPG keys, wallets, or browser sessions.
- Never trust code from an unknown source. A repo invite, a polished README, a long commit history, a familiar package name — none of it is a vouch.
- Delete every test clone and artifact when done.
STOP + RAISE HANDS immediately
Halt the run, do not continue, and report to the user at once (with what was attempted, the path/target, and the evidence) if any executed code:
- reads the filesystem outside
/tmp(or outside the declared sandbox); - touches sensitive data —
process.env, API keys, tokens, credentials, SSH/Git config, wallets; - collects or sends any local data off the machine;
- spawns child processes or opens network connections that were not explicitly authorized;
- shows any malicious, harmful, deceptive, cheating, or stealing behavior.
Raising hands is not a status update — it is a hard stop. Do not "finish the run first". Do not bury it. Surface it in the next message.
Confirm first when unsure
If the sandbox boundary, the intent, or the safety of an action is unclear, ask the user before proceeding. A wrong assumption here is expensive.
Default: do not execute. Static triage is usually enough. Escalate to a sandboxed run only when the question cannot be answered statically, and get the user's explicit go-ahead before any Level-2 execution (step 3 below).
Procedure
- Detect (static, no execution). Decide as much as possible from metadata and text; most verdicts need no run.
- Sensitivity. Inventory what a process running as the user could reach before running anything.
- Contain. Execute only inside stacked isolation if execution is truly needed.
- Instrument. Make the harness log and block
fs/env/network/child-process reach and scream on violations. - Decide. Static + contained evidence → verdict; never execute at "trust level 3".
- Clean up. Remove clones/artifacts; report to the platform if malicious.
Trust ladder (escalate only with reason)
| Level | Action | Safe on daily driver? |
|---|---|---|
| 0 | Metadata only (gh api, git log, sizes, dates) |
yes |
| 1 | Read/triage files as plain text (no build, no eval) | yes |
| 2 | Execute in a throwaway sandbox: no network, no secrets, cleared env, non-root, fs allowlist | contained |
| 3 | Execute with host mounts / credentials / network | never for untrusted code |
Detection commands
git log --format='%h %ad %an <%ae> %s' --date=iso | head -40
git shortlog -sne
find . -type f -not -path './.git/*' -size +500k -printf '%s\t%p\n' | sort -rn
rg -l --hidden -g '!**/node_modules/**' 'eval\(|Function\(|atob\(|Buffer\.from\(|fromCharCode'
rg -n '(pre|post)?(install|prepare|pack|publish)' package.json **/package.json 2>/dev/null
rg -n 'require\(|import ' tailwind.config.js postcss.config.js babel.config.js webpack.config.js config-overrides.js 2>/dev/null
rg -n 'child_process|execSync|spawn|process\.env|os\.homedir|\.ssh|id_rsa|wallet|mnemonic|privateKey' -g '!**/node_modules/**'
npm view <pkg> repository dist.tarball time.modified
Other tells: a single giant line, rotated string arrays, hex/base64 blobs,
--no-save, npm install inside build scripts, curl|sh, config files that
require code, and lifecycle hooks (preinstall/install/postinstall/prepare).
Defang before you sandbox
- Prefer
npm ci --ignore-scripts(ornpm install --ignore-scripts) — lifecycle hooks never run, for any untrusted dependency tree. npm config set ignore-scripts truefor the session, andgit config --global core.hooksPath /dev/nullto neutralize repo hooks.- Run with a scrubbed environment and a throwaway
HOME; never install with real credentials in scope.
Provenance (earn trust, don't assume it)
sha256sum <file>and compare against a trusted source.git verify-commit <sha>orgit log --show-signaturefor signed history.npm audit signaturesfor registry provenance/attestations.gh attestation verify <artifact> --repo <owner>/<repo>for GitHub build attestations.- Pin versions and review any lockfile change with
git diff.
Containment recipe (Linux, unprivileged)
Create the work dir first (mkdir -p /tmp/opencode/sbx/work), and adjust /usr, /bin, /lib*, and /etc/ld.so.cache for the distro — these bind paths are glibc/Arch-shaped.
bwrap --unshare-all --die-with-parent --new-session \
--ro-bind /usr /usr --ro-bind /bin /bin --ro-bind /lib
Установить untrusted-code-safety в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл untrusted-code-safety?
Zero-trust procedure for reviewing or running code from an unknown source. Use when reviewing, vetting, cloning, installing, or running code from an untrusted source (repo invites, packages, scripts, executable config files), when asked whether code is safe or hazardous, when executed code may read secrets/files or reach the network, and when the user says "raise hands", "stop and alert", or "sandbox it". Also trigger on suspicion of malicious, harmful, deceptive, cheating, or stealing behavior.
Как установить скилл untrusted-code-safety?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл untrusted-code-safety запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic