Security Audit
Run a defensive, read-only security sweep over ${input.path}. This skill is
for authorized auditing of code you own or are permitted to test. Never use it
to evade detection or attack third-party systems.
Procedure
- Detect available scanners. Probe PATH (
where <tool>on Windows,which <tool>elsewhere) for each candidate. If${input.tools}is set, restrict to that subset. Skip any tool that is not installed — note it in the summary rather than failing. - Pick scanners by content. Run only what fits the target:
- Python present →
bandit -r "${input.path}" -f json(SAST) and, for dependency files,pip-audit -r <requirements file>orpip-auditin a project dir. - JS/TS present →
npx eslint "${input.path}" -f jsonif an eslint config exists. - Any language →
semgrep --config auto --json "${input.path}"when semgrep is installed (falls back to--config p/cioffline). - Secrets →
gitleaks detect --source "${input.path}" --report-format json(ortrufflehog filesystem) to catch committed credentials/keys. - Always run
ruff check "${input.path}" --output-format jsonwhen Python is present — its security-adjacent lint rules (S-prefixed) are cheap signal.
- Python present →
- Run each scanner via
chat_agent_executer. Capture stdout even on a non-zero exit code — most of these tools exit non-zero precisely because they found issues. Truncate any single tool's raw output to ~16000 chars before parsing. - Normalise findings into one shape:
{tool, file, line, severity, rule_id, message}. Map each tool's native severity ontocritical | high | medium | low. Treat any committed secret/credential ascritical. - Filter & count. Drop findings below
${input.min_severity}. Produceseverity_counts = {critical, high, medium, low}. - Summarise for action. Lead with the count of critical/high issues, name the top 3 things to fix first, and list which scanners were unavailable so the reader knows the coverage gaps.
Output
Return { findings, severity_counts, summary }. Order findings by severity
(critical first). Do not modify any file, do not attempt remediation, and do not
exfiltrate scan output anywhere — this skill only reports.