From harness-claude
Performs deep security audits combining mechanical scanning via harness CLI, AI-powered vulnerability analysis, OWASP baselines, stack-adaptive rules, and optional threat modeling. Use before releases, after dep updates, or for unfamiliar codebases.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Deep security audit combining mechanical scanning with AI-powered vulnerability analysis. OWASP baseline + stack-adaptive rules + optional threat modeling.
Performs comprehensive code security audits across 8 dimensions: OWASP Top 10/CWE vulns, secrets, deps/supply chain, IaC, threats/MITRE ATT&CK, auth, AI code, compliance via 8 parallel agents.
Scans codebases for OWASP Top 10 vulnerabilities via static analysis: secret exposure, injection flaws, auth/authz gaps, supply-chain risks, misconfigurations, logging failures. Use before deployments, PR merges, auth/payment changes.
Scans local projects for dependency vulnerabilities (SCA), code security patterns (SAST), leaked secrets, auth/crypto flaws, misconfigs, supply chain risks, CI/CD issues. Generates prioritized report with remediation guidance.
Share bugs, ideas, or general feedback.
Deep security audit combining mechanical scanning with AI-powered vulnerability analysis. OWASP baseline + stack-adaptive rules + optional threat modeling.
on_pr triggers fire on security-sensitive pathsThis skill adapts its behavior based on invocation context — standalone or as part of the code review pipeline.
Check for pipelineContext in .harness/handoff.json. If present, run in changed-files mode. Otherwise, run in full mode.
# Check for pipeline context
cat .harness/handoff.json 2>/dev/null | grep -q '"pipelineContext"'
When invoked from the code review pipeline (Phase 4 fan-out, security slot):
PipelineContext.findings where domain === 'security' instead of re-running run_security_scan.--deep flag was passed through from code review.ReviewFinding[] to the pipeline. The pipeline handles output formatting (Phase 7).Findings returned in this mode must use the ReviewFinding schema with populated security fields (cweId, owaspCategory, confidence, remediation, references).
When invoked directly (no PipelineContext):
This skill follows the Deterministic-vs-LLM Responsibility Split principle. The mechanical scanner runs first and catches what patterns can catch. The AI review then looks for semantic issues that patterns miss — user input flowing through multiple functions to a dangerous sink, missing authorization checks, logic flaws in authentication flows.
Note: This phase is skipped in changed-files mode. See Scope Adaptation above.
Run the built-in security scanner against the project.
Run the scanner. Use the harness check-security CLI command:
harness check-security
For machine-readable output, add --json. For scanning only changed files, add --changed-only.
Review findings. Categorize by severity:
Report mechanical findings. Present each finding with:
After mechanical scanning, perform deeper AI analysis.
Review the codebase against OWASP Top 10 and CWE Top 25:
Injection (CWE-89, CWE-78, CWE-79): Look for user input flowing to SQL queries, shell commands, or HTML output without sanitization. Trace data flow across function boundaries — patterns only catch single-line issues.
Broken Authentication (CWE-287): Check for weak session management, missing MFA enforcement, hardcoded credentials, predictable tokens.
Sensitive Data Exposure (CWE-200): Look for PII logged to console/files, sensitive data in error messages, missing encryption for data at rest or in transit.
Broken Access Control (CWE-862): Check for missing authorization on API endpoints, IDOR vulnerabilities, privilege escalation paths.
Security Misconfiguration (CWE-16): Check for debug mode in production configs, default credentials, overly permissive CORS, missing security headers.
After the OWASP baseline, add stack-specific checks:
Object.assign or spread on user input, __proto__ injection, unhandled promise rejections exposing stack tracesdangerouslySetInnerHTML, sensitive data in client state, insecure postMessage listenersunsafe.Pointer usage, format string injectionFor each configuration variable that controls a security feature (auth, encryption, TLS, CORS, rate limiting), verify:
config.x ?? env.Y ?? default — is the final default secure?Patterns the mechanical SEC-DEF-* rules cannot catch (focus here):
if (isProd) enableTLS())catch blocks)Rationalizations to reject (adapted from Trail of Bits):
--deep flag; full mode or explicit --deep in pipeline)When invoked with --deep, build a lightweight threat model:
Identify entry points. Find all HTTP routes, API endpoints, message handlers, CLI commands, and file upload handlers.
Map trust boundaries. Where does data cross from untrusted (user input, external APIs) to trusted (database queries, file system, internal services)?
Trace data flows. For each entry point, trace how user-controlled data flows through the system. Use the knowledge graph if available (query_graph, get_relationships).
Identify threat scenarios. For each trust boundary crossing, ask:
Report threat model. Present as a table:
| Entry Point | Data Flow | Trust Boundary | Threats | Controls | Risk |
|---|
Produce a unified security report:
Security Review: [PASS/WARN/FAIL]
Mechanical Scanner:
- Scanned: N files, M rules applied
- Coverage: baseline/enhanced
- Errors: N | Warnings: N | Info: N
[List each finding with rule ID, file:line, severity, and remediation]
AI Review:
- OWASP Baseline: [findings or "No issues found"]
- Stack-Adaptive ([detected stacks]): [findings or "No issues found"]
[If --deep]
Threat Model:
- Entry points: N
- Trust boundaries: N
- High-risk flows: [list]
harness check-security — Run the mechanical scanner via CLI. Use --json for machine-readable output.harness validate — Standard project health checkquery_graph / get_relationships — Used in threat modeling phase for data flow tracingget_impact — Understand blast radius of security-sensitive changes| Rationalization | Reality |
|---|---|
| "The scanner didn't flag it so it must be fine" | Mechanical scanners catch pattern-level issues. They cannot trace user input across multiple function calls to a dangerous sink, detect authorization logic flaws, or evaluate whether a fallback chain fails open. The AI review phase exists precisely because scanners miss semantic vulnerabilities. |
| "This endpoint is behind authentication so we don't need to validate input" | Authentication and input validation are orthogonal controls. Authenticated users can still send malicious payloads. Authenticated SQL injection, SSRF, and path traversal are well-documented attack patterns against internal-only endpoints. |
| "The vulnerability requires knowing our internal schema to exploit" | Security through obscurity is not a control. Internal schema details leak through error messages, API responses, documentation, and employee turnover. Rate the vulnerability based on its impact assuming the attacker knows the system. |
| "We'll add rate limiting and input validation later once the feature ships" | Security controls added after deployment require re-testing and re-review. Shipping without them creates an exposure window and establishes technical debt that is systematically deprioritized once the feature is live. |
| "That's an OWASP theoretical risk — our app isn't targeted by sophisticated attackers" | OWASP findings are exploited by automated scanners, not just sophisticated attackers. Opportunistic bots continuously probe for SQL injection, XSS, and auth bypass. Unpatched OWASP Top 10 issues are routinely exploited within hours of exposure. |
--deep. Do not run it unless explicitly requested.Security Review: PASS
Mechanical Scanner:
- Scanned: 42 files, 22 rules applied
- Coverage: baseline
- Errors: 0 | Warnings: 0 | Info: 0
AI Review:
- OWASP Baseline: No issues found
- Stack-Adaptive (node, express): No issues found
Security Review: FAIL
Mechanical Scanner:
- Scanned: 42 files, 22 rules applied
- Coverage: baseline
- Errors: 2 | Warnings: 1 | Info: 0
Findings:
1. [SEC-SEC-002] ERROR src/config.ts:12 — Hardcoded API key or secret detected
Remediation: Use environment variables: process.env.API_KEY
2. [SEC-INJ-002] ERROR src/db.ts:45 — SQL query built with string concatenation
Remediation: Use parameterized queries: query("SELECT * FROM users WHERE id = $1", [id])
3. [SEC-NET-001] WARNING src/cors.ts:8 — CORS wildcard origin allows any website to make requests
Remediation: Restrict CORS to specific trusted origins
AI Review:
- OWASP Baseline: 1 finding — user input from req.params.id flows through formatQuery() to db.execute() without sanitization (confirms SEC-INJ-002 with data flow trace)
- Stack-Adaptive (node, express): Missing helmet middleware, missing rate limiting on /api/* routes
Security Review: WARN
Mechanical Scanner:
- Scanned: 120 files, 30 rules applied
- Coverage: baseline
- Errors: 0 | Warnings: 2 | Info: 3
AI Review:
- OWASP Baseline: No critical issues
- Stack-Adaptive (node, react): localStorage used for session token (SEC-REACT-001)
Threat Model:
- Entry points: 12 (8 REST endpoints, 2 WebSocket handlers, 2 CLI commands)
- Trust boundaries: 4 (client→API, API→database, API→external service, CLI→filesystem)
- High-risk flows:
1. POST /api/upload → file stored to disk without size limit or type validation
2. WebSocket message handler passes user data to eval-like template engine