Security Engineer logo

Security Engineer

Community
wasintoh
security-engineer

Security-first auditing of AI-generated code — Level 1 quick checks during /toh-dev and /toh-test (hardcoded secrets, dangerous code execution, obvious injection vectors) and Level 2 full audits for /toh-protect (SQL/XSS/command injection, auth and authorization flaws, configuration and dependency risks) with human-readable, actionable fix reports. Use for any security review or before shipping.

Overview

Publisherwasintoh
Repositorytoh-framework
Skill namesecurity-engineer
Stars
96
Forks
19
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by wasintoh on GitHub. Read the source before you install it.

Installation

Install the Security Engineer AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wasintoh/toh-framework.git /tmp/toh-framework
mkdir -p .claude/skills
cp -r /tmp/toh-framework/src/skills/security-engineer .claude/skills/security-engineer
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Security Engineer in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Security Engineer on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Security Engineer is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Security Engineer Skill

Overview

Security-first approach for AI-generated code auditing. Provides both quick checks (during dev/test) and comprehensive audits (full protection).

Core Philosophy

"Trust, but verify - especially AI-generated code"

  1. Proactive Detection - Catch issues before they become vulnerabilities
  2. Layer Defense - Quick checks + Full audits = Maximum coverage
  3. Zero False Sense - Don't trust code just because it "looks safe"
  4. Human-Readable Reports - Clear findings with actionable fixes

Security Check Levels

text
+-------------------------------------------------------------+
|  LEVEL 1: Quick Check (during /toh-dev, /toh-test)          |
|  - Hardcoded secrets                                        |
|  - Dangerous imports/code execution                         |
|  - Basic auth issues                                        |
|  - Obvious injection vectors                                |
|  Duration: < 5 seconds                                      |
+-------------------------------------------------------------+
                           |
                           v
+-------------------------------------------------------------+
|  LEVEL 2: Full Audit (/toh-protect)                         |
|  - All Level 1 checks                                       |
|  - Injection attacks (SQL, XSS, Command)                    |
|  - Auth/Authorization flaws                                 |
|  - AI-Generated Code risks                                  |
|  - Configuration security                                   |
|  - Dependency vulnerabilities                               |
|  Duration: 30-60 seconds                                    |
+-------------------------------------------------------------+

Level 1: Quick Check Patterns

1.1 Hardcoded Secrets Detection

Detection Patterns:

text
SECRET_PATTERNS:
  # API Keys
  - Pattern for api_key, apikey with 20+ char values
  - Pattern for sk-live, pk-live, sk-test prefixes

  # AWS
  - Pattern: AKIA followed by 16 alphanumeric chars
  - Pattern for aws_secret values

  # Database URLs
  - Connection strings with embedded credentials

  # Private Keys
  - PEM format key headers

  # JWT Secrets
  - jwt_secret, secret_key patterns

  # Generic passwords
  - password/passwd/pwd assignments

Files to check:

  • **/*.ts, **/*.tsx, **/*.js, **/*.jsx
  • **/*.env* (.env, .env.local, .env.production)
  • **/config/**, **/*.json

Files to IGNORE:

  • **/node_modules/**, **/.git/**
  • **/dist/**, **/build/**
  • **/*.test.*, **/*.spec.*

1.2 Dangerous Code Patterns Detection

CRITICAL - Block immediately:

text
CRITICAL_PATTERNS:
  # Dynamic code execution
  - String-based code evaluation functions
  - Timer functions with string arguments

  # Dangerous Node.js modules
  - Shell command execution
  - Process spawning with shell mode

  # SQL without parameterization
  - Template literals in SQL statements
  - String concatenation in queries

  # Dangerous HTML rendering
  - React's unsafe HTML rendering attribute
  - Direct HTML content assignment to DOM

WARNING - Review required:

text
WARNING_PATTERNS:
  # Disabled security
  - ESLint security rule disabling
  - TypeScript strict mode bypasses
  - CORS with wildcard origin

  # Unsafe data handling
  - JSON parsing without validation
  - Deserialization of untrusted data

  # Weak cryptography
  - Deprecated hash algorithms (MD5, SHA1)
  - Non-cryptographic random for security

1.3 Basic Auth Issues

text
AUTH_PATTERNS:
  # Hardcoded credentials
  - Default admin/root credentials

  # Disabled auth
  - Authentication bypass flags
  - Skip auth configurations

  # Weak session
  - Short session secrets
  - Insecure cookie settings

  # JWT issues
  - None algorithm acceptance
  - Signature verification disabled

Quick Check Output Format

text
+------------------------------------------------------------+
|  QUICK SECURITY CHECK                                      |
+------------------------------------------------------------+

Scanning: src/**/*.{ts,tsx,js,jsx}

