api-security

A command that scans an OpenAPI 3.x specification, a document describing an HTTP API, for issues from the OWASP API Top 10 security list. It is designed to run in a controlled QA process.

In plain words
What is it for?
Use it to scan an API specification for security issues, subject to the required consent, authorized-domain, and optional mass-assignment safeguards.
Why use it?
It helps find common API security weaknesses before testing or release, while requiring consent and authorization checks for protected targets.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/kao273183/mk-qa-master/api-security
Clone the repo
git clone --depth 1 https://github.com/kao273183/mk-qa-master
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,069 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00031 $0.01069
Opus 5 $0.00015 $0.00535
Sonnet 5 $0.00006 $0.00214
Haiku 4.5 $0.00003 $0.00107

Measured 2d ago against content hash 2f58dcdf23d6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

api-security scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mk-qa-master/commands/api-security.md · 94 lines

How it starts

The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are operating as the mk-qa-master agent in OWASP API security scanning mode. Follow Flow 5 in the parent SKILL.md and read reference/api-security-deep.md before proceeding.

Spec target:

$ARGUMENTS

Required gates BEFORE you call run_api_security_scan

  1. Consent. Check QA_API_SECURITY_CONSENT=true is set in the host env. If not, the tool will return consent_required with a legal disclaimer — surface that disclaimer verbatim to the user; do NOT re-prompt or paraphrase.

  2. Authorization. If the spec's servers[0].url (or the user- provided base_url) points to anything other than localhost / 127.0.0.1, the host MUST be in QA_API_SECURITY_AUTHORIZED_DOMAINS. If not set, the tool returns unauthorized_domain — surface that verbatim too.

  3. mass_assignment opt-in. The default categories exclude mass_assignment because it mutates server state (it POSTs probe data). Include it ONLY if:

    • the spec's base_url is localhost (a known fixture, not a real API), OR
    • the user explicitly opted in by saying "include mass assignment" / "scan for over-posting" / "test API3".

Steps

  1. Survey the spec. Use the MCP tool's severity_threshold="info" first pass to see ALL endpoints + which rules apply. Don't expose info-level findings to the user — they're noisy. Just check the ops_scanned count looks reasonable (5+ endpoints).

  2. Decide categories. Default: ["headers", "broken_auth", "bola", "function_authz"]. Add "mass_assignment" only per the opt-in rule above.

  3. Decide auth. If the user provided a token, pass it as auth={"token": "..."}. If they provided BOTH user-a + user-b tokens (for BOLA), pass both + bola_test_ids mapping each user to the object ids they own. Without bola_test_ids, BOLA emits INFO "skipped" findings rather than firing false positives.

  4. Run. Call run_api_security_scan(spec_url=..., auth=..., categories=..., severity_threshold="medium", base_url=..., timeout_s=30).

Read the full file on GitHub · 94 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 94 lines · 31 tokens per session scan A 2f58dcdf23d6

Subscribe to this mod's changes

api-security is a command published in the GitHub repository kao273183/mk-qa-master (37 stars, last pushed 3mo ago), licensed MIT. It adds 31 tokens to every session and 1,069 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.