Skip to content

Commit dda693a

Browse files
feat: add security guardrails to prevent credential exposure (#29)
* feat: add security guardrails to prevent credential exposure in proof artifacts Add security warnings and best practices throughout SDD workflow to prevent API keys and sensitive data from being committed in proof artifacts. Changes: - Add Security Considerations section to spec template - Add security warnings to proof artifact creation workflow - Add security validation gate to spec implementation validation - Document pre-commit hook options for secret scanning - Add security best practices section to README Related to issue #28 Co-authored-by: Damien Storm <ryderstorm@users.noreply.github.com> * fix: convert bold text to proper markdown headings in CONTRIBUTING.md Fixes markdownlint errors MD036/no-emphasis-as-heading by converting bold text used as headings to proper markdown heading syntax (####). Co-authored-by: Damien Storm <ryderstorm@users.noreply.github.com> * fix: clarify developer responsibility Clarify responsibility for reviewing artifacts before pushing to remotes. * build(release): configure semantic release commit message Add explicit commit message template for release commits that includes [skip ci] flag to prevent CI from triggering on automated version bumps. Update configuration comments to reflect template repo nature and add reference to python-semantic-release documentation. * docs: add autoupdate reminder for pre-commit hook versions --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
1 parent 5ef8bf9 commit dda693a

File tree

7 files changed

+103
-4
lines changed

7 files changed

+103
-4
lines changed

.releaserc.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1+
# See https://python-semantic-release.readthedocs.io/en/latest/configuration/configuration.html
2+
# for detailed documentation on the configuration options.
3+
14
[semantic_release]
25
# Use annotated tags like v1.2.3
36
tag_format = "v{version}"
47
# Allow 0.x.x versions (required for pre-1.0.0 releases)
58
allow_zero_version = true
6-
# Don't update version in any files since this is a markdown-only repo
7-
# Version is tracked via git tags only
9+
# Don't update version in any files since this is a template repo
810
version_variables = []
9-
# Generate changelog and commit version bumps
11+
# Assets to include in the release commit
1012
assets = []
13+
# Commit message for release commits - includes [skip ci] to prevent CI from running
14+
commit_message = "chore(release): {version} [skip ci]\n\nAutomatically generated by python-semantic-release"
1115

1216
[semantic_release.changelog]
1317
# Generate CHANGELOG.md in Markdown

CONTRIBUTING.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,51 @@ pre-commit install
2929
- Keep changes small and focused; prefer incremental PRs.
3030
- All prompts are plain Markdown files in the `prompts/` directory.
3131

32+
### Recommended: Secret Scanning Pre-commit Hooks
33+
34+
To prevent accidental commits of API keys, tokens, or other sensitive data (especially in proof artifacts), consider adding secret scanning to your pre-commit configuration:
35+
36+
#### Option 1: gitleaks (recommended)
37+
38+
```yaml
39+
# Add to .pre-commit-config.yaml
40+
repos:
41+
- repo: https://github.com/gitleaks/gitleaks
42+
rev: v8.18.0 # Update to the latest version (run `pre-commit autoupdate`)
43+
hooks:
44+
- id: gitleaks
45+
```
46+
47+
#### Option 2: truffleHog
48+
49+
```yaml
50+
# Add to .pre-commit-config.yaml
51+
repos:
52+
- repo: https://github.com/trufflesecurity/trufflehog
53+
rev: v3.63.0 # Update to the latest version (run `pre-commit autoupdate`)
54+
hooks:
55+
- id: trufflehog
56+
args: ['--trace', 'filesystem', '.']
57+
```
58+
59+
#### Option 3: detect-secrets
60+
61+
```yaml
62+
# Add to .pre-commit-config.yaml
63+
repos:
64+
- repo: https://github.com/Yelp/detect-secrets
65+
rev: v1.4.0 # Update to the latest version (run `pre-commit autoupdate`)
66+
hooks:
67+
- id: detect-secrets
68+
args: ['--baseline', '.secrets.baseline']
69+
```
70+
71+
After adding a secret scanner, run `pre-commit install` again to activate it. The scanner will automatically check files before each commit and block commits containing potential secrets.
72+
73+
See the [pre-commit hooks documentation](https://pre-commit.com/hooks.html) for more secret scanning options.
74+
75+
> ⚠️ **Note:** To keep your hooks current with the latest versions, periodically run `pre-commit autoupdate`.
76+
3277
### Common Commands
3378

3479
```bash

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,32 @@ Once installed, you can use:
232232
- `/manage-tasks` - Manage task execution
233233
- `/validate-spec-implementation` - Validate implementation against spec
234234

235-
## Installation
235+
### Option 3: MCP Server (Advanced)
236+
237+
Run the prompts as an MCP server for programmatic access. This option is most useful for custom integrations and tools that support MCP.
238+
239+
> Note: MCP prompt support is not uniformly supported across AI tools. See [docs/mcp-prompt-support.md](./docs/mcp-prompt-support.md) for details.
240+
241+
### Workflow Essentials
242+
243+
1. Open `prompts/generate-spec.md` inside your AI assistant and follow the instructions to produce a new spec in `tasks/`.
244+
2. Point the assistant at the generated spec and run `prompts/generate-task-list-from-spec.md` to create the implementation backlog.
245+
3. Use `prompts/manage-tasks.md` while executing work to keep status, demo criteria, and proof artifacts up to date.
246+
247+
## Security Best Practices
248+
249+
### Protecting Sensitive Data in Proof Artifacts
250+
251+
Proof artifacts are committed to your repository and may be publicly visible. **Never commit real credentials or sensitive data.** Follow these guidelines:
252+
253+
- **Replace credentials with placeholders**: Use `[YOUR_API_KEY_HERE]`, `[REDACTED]`, or `example-key-123` instead of real API keys, tokens, or passwords
254+
- **Use example values**: When demonstrating configuration, use dummy or example data instead of production values
255+
- **Sanitize command output**: Review CLI output and logs for accidentally captured credentials before committing
256+
- **Consider pre-commit hooks**: Tools like [gitleaks](https://github.com/gitleaks/gitleaks), [truffleHog](https://github.com/trufflesecurity/truffleHog), or [talisman](https://github.com/thoughtworks/talisman) can automatically scan for secrets before commits
257+
258+
The SDD workflow prompts include built-in reminders about security, but ultimate responsibility lies with the developer to review artifacts before committing or pushing to remotes.
259+
260+
### Installation
236261

237262
```bash
238263
# Clone the repository

prompts/generate-spec.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,15 @@ Generate a comprehensive specification using this exact structure:
290290

291291
[Focus on implementation constraints and HOW it will be built. Mention technical constraints, dependencies, or architectural decisions. If no technical constraints, state "No specific technical constraints identified."]
292292

293+
## Security Considerations
294+
295+
[Identify security requirements and sensitive data handling needs. Consider:
296+
- API keys, tokens, and credentials that will be used
297+
- Data privacy and sensitive information handling
298+
- Authentication and authorization requirements
299+
- Proof artifact security (what should NOT be committed)
300+
If no specific security considerations, state "No specific security considerations identified."]
301+
293302
## Success Metrics
294303

295304
[How will success be measured? Include specific metrics where possible.]

prompts/generate-task-list-from-spec.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ Proof artifacts provide evidence of task completion and are essential for the up
8282
- **Enable validation** (provide evidence for `/validate-spec-implementation`)
8383
- **Support troubleshooting** (logs, error messages, configuration states)
8484

85+
**Security Note**: When planning proof artifacts, remember that they will be committed to the repository. Artifacts should use placeholder values for API keys, tokens, and other sensitive data rather than real credentials.
86+
8587
## Chain-of-Thought Analysis Process
8688

8789
Before generating any tasks, you must follow this reasoning process:

prompts/manage-tasks.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,15 @@ Each parent task must include artifacts that:
198198
- **Enable validation** (provide evidence for `/validate-spec-implementation`)
199199
- **Support troubleshooting** (logs, error messages, configuration states)
200200

201+
### Security Warning
202+
203+
**CRITICAL**: Proof artifacts will be committed to the repository. Never include sensitive data:
204+
205+
- Replace API keys, tokens, and secrets with placeholders like `[YOUR_API_KEY_HERE]` or `[REDACTED]`
206+
- Sanitize configuration examples to remove credentials
207+
- Use example or dummy values instead of real production data
208+
- Review all proof artifact files before committing to ensure no sensitive information is present
209+
201210
### Proof Artifact Creation Protocol
202211

203212
```markdown
@@ -216,10 +225,12 @@ For each parent task completion:
216225
- ## Verification section showing proof artifacts demonstrate required functionality
217226
[ ] **Format with Markdown**: Use code blocks, headers, and clear organization
218227
[ ] **Verify File Content**: Ensure the markdown file contains all required evidence
228+
[ ] **Security Check**: Scan proof file for API keys, tokens, passwords, or other sensitive data and replace with placeholders
219229

220230
**SIMPLE VERIFICATION**: One file per task, all evidence included
221231
**CONTENT VERIFICATION**: Check the markdown file contains required sections
222232
**VERIFICATION**: Ensure proof artifact file demonstrates all required functionality
233+
**SECURITY VERIFICATION**: Confirm no real credentials or sensitive data are present
223234

224235
**The single markdown proof file must be created BEFORE the parent task commit**
225236
```

prompts/validate-spec-implementation.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ If no spec is provided, follow this exact sequence:
7474
- **GATE C:** All Proof Artifacts are accessible and functional → **REQUIRED**.
7575
- **GATE D:** All changed files are either in "Relevant Files" list OR explicitly justified in git commit messages → **REQUIRED**.
7676
- **GATE E:** Implementation follows identified repository standards and patterns → **REQUIRED**.
77+
- **GATE F (security):** Proof artifacts contain no real API keys, tokens, passwords, or other sensitive credentials → **REQUIRED**.
7778

7879
## Evaluation Rubric (score each 0–3 to guide severity)
7980

@@ -137,6 +138,7 @@ For each Functional Requirement, Demoable Unit, and Repository Standard:
137138
- CLI commands execute successfully with expected output
138139
- Test references exist and can be executed
139140
- Screenshots/demos show required functionality
141+
- **Security Check**: Proof artifacts contain no real API keys, tokens, passwords, or sensitive data
140142

141143
3) **Requirement Coverage**
142144
- Proof Artifacts exist for each Functional Requirement
@@ -163,6 +165,7 @@ For each Functional Requirement, Demoable Unit, and Repository Standard:
163165
- Any `Unknown` entries in the Coverage Matrix
164166
- Repository pattern violations (coding standards, quality gates, workflows)
165167
- Implementation that ignores identified repository conventions
168+
- **Real API keys, tokens, passwords, or credentials in proof artifacts** (auto CRITICAL)
166169

167170
## Output (single human-readable Markdown report)
168171

0 commit comments

Comments
 (0)