token-safety-checker
БесплатноЗапускает вложенные скриптыНе проверенFind and fix leaked API keys, tokens and passwords in your AI agent's config, long/short-term memory and session transcripts (OpenClaw + Claude Code). Use…
от maoisdamao1 228 установок в других каталогахОб этом скилле
Token Safety Checker 🔐 (tightlip)
Find leaked secrets in agent config, long-term memory, short-term memory and transcripts, migrate config secrets to env vars, and install a guard that stops new leaks. Everything runs locally with the Python standard library. No network calls.
Script: scripts/safeclaw.py inside this skill's folder.
Skill folder — OpenClaw: {baseDir} · Claude Code: ${CLAUDE_SKILL_DIR} (use whichever is an absolute path).
Below, SC means python3 <skill folder>/scripts/safeclaw.py.
Hard rules (secret hygiene)
- Never
cat,grep,heador otherwise open a file the scanner flagged, and never echo a secret. Doing so copies the secret into this conversation's transcript — a new leak. - Only show the user what the script prints: paths, line numbers, detector names, lengths,
sha256:fingerprints. These are safe. The script never prints secret values. - Never pass secret values on the command line.
migratereads them from disk itself. - Ask for explicit confirmation before
migrateorinstall-guard(they change files).
Pick the workflow
| User asks about… | Run |
|---|---|
| "check token safety", openclaw.json, OpenClaw setup | A. Config (OpenClaw only) |
| memory, MEMORY.md, CLAUDE.md, chat history, transcripts, "did I leak a key?" | B. Memory |
| "stop this from happening again", prevention | C. Guard |
| full audit | A + B (SC scan --memory), then offer C |
On Claude Code without OpenClaw, skip A — there is no openclaw.json.
A. Config secrets (OpenClaw openclaw.json)
- Scan:
SC scan(add--deepto also check git history of the config). Exit 0 = clean → report and stop. Exit 1 = findings. Exit 2 = no config found. Output:findings[]withpath,env_var,length,risk(🔴 HIGH / 🟡 MEDIUM / 🟢 LOW),fingerprint.checks.file_permissions(should be 600) andchecks.format(JSON5 configs can be scanned, not migrated). - Confirm: show a table
path | env_var | risk. Let the user rename env vars. Do not proceed without a yes. - Dry run:
SC migrate --findings '<findings JSON from step 1>' --dry-runand show the plan. - Migrate:
SC migrate --findings '<findings JSON>'It re-scans from disk, writes a timestamped backup created with mode 600 (openclaw.json.bak-<time>), appendsexportlines to a private secrets file (~/.openclaw/tightlip.env, mode 600 before any value is written; exact-name dedupe; refuses if a var exists with a different value), adds one line to the shell profile that loads that file (no secret values in the profile;--no-profileto skip,--profile/--secrets-fileto choose paths), replaces values with{"source":"env","provider":"default","id":"VAR"}and runs the read-onlyverify. - Reload: shell-launched gateway →
source ~/.openclaw/tightlip.envthenopenclaw gateway restart. systemd → put the vars inEnvironmentFile=. Docker →-e/environment:. - Verify:
SC verify(exit 0 = clean).SC verify --clean-backupdeletes backups once rollback is not needed. - Rollback:
SC migrate --restore(newest backup),SC migrate --list-backups,SC migrate --restore --backup <file>.
B. Memory + transcript secrets (OpenClaw and Claude Code)
SC memory — read-only. Auto-detects ~/.openclaw and ~/.claude.
Options: --platform openclaw|claude|all, --project <dir> (default: cwd, for CLAUDE.md / .claude/rules),
--no-transcripts (memory files only — faster), --claude-dir, --openclaw-dir.
What it scans:
| Scope | OpenClaw | Claude Code |
|---|---|---|
long_term |
workspace MEMORY.md, USER.md, DREAMS.md, SOUL.md, AGENTS.md, TOOLS.md…, memory/imports/ |
~/.claude/CLAUDE.md, ~/.claude/rules/, auto memory ~/.claude/projects/*/memory/, project CLAUDE.md, CLAUDE.local.md, .claude/rules/, AGENTS.md |
short_term |
daily notes memory/YYYY-MM-DD*.md (written by the pre-compaction memory flush) |
~/.claude/history.jsonl (prompt history) |
transcript |
agents/*/sessions/*.jsonl, agents/*/agent/*.sqlite |
~/.claude/projects/*/*.jsonl, tool results |
log |
logs/*.jsonl (e.g. config-audit.jsonl, which recorded openclaw config set arguments up to OpenClaw 2026.6) |
— |
Output memory.secrets[] — one entry per unique secret: detector, risk, fingerprint, length,
occurrences, scopes, locations[] (file, line; sqlite rows show table:rowid=N), live_match
(set when it equals a secret currently used in openclaw.json or a SecretRef env var — rotate these first), rotate.
Report to the user:
- Summary: unique secrets, how many are HIGH, how many are live.
- Table:
risk | detector | fingerprint | ×occurrences | scopes | first location. - Rotation is mandatory. Anything in memory or a transcript has already been sent to a model provider;
deleting the file does not un-send it. Use each entry's
rotatehint. - C
Установить token-safety-checker в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Bash(python3 ${CLAUDE_SKILL_DIR}/scripts/safeclaw.py scan *)Bash(python3 ${CLAUDE_SKILL_DIR}/scripts/safeclaw.py memory *)Bash(python3 ${CLAUDE_SKILL_DIR}/scripts/safeclaw.py verify *)FAQ
Что делает скилл token-safety-checker?
Find and fix leaked API keys, tokens and passwords in your AI agent's config, long/short-term memory and session transcripts (OpenClaw + Claude Code). Use when the user asks to check token or secret safety, scan for leaked credentials, audit agent memory, MEMORY.md, CLAUDE.md or chat history for secrets, move plaintext tokens in openclaw.json to env vars, or stop secrets from being written into memory. Also use after editing openclaw.json or when setting up a new OpenClaw instance. Secret values are never printed.
Как установить скилл token-safety-checker?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл token-safety-checker запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
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