ai-secure-by-design is a platform-neutral security and privacy checking tool for AI-assisted development. It aims to solve the problem that AI coding tools generate code quickly but easily overlook rules, by moving rules out of prompts and into a deterministic engine, ensuring the same answer on every run and enforcing them in the editor, Git hooks and CI.
Purpose
The tool is used to automatically enforce security and privacy checks during AI-assisted development, helping teams detect and block sensitive information leaks before code is committed, and generate scaffolding code that complies with multiple regulations and standards.
Key capabilities
- Deterministic checking engine: The checking logic is implemented in code rather than prompts, so Claude, GPT, Gemini or a human running the CLI all see the same list of findings, each with a stable rule ID, severity and location.
- Sensitive data detection: Detects hardcoded secrets, Aadhaar numbers, PAN, mobile numbers, email addresses, etc., and blocks them in Claude Code, at commit time and in CI. Reports do not repeatedly display the specific values.
- Manifest-driven: A YAML manifest file records data categories, applicable regulations, retention policies and consent information. Only the regulations listed in the manifest are enforced; the tool does not automatically classify fields.
- Editable scaffolding: Provides code scaffolding for consent management, data subject rights, audit logging, RBAC, PHI redaction, AI decision logging, etc., placed directly into the repository and free to modify or delete.
- Multi-platform integration: Provides a CLI, an MCP server (supporting Claude, ChatGPT, Gemini, Copilot, Cursor, etc.), Git hooks (via the pre-commit framework), and a GitHub Action (supporting SARIF upload).
- Local operation: All checks run locally, with no telemetry and no hosted services. The MCP server's HTTP mode is optional and by default listens only on localhost.
Usage
- Quick start: Can be installed as a development dependency via npm (
npm i -D github:ankush1982/ai-secure-by-design#v0.2.1), then runnpx sbd check. A prebuilt CLI can also be used directly (dist/sbd.mjs), requiring only Node.js 20+. - Initialize a project: Run
sbd initto generate a manifest draft; you need to manually select regulations and classify data. - Git hooks: Add configuration in
.pre-commit-config.yaml, then runpre-commit install --hook-type pre-commit --hook-type commit-msg. - CI integration: Copy
templates/.github/workflows/secure-by-design.ymlinto the project, use the GitHub Action and fail the build when findings occur. - MCP server: Provides read-only tools such as
sbd_validate_manifest、sbd_check、sbd_scan_text, as well as prompts and resources. - Claude Code plugin: Provides slash commands such as
/sbd-init、/sbd-deploy、/sbd-checketc.
Applicable Scenarios
Suitable for development teams using AI coding tools, especially projects that need to comply with NIST SSDF, ISO 27001:2022, the India DPDP Act 2023, or the security practices in the AI Security Wiki. Can be used to embed privacy and security checks early in development, reducing the risk of sensitive data leakage.
Limitations
- Not a compliance certification, and does not constitute legal compliance or legal advice.
- Not a runtime SaaS; all checks run locally against the repository.
- Not an audit evidence collector;
sbd evidenceonly plans what to collect and reports what the checks find. - Cannot replace a Data Protection Officer or legal counsel.
- Platform support is unverified; integration points are based on the maintainer's knowledge as of mid-2026 and have not been tested on every platform.
- Rules are based on pattern matching; a clean report cannot prove that data does not exist.
- Placeholder values (such as @example.com) are skipped, and secret rules skip lock files, snapshots, and fixtures folders.
- Local blocking can be disabled via
--fail-on criticalor--no-verify, so it is recommended to make the GitHub Action a required check. - The scaffolding has not yet undergone legal review, especially the DPDP scaffolding.
- Current version v0.2.1, pending real-world validation.