DeepSafe Scan - Preflight Security Scanner

VerifiedCaution

Preflight security scanner for AI coding agents. Scans configs, skills, memory sessions, hooks, and model behaviors for secrets, PII, prompt injection, and dangerous patterns.

Sby Skills Guide Bot
SecurityIntermediate
7/23/2026
Claude CodeCursorCodex
#security-audit#secret-scanning#prompt-injection#mcp-security#ai-agent-config

Recommended for

Automated summary

Scans an AI coding agent's deployment config, skills/MCP servers, session memory, and hook config files for secrets, PII, prompt injection, and dangerous patterns, optionally running four behavioral safety probes against the model.

Strengths

  • Covers five separate dimensions (posture, skills/MCP, memory, hooks, model) in a single run
  • The static scan of the four config/memory modules runs without any API key, enabling a fast offline audit
  • Auto-detects credentials (ANTHROPIC_API_KEY, OPENAI_API_KEY, OpenClaw gateway config) with no manual setup
  • Three output formats (json, markdown, html) plus configurable caching via --ttl-days and --no-cache

Limitations

  • Requires python3 and execution of a local script, with no sandboxing or provenance guarantees
  • Model behavior probing is limited to four axes (persuasion, sandbagging, deception, hallucination) and needs API credentials
  • Per-module scores use fixed severity deductions, so results are indicative rather than an absolute measure
When to use it

Use it before deploying an agent or right after installing a new skill, MCP server, or project that ships agent config files, as a preflight security check.

When not to use it

Do not treat it as a sole production security audit, nor use it for agents or config formats outside the supported set (OpenClaw, Claude Code, Cursor, Codex, OpenCode).

Security analysis

Caution
Quality score85/100

The skill is a legitimate security-auditing tool, but it runs an uninspected local Python script and has broad access to credential and session directories. Its LLM-enhanced modes can transmit scanned content to third-party APIs using auto-detected keys, creating a real data-exposure path. These are powerful legitimate capabilities rather than clear malicious intent, so caution is appropriate.

Findings
  • •Executes an unvetted Python script at {baseDir}/scripts/scan.py; the script content is not included, so its actual behavior cannot be verified.
  • •Auto-detects and uses LLM API credentials, and with LLM features enabled can send scanned content (skills, configs, possibly sensitive material) to external providers.
  • •Scans credentials/, agents/, identity/, logs/, and workspace/ directories, which may contain secrets or PII; report output could leak sensitive data if not handled carefully.
  • •Installs python3 via brew, adding a supply-chain dependency for users who use the install metadata.
How this analysis is made

Examples

Preflight audit of a new skill
Scan my Claude Code setup for security issues before I install this new MCP server — check the config, skills, and memory for leaked secrets.
Hooks injection check
Audit my project for hooks injection risks in .claude/settings.json and .cursorrules, fast static scan only, markdown output.
Full report with behavior probes
Run a full DeepSafe scan including the model behavior probes and give me an HTML report at /tmp/deepsafe-report.html.

name: deepsafe-scan description: "Preflight security scanner for AI coding agents — scans deployment config, skills/MCP servers, memory/sessions, and AI agent config files (hooks injection) for secrets, PII, prompt injection, and dangerous patterns. Runs 4 model behavior probes (persuasion, sandbagging, deception, hallucination). Supports LLM-enhanced semantic analysis. Works with OpenClaw, Claude Code, Cursor, Codex, and OpenCode. Use when a user asks for a security audit, health check, or wants to scan their AI agent setup for vulnerabilities." metadata: { "openclaw": { "emoji": "🛡️", "requires": { "bins": ["python3"] }, "install": [ { "id": "brew-python3", "kind": "brew", "package": "python3", "bins": ["python3"], "label": "Install Python 3 (brew)", }, ], }, } allowed-tools: Bash(python3:), Bash(cat:), Read

DeepSafe Scan — Preflight Security Scanner for AI Coding Agents

Full-featured preflight security scanner across 5 dimensions: Posture (config), Skill (skills & MCP), Memory (sessions), Hooks (agent config injection), Model (behavioral safety probes).

Works with OpenClaw, Claude Code, Cursor, Codex, and OpenCode. LLM features auto-detect credentials — no manual configuration needed.

When to Use

  • User asks to "scan", "audit", "check security", or "health check" their AI setup
  • User installs a new skill, MCP server, or clones a project with agent configs
  • User wants to know if any secrets or PII are leaked in session history
  • User asks about hooks injection risks (Claude Code settings.json, .cursorrules, opencode.json, etc.)
  • User wants to probe model behavior for manipulation, deception, or hallucination risks

How to Run

Quick static scan (no API key needed)

python3 {baseDir}/scripts/scan.py --modules posture,skill,memory,hooks --scan-dir . --no-llm --format markdown

Full scan (auto-detects API credentials)

# OpenClaw (reads gateway config automatically)
python3 {baseDir}/scripts/scan.py --openclaw-root ~/.openclaw --format html --output /tmp/deepsafe-report.html

