convez.ai
SkillSegurançaIntermediário
DeHor-Labs

ShieldCode

DeHor-Labs/shieldcode

Previne vulnerabilidades em código gerado por IA com regras de segurança ativas

Ver no GitHub
InicialPluginScore · de 0 a 100

Skill de endurecimento de segurança para fluxos de desenvolvimento assistido por IA. Impõe 8 regras de segurança (validação, SQL injection, XSS, autenticação, autorização, secrets, arquivos, dependências) e 6 de tratamento de erros, corrigindo vulnerabilidades comuns em código gerado por IA.

Instalação

$npx convez-ai DeHor-Labs/shieldcode

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
3
Forks
2
Acompanhando
1
Saúde
62%
Último commit
há 4 meses
Versão
v1.0.0
Issues abertas
5
Contribuidores
1

Casos de uso

  • Endurecimento automático de código gerado por Claude Code
  • Validação de entrada e prevenção de SQL injection
  • Implementação de autenticação segura (bcrypt, argon2, JWT)
  • Tratamento estruturado de erros e logging seguro
  • Conformidade com OWASP Top 10

Veredito

ShieldCode aborda um problema real: 62% do código gerado por IA contém vulnerabilidades. A skill é bem estruturada, com regras claras e exemplos antes/depois. Recomendado para equipes que usam Claude Code em produção e precisam garantir segurança sem revisar manualmente cada linha.

README

A tradução para o português deste README ainda está na fila.


The Problem

62% of AI-generated code contains at least one security vulnerability.

45% fail OWASP Top 10 checks. Error handling gaps are 2x more common in AI code than in human-written code. Claude is excellent at writing code fast - but without active guidance, it takes shortcuts: concatenating user input into SQL queries, using MD5 for passwords, swallowing exceptions silently, leaking stack traces to clients.

ShieldCode fixes this by giving Claude a set of non-negotiable rules that activate automatically whenever it touches user input, authentication, databases, APIs, file operations, or error handling.


What It Covers

Security (8 rules):

RuleWhat it enforces
Input ValidationAllowlist patterns, type/length/format/range checks
SQL Injection PreventionParameterized queries only - no string concatenation
XSS PreventionSafe DOM APIs, Content Security Policy, template autoescape
Authenticationbcrypt/argon2 only, full JWT verification, rate limiting, secure cookies
AuthorizationServer-side role checks, resource ownership validation
Secrets ManagementEnvironment variables only - no hardcoded keys, no secret logging
File SecurityPath traversal prevention, upload type/size restrictions
Dependency SafetyOnly real, known packages (slopsquatting prevention)

Error Handling (6 rules):

RuleWhat it enforces
Exception HierarchyTyped error classes - no raw Error throws
HTTP Status CodesCorrect 400/401/403/404/409/422/429/500 usage
Secure LoggingStructured JSON with correlation IDs, no PII or secrets
Retry with BackoffExponential backoff + jitter on all external calls
Circuit BreakerFail fast, recover gracefully
Async Error SafetyHandled promises, no unhandled rejections

Before / After

Every rule includes concrete UNSAFE vs SAFE examples in TypeScript and Python.

SQL Injection

// UNSAFE
db.query(`SELECT * FROM users WHERE id = '${id}'`);
// SAFE
db.query('SELECT * FROM users WHERE id = $1', [id]);

Password Hashing

// UNSAFE
const hash = crypto.createHash('md5').update(password).digest('hex');
// SAFE
const hash = await bcrypt.hash(password, 12);

Error Leakage

// UNSAFE
res.status(500).json({ error: err.stack });
// SAFE
logger.error({ correlationId, err });
res.status(500).json({ error: 'Internal server error', correlationId });

How it Works

  1. Install ShieldCode (one command)
  2. Write code normally
  3. Claude automatically follows secure patterns
  4. Ship secure code every time

ShieldCode is a knowledge skill - a SKILL.md file that Claude Code loads from ~/.claude/skills/shieldcode/. No tools. No scripts. No external calls. Pure guidance that shapes Claude's output at the source.


Install

curl -fsSL https://raw.githubusercontent.com/nikolasdehor/shieldcode/main/install.sh | bash
# Claude Code plugin
claude plugins install github:nikolasdehor/shieldcode
# Manual
mkdir -p ~/.claude/skills/shieldcode
curl -o ~/.claude/skills/shieldcode/SKILL.md \
  https://raw.githubusercontent.com/nikolasdehor/shieldcode/main/skills/shieldcode/SKILL.md

After installing, restart Claude Code. The skill activates automatically on security-sensitive code.


Requirements

  • Claude Code - any plan (Free, Pro, Teams)
  • That's it. Zero dependencies.

Roadmap

  • v1.0 - OWASP Top 10 + Error Handling (current)
  • v1.1 - CSRF protection, rate limiting patterns
  • v1.2 - Database design security patterns
  • v2.0 - Auto-scan mode (detect vulnerabilities in existing code)

License

MIT - see LICENSE


Ver o original no GitHub

Bom para

Relacionados