agentsclimarketplace

Unicorn security

Skill andrey-learning-machines/swe-harness/plugins/swe-harness/skills/unicorn-security

Portable SWE harness plugin for Codex and Claude Code

Install
npx -y skills add andrey-learning-machines/swe-harness --skill unicorn-security

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Guides secure development using defense-in-depth and attacker's mindset. ALWAYS trigger on "security review", "vulnerability", "authentication", "authorization", "input validation", "XSS", "SQL injection", "CSRF", "secrets management", "OWASP", "threat model", "security scan", "path traversal", "mass assignment", "privilege escalation", "security headers", "bandit", "dependency audit", "hardening". Use when implementing auth, handling user input, storing secrets, reviewing code for vulnerabilities, or preparing for production deployment. Different from devops skill which covers infrastructure; this covers application-level security patterns.

SKILL.md

5.7 KB, as published. Nobody here has run it

<!-- Last reviewed: 2026-03 -->

Security: Think Like an Attacker

Core Principle

Defense in Depth + Least Privilege. Layer multiple controls. Grant minimum permissions. Assume every layer can fail.

Security Mindset

Six Questions (Every Feature)

  1. Who can access this? (Authentication)
  2. Are they allowed to? (Authorization)
  3. Can they see more than they should? (Data exposure)
  4. Can they do more than they should? (Privilege escalation)
  5. Can they break it for others? (Denial of service)
  6. Will we know if they do? (Audit logging)

OWASP Top 10 (Quick Reference)

#VulnerabilityKey Defense
1Broken Access ControlAuth check per resource, deny by default
2Cryptographic FailuresArgon2/bcrypt, never MD5/SHA1 for passwords
3Injection (SQL, XSS, Command)Parameterized queries, escaping, allowlists
4Insecure DesignRate limiting, STRIDE threat modeling
5Security MisconfigurationDebug off in prod, generic error messages
6Vulnerable Componentssafety check / npm audit
7Authentication FailuresSecure cookies, crypto-random session IDs
8Data Integrity FailuresJSON with validation, never pickle
9Logging FailuresLog security events, failed auth, admin actions
10SSRFURL allowlist, block internal IPs

See references/owasp-top-10.md for detailed bad/good code examples per vulnerability.


Input Validation

Allowlist over Denylist:

# BAD: Denylist (easy to bypass)
if username in ['admin', 'root']:
    raise ValueError()

# GOOD: Allowlist (explicit)
if not re.match(r'^[a-zA-Z0-9_]{3,20}$', username):
    raise ValueError("Invalid format")

Layered Validation:

from pydantic import BaseModel, validator, constr

class UserInput(BaseModel):
    username: constr(min_length=3, max_length=20, regex=r'^[a-zA-Z0-9_]+$')
    email: str
    age: int

    @validator('email')
    def validate_email(cls, v):
        if not re.match(r'^[\w\.-]+@[\w\.-]+\.\w+$', v):
            raise ValueError('Invalid email')
        return v.lower()

    @validator('age')
    def validate_age(cls, v):
        if not (0 <= v <= 150):
            raise ValueError('Age 0-150')
        return v

Output Encoding

Context-Aware:

from markupsafe import escape
from urllib.parse import quote

html = f"<div>{escape(username)}</div>"          # HTML context
url = f"https://example.com/search?q={quote(term)}"  # URL context
js = f"var name = {json.dumps(username)};"        # JS context
db.execute("SELECT * FROM users WHERE name = ?", [username])  # SQL: parameterize

Secrets Management

# BAD: Hardcoded
API_KEY = "sk_live_abc123"

# GOOD: Environment with verification
import os
for secret in ['API_KEY', 'DATABASE_URL', 'SECRET_KEY']:
    if secret not in os.environ:
        raise RuntimeError(f"Missing: {secret}")
# .env (add to .gitignore, NEVER commit)
API_KEY=sk_live_abc123

# .env.example (commit this)
API_KEY=your_api_key_here

Production: Use AWS Secrets Manager, HashiCorp Vault, or platform-native secret stores.


Common Vulnerability Fixes

Path Traversal

from pathlib import Path
BASE_DIR = Path('/var/data')
file_path = (BASE_DIR / filename).resolve()
if not file_path.is_relative_to(BASE_DIR):
    abort(403)

Mass Assignment

# BAD: user.update(**request.json)  # Attack: {"is_admin": true}
ALLOWED = ['name', 'email', 'bio']
for field in ALLOWED:
    if field in request.json:
        setattr(user, field, request.json[field])

CSRF Protection

from flask_wtf.csrf import CSRFProtect
csrf = CSRFProtect(app)
app.config['SESSION_COOKIE_SAMESITE'] = 'Strict'

Security Tooling

bandit -r src/ -f json -o report.json   # Static analysis
safety check                            # Python dependency scan
npm audit                               # Node dependency scan
trivy image myapp:latest                # Container scan

See references/security-tooling.md for pre-commit hooks, security headers config, and CI/CD integration.


Quick Checklist

Auth:

  • Auth required for protected endpoints
  • Authorization checked per resource
  • Password hashing (bcrypt/argon2)
  • Secure session management
  • MFA for sensitive operations

Input/Output:

  • All inputs validated (allowlist)
  • Parameterized queries
  • Context-aware output encoding
  • CSP headers set
  • Generic error messages (no stack traces)

Secrets & Crypto:

  • No secrets in code or git
  • Environment variables or secret manager
  • TLS everywhere
  • secrets module for random tokens

Monitoring:

  • Security events logged
  • Failed auth attempts tracked
  • Audit trail for admin actions
  • Alerts configured

Config:

  • Debug off in production
  • Security headers (HSTS, CSP, X-Frame-Options)
  • Default credentials changed
  • Dependencies updated

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.