# Claude Code / Cursor / Codex / OpenCode (uses ANTHROPIC_API_KEY or OPENAI_API_KEY)
python3 {baseDir}/scripts/scan.py --modules posture,skill,memory,hooks,model --scan-dir . --format html --output /tmp/deepsafe-report.html

Targeted scans

# Hooks injection only (fastest — checks .claude/settings.json, .cursorrules, opencode.json, etc.)
python3 {baseDir}/scripts/scan.py --modules hooks --scan-dir . --no-llm --format markdown

# Memory scan only (check for leaked secrets/PII)
python3 {baseDir}/scripts/scan.py --openclaw-root ~/.openclaw --modules memory --no-llm

# Model behavior probes only
python3 {baseDir}/scripts/scan.py --openclaw-root ~/.openclaw --modules model --profile quick

Output options

python3 {baseDir}/scripts/scan.py --format json      # machine-readable
python3 {baseDir}/scripts/scan.py --format markdown  # human-readable summary
python3 {baseDir}/scripts/scan.py --format html --output /tmp/report.html  # visual report

Cache control

python3 {baseDir}/scripts/scan.py --ttl-days 3   # cache for 3 days
python3 {baseDir}/scripts/scan.py --no-cache      # always fresh scan

Interpreting Results

Scores

  • Each module scores 1-100 (100 = clean, deductions per finding, minimum 1)
  • Module contribution = floor(score / 4), range 1–25
  • Total = sum of 4 contributions, max 100

Severity Levels

  • CRITICAL (-10 pts): Immediate exploitation risk — secrets exposed, no auth, data exfiltration chains
  • HIGH (-5 pts): Serious risk — prompt injection, sensitive file access, network exposure
  • MEDIUM (-2 pts): Moderate risk — hardcoded keys, missing logs, supply chain concerns
  • LOW (-1 pt): Minor improvement — non-standard endpoints, missing metadata

Risk Ratings

  • 85-100: LOW RISK (green)
  • 65-84: MEDIUM RISK (yellow)
  • 40-64: HIGH RISK (orange)
  • 4-39: CRITICAL RISK (red)

After Scanning

  1. Present the total score and per-module breakdown to the user
  2. List CRITICAL and HIGH findings first with clear explanations
  3. For each finding, explain what the risk is and how to fix it
  4. Offer to help fix issues (e.g., "want me to add auth to your gateway config?")

What Gets Scanned

Posture Module (deployment config)

Reads openclaw.json and checks: gateway auth, network exposure, API key handling, TLS, plugin permissions, MCP server risks, logging, sandboxing.

Skill Module (installed skills & MCP)

Scans all files in workspace/skills/, mcp/, mcp-servers/ for: hidden unicode, prompt injection, dangerous runtime calls, encoded payloads, sensitive file references, hardcoded secrets, system prompt extraction, command injection, data exfiltration patterns, destructive actions, auto-execute without confirmation, excessive permissions.

With --gateway-url provided (and --no-llm not set), also runs LLM-enhanced semantic analysis on each skill's SKILL.md for social engineering, implicit data exfiltration, and deeper pattern recognition.

Memory Module (sessions & stored data)

Scans agents/, credentials/, identity/, logs/, workspace/ for: 27+ secret patterns (API keys for OpenAI, GitHub, AWS, Slack, Stripe, etc.), 9 PII patterns (email, phone, ID numbers, credit cards), persistent prompt injection traces.

Model Module (4 behavioral safety probes)

Requires --gateway-url and --gateway-token. Runs:

  • Persuasion Probe: Tests if the model can manipulate user opinions in multi-turn conversation
  • Sandbagging Probe: Tests if the model can strategically hide capabilities (performance control)
  • Deception Probe: 3-phase test for reasoning/action misalignment (DTR metric)
  • HaluEval Probe: Tests hallucination detection accuracy on QA benchmarks

Each probe produces a finding with risk level and score. Average across probes = module score.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/deepsafe-scan-preflight-security-scanner-mrx3xwtk/download' --output '.skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk/SKILL.md.part' && mv '.skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk/SKILL.md.part' '.skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Bash(python3:*), Bash(cat:*), Read

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk/SKILL.md' && test -s '.skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/deepsafe-scan' && cp -R '.skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk' '.claude/skills/deepsafe-scan'

Cursor
test -f '.skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk/SKILL.md' && test -s '.skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/deepsafe-scan' && cp -R '.skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk' '.cursor/skills/deepsafe-scan'

Codex
test -f '.skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk/SKILL.md' && test -s '.skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/deepsafe-scan' && cp -R '.skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk' '.agents/skills/deepsafe-scan'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk'

openskills read 'deepsafe-scan-preflight-security-scanner-mrx3xwtk'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/deepsafe-scan-preflight-security-scanner-mrx3xwtk/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills