Back to skills
SKILL.md
Secure Coding
ASecuritySecure coding — input validation and output encoding, parameterized queries, safe deserialization, SSRF defences, path traversal, file upload safety, CSRF and CORS, crypto via vetted libraries, error handling without leaks, logging without secrets/PII, dependency hygiene. Use when writing or reviewing code handling untrusted input (secure coding, injection, XSS, SSRF, CSRF, validation).
- 5 stars
- 0 votes
- 0 copies
- 0 views
- Added December 3, 2026
Works with
Security analysis
100/100npx -y skills add vectora-os/kit --skill secure-coding --agent claude-codeAre you the author of Secure Coding?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vectora-os-secure-coding)---
name: secure-coding
description: Secure coding — input validation and output encoding, parameterized queries, safe deserialization, SSRF defences, path traversal, file upload safety, CSRF and CORS, crypto via vetted libraries, error handling without leaks, logging without secrets/PII, dependency hygiene. Use when writing or reviewing code handling untrusted input (secure coding, injection, XSS, SSRF, CSRF, validation).
metadata:
category: security
---
# Secure coding
## Purpose
Write code that treats every external input as hostile.
**Use when:** implementing or reviewing code at trust boundaries.
**Not for:** infrastructure hardening.
## Inputs
- Code, threat model.
## Outputs
- Secure code and review findings with fixes.
## Read first
- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "secure coding"` for prior decisions, patterns and anti-patterns.
- [Security standard](../../../standards/security.md)
## Steps
1. **Boundaries.** Identify untrusted inputs (HTTP, files, messages, LLM output).
Done when inputs listed.
2. **Validate.** Schema validation, allow-lists, size limits.
Done when unknown input rejected.
3. **Encode and parameterize.** Parameterized queries; context-aware encoding; no shell string building.
Done when no injection sinks.
4. **Fail safe.** Generic errors to clients; detailed logs without secrets.
Done when no stack traces leaked.
## Best practices
- Outbound URLs only from allow-listed config (SSRF).
- Use framework security features rather than custom code.
## Common mistakes
- Blacklist filtering.
- Logging tokens or full requests.
## Example
Image import by URL: allow-list domains, resolve and block private IPs, no redirects, size limit — SSRF closed.
## Reusable prompt
```text
Apply the Secure coding skill (.agents/skills/secure-coding/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Review the code at its trust boundaries for validation, injection, SSRF, encoding and error leakage.
Return: Secure code and review findings with fixes..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.