pn-audit-security

pn-audit-security is a command for Claude Code, Cursor from perniemann/pnCore. It costs 46 tokens per session (949 once invoked), scanned A, original, MIT.

A backend security review guided by common web security practices from OWASP, a group that publishes guidance for protecting web applications.

In plain words
What is it for?
Use it to review authentication, permissions, input validation, secret handling, CORS, JWT settings, and rate limiting.
Why use it?
It helps uncover weaknesses in login access, user input, secrets, cross-origin requests, tokens, and request limits.

Command for Claude CodeCursor

Written for Cursor and Claude Code: shipped in a Cursor plugin, but also a Claude Code command (commands/*.md).

Part of the pn-core plugin — 133 skills, 19 commands, 9 agents, 1 MCP server shipped together

Good fit Use it to review authentication, permissions, input validation, secret handling, CORS, JWT settings, and rate limiting.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/perniemann/pncore/pn-audit-security
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.

Clone the repo
git clone --depth 1 https://github.com/perniemann/pnCore

Made for: Claude Code, Cursor.

Or install pn-core, the plugin that ships this one along with the rest of its 133 skills, 19 commands, 9 agents, 1 MCP server.

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 pn-audit-security

README.md
[![agentmods](https://agentmods.dev/badge/commands/perniemann/pncore/pn-audit-security.svg)](https://agentmods.dev/commands/perniemann/pncore/pn-audit-security)
Your own site
<a href="https://agentmods.dev/commands/perniemann/pncore/pn-audit-security"><img src="https://agentmods.dev/badge/commands/perniemann/pncore/pn-audit-security.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 949 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.00046 $0.00949
Opus 5 $0.00023 $0.00475
Sonnet 5 $0.00009 $0.00190
Haiku 4.5 $0.00005 $0.00095

Measured 7d ago against content hash 24d30f732e3b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

pn-audit-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 7d 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.

packages/pn-core-mcp/content/commands/pn-audit-security.md · 101 lines

How it starts

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

pn-audit-security

Start every response with: [pn-command] 🔺

Advanced (palette-hidden). Not in the / slash palette. Invoked by the /pn-backend-audit umbrella, or directly via get_command("pn-audit-security").

Focused security pass: audit and harden authentication, authorization, input validation, secret handling, CORS, JWT configuration, and rate limiting. No API design changes (use pn-audit-api), no performance changes (use pn-audit-performance) — security posture only.

Flow

1. Context

Check .pncore-stack.md for auth mechanism, framework, and known security constraints. If not found, ask:

  • "What auth mechanism? (JWT / session cookies / API keys / OAuth)"
  • "What framework? (Express/Fastify/FastAPI/Rails/other)"

2. Scope

If not specified: "Should I audit the full API surface or specific areas? (auth routes / all routes / specific files)"

3. Audit

Consult pn-core://skills/backend/reference/security-patterns.md and load get_skill("pn-auth-patterns").

Injection:

  • Any raw SQL string interpolation? db.query(\WHERE id = ${id}`)` → parameterized?
  • Any shell command with user input? exec(userInput) → use safe APIs?
  • Any template rendering with unsanitized user data?

Authentication:

  • JWT: algorithm pinned? Never algorithms: ['none']?
  • JWT: expiry set? Access tokens < 60 min?
  • Password hashing: bcrypt/argon2? Not md5/sha1?
  • Session tokens: httpOnly, Secure, SameSite cookies?
  • Refresh token: stored as hash, not plaintext?

Authorization:

  • Data queries scoped to authenticated user? No trust of client-supplied userId?
  • Role/permission checks present before sensitive operations?
  • IDOR (Insecure Direct Object Reference): resources fetched by ID without ownership check?

Input validation:

  • Input validated at every boundary before processing?
  • Enum values allowlisted? No trusting req.body.role directly into DB?
  • File uploads: type checked, size limited, name sanitized?

Secrets:

  • No hardcoded secrets in source?
  • .env in .gitignore?
  • process.env / os.getenv validated at startup?
  • Are internal secrets exposed in error responses or logs?

Read the full file on GitHub · 101 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. 7d ago First seen · 101 lines · 46 tokens per session scan A 24d30f732e3b

Subscribe to this mod's changes

pn-audit-security is a command published in the GitHub repository perniemann/pnCore (0 stars, last pushed yesterday), licensed MIT. It adds 46 tokens to every session and 949 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-31.