Your AI Writes the Code. Who's Checking It for Security? Meet ai-Security-Skill
ai-security-skill is a local-first security control plane designed to integrate deterministic code analysis directly into AI-assisted development workflows, addressing the "marking your own homework" problem where AI agents verify their own code The system combines a Knowledge Layer (OWASP ASVS V5, OWASP API Security Top 10, OWASP Top 10 for GenAI/LLMs, NIST SSDF, CIS Controls) with a Verification Layer using TypeScript AST parsing, static analysis, and taint-flow detection Context-aware securit
Analysis
TL;DR
- ai-security-skill is a local-first security control plane designed to integrate deterministic code analysis directly into AI-assisted development workflows, addressing the "marking your own homework" problem where AI agents verify their own code
- The system combines a Knowledge Layer (OWASP ASVS V5, OWASP API Security Top 10, OWASP Top 10 for GenAI/LLMs, NIST SSDF, CIS Controls) with a Verification Layer using TypeScript AST parsing, static analysis, and taint-flow detection
- Context-aware security profiling automatically detects project dependencies (frameworks, databases, auth providers, sensitive integrations like Stripe/OpenAI) and activates only relevant security controls rather than running hundreds of irrelevant rules
- The TaintAnalyzer tracks data flow from untrusted sources (req.body, req.query) through transformations to sensitive sinks (payment APIs, database operations), enabling precise vulnerability detection beyond simple pattern matching
- MCP integration allows AI coding assistants (Cursor, Claude Code, Windsurf) to query security requirements before implementation and receive immediate feedback, while Architecture Decision Records provide version-controlled exception management
Why It Matters
This addresses a critical gap in the rapidly expanding AI-assisted development ecosystem: as agents generate code at unprecedented speed, traditional security workflows cannot keep pace with the volume and velocity of code creation. The "marking your own homework" problem highlights a fundamental trust deficit that will only worsen as AI agents gain more autonomous capabilities, making independent verification layers essential for enterprise adoption.
Technical Details
- Architecture: Two-layer system combining a Knowledge Layer (OWASP standards, NIST SSDF, CIS Controls) with a Verification Layer built on TypeScript Compiler API for AST parsing, static analysis, and taint-flow analysis
- Context Discovery:
discoverProjectfunction profiles workspaces by analyzing package.json, dependencies, and imports to identify application stack (Next.js, Express, Fastify), database stack (PostgreSQL, MongoDB, Prisma), authentication systems (Clerk, NextAuth, OAuth), and sensitive integrations (Stripe, OpenAI, LangChain) - Taint Flow Analysis: Tracks untrusted data sources (req.body, req.query, req.params, request.json()) through intermediate transformations to sensitive sinks (payment APIs, database operations), flagging entire data flows rather than isolated code points
- AIAgentAnalyzer: Specifically examines AI agent tool definitions for destructive operations (refund, delete, transfer) and validates authorization controls (auth(), session, userId, role) to prevent prompt injection attacks that could trigger unauthorized actions
- MCP Integration & ADRs: Exposes security controls as an MCP server for direct IDE integration; uses
.security/decisions/directory with version-controlled Architecture Decision Records that support expiration dates, approval workflows, and reviewer attribution for legitimate exceptions
Industry Insight
- The shift toward "security at the point of generation" rather than post-hoc scanning represents a fundamental workflow change that will become table stakes as AI coding agents reach mainstream enterprise adoption; organizations should evaluate tools that integrate into existing CI/CD pipelines and IDE environments
- Context-aware security profiling that reduces false positives by understanding project-specific technology stacks addresses the primary complaint developers have with traditional SAST tools—alert fatigue from hundreds of irrelevant findings—making security teams more likely to act on genuine vulnerabilities
- The MCP integration pattern demonstrates how security tooling can evolve from passive scanners to active participants in the development loop, enabling pre-emptive security guidance that shapes agent behavior before vulnerable code is written rather than detecting issues after the fact
Disclaimer: The above content is generated by AI and is for reference only.