You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: A software security skill that integrates with Project CodeGuard to help AI coding agents write secure code and prevent common vulnerabilities. Use this skill when writing, reviewing, or modifying code to ensure secure-by-default practices are followed.
4
+
metadata:
5
+
codeguard-version: "1.0.0"
6
+
framework: "Project CodeGuard"
7
+
purpose: "Embed secure-by-default practices into AI coding workflows"
8
+
---
9
+
10
+
# Software Security Skill (Project CodeGuard)
11
+
This skill provides comprehensive security guidance to help AI coding agents generate secure code and prevent common vulnerabilities. It is based on **Project CodeGuard**, an open-source, model-agnostic security framework that embeds secure-by-default practices into AI coding workflows.
12
+
13
+
## When to Use This Skill
14
+
This skill should be activated when:
15
+
- Writing new code in any language
16
+
- Reviewing or modifying existing code
17
+
- Implementing security-sensitive features (authentication, cryptography, data handling, etc.)
18
+
- Working with user input, databases, APIs, or external services
19
+
- Configuring cloud infrastructure, CI/CD pipelines, or containers
20
+
- Handling sensitive data, credentials, or cryptographic operations
21
+
22
+
## How to Use This Skill
23
+
When writing or reviewing code:
24
+
1. Always-Apply Rules: Some rules MUST be checked on every code operation:
25
+
- `codeguard-1-hardcoded-credentials.md` - Never hardcode secrets, passwords, API keys, or tokens
26
+
- `codeguard-1-crypto-algorithms.md` - Use only modern, secure cryptographic algorithms
27
+
- `codeguard-1-digital-certificates.md` - Validate and manage digital certificates securely
28
+
- `codeguard-1-safe-c-functions.md` - Avoid unsafe C/C++ functions and use safe alternatives
29
+
2. Context-Specific Rules: Apply rules from /rules directory based on the language of the feature being implemented using the table given below:
30
+
<!-- LANGUAGE_MAPPINGS_START -->
31
+
<!-- LANGUAGE_MAPPINGS_END -->
32
+
3. Proactive Security: Don't just avoid vulnerabilities-actively implement secure patterns:
33
+
- Use parameterized queries for database access
34
+
- Validate and sanitize all user input
35
+
- Apply least-privilege principles
36
+
- Use modern cryptographic algorithms and libraries
37
+
- Implement defense-in-depth strategies
38
+
39
+
## CodeGuard Security Rules
40
+
The security rules are available in the `rules/` directory.
41
+
42
+
### Usage Workflow
43
+
When generating or reviewing code, follow this workflow:
44
+
45
+
### 1. Initial Security Check
46
+
Before writing any code:
47
+
- Check: Will this handle credentials? → Apply codeguard-1-hardcoded-credentials
48
+
- Check: What language am I using? → Identify applicable language-specific rules
49
+
- Check: What security domains are involved? → Load relevant rule files
50
+
51
+
### 2. Code Generation
52
+
While writing code:
53
+
- Apply secure-by-default patterns from relevant Project CodeGuard rules
0 commit comments