business-ops
Business operations: strategy, technology, growth, competitive intelligence, support, finance, HR, legal, operations, sales, productivity, product management.
Security threat model: scan toolkit for attack surface, supply-chain risks.
$ npx -y skills add notque/vexjoy-agent --skill security-threat-model --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/security-threat-modelContext preview
The summary Claude sees to decide when to auto-load this skill.
Security threat model: scan toolkit for attack surface, supply-chain risks.
name: security-threat-model
description: "Security threat model: scan toolkit for attack surface, supply-chain risks."
agent: python-general-engineer
effort: high
user-invocable: false
allowed-tools:
- Read
- Write
- Bash
- Grep
- Glob
- Edit
routing:
triggers:
- threat model
- security audit
- supply chain scan
- deny list
- learning db sanitize
- security posture
- injection scan
- surface scan
- audit hooks
- audit skills
pairs_with:
- python-general-engineer
complexity: Complex
category: securityThis skill executes a structured, phase-gated security threat model workflow that scans the toolkit installation for attack surface exposure, supply-chain injection patterns, and learning DB contamination. It follows the toolkit's four-layer architecture: deterministic Python scripts perform all checks and produce JSON artifacts; Phase 5 (synthesis only) is the LLM step. Each phase gates on artifact validation before proceeding.
Outputs are saved to `security/` with a shared `run_id` for correlation across phases. Phase 5 produces an actionable threat model document.
---
**Goal**: Enumerate the active attack surface of the current installation.
Create the `security/` output directory and run the surface scan script:
mkdir -p security python3 scripts/scan-threat-surface.py --output security/surface-report.json
This script enumerates:
**Validate output**:
python3 -c "import json; d=json.load(open('security/surface-report.json')); print('hooks:', len(d.get('hooks',[])), '| skills:', len(d.get('skills',[])), '| mcp_servers:', len(d.get('mcp_servers',[])))"**Gate (ARTIFACT VALIDATION)**: `security/surface-report.json` must exist, parse as valid JSON, and contain `hooks`, `skills`, and `mcp_servers` keys. A missing directory is handled gracefully with empty arrays. All artifacts are written to `security/` before gating. Do not proceed to Phase 2 until this gate passes.
---
**Goal**: Produce a concrete deny-list config derived from Phase 1 findings.
Generate the deny-list from the surface report:
python3 scripts/generate-deny-list.py \
--surface security/surface-report.json \
--output security/deny-list.jsonThe script applies these mappings from surface findings to deny rules:
Always includes static baseline deny rules for credentials and privileged operations:
["Read(~/.ssh/**)", "Read(~/.aws/**)", "Read(**/.env*)", "Write(~/.ssh/**)", "Write(~/.aws/**)", "Bash(curl * | bash)", "Bash(ssh *)", "Bash(scp *)", "Bash(nc *)", "Bash(* ANTHROPIC_BASE_URL=*)"]
**Display deny-list for human review**:
python3 -c "
import json
d = json.load(open('security/deny-list.json'))
print('Deny-list entries to add to settings.json:')
for rule in d['permissions']['deny']:
print(' ', rule)
print()
print('Review security/deny-list.json before merging.')
"**Gate (HUMAN APPROVAL REQUIRED)**: The deny-list is produced for human review only — it is never merged automatically. Display the diff and block until the operator confirms review. This gate is the highest-ROI control in the workflow. In `--ci-mode`, skip this gate and proceed to Phase 3. Do not proceed without explicit acknowledgment.
---
**Goal**: Scan all installed hooks, skills, and agents for injection patterns and hidden characters.
Run the supply-chain audit:
python3 scripts/scan-supply-chain.py \
--scan-dirs hooks/ skills/ agents/ \
--output security/supply-chain-findings.jsonDetection patterns (full regex details in `scripts/scan-supply-chain.py` source): | Pattern | Severity | |---------|----------| | Zero-width + bidi Unicode characters | CRITICAL | | HTML comments and hidden payload blocks | CRITICAL | | `ANTHROPIC_BASE_URL` override in any file | CRITICAL | | Instruction-override and role-hijacking phrases | CRITICAL | | Outbound network commands in hooks/skills | WARNING | | `enableAllProjectMcpServers` setting | WARNING | | Broad permission grants without path scoping | WARNING |
**Check for CRITICAL findings**:
python3 -c "
import json, sys
d = json.load(open('security/supply-chain-findings.json'))
crits = [f for f in d.get('findings', []) if f.get('severity') == 'CRITICAL']
warns = [f for f in d.get('findings', []) if f.get('severity') == 'WARNING']
print(f'CRITICAL: {len(crits)}, WARNING: {len(warns)}')
if crits:
for c in crits:
print(f' CRITICAL: {c[\"file\"]}:{c.get(\"line\",\"?\")} -- {c[\"pattern\"]}')
sys.exit(1)
"**Gate (BLOCKING CRITICAL FINDINGS)**: Any CRITICAL finding halts forward progress. All CRITICAL findings must be remediated or explicitly acknowledged before Phase 4 can start. This includes zero-width Unicode, ANTHROPIC_BASE_URL overrides, hidden payloads, and instruction-override phrases. WARNING findings are logged but do not block. Log warnings in the threat model under "Gaps and Recommended Next Controls" with acceptance rationale.
---
**Goal**: Inspect the learning DB for entries that may contain injected content from external sources.
Run the sanitization check in dry-run mode (never mutates
Essays and writing behind this toolkit live at vexjoy.com. VexJoy Agent connects plain-English requests to specialist agents, skills, and workflows. /do selects the knowledge and tools needed for your task.
Repo: notque/vexjoy-agent
Business operations: strategy, technology, growth, competitive intelligence, support, finance, HR, legal, operations, sales, productivity, product management.
Design workflows — UX copy, design systems, design critique, accessibility review, design handoff, user research synthesis. Use when writing UI copy, reviewing…
Marketing: SEO audits, campaign planning, content strategy, email sequences, competitive analysis, brand review, performance reporting.