Skills
Threat-model and remediate code with ak:security
Run a STRIDE and OWASP audit, optionally add red-team discovery, and apply bounded fixes with explicit local commit authority.
Use ak:security for a secret, dependency, and code-pattern scan plus STRIDE
and OWASP threat modeling. Default invocation is that comprehensive pass.
--secrets-only and --deps-only skip code patterns and threat modeling;
combining them still skips code patterns. Optional red-team and fix modes add
deeper discovery and local code changes.
Choose ak:security for threat-modelled review
Use ak:security when
- Authentication, authorization, payments, personal data, or sensitive system boundaries have changed.
- You want findings connected to attacker scenarios and source locations.
- You need external, supply-chain, insider, and infrastructure perspectives.
- You are preparing for a release or a focused compliance review.
Choose another workflow when
- You only need a fast secret or dependency pass. Stay on
ak:securityand pass--secrets-only,--deps-only, or both. - The change is cosmetic and does not affect data or user-facing behavior.
- You need a real penetration test against a running service; this Skill is a source-led audit and does not claim exploit execution.
- You already have a confirmed defect and only need implementation. Use
ak:fixwith the evidence and acceptance boundary.
Prepare a bounded audit surface
Before you start:
- Complete Onboarding, and confirm Engineer Kit is installed for the current runtime and scope.
- Provide a file glob, directory, or the exact keyword
full. - Make the relevant source, manifests, lockfiles, CI configuration, deployment files, and repository instructions available.
- Install the stack's audit tool if you expect dependency evidence:
npm audit,pip-audit,govulncheck, orbundle auditfor the documented stacks. - Decide whether network-backed advisory lookups and local fix commits are allowed before selecting their modes.
| Runtime | Invocation | Availability boundary |
|---|---|---|
| Claude Code | /ak:security ... | Native execution can use the available file, shell, testing, and editing tools. |
| Cursor | /ak:security ... | Slash invocation is user-verified; shell access, approvals, and tool availability depend on the Cursor session. |
| Codex | $ak:security ... | Native discovery is supported; equivalent audit binaries, approvals, and write tools are not implied. |
Select depth and mutation separately
| Input or option | Result | Effects and limits |
|---|---|---|
<scope> | Comprehensive secrets, dependency, code-pattern, STRIDE, and OWASP audit | Omitting scope scans the project root; dependency tools may use network and caches |
full | Expands the audit to the project | Higher disk, context, process, and dependency-audit cost |
--secrets-only | Secret and credential scan only | Skips dependency audit, code patterns, STRIDE, and red-team |
--deps-only | Package-advisory audit only | Skips code patterns, STRIDE, and red-team |
--red-team | Adds four attacker-persona phases before the final sweep | Appends discovery evidence to security-audit-results.tsv; fast flags win if combined |
--iterations N | Caps red-team discovery or fix iterations for the selected mode | N must be chosen by the user; no default numeric cap is documented |
--fix | Applies targeted fixes, runs a guard, and commits successful iterations | Mutates source and Git history; stops when a guard fails |
--red-team --fix | Discovers broadly, then fixes confirmed Critical and High findings | Still requires scoped authority and usable verification commands |
/ak:security --secrets-only
/ak:security --deps-only
/ak:security src/auth/ --red-team --iterations 12/ak:security --secrets-only
/ak:security --deps-only
/ak:security src/auth/ --red-team --iterations 12$ak:security --secrets-only
$ak:security --deps-only
$ak:security src/auth/ --red-team --iterations 12Start without --fix when you need to calibrate findings or obtain approval
for risky remediations. A realistic request also names trusted test commands,
files that must not change, and whether local commits are acceptable.
Understand the observable stages
- The Skill resolves scope. It expands the glob, directory, or
fulland reads every selected file before analysis. - It maps threats. STRIDE covers spoofing, tampering, repudiation, information disclosure, denial of service, and elevation of privilege.
- It checks OWASP categories. Access control, cryptography, injection, design, configuration, components, authentication, integrity, logging, and SSRF receive an explicit pass.
- It audits dependencies and secrets. The detected stack selects a package auditor, while source is checked for credential patterns.
- Red-team mode iterates personas. External adversary, supply-chain, insider, and infrastructure phases select vectors, trace flows, validate evidence, and chain relevant findings.
- It consolidates evidence. Findings are deduplicated, assigned Critical, High, Medium, Low, or Info severity, and written into the report.
- Fix mode remediates iteratively. Each targeted change runs a test or lint
guard and creates a
security(fix-N): ...commit only after the guard passes.
Optional finding-triage experiment
Ordinary review is unchanged and makes no provider call. Only when you
explicitly opt into a finding-triage experiment after candidate discovery does
the Skill use ak eval triage, whose default mode is off.
Shadow mode requires your provider consent, explicit review-triage consumer
consent, and a credential. The Skill sends only compact, sanitized facts: it
removes every discovered secret value from the batch and never submits raw
scanner output, full source, credentials, or sensitive paths.
The shadow signals are compared with the original decisions and never replace
them. Protected Critical or High signals, unknowns, and provider failures keep
deep review, and duplicate or auto-fix signals never authorize suppressing a
finding or editing code. To measure the experiment offline, use
ak eval triage-benchmark with frozen shadow receipts and
independently verified labels.
Protect credentials and repository state
An audit can expose sensitive evidence
Keep the scope away from unrelated secret stores. Findings must replace token,
password, connection-string, and private-key values with an opaque marker such
as <REDACTED_PASSWORD> before they are logged or returned. Keep only a
public issuer prefix such as AKIA, ghp_, sk_, sk-, or xox when it
aids triage. Never emit raw lengths or trailing characters. Name environment
variables; redact the entire user:password@ segment in connection strings.
- Dependency audit commands can contact advisory registries and update local caches. Their availability, data transfer, rate limits, and provider cost are properties of the selected tool and environment.
- Static inspection does not authorize requests against production systems, credential use, exploit execution, data exfiltration, or destructive testing.
--fixauthorizes local edits and one commit per successful fix iteration. It does not authorize push, pull request creation, merge, release, or deployment.- A failing guard stops the fix loop and remains visible; the Skill does not skip or weaken verification to continue.
- Review generated changes before accepting broad security hardening. Some findings require a product, compliance, or compatibility decision that automation cannot make.
Verify the report and fixes
A complete audit should provide:
- Number of files scanned and finding counts by severity.
- Category, source location, description, attack scenario, impact, confidence, and a bounded fix recommendation for each finding.
- Red-team persona and iteration evidence when that mode runs.
- Dependency-audit command and result, or an explicit unavailable reason.
- Redacted secret evidence as an opaque marker, never a partial live secret.
- For fix mode, changed files, guard commands and results, commits created, stopped iterations, and unresolved findings.
The packaged evidence confirms installation coverage for the Skill; it does not provide an end-to-end test of the full audit, live advisory services, or fix quality.
Troubleshoot and interpret limits
| Symptom | Safe next step |
|---|---|
| The scope matches too much | Replace full or a broad glob with the smallest trust boundary that contains the relevant flow. |
| A dependency auditor is missing | Install the documented tool deliberately or mark dependency evidence unavailable; do not claim the dependency tree is clean. |
| The dependency audit cannot reach its registry | Preserve the command and network error, then rerun in an approved connected environment. |
| A secret-like match is a fixture | Confirm it is a non-live placeholder, keep the value redacted, and record why it is not exploitable. |
| Red-team iterations stop before all personas finish | Report partial persona, STRIDE, and OWASP coverage; do not present it as a full audit. |
| A fix guard fails | Stop at that commit boundary, inspect the regression, and hand the evidence to ak:fix or a human reviewer. |
| The runtime does not recognize the Skill | Confirm target and scope, restart the runtime session, then follow Runtime cannot find a Skill or Agent. |
The retired ak:security-scan invocation maps to ak:security. Continue with
ak:plan to schedule findings that should not be fixed immediately.
Review, repair, or merge pull requests with ak:review-pr
Inspect one or more GitHub pull requests, optionally fix findings, publish reviews, and merge only after explicit readiness gates pass.
Expose page features as in-browser tools with ak:webmcp
Register WebMCP tools on a page so in-browser agents can call named actions instead of guessing at the DOM.