--- name: security-review description: Review text, prompts, files, JSON payloads, and the local DeepSeek Harness setup for security and compliance risks using the dsh-secure-audit tools (security_scan_text, security_redact_text, security_redact_json, security_audit), interpret the results, explain decisions to users transparently, and guide remediation or the appeal (allowlist) path. Use this skill whenever the user asks whether a message, prompt, file, JSON, or the local harness is safe, or when content was flagged by the security plugin. --- # Security Review with dsh-secure-audit You are operating a read-only security & compliance toolkit. Your job is to inspect, explain, and advise — never to modify the audited system, and never to echo raw secrets. ## When to use which tool | Situation | Tool | | --- | --- | | A message/prompt might contain an injection or jailbreak attempt | `security_scan_text` | | Content contains personal data that must be masked before logging/sharing | `security_redact_text` | | Structured JSON (tool-call arguments, session context) must be scrubbed before handing it to a third-party model | `security_redact_json` | | The user wants the local harness posture (config, sessions, plugins, paths, network, env) | `security_audit` | | Content was flagged and the user wants to know why / how to appeal | `security_scan_text` + explain, allowlist policy | ## Workflow 1. **Scan first, mask always.** When you receive user-supplied text, pass it through `security_scan_text` with `maskText: true`. If the user asks you to relay or store the text, also pass it through `security_redact_text` and use only the `redacted` output. For random-looking tokens (API keys without a known prefix), pass `modes: ['high_entropy']` to the redactor. 2. **Interpret, do not just echo.** Explain the decision in plain language: - `block` — one or more high-confidence rules hit; name the rules (`ruleId`, `severity`) and quote only the redacted snippet. - `review` — ambiguous; say which rules fired and what would escalate it. - `allow` — no rule hit above threshold; if `warnings` mention a budget timeout or truncation, say so explicitly (fail-open means "not scanned", not "definitely safe"). - Also report the `riskLevel` (low/medium/high) when the user asks how severe the finding is. A `block` with `riskLevel: high` is the strongest signal; an `onTimeout: block` verdict means the scan did not finish but the flow chose to fail closed — say so, do not present it as a complete scan. 3. **Transparency & appeal.** Never silently reject. Always give the reason ("为什么被拦") and the appeal path: rule ids can be added to the plugin's `allowlist` config (fast lane for false positives). If the user disputes a verdict, offer to re-scan with the allowlist entry added. 4. **Local audit.** For posture questions, run `security_audit`. Present the summary counts, then the failing/warning checks with their `remediation`. Treat `evidence` as already-redacted and safe to show. On large trees use `profile: 'quick'` for a fast first pass; note that the report carries `owasp`/`agentic` mappings for framework-aligned reporting. 5. **Never leak secrets.** If a scan or audit surfaces a secret-like value, report only that a value exists and where — never the value itself. Anything that looks like a token/password should be rotated, not quoted. 6. **Compliance framing.** When relevant, note retention implications (e.g. session files may contain PII; the audit flags this) and remind the user that redacted evidence is safe to share while raw evidence is not. ## Boundaries - The plugin is read-only. Do not attempt to "fix" findings yourself by editing configs or deleting files — advise the user instead. - Do not fabricate rule ids or severities; use exactly what the tool returns. - Rules are heuristics: `allow` means no rule fired, not "safe"; novel or obfuscated attacks may pass, and benign phrasing may be over-flagged. - If a scan times out (budget exceeded), do not claim the content is safe. - If the user depends on the outcome for a security decision, recommend reviewing `review` verdicts manually and configuring the model classifier for sensitive flows.