Skip to content
Back to skills

Coding

ASecurity

Apply OWASP Proactive Controls while writing code: validation, output encoding, authN/authZ, crypto choices. Use when code handles untrusted input, sessions, secrets or encryption.

  • 24 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added October 14, 2026
ai-agentsrustgosqlgitbackendsecurity

Works with

  • cli

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned November 22, 2026

npx -y skills add andreibesleaga/GABBE --skill coding --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Coding?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Coding
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/andreibesleaga-coding-657b5fa8/badge)](https://www.skillsdirectory.com/skills/andreibesleaga-coding-657b5fa8)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: secure-coding
description: "Apply OWASP Proactive Controls while writing code: validation, output encoding, authN/authZ, crypto choices. Use when code handles untrusted input, sessions, secrets or encryption."
triggers: [secure coding, validate user input, prevent xss, prevent sql injection, password hashing, session timeout]
tags: [coding]
core: true
role: ops-security, eng-backend
context_cost: low
---
# secure-coding Skill

## Goal
This skill guides the implementation of security controls *during* development (Shift Left).

## Steps
## 1. Input Validation (Defense)
> "Never trust input."

- **Syntactic Validation**: Is it an email? Is it a number? (Use Zod/Pydantic).
- **Semantic Validation**: Is `start_date` before `end_date`? Is `transfer_amount` > 0?
- **Allow-list**: Only accept known good characters (e.g., `[a-zA-Z0-9]`). Block everything else.

## 2. Output Encoding (Defense)
> "Context matters."

- **HTML Context**: Escape `<` -> `&lt;`. (Prevent XSS).
- **SQL Context**: Use Parameterized Queries. (Prevent SQLi).
- **JSON Context**: Ensure valid JSON structure.

## 3. Authentication & Authorization
- **NIST Guidelines**:
  - Passwords: Min 12 chars, no complexity rules, check against pwned passwords.
  - MFA: Required for admin/privileged actions.
  - Sessions: Absolute timeout (e.g., 12 hours) + Idle timeout (e.g., 30 mins).
- **Authorization**:
  - **Broken**: `if (user.isAdmin)` (Client-side check).
  - **Fixed**: `if (ctx.user.hasPermission('delete:user'))` (Server-side check).

## 4. Cryptography
- **At Rest**: Use AES-256-GCM (Authenticated Encryption).
- **In Transit**: TLS version rule: `security/cryptography-standards.skill.md`.
- **Hashing**: Argon2id; parameters and legacy options: `security/cryptography-standards.skill.md`.
- **Secrets**: Never hardcode. Read them from the environment or the project's secret store.

Part of the path in `security/security-baseline.skill.md`; evidence goes in project/SECURITY_BASELINE.md.

## Constraints
- Validate input with strict schemas and convert types before range checks.
- Allow-list known good input; reject the rest.
- Check permissions on the server, never only on the client.

## Output Format
Code changes with, for each boundary touched, a short note of the controls applied: validation, output encoding, authentication and authorisation, cryptography.

## Limits and safety
- A secret found in code is removed from the code and the human is told to rotate it; moving it into a constant does not fix it. Removing it from git history needs the human's yes.
- Use maintained standard libraries for cryptography, authentication and sanitising (for example `DOMPurify`, an Argon2id or bcrypt library, the platform's crypto); never write your own, and check a new package's name and maintenance before adding it.
- Do not add a fallback to weaker protocols or algorithms for old clients; fail instead.
- Encode for the destination context (HTML body, attribute, script, URL, SQL); a value encoded for one context is not safe in another.
- Every handler that changes data checks permission on the server; being logged in is not permission.

Files in this skill

  • agent-trajectory-eval.skill.md5.7 KB
  • artisan-commands.skill.md3.7 KB
  • browser-tdd.skill.md7 KB
  • chaos-fault-injection.skill.md8.1 KB
  • ci-autofix.skill.md4.2 KB
  • clean-coder.skill.md4.5 KB
  • code-review.skill.md6.1 KB
  • debug.skill.md6.5 KB
  • documentation.skill.md7.3 KB
  • eval-driven-development.skill.md6.9 KB
  • evals/code-review.eval.yaml1 KB
  • excalidraw.skill.md3.7 KB
  • file-processing.skill.md4.3 KB
  • git-workflow.skill.md7.2 KB
  • metamorphic-testing.skill.md7.8 KB
  • mobile-dev.skill.md4.2 KB
  • nodejs-expert.skill.md1.6 KB
  • output-validation.skill.md5.4 KB
  • pbt-strategy.skill.md8 KB
  • performant-ai.skill.md3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.