This skill provides quick, secure templates for common features using existing utilities, enabling fast, safe implementations like contact forms and public
npx playbooks add skill harperaa/secure-claude-skills --skill built-in-controls
This skill provides simple, fast security prompt templates for common features that leverage existing Secure Vibe Coding OS utilities. These are streamlined templates for straightforward implementations that don't require extensive customization.
When to use these templates:
When to use prompt-engineering instead:
File: 01_contact_form.md
When to use: Public form with full security stack
Time: 15-30 minutes
Security Controls (Pre-configured):
Implementation:
Trigger keywords: "contact form", "simple form", "feedback form", "quick form", "form with security"
Use case: Contact forms, feedback forms, newsletter signups, support requests
Difference from prompt-engineering/01_secure_form.md:
---
File: 02_authenticated_update.md
When to use: User data modification with auth
Time: 30 minutes
Security Controls (Pre-configured):
Implementation:
Trigger keywords: "authenticated update", "update profile", "user update", "edit profile", "user data modification"
Use case: Profile updates, user settings, preference changes
Important: For resources requiring strict ownership verification, follow up with:
→ .claude/skills/security/security-prompts/auth-authorization/03_ownership.md
Difference from prompt-engineering/02_authenticated_endpoint.md:
---
File: 03_public_api.md
When to use: Public GET endpoints with validation
Time: 20 minutes
Security Controls (Pre-configured):
Implementation:
Trigger keywords: "public API", "public endpoint", "GET endpoint", "read-only API", "public data"
Use case: Blog posts, product catalogs, public listings, documentation
Difference from prompt-engineering/03_public_endpoint.md:
---
Simple contact form:
→ 01_contact_form.md ✅
Profile editing:
→ 02_authenticated_update.md ✅
Public data listing:
→ 03_public_api.md ✅
Admin features:
→ Use prompt-engineering/04_admin_action.md ❌ (not here)
File uploads:
→ Use prompt-engineering/05_file_upload.md ❌ (not here)
For: [Simple feature name]
Template: built-in-controls/[template].md
Estimated time: [15-30 minutes]
This uses existing Secure Vibe Coding OS utilities:
- [List utilities from template]
Let me implement this quickly...
Start with built-in-controls, upgrade if needed:
Started with: built-in-controls/02_authenticated_update.md
Need to add: Ownership verification for team resources
Upgrade to: auth-authorization/03_ownership.md
Started with: built-in-controls/01_contact_form.md
Need to add: File attachment support
Upgrade to: prompt-engineering/05_file_upload.md
built-in-controls/01_contact_form.md:
prompt-engineering/01_secure_form.md:
Choose built-in-controls when: Standard contact form, quick implementation
Choose prompt-engineering when: Custom fields, complex validation, learning security patterns
built-in-controls/02_authenticated_update.md:
prompt-engineering/02_authenticated_endpoint.md:
Choose built-in-controls when: User editing their own profile/settings
Choose prompt-engineering when: Team resources, complex permissions, admin features
built-in-controls/03_public_api.md:
prompt-engineering/03_public_endpoint.md:
Choose built-in-controls when: Simple data listing
Choose prompt-engineering when: Search, complex filtering, advanced pagination
1. Quick Implementation
→ built-in-controls/[template].md
2. Test
→ Follow template testing checklist
3. Deploy
→ Update threat model (threat-modeling/08_update_model.md)
1. Start Simple
→ built-in-controls/[template].md
2. Add Complexity (if needed)
→ Upgrade to prompt-engineering/[template].md
→ Or add auth-authorization/[template].md
3. Test Thoroughly
→ prompt-engineering/08_security_testing.md
4. Review
→ threat-modeling/04_code_review.md
All templates use these Secure Vibe Coding OS utilities:
withCsrf():
import { withCsrf } from "@/lib/security/csrf";
export const POST = withCsrf(handler);
withRateLimit():
import { withRateLimit } from "@/lib/security/rate-limit";
export const POST = withRateLimit(withCsrf(handler), {
requests: 5,
window: 15 * 60 // 15 minutes
});
safeTextSchema:
import { safeTextSchema } from "@/lib/validation";
const schema = z.object({
message: safeTextSchema.max(1000)
});
emailSchema:
import { emailSchema } from "@/lib/validation";
const schema = z.object({
email: emailSchema
});
validateRequest():
import { validateRequest } from "@/lib/validation";
const data = await validateRequest(req, schema);
handleApiError():
import { handleApiError } from "@/lib/errors";
try {
// Logic
} catch (error) {
return handleApiError(error);
}
auth():
import { auth } from "@clerk/nextjs/server";
const { userId } = auth();
if (!userId) return Response.json({error: "Unauthorized"}, {status: 401});
- [ ] Form requires CSRF token
- [ ] Rate limiting blocks 6th submission
- [ ] XSS in message field is sanitized
- [ ] Invalid email rejected
- [ ] Empty fields rejected
- [ ] Form submission succeeds with valid data
- [ ] Unauthenticated request rejected (401)
- [ ] User can update own data
- [ ] User cannot update other user's data (403)
- [ ] Invalid data rejected
- [ ] Rate limiting works
- [ ] Success response correct
- [ ] Endpoint returns data without auth
- [ ] Pagination works correctly
- [ ] Invalid query params rejected
- [ ] Rate limiting enforces limits
- [ ] Error responses secure
- [ ] Performance acceptable
❌ Admin features
→ Use: prompt-engineering/04_admin_action.md
❌ File uploads
→ Use: prompt-engineering/05_file_upload.md
❌ Complex authorization
→ Use: auth-authorization/[appropriate_template].md
❌ Multiple middleware layers
→ Use: prompt-engineering/06_composable_middleware.md
❌ Custom security patterns
→ Use: prompt-engineering/07_new_control.md
❌ Team/organization resources
→ Use: prompt-engineering/02_authenticated_endpoint.md + auth-authorization/03_ownership.md
User: "Add a contact form"
Agent Response:
"I'll use the quick contact form template from built-in-controls.
This leverages existing security utilities for a 15-30 minute implementation.
Loading: .claude/skills/security/security-prompts/built-in-controls/01_contact_form.md"
User: "The contact form needs file attachment support"
Agent Response:
"File uploads require additional security controls beyond the simple template.
I'll upgrade to the comprehensive file upload template.
Switching to: .claude/skills/security/security-prompts/prompt-engineering/05_file_upload.md"
Begin with built-in-controls:
Upgrade when needed:
Even simple templates need testing:
If customizing beyond template:
// Custom rate limit for this endpoint
// Deviation from template: Increased to 10 requests per 15 min
// Reason: Users frequently update bio
withRateLimit(handler, { requests: 10, window: 15 * 60 })
1. Quick Implementation
→ security-prompts-controls (this skill)
2. Security Testing
→ prompt-engineering/08_security_testing.md
3. Update Threat Model
→ threat-modeling/08_update_model.md
1. Start Simple
→ security-prompts-controls (this skill)
2. Add Authorization
→ security-prompts-auth
3. Add Advanced Features
→ security-prompts-engineering
4. Review Security
→ security-prompts-threat-modeling
Parent Skill:
Implementation Skills (referenced by templates):
Note: For other template categories (comprehensive implementation, authentication, threat modeling), see the parent security-prompts skill
v1.0 (2025-10-23): Initial skill creation
---
Note: These templates are optimized for speed and simplicity. For comprehensive security guidance and complex features, see the parent security-prompts skill directory.
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.