threat-model-security

threat-model-security is a skill for Claude Code, Codex from 05-deepak-patidar/claude-skills. It costs 79 tokens per session (1,175 once invoked), scanned A, original, MIT.

A security-focused development and review guide for software that handles accounts, sessions, payments, uploads, user input, private data, secrets, or public APIs.

In plain words
What is it for?
Use it when building or reviewing authentication, authorization, payments, file uploads, APIs, multi-customer systems, or software before launch.
Why use it?
It helps prevent users from accessing someone else’s data and checks that identity, permissions, sessions, and login protections are enforced on the server.

Skill for Claude CodeCodex

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

Good fit Use it when building or reviewing authentication, authorization, payments, file uploads, APIs, multi-customer systems, or software before launch.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/05-deepak-patidar/claude-skills/threat-model-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.

Any agent
npx skills add 05-deepak-patidar/claude-skills --skill threat-model-security
Clone the repo
git clone --depth 1 https://github.com/05-deepak-patidar/claude-skills

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 threat-model-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/threat-model-security/github.svg)](https://agentmods.dev/skills/05-deepak-patidar/claude-skills/threat-model-security)
Your own site
<a href="https://agentmods.dev/skills/05-deepak-patidar/claude-skills/threat-model-security"><img src="https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/threat-model-security/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for threat-model-security

Your own site · 80×15
<a href="https://agentmods.dev/skills/05-deepak-patidar/claude-skills/threat-model-security"><img src="https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/threat-model-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,175 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.00079 $0.01175
Opus 5 $0.00039 $0.00588
Sonnet 5 $0.00016 $0.00235
Haiku 4.5 $0.00008 $0.00118

Measured 11d ago against content hash 6be9a40a8095, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

threat-model-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 11d 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.

threat-model-security/SKILL.md · 59 lines

How it starts

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

Threat-Model Security

Security is not a checklist you run at the end; it is a set of invariants you refuse to violate while building. This skill defines the invariants and the gates.

The one question that finds most bugs

For every endpoint, function, or query you write or review, ask:

"What stops a logged-in user from doing this to SOMEBODY ELSE'S data?"

Broken object-level authorization (IDOR) is the #1 real-world API vulnerability. The answer must be a server-side check on every request — never "the UI doesn't show that button", never "the ID is hard to guess".

Gates — do not proceed until each holds

Gate 1: Identity — who is asking?

  • Every non-public route resolves a principal server-side from a validated credential (session/token). No trust in client-supplied user IDs, roles, or account IDs — ever, including in request bodies, headers, or JWT claims you didn't sign.
  • Sessions/tokens: expire, are revocable, and rotate on privilege change (login, password/OTP reset, role change).
  • Rate-limit and lock out authentication attempts (login, OTP verify, password reset). Count failures server-side; commit the counter even when you then raise an error.

Gate 2: Authorization — are they allowed?

  • Object-level: every fetch/update/delete by ID verifies the object belongs to the caller's tenant/user in the query itself (WHERE account_id = :caller), not by fetching then comparing in code you might forget.
  • Function-level: role checks live server-side in one reusable guard (middleware/dependency), not copy-pasted per route. Hidden UI is not authorization.
  • Multi-tenant: prefer defense in depth — app-level scoping AND database-level enforcement (e.g., Postgres RLS with a non-bypassing role). Verify the DB role cannot bypass (superuser/BYPASSRLS silently disables RLS).

Gate 3: Input — is it what you think it is?

  • Parse, don't validate strings ad hoc: use a schema layer (Pydantic/zod/etc.) at the boundary; reject unknown fields on sensitive endpoints.
  • SQL only via parameterized queries/ORM. Shell only via arg arrays, never string interpolation. Paths: resolve and verify prefix before file access.
  • File uploads: allowlist content types by sniffing magic bytes not extension, cap size, store outside webroot / in object storage, never execute or serve with original name+type blindly.
  • Deserialization: never pickle/eval/yaml.load untrusted data.

Read the full file on GitHub · 59 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. 11d ago First seen · 59 lines · 79 tokens per session scan A 6be9a40a8095

Subscribe to this mod's changes

threat-model-security is a skill published in the GitHub repository 05-deepak-patidar/claude-skills (4 stars, last pushed 2mo ago), licensed MIT. It adds 79 tokens to every session and 1,175 once invoked, about $0.0004 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.