Two-phase audit tool to detect environment variable theft in skill scripts.
ScriptPurposescripts/fang_audit.pyMain audit runner — static scan + LLM deep analysisscripts/scan_env.pyStatic pattern scanner (env / network / encode / exec)
Uses scan_env.py regex rules across .py and .sh files.
Risk scoring:
FlagPointsenv access+2network call+3base64 / encode+2exec / subprocess+2
Score ≥ 6 → HIGH · ≥ 3 → MEDIUM · > 0 → LOW · 0 → CLEAN
Reads all .py .sh .js .ts .ps1 .bash scripts in the target directory and sends them to an OpenAI-compatible LLM. The LLM checks for:
bash
python scripts/fang_audit.py <target_dir>
bash
python scripts/fang_audit.py <target_dir> --llm-key sk-... --model gpt-4o-mini
bash
python scripts/fang_audit.py <target_dir> \
--llm-key any \
--model deepseek-chat \
--base-url https://api.deepseek.com/v1
bash
python scripts/fang_audit.py <target_dir> --llm-key sk-... --output report.txt
bash
python scripts/fang_audit.py C:/Users/dad/.openclaw/workspace/skills
When the user asks to audit skills for env theft:
skills/ folder)--llm-key is available (from env or user), run Phase 2 automaticallyRisk LevelRecommended Action🔴 HIGHImmediately quarantine the skill, do not run it🟡 MEDIUMManual code review before use🟢 LOWMonitor; likely benign but worth noting✅ CLEANSafe to use
scan_env.py only processes .py and .sh files; fang_audit.py LLM mode also covers .js, .ts, .ps1.