Harness-engineering harness-security-scan
<!-- Generated by harness generate-slash-commands. Do not edit. -->
install
source · Clone the upstream repo
git clone https://github.com/Intense-Visions/harness-engineering
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/Intense-Visions/harness-engineering "$T" && mkdir -p ~/.claude/skills && cp -r "$T/agents/commands/codex/harness/harness-security-scan" ~/.claude/skills/intense-visions-harness-engineering-harness-security-scan && rm -rf "$T"
manifest:
agents/commands/codex/harness/harness-security-scan/SKILL.mdsource content
<!-- Generated by harness generate-slash-commands. Do not edit. -->
Harness Security Scan
Lightweight mechanical security scan. Fast triage, not deep review.
When to Use
- As part of the codebase-health-analyst sweep
- For quick security triage on a project or changed files
- On scheduled cron runs for continuous security coverage
- NOT for deep security review (use harness-security-review)
- NOT for threat modeling (use harness-security-review --deep)
Process
Phase 1: SCAN — Run Mechanical Scanner
-
Resolve project root. Use provided path or cwd.
-
Load security config. Read
and extractharness.config.json
section. Fall back to defaults if absent.security -
Determine file scope.
- If
or triggered by PR: run--changed-only
to get changed files. Filter to source files only (exclude node_modules, dist, test files per config).git diff --name-only HEAD~1 - Otherwise: scan all source files in the project.
- If
-
Run SecurityScanner. Call
fromSecurityScanner.scanFiles()
.@harness-engineering/core -
Filter by severity threshold. Remove findings below the configured threshold:
: only errorserror
: errors and warnings (default)warning
: all findingsinfo
-
Output report. Present findings grouped by severity:
Security Scan: [PASS/FAIL] Scanned: N files, M rules applied Errors: N | Warnings: N | Info: N [List findings with rule ID, file:line, severity, message, remediation]
Gates
- Error-severity findings are blocking. Report is FAIL if any error-severity finding exists after filtering.
- No AI review. This skill is mechanical only. Do not perform OWASP analysis or threat modeling.
Harness Integration
— CLI command that invokes this skill's scanner.harness check-security
— Core class fromSecurityScanner
that executes the rule engine.@harness-engineering/core
— Security section configures severity threshold and file exclusions.harness.config.json- codebase-health-analyst persona — Invokes this skill as part of its sweep.
Evidence Requirements
When this skill makes claims about existing code, architecture, or behavior, it MUST cite evidence using one of:
- File reference:
format (e.g.,file:line
)src/auth.ts:42 - Code pattern reference:
with description (e.g.,file
— "existing bcrypt wrapper")src/utils/hash.ts - Test/command output: Inline or referenced output from a test run or CLI command
- Session evidence: Write to the
session section viaevidencemanage_state
Uncited claims: Technical assertions without citations MUST be prefixed with
[UNVERIFIED]. Example: [UNVERIFIED] The auth middleware supports refresh tokens.
Red Flags
Universal
These apply to ALL skills. If you catch yourself doing any of these, STOP.
- "I believe the codebase does X" — Stop. Read the code and cite a file:line reference. Belief is not evidence.
- "Let me recommend [pattern] for this" without checking existing patterns — Stop. Search the codebase first. The project may already have a convention.
- "While we're here, we should also [unrelated improvement]" — Stop. Flag the idea but do not expand scope beyond the stated task.
Domain-Specific
- "This finding is in test code, so it's not a real issue" — Stop. Test code can leak secrets, establish bad patterns, and be copy-pasted to production.
- "This dependency is widely used, so it's safe" — Stop. Popularity is not a security guarantee. Check CVE databases and advisory feeds.
- "This is a low-severity finding, skipping" — Stop. Low-severity findings compound. Document why you are deprioritizing, do not silently skip.
- "The scanner didn't flag it, so it's clean" — Stop. Scanners have false negatives. A clean scan is not proof of security — it is absence of evidence.
Rationalizations to Reject
| Rationalization | Reality |
|---|---|
| "No attacker would find this" | Security by obscurity. If the code is wrong, flag it regardless of discoverability. |
| "We're behind a firewall" | Network boundaries change. Code should be secure at every layer regardless of deployment topology. |
| "The framework handles this for us" | Verify the framework's actual behavior. Misuse of a secure framework is still insecure. |
Escalation
- When error-severity findings are disputed: The scanner is mechanical — it may flag false positives. If a finding is a false positive, add a
comment on the line and document the rationale. Do not suppress without explanation.// harness-ignore SEC-XXX - When the scanner misses a known vulnerability: This skill runs pattern-based rules only. For semantic analysis (taint tracking, control flow), use
instead./harness:security-review - When scan is too slow on large codebases: Use
to scope to recently changed files. Full scans can run on a scheduled cron instead.--changed-only
Success Criteria
- Scanner ran and produced findings (or confirmed clean)
- Findings are filtered by the configured severity threshold
- Report follows the structured format
- Exit code reflects pass/fail status
Examples
Example: Clean Scan
Security Scan: PASS Scanned: 42 files, 12 rules applied Errors: 0 | Warnings: 0 | Info: 0
Example: Findings Detected
Security Scan: FAIL Scanned: 42 files, 12 rules applied Errors: 1 | Warnings: 2 | Info: 0 [SEC-SECRET-001] src/config.ts:15 (error) Hardcoded API key detected: `const API_KEY = "sk-..."` Remediation: Move to environment variable, use dotenv or secrets manager. [SEC-NET-001] src/cors.ts:5 (warning) CORS wildcard origin: `origin: "*"` Remediation: Restrict to specific allowed origins. [SEC-CRYPTO-001] src/auth.ts:22 (warning) Weak hash algorithm: `crypto.createHash("md5")` Remediation: Use SHA-256 or stronger.