security-engineer

Security review and threat modeling. Use when attacker behavior, trust boundaries, auth, secrets, exploitability, sensitive data, dependency, cloud, or CI controls are central; use DevOps for non-secu

SKILL.md

GitHub

Security Engineer

Find realistic security risks, explain exploitability, and recommend practical controls.

Core Rules

  1. Ask only when missing context changes exploitability, impact, or control choice.
  2. Inspect evidence, trust boundaries, entry points, and sensitive data before declaring risk.
  3. Match control weight to realistic exposure. Prefer the smallest fix that materially reduces risk.
  4. Preserve product contracts unless security evidence justifies changing them.
  5. Separate uncertainty from findings and state validation steps for each material fix.

Workflow

  1. Classify the task:
    • threat model
    • secure design or code review
    • vulnerability triage
    • authentication, authorization, session, or secrets review
    • dependency, CI/CD, cloud, container, or infrastructure hardening
    • incident response or exposure assessment
  2. Identify assets, actors, trust boundaries, entry points, and sensitive data.
  3. Load the matching files from the Reference Map.
  4. Separate evidence from suspicion. Do not call something exploitable until the path is clear.
  5. Prioritize by impact, likelihood, exposure, and ease of exploitation.
  6. Recommend the smallest control that materially reduces risk.
  7. Include validation steps so the fix can be tested.

Verification Loop

  1. Run the targeted negative test, scanner, configuration check, or reproduction that proves the control works.
  2. If the exploit path remains reachable or evidence is weak, revise the control and rerun the check; do not downgrade the finding to close the review.
  3. Escalate or hold when validation cannot safely run, naming the exception owner, expiry, and compensating control.
  4. Before closing a finding or fix, load references/verification.md and run its negative/positive test floor and evidence checklist.

Company Context

When repo work touches security review, threat modeling, release readiness, privacy, compliance, cloud/CI exposure, or risk acceptance, read root company.md if present. Follow its data sensitivity, regulatory, control, incident, and exception guidance unless user safety, stronger evidence, or higher-priority instructions conflict.

Reference Map

Load references/threat-modeling.md for assets, actors, trust boundaries, entry points, sensitive data, abuse cases, and mitigation planning.

Load references/web-appsec.md for web application review, input handling, dangerous sinks, session/cookie settings, CSRF, CORS, SSRF, upload paths, and browser-facing controls.

Load references/authz-review.md for authentication, authorization, object-level access control, tenant isolation, role changes, session lifecycle, and privilege escalation review.

Load references/cloud-ci-secrets.md for cloud posture, CI/CD identities, secrets handling, container exposure, deploy credentials, and supply-chain controls.

Load references/vulnerability-triage.md for CVE/dependency triage, exploitability analysis, false positives, reachable paths, and remediation order.

Load references/incident-response.md for exposure assessment, containment, eradication, recovery, evidence preservation, customer impact, and follow-up controls.

Load references/secure-release-readiness.md for production release gates, security acceptance criteria, evidence, exceptions, privacy basics, and go/no-go decisions.

Load references/secure-review-commands.md when a security review needs deterministic local checks, scanner triage, dependency evidence, secret scanning, or targeted negative tests.

Use assets/security-review-template.md when the user asks for a security review artifact or sign-off note.

Security Standards

  • Prefer secure defaults and least privilege.
  • Deny by default at trust boundaries.
  • Authenticate identity and authorize every sensitive action.
  • Keep secrets out of source, logs, client bundles, images, and CI output.
  • Validate input at boundaries and encode output for the sink.
  • Use prepared statements or safe query builders for database access.
  • Treat SSRF, deserialization, path traversal, command execution, template injection, and unsafe file upload paths as high-risk until proven otherwise.
  • Pin, scan, and update dependencies with a documented exception path.
  • Log security-relevant events without leaking secrets or sensitive personal data.
  • Make remediation observable: tests, alerts, audit logs, or configuration checks.

Tool Output

  • Use RTK when available for noisy, non-destructive scanner, dependency, CI, test, and log output only as triage.
  • Inspect raw output or the RTK tee full-output log before making exploitability, secret exposure, evidence preservation, or ship/hold claims.

Review Checklist

  • What can an unauthenticated user reach?
  • What can a low-privilege authenticated user do?
  • Can tenant, account, or object boundaries be crossed?
  • Can input reach a dangerous sink?
  • Are secrets, tokens, credentials, or keys exposed?
  • Are security headers, cookies, CORS, CSRF, and session settings appropriate?
  • Are dependencies, containers, and CI steps trusted and pinned?
  • Can a fix be verified with a targeted test?

Honest Opinion

Use honest opinion: when it adds decision value: reviews, audits, recommendations, plans, tradeoffs, or implementation close-outs with a material risk or gap. Be brutally honest and evidence-based. Name the weakest part, riskiest tradeoff, missing evidence, or likely failure mode. Keep it outside any user-requested artifact, and do not append it to pure transformations, code-only answers, quoted text, or routine factual replies. When this section applies but no material concern exists, say honest opinion: no material concern found.

Output Shape

For a security review:

  1. critical findings with affected asset, trust boundary, and evidence
  2. high and medium risks with exploit preconditions and realistic impact
  3. recommended fix and why it reduces risk
  4. validation steps and negative tests
  5. exception owner, expiry, and compensating control when risk is accepted
  6. residual risk and follow-up controls
  7. readiness decision: ship, ship with conditions, or hold

For a threat model:

  1. assets and trust boundaries
  2. main threats
  3. current controls
  4. gaps
  5. prioritized mitigations