secure-coding

A secure coding checklist based on the OWASP Top 10, a widely used list of common web-application security risks. It applies security checks while code is being written at points where data crosses between trusted and untrusted systems.

In plain words
What is it for?
Use it when handling user input, files, environment variables, databases, or third-party APIs, and when adding dependencies or writing logs and error responses.
Why use it?
It helps catch unsafe input, exposed secrets, access-control mistakes, risky dependencies, and unsafe error handling before they reach production.

Skill for Claude CodeCodex

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 skills/aethrox/doctrine/secure-coding
Any agent
npx skills add aethrox/doctrine --skill secure-coding
Clone the repo
git clone --depth 1 https://github.com/aethrox/doctrine

Made for: Claude Code, Codex.

Per session 111 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,186 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.00111 $0.01186
Opus 5 $0.00056 $0.00593
Sonnet 5 $0.00022 $0.00237
Haiku 4.5 $0.00011 $0.00119

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

Security

Grade A, and why

secure-coding 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/secure-coding/SKILL.md · 61 lines

How it starts

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

Secure Coding

Security is checked at the point of writing the code, not bolted on after. Every trust boundary gets its input validated, every secret goes through the environment or a vault and never a literal in source, and every new dependency gets a known-vulnerability check before it merges. Retrofit security review finds problems too late to fix cheaply; this skill runs while the code is still being written.

A trust boundary is any point where data crosses from a less-trusted source into more-trusted code: a request body, a query parameter, a file upload, an environment variable set by a deploy pipeline, a response from a third-party API, a value read from a database another service writes to.

Phase 1: Input validation and injection classes

At every trust boundary, validate before use: allowlist the shape you expect rather than denylisting what you don't:

Injection class Root cause Fix
SQL / NoSQL injection user input concatenated into a query parameterised queries / prepared statements: never string-built queries
Command injection user input passed to a shell avoid shelling out to build a command from input; if unavoidable, use an argument-array API, never string interpolation into a shell string
Path traversal user input used to build a filesystem path resolve the path, then verify it is still inside the allowed root directory before any read/write
XSS user input rendered into HTML/JS context unescaped context-aware output encoding (the framework's templating auto-escape, not manual string concatenation)
Deserialization untrusted bytes deserialized into objects/classes use a data-only format (JSON with a schema) instead of a format that can instantiate arbitrary types (e.g. pickle, native object serialization)
SSRF server fetches a URL supplied by the user allowlist destination hosts/IP ranges; block requests to internal/link-local addresses

Validate type, length, format, and range; reject early, fail closed (deny by default on anything unexpected, don't try to "sanitize and continue").

Read the full file on GitHub · 61 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 61 lines · 111 tokens per session scan A 62a798819571

Subscribe to this mod's changes

secure-coding is a skill published in the GitHub repository aethrox/doctrine (18 stars, last pushed 21d ago), licensed MIT. It adds 111 tokens to every session and 1,186 once invoked, about $0.0006 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

finishing-a-development-branch

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work.

obra/superpowers · 27 tokens

receiving-code-review

Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation.

obra/superpowers · 38 tokens

openspec-explore

Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.

Fission-AI/OpenSpec · 39 tokens

release-openspec

Use this skill when releasing OpenSpec: audit merged work and changeset coverage, decide whether a catch-up changeset PR is needed, prepare or resume the Changesets Version Packages PR, cut a beta or stable release, verify publishing, and polish GitHub release notes. Also use when asked whether an open release PR is…

Fission-AI/OpenSpec · 88 tokens

openspec-update-change

Update an OpenSpec change by revising its existing planning artifacts and keeping them coherent with one another. Use when the user wants to revise a change's plan, fold new decisions into it, or reconcile its artifacts after an edit. Never edits code.

Fission-AI/OpenSpec · 55 tokens

openspec-verify-change

Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.

Fission-AI/OpenSpec · 32 tokens