CRITICAL (2 issues - must fix!)
-----------------------------------
1. Hardcoded API Key
   File: src/lib/api.ts:15
   Code: const API_KEY = "sk-live-abc123..."
   Fix:  Use environment variable: process.env.API_KEY

2. SQL Injection Risk
   File: src/api/users.ts:42
   Code: SELECT with template literal interpolation
   Fix:  Use parameterized query: WHERE id = $1

WARNING (1 issue - review recommended)
-----------------------------------
1. Disabled ESLint Security
   File: src/utils/parse.ts:8
   Why:  Security rules should not be disabled

====================================
Summary: 2 critical, 1 warning
Status: BLOCKED - Fix critical issues
====================================

Level 2: Full Audit Patterns

2.1 Injection Attack Detection

SQL Injection

Vulnerable patterns:

  • String concatenation in queries
  • Dynamic table/column names via interpolation
  • Raw queries without ORM parameterization

Safe patterns:

  • Positional placeholders ($1, $2 for PostgreSQL)
  • Question mark placeholders (MySQL/SQLite)
  • Named parameters (various ORMs)
XSS (Cross-Site Scripting)

Vulnerable patterns:

  • Unsafe HTML rendering in React components
  • Direct DOM HTML content manipulation
  • User input in dynamically created HTML
  • Unvalidated URL assignments

Safe patterns:

  • HTML sanitization with DOMPurify
  • Text content assignment (no HTML parsing)
  • Proper output encoding
Command Injection

Vulnerable patterns:

  • Shell execution with user input
  • Unsanitized process arguments
  • Path traversal sequences

2.2 Authentication/Authorization Flaws

text
AUTH_FLAWS:
  # Missing auth checks
  - API routes without middleware
  - Unprotected admin endpoints

  # Insecure session
  - Missing secure flag on cookies
  - Missing httpOnly flag
  - Improper sameSite configuration

  # JWT vulnerabilities
  - Algorithm confusion attacks
  - Excessive token lifetime

  # CORS misconfig
  - Wildcard origin with credentials
  - Overly permissive origins

  # Missing rate limiting
  - Auth endpoints without throttling

2.3 AI-Generated Code Risks

text
AI_CODE_RISKS:
  # Common AI mistakes
  - Unimplemented TODO comments
  - Placeholder implementations
  - Debug logging left in code
  - Empty error handlers
  - Silently ignored exceptions

  # Over-trusting patterns
  - Unvalidated request data usage
  - Direct database queries with user input
  - Type assertion abuse
  - TypeScript safety bypasses

  # Hallucinated APIs
  - Non-existent library methods
  - Invented function calls

2.4 Configuration Security

Environment files:

  • No secrets in committed files
  • Suspicious encoded strings
  • Non-placeholder passwords

Package.json:

  • Outdated dependencies
  • Known vulnerabilities
  • Excessive permissions

Framework config:

  • Overly permissive image domains
  • Unsafe header configurations
  • Risky experimental features

Security Headers:

  • Content-Security-Policy
  • X-Frame-Options
  • X-Content-Type-Options
  • Strict-Transport-Security

2.5 Dependency Vulnerabilities

bash
# Commands to run
npm audit --json
npx audit-ci --moderate

Full Audit Report Format

text
+------------------------------------------------------------+
|  FULL SECURITY AUDIT                                       |
|  Project: [project-name]                                   |
|  Date: YYYY-MM-DD HH:mm                                    |
+------------------------------------------------------------+

EXECUTIVE SUMMARY
====================================
Risk Level: HIGH / MEDIUM / LOW
Files Scanned: 142
Issues Found: 8 (3 critical, 3 high, 2 medium)

CRITICAL ISSUES
====================================
[SEC-001] SQL Injection
|- File: src/api/users.ts:42
|- Risk: Database compromise
|- Fix: Use parameterized queries

[SEC-002] Hardcoded Secret
|- File: src/lib/stripe.ts:5
|- Risk: Credential exposure
|- Fix: Use environment variables

[SEC-003] XSS Vulnerability
|- File: src/components/Comment.tsx:28
|- Risk: Script injection
|- Fix: Sanitize with DOMPurify

HIGH ISSUES
====================================
[SEC-004] Missing Authentication
[SEC-005] CORS Misconfiguration
[SEC-006] Weak Session Secret

MEDIUM ISSUES
====================================
[SEC-007] Missing Rate Limiting
[SEC-008] Outdated Dependencies

RECOMMENDATIONS
====================================
1. [URGENT] Fix critical issues before deploy
2. [HIGH] Add authentication middleware
3. [HIGH] Configure CORS properly
4. [MEDIUM] Set up rate limiting
5. [LOW] Update dependencies

====================================
Report saved: .toh/security-audit-YYYY-MM-DD.md
====================================

Integration with Commands

Quick Check Integration

Add to /toh-dev and /toh-test:

text
BEFORE building/testing:
|- Run Level 1 Quick Check
|- If CRITICAL found → BLOCK
|- If WARNING found → WARN and continue
|- If clean → PASS

Full Audit Integration

Triggered by /toh-protect:

text
FULL AUDIT FLOW:
|- Step 1: Run all Level 1 checks
|- Step 2: Run Level 2 deep analysis
|- Step 3: Run npm audit
|- Step 4: Check security headers
|- Step 5: Generate report
|- Step 6: Save to .toh/security-audit-[date].md

Auto-Fix Capabilities

IssueAuto-FixMethod
Hardcoded secretsYesMove to .env
Dynamic code executionPartialSuggest alternatives
SQL injectionPartialConvert to parameterized
XSSYesAdd sanitizer wrapper
Missing headersYesUpdate config
CORS misconfigYesFix configuration
Outdated depsYesnpm audit fix

Requires Human Review

  • Authentication logic
  • Authorization rules
  • Business logic validation
  • Complex queries
  • Third-party integrations

Security Checklist

Before Development

  • Environment variables configured
  • .gitignore includes sensitive files
  • Dependencies audited

During Development

  • No hardcoded secrets
  • Input validation on user data
  • Parameterized queries
  • Output encoding
  • Auth on protected routes

Before Deployment

  • npm audit clean
  • Security headers set
  • CORS configured
  • Rate limiting enabled
  • Full audit passed

References

Frequently asked questions

What does the Security Engineer AI skill do?

Security-first auditing of AI-generated code — Level 1 quick checks during /toh-dev and /toh-test (hardcoded secrets, dangerous code execution, obvious injection vectors) and Level 2 full audits for /toh-protect (SQL/XSS/command injection, auth and authorization flaws, configuration and dependency risks) with human-readable, actionable fix reports. Use for any security review or before shipping.

Why use Security Engineer on TypingMind?

Because you install it once and use it with any model. Security Engineer is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Security Engineer in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wasintoh/toh-framework/tree/main/src/skills/security-engineer. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Security Engineer?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Security Engineer?

As many as you like. As long as a model supports skills, you can use Security Engineer with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Security Engineer AI skill free?

Yes. It is published on GitHub by wasintoh under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