Skip to content

sekar3s/secure-code

v1.0.0MIT

Security guardian: blocks secrets and dangerous commands before they land, scans for OWASP Top 10 patterns, and guides fast, minimal fixes so code ships safely.

🛡️ secure-code

Security guardian that helps you ship faster. It blocks hard-coded secrets and destructive commands before they land, flags OWASP Top 10 patterns as code is written, audits your supply chain, and guides minimal, tested fixes.

Version1.0.0
FormatAgent Plugins 1.0 + com.github.copilot extensions
Works inVS Code · GitHub Copilot CLI · GitHub Copilot app
RequiresNode.js 18+ and git on PATH
Network accessNone. Offline rules; secret values are always redacted

What's inside

ComponentNameLocationPortable?
Skillsecure-code-reviewskills/secure-code-review/✅ Agent Plugins standard
MCP servervuln-scout (stdio)mcp.json → servers/vuln-scout.mjs✅ Agent Plugins standard
Custom agentsecurity-guardian (read-only)com.github.copilot/agents/Copilot clients
HookssessionStart, preToolUse, postToolUsecom.github.copilot/hooks/hooks.jsonCopilot clients
Slash command/security-scancom.github.copilot/commands/Copilot clients
Automation templateNightly security sweepautomations/VS Code only

vuln-scout MCP tools (all read-only)

ToolWhat it finds
scan_secretsCloud keys, GitHub/Slack/Stripe tokens, private keys, connection strings, JWTs, hard-coded passwords (values redacted)
scan_insecure_patternsSQL injection, XSS, command injection, eval, unsafe deserialization, weak hashes, TLS bypass, permissive CORS, path traversal, open redirect, hard-coded JWT secrets, client-side auth, and more, each mapped to a CWE with a fix
audit_dependenciesMissing lockfiles, unbounded versions, non-registry sources, known-compromised npm packages, risky install scripts, unpinned GitHub Actions, pull_request_target misuse, and script injection in workflows
scan_snippetChecks proposed code before it's written
explain_cweCWE name, OWASP category, impact, and fix

Hooks: the policy backstop

EventBehavior (SECURE_CODE_MODE=enforce, the default)
sessionStartAdds secure-coding guidance to the session context
preToolUseDeny: writing high-confidence secrets, curl … | sh, rm -rf //~/*, chmod 777, disk wipes, disabling TLS verification, reading SSH/cloud credential files, piping env vars to the network. Ask: possible secrets, editing or reading .env/key files, --no-verify, sudo
postToolUseScans code that was just written and feeds medium+ findings (with CWE and fix) back to the agent so it corrects itself

These rules are fast, offline heuristics for the inner loop. They complement, and don't replace, GitHub code scanning (CodeQL), Dependabot, and secret scanning with push protection.

Install

copilot plugin marketplace add sekar3s/octocat-agent-plugins-demo
copilot plugin install secure-code@octocat-agent-plugins

VS Code and the GitHub Copilot app are covered in the installation guide.

Use it

Try thisWhere
/security-scanAny client
"Is this change safe to ship?" / "Review api/src/routes for vulnerabilities"Any client (the skill loads automatically)
security-guardian agentVS Code agent picker · CLI copilot --agent secure-code:security-guardian · Copilot app agent picker
node skills/secure-code-review/scripts/scan.mjs --path <repo> --changedTerminal or CI (exits 1 on high/critical findings)

Suppress a reviewed finding

Add a comment containing secure-code-ignore on the finding's line or the line above it, with a reason:

// secure-code-ignore: identifiers come from a fixed allow-list (TABLES)
await db.run(`DELETE FROM ${table.name}`);

The scan script reports findings in test and fixture files but doesn't count them as blocking unless you pass --include-tests.

Configuration

VariableDefaultEffect
SECURE_CODE_MODEenforceenforce = deny + ask · warn = ask only (never deny) · off = disable hooks
OCTOCAT_PLUGINS_AUDIT_DIRunsetWhen set, hook decisions are appended to <dir>/secure-code.jsonl. Commands are truncated; secret values are never logged

Remove

copilot plugin uninstall secure-code

See the uninstall guide for VS Code and the Copilot app.