security-test-generator

security-test-generator is a skill for Claude Code, Codex from apisec-inc/apisec-skills. It costs 90 tokens per session (8,303 once invoked), scanned A, original, MIT.

A guide for writing security tests that act like hostile users instead of only checking valid requests. It complements ordinary tests by checking that an API fails safely.

In plain words
What is it for?
Use it when adding tests for API endpoints with Jest, Mocha, pytest, or JUnit, especially to check unauthorized access, invalid data, boundary cases, and expected error responses.
Why use it?
It exposes gaps where code works for legitimate users but mishandles malformed or dangerous input, leaks data, or returns server errors.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import app from '../../src/app.js';.

Good fit Use it when adding tests for API endpoints with Jest, Mocha, pytest, or JUnit, especially to check unauthorized access, invalid data, boundary cases, and expected error responses.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/apisec-inc/apisec-skills
agentmods
npx agentmods add skills/apisec-inc/apisec-skills/security-test-generator

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for security-test-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/apisec-inc/apisec-skills/security-test-generator.svg)](https://agentmods.dev/skills/apisec-inc/apisec-skills/security-test-generator)
Your own site
<a href="https://agentmods.dev/skills/apisec-inc/apisec-skills/security-test-generator"><img src="https://agentmods.dev/badge/skills/apisec-inc/apisec-skills/security-test-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,303 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00090 $0.08303
Opus 5 $0.00045 $0.04151
Sonnet 5 $0.00018 $0.01661
Haiku 4.5 $0.00009 $0.00830

Measured 8d ago against content hash 53b281af6e63, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

security-test-generator 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 8d 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/security-test-generator/SKILL.md · 992 lines

How it starts

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

Security Test Generator

1. Role

You are a security test engineer who writes adversarial test cases that probe for the vulnerabilities APIsec detects in production scans. Your tests complement — never replace — the developer's existing functional test suite. Where functional tests ask "does this work for legitimate users?", your tests ask "does this fail safely when an attacker tries to break it?".

You generate complete, runnable test files organized by attack category. Every test has a descriptive name that states the attack scenario being tested, making the test suite readable as a security specification.


2. Philosophy — Why Security Tests Are Different

Functional tests vs security tests

Functional Test Security Test
Perspective Legitimate user Adversarial attacker
Goal Confirm the code works Confirm the code fails safely
Input Valid, expected data Malformed, boundary, hostile data
Success 200 OK with correct data 401, 403, 404, 400 — never 500, never data leak
Coverage gap "It works" ≠ "it's safe" Security tests close that gap

Why this matters

A typical test suite has tests like:

test('GET /orders/:id returns the order', async () => {
  const res = await request(app).get(`/api/orders/${orderId}`).set('Authorization', `Bearer ${token}`);
  expect(res.status).toBe(200);
  expect(res.body.id).toBe(orderId);
});

This test passes even if:

  • Any authenticated user can fetch any order (BOLA)
  • The endpoint accepts requests with no token at all (auth bypass)
  • An expired token still works (broken auth)
  • Sending isAdmin: true in a PUT body escalates privileges (mass assignment)
  • SQL injection in query parameters returns a 500 instead of a 400

Security tests make these attack scenarios executable and repeatable in CI/CD, catching regressions before they reach production.

The core principle

A security test passes when the application rejects the attack. A security test fails when the application allows the attack or crashes.

Read the full file on GitHub · 992 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. 8d ago First seen · 992 lines · 90 tokens per session scan A 53b281af6e63

Subscribe to this mod's changes

security-test-generator is a skill published in the GitHub repository apisec-inc/apisec-skills (18 stars, last pushed 5mo ago), licensed MIT. It adds 90 tokens to every session and 8,303 once invoked, about $0.0005 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.

Related

Other skills, from other repositories

research-engineer

An uncompromising Academic Research Engineer. Operates with absolute scientific rigor, objective criticism, and zero flair. Focuses on theoretical correctness, formal verification, and optimal implementation across any required technology.

davila7/claude-code-templates · 43 tokens

tika-eval-compare

Compare extracts from two Tika builds over a corpus to detect regressions in content, encoding, exceptions, and embedded-document handling. Use for "compare before/after extracts", "eval this change against the corpus".

apache/tika · 50 tokens

neuron-evaluation-engineer

Create and run AI evaluations with datasets, assertions, and output drivers in Neuron AI. Use this skill whenever the user mentions evaluation, testing AI systems, creating evaluators, dataset-driven testing, assertion-based validation, or wants to measure AI system performance. Also trigger for tasks involving…

neuron-core/neuron-ai · 77 tokens

jetson-validate-image

Use after jetson-flash-image to run static BSP checks, on-target smoke/regression tests on a flashed DUT, or both. Not for build or flash steps. Triggers: validate bsp, on-target validation.

NVIDIA/skills · 50 tokens

atmos-validation

Validate Atmos projects, components, arbitrary JSON Schema inputs, EditorConfig, and GitHub Actions; use affected-file selection and native CI annotations.

cloudposse/atmos · 31 tokens

skill-benchmark

Benchmark AI skill effectiveness by measuring implementation quality against legacy constraints.

HoangNguyen0403/agent-skills-standard · 16 tokens