security-best-practices

security-best-practices is a skill for Claude Code, Codex from tao12345666333/ankaloop. It costs 13 tokens per session (1,106 once invoked), scanned A, original, Apache-2.0.

A coding guide for preventing common security flaws, such as unsafe input handling, weak password storage, and missing permission checks.

In plain words
What is it for?
Use it while writing or reviewing application code that accepts user input, authenticates users, manages sessions, or checks permissions.
Why use it?
It helps catch dangerous coding patterns before they become vulnerabilities. It also gives developers practical rules for handling user input, logins, and access control safely.

Skill for Claude CodeCodex

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

Good fit Use it while writing or reviewing application code that accepts user input, authenticates users, manages sessions, or checks permissions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tao12345666333/ankaloop/security-best-practices
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 tao12345666333/ankaloop --skill security-best-practices
Clone the repo
git clone --depth 1 https://github.com/tao12345666333/ankaloop

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-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/tao12345666333/ankaloop/security-best-practices/github.svg)](https://agentmods.dev/skills/tao12345666333/ankaloop/security-best-practices)
Your own site
<a href="https://agentmods.dev/skills/tao12345666333/ankaloop/security-best-practices"><img src="https://agentmods.dev/badge/skills/tao12345666333/ankaloop/security-best-practices/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 security-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/tao12345666333/ankaloop/security-best-practices"><img src="https://agentmods.dev/badge/skills/tao12345666333/ankaloop/security-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,106 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00013 $0.01106
Opus 5 $0.00006 $0.00553
Sonnet 5 $0.00003 $0.00221
Haiku 4.5 $0.00001 $0.00111

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

Security

Grade A, and why

security-best-practices 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.

examples/plugins/security-guidance/skills/security-best-practices/SKILL.md · 209 lines

How it starts

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

Security Best Practices Skill

When writing code, follow these security best practices to prevent common vulnerabilities.

Input Validation

Always validate and sanitize user input:

# ❌ Bad - trusting user input
user_id = request.args.get('id')
query = f"SELECT * FROM users WHERE id = {user_id}"

# ✅ Good - parameterized query
user_id = request.args.get('id')
cursor.execute("SELECT * FROM users WHERE id = ?", (user_id,))

Validation Checklist

  • Validate type, length, format, and range
  • Use allowlists over denylists
  • Sanitize for the specific output context
  • Never trust client-side validation alone

Authentication

Implement secure authentication:

  • Use established libraries (e.g., bcrypt, argon2)
  • Never store passwords in plain text
  • Implement rate limiting on login attempts
  • Use secure session management
  • Implement proper logout handling
# ✅ Good - using bcrypt
import bcrypt

def hash_password(password: str) -> bytes:
    return bcrypt.hashpw(password.encode(), bcrypt.gensalt())

def verify_password(password: str, hash: bytes) -> bool:
    return bcrypt.checkpw(password.encode(), hash)

Authorization

Check permissions on every request:

# ✅ Good - checking authorization
def delete_post(post_id: int, user: User):
    post = get_post(post_id)
    if post.author_id != user.id and not user.is_admin:
        raise PermissionError("Not authorized")
    delete_post_from_db(post_id)

Secrets Management

Never hardcode secrets:

# ❌ Bad
API_KEY = "sk-1234567890abcdef"

# ✅ Good
import os
API_KEY = os.environ.get('API_KEY')

Environment Variables

  • Use .env files for development (in .gitignore)
  • Use secrets managers in production
  • Rotate secrets regularly
  • Use different secrets per environment

SQL Injection Prevention

Always use parameterized queries:

# ❌ Bad - string concatenation
cursor.execute(f"SELECT * FROM users WHERE name = '{name}'")

# ✅ Good - parameterized
cursor.execute("SELECT * FROM users WHERE name = ?", (name,))

# ✅ Good - ORM
User.query.filter_by(name=name).first()

Read the full file on GitHub · 209 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 · 209 lines · 13 tokens per session scan A 51e04889434e

Subscribe to this mod's changes

security-best-practices is a skill published in the GitHub repository tao12345666333/ankaloop (48 stars, last pushed 13d ago), licensed Apache-2.0. It adds 13 tokens to every session and 1,106 once invoked, about $0.0001 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.