Skip to content
Back to skills

Secure Coding

ASecurity

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).

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsrustgoshellsecurity

Works with

  • cli

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add vectora-os/kit --skill secure-coding --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Secure Coding?

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

Security grade badge for Secure Coding
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectora-os-secure-coding/badge)](https://www.skillsdirectory.com/skills/vectora-os-secure-coding)

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: 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

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.