code-security

Implements secure coding patterns for input validation, cryptography, authentication, and container hardening.

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/nbiish/tts-mcp --skill code-security-nbiish
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-security
Source: https://github.com/nbiish/tts-mcp/tree/main/.agents/skills/code-security
Command: npx skills add https://github.com/nbiish/tts-mcp --skill code-security-nbiish

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing security-critical code requires knowing the correct, current defenses against vulnerabilities like SQL injection, XSS, path traversal, SSRF, and CSRF, plus modern requirements like post-quantum cryptography and MCP server hardening. This Skill provides verified, copy-ready secure code patterns so engineers avoid shipping exploitable implementations. ## Core Features & Use Cases - Vulnerability-Specific Input Validation: Parameterized queries, DOMPurify sanitization, path containment checks, SSRF domain allowlists, and CSRF token verification across Python, TypeScript, Rust, and Go. - Authentication & Cryptography: ML-DSA-65 token signing, RBAC middleware for FastAPI and Express, AES-256-GCM encryption, Argon2id password hashing, HKDF key derivation, and TLS 1.3 configuration. - Supply Chain & Container Security: SBOM generation, SLSA provenance in GitHub Actions, dependency pinning, non-root Dockerfiles, and Kubernetes pod security policies. - MCP Security Hardening: Manifest signing, tool drift detection, rate limiting, and output sanitization mapped to real CVEs. - Use Case: When building a FastAPI endpoint that accepts user input and queries a database, load this Skill to get the parameterized query pattern, RBAC decorator, and CSRF validation code in one pass. ## Quick Start Use the code-security skill to write a FastAPI endpoint with SQL injection prevention, RBAC authorization, and Argon2id password hashing.

Frequently Asked Questions about code-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent SQL injection in Python with SQLAlchemy?▼

Use parameterized queries with bound parameters instead of string interpolation. Pass user input via session.execute(text("... WHERE id = :id"), {"id": user_input}) or use the ORM filter API, which parameterizes automatically.

How do I sanitize HTML to prevent XSS in React?▼

React auto-escapes content rendered in JSX expressions. When raw HTML rendering is required, sanitize with DOMPurify using an allowlist of tags and attributes, enforce Trusted Types policies, and set a strict Content Security Policy header.

What password hashing algorithm should I use in 2026?▼

Use Argon2id with OWASP-recommended parameters: time_cost 3, memory_cost 65536 (64 MB), parallelism 4, and 32-byte output. Verification uses constant-time comparison via the library's verify method.

Why use ML-DSA instead of RS256 for JWT signing?▼

NIST IR 8547 moves RSA to risk-acceptance-only after 2030 and disallows it after 2035, so new token-signing paths use ML-DSA-65 (FIPS 204). Hybrid classical-plus-PQC signatures are an approved transitional approach during the migration window.

How do I prevent SSRF when fetching user-supplied URLs?▼

Enforce HTTPS-only schemes, validate the hostname against a domain allowlist, and resolve DNS to check the IP against blocked private, loopback, and link-local ranges including 169.254.0.0/16 for cloud metadata endpoints.

What are the limitations of output sanitization for MCP tool responses?▼

Regex-based sanitization strips known injection patterns and secret formats but cannot catch novel prompt injection phrasings. It should be combined with manifest signing, tool drift detection, rate limiting, and sandboxed execution for defense in depth.