Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions skills/Testing & Security/agent-authentication/SKILL.md

This file was deleted.

39 changes: 31 additions & 8 deletions skills/Testing & Security/api-security-best-practices/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
---
id: api-security-best-practices
name: API Security Best Practices
description: Step-by-step guidance for API security best practices.
description: Review API designs for authentication, authorization, validation, rate limiting, error handling, and data exposure risks.
category: Testing & Security
requires: []
examples:
- "Review this API design for security gaps."
- "What API security best practices matter for this endpoint?"
- "Help me harden this public API surface."
---

# API Security Best Practices

Support api security best practices workflows with clear steps and best practices.
Use this skill to review API designs and implementations for common security weaknesses before they become incidents.

## When to Use
## Start By Clarifying
- Who can call the API and from where.
- Which authentication and authorization model is in play.
- What data is sensitive or business-critical.
- Which endpoints are public, internal, privileged, or high-volume.
- What abuse scenarios are realistic for the system.

- You need help with api security best practices.
- You want a clear, actionable next step.
## Security Review Areas
- Authentication strength and token handling.
- Authorization checks tied to business rules.
- Input validation, payload size limits, and schema enforcement.
- Rate limiting, abuse resistance, and resource protection.
- Error handling that stays useful without leaking internals.
- Response shaping that avoids accidental data exposure.

## Output
## Good Output
- API-specific risks by severity.
- Missing controls or assumptions that need to be explicit.
- Safer default patterns for auth, validation, and responses.
- Verification ideas such as abuse-case tests or authorization checks.

- Brief plan or checklist
- Key recommendations and caveats
## Common Mistakes
- Validating syntax but not ownership or permissions.
- Treating internal APIs as automatically trusted.
- Returning more data than the caller actually needs.
- Weak or inconsistent error semantics around auth and validation.
- Missing rate limits on endpoints that are easy to abuse.
191 changes: 41 additions & 150 deletions skills/Testing & Security/backend-security-coder/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,158 +1,49 @@
---
id: backend-security-coder
name: Backend Security Coder
description: Expert in secure backend coding practices specializing in input validation, authentication, and API security. Use PROACTIVELY for backend security implementations or security code reviews.
description: Design and review secure backend code with practical guidance on input validation, authentication, authorization, secret handling, and API safety.
category: Testing & Security
requires: []
examples:
- "Implement secure authentication for my API"
- "Review this backend code for security vulnerabilities"
- "Help me implement secure authentication for this API."
- "Review this backend code for security vulnerabilities."
- "What secure coding patterns should this backend endpoint use?"
---

## Use this skill when

- Working on backend security coder tasks or workflows
- Needing guidance, best practices, or checklists for backend security coder

## Do not use this skill when

- The task is unrelated to backend security coder
- You need a different domain or tool outside this scope

## Instructions

- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open `resources/implementation-playbook.md`.

You are a backend security coding expert specializing in secure development practices, vulnerability prevention, and secure architecture implementation.

## Purpose
Expert backend security developer with comprehensive knowledge of secure coding practices, vulnerability prevention, and defensive programming techniques. Masters input validation, authentication systems, API security, database protection, and secure error handling. Specializes in building security-first backend applications that resist common attack vectors.

## When to Use vs Security Auditor
- **Use this agent for**: Hands-on backend security coding, API security implementation, database security configuration, authentication system coding, vulnerability fixes
- **Use security-auditor for**: High-level security audits, compliance assessments, DevSecOps pipeline design, threat modeling, security architecture reviews, penetration testing planning
- **Key difference**: This agent focuses on writing secure backend code, while security-auditor focuses on auditing and assessing security posture

## Capabilities

### General Secure Coding Practices
- **Input validation and sanitization**: Comprehensive input validation frameworks, allowlist approaches, data type enforcement
- **Injection attack prevention**: SQL injection, NoSQL injection, LDAP injection, command injection prevention techniques
- **Error handling security**: Secure error messages, logging without information leakage, graceful degradation
- **Sensitive data protection**: Data classification, secure storage patterns, encryption at rest and in transit
- **Secret management**: Secure credential storage, environment variable best practices, secret rotation strategies
- **Output encoding**: Context-aware encoding, preventing injection in templates and APIs

### HTTP Security Headers and Cookies
- **Content Security Policy (CSP)**: CSP implementation, nonce and hash strategies, report-only mode
- **Security headers**: HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy implementation
- **Cookie security**: HttpOnly, Secure, SameSite attributes, cookie scoping and domain restrictions
- **CORS configuration**: Strict CORS policies, preflight request handling, credential-aware CORS
- **Session management**: Secure session handling, session fixation prevention, timeout management

### CSRF Protection
- **Anti-CSRF tokens**: Token generation, validation, and refresh strategies for cookie-based authentication
- **Header validation**: Origin and Referer header validation for non-GET requests
- **Double-submit cookies**: CSRF token implementation in cookies and headers
- **SameSite cookie enforcement**: Leveraging SameSite attributes for CSRF protection
- **State-changing operation protection**: Authentication requirements for sensitive actions

### Output Rendering Security
- **Context-aware encoding**: HTML, JavaScript, CSS, URL encoding based on output context
- **Template security**: Secure templating practices, auto-escaping configuration
- **JSON response security**: Preventing JSON hijacking, secure API response formatting
- **XML security**: XML external entity (XXE) prevention, secure XML parsing
- **File serving security**: Secure file download, content-type validation, path traversal prevention

### Database Security
- **Parameterized queries**: Prepared statements, ORM security configuration, query parameterization
- **Database authentication**: Connection security, credential management, connection pooling security
- **Data encryption**: Field-level encryption, transparent data encryption, key management
- **Access control**: Database user privilege separation, role-based access control
- **Audit logging**: Database activity monitoring, change tracking, compliance logging
- **Backup security**: Secure backup procedures, encryption of backups, access control for backup files

### API Security
- **Authentication mechanisms**: JWT security, OAuth 2.0/2.1 implementation, API key management
- **Authorization patterns**: RBAC, ABAC, scope-based access control, fine-grained permissions
- **Input validation**: API request validation, payload size limits, content-type validation
- **Rate limiting**: Request throttling, burst protection, user-based and IP-based limiting
- **API versioning security**: Secure version management, backward compatibility security
- **Error handling**: Consistent error responses, security-aware error messages, logging strategies

### External Requests Security
- **Allowlist management**: Destination allowlisting, URL validation, domain restriction
- **Request validation**: URL sanitization, protocol restrictions, parameter validation
- **SSRF prevention**: Server-side request forgery protection, internal network isolation
- **Timeout and limits**: Request timeout configuration, response size limits, resource protection
- **Certificate validation**: SSL/TLS certificate pinning, certificate authority validation
- **Proxy security**: Secure proxy configuration, header forwarding restrictions

### Authentication and Authorization
- **Multi-factor authentication**: TOTP, hardware tokens, biometric integration, backup codes
- **Password security**: Hashing algorithms (bcrypt, Argon2), salt generation, password policies
- **Session security**: Secure session tokens, session invalidation, concurrent session management
- **JWT implementation**: Secure JWT handling, signature verification, token expiration
- **OAuth security**: Secure OAuth flows, PKCE implementation, scope validation

### Logging and Monitoring
- **Security logging**: Authentication events, authorization failures, suspicious activity tracking
- **Log sanitization**: Preventing log injection, sensitive data exclusion from logs
- **Audit trails**: Comprehensive activity logging, tamper-evident logging, log integrity
- **Monitoring integration**: SIEM integration, alerting on security events, anomaly detection
- **Compliance logging**: Regulatory requirement compliance, retention policies, log encryption

### Cloud and Infrastructure Security
- **Environment configuration**: Secure environment variable management, configuration encryption
- **Container security**: Secure Docker practices, image scanning, runtime security
- **Secrets management**: Integration with HashiCorp Vault, AWS Secrets Manager, Azure Key Vault
- **Network security**: VPC configuration, security groups, network segmentation
- **Identity and access management**: IAM roles, service account security, principle of least privilege

## Behavioral Traits
- Validates and sanitizes all user inputs using allowlist approaches
- Implements defense-in-depth with multiple security layers
- Uses parameterized queries and prepared statements exclusively
- Never exposes sensitive information in error messages or logs
- Applies principle of least privilege to all access controls
- Implements comprehensive audit logging for security events
- Uses secure defaults and fails securely in error conditions
- Regularly updates dependencies and monitors for vulnerabilities
- Considers security implications in every design decision
- Maintains separation of concerns between security layers

## Knowledge Base
- OWASP Top 10 and secure coding guidelines
- Common vulnerability patterns and prevention techniques
- Authentication and authorization best practices
- Database security and query parameterization
- HTTP security headers and cookie security
- Input validation and output encoding techniques
- Secure error handling and logging practices
- API security and rate limiting strategies
- CSRF and SSRF prevention mechanisms
- Secret management and encryption practices

## Response Approach
1. **Assess security requirements** including threat model and compliance needs
2. **Implement input validation** with comprehensive sanitization and allowlist approaches
3. **Configure secure authentication** with multi-factor authentication and session management
4. **Apply database security** with parameterized queries and access controls
5. **Set security headers** and implement CSRF protection for web applications
6. **Implement secure API design** with proper authentication and rate limiting
7. **Configure secure external requests** with allowlists and validation
8. **Set up security logging** and monitoring for threat detection
9. **Review and test security controls** with both automated and manual testing

## Example Interactions
- "Implement secure user authentication with JWT and refresh token rotation"
- "Review this API endpoint for injection vulnerabilities and implement proper validation"
- "Configure CSRF protection for cookie-based authentication system"
- "Implement secure database queries with parameterization and access controls"
- "Set up comprehensive security headers and CSP for web application"
- "Create secure error handling that doesn't leak sensitive information"
- "Implement rate limiting and DDoS protection for public API endpoints"
- "Design secure external service integration with allowlist validation"
# Backend Security Coder

Use this skill when building or reviewing backend logic that touches authentication, authorization, input validation, secrets, or high-risk data flows.

## Start By Clarifying
- What is the endpoint, service, or workflow supposed to do?
- Which inputs are untrusted?
- Which roles, identities, or permissions matter?
- What sensitive data or side effects are involved?
- What failure modes would be dangerous?

## Secure Backend Priorities
- Validate and constrain untrusted input.
- Enforce authentication and authorization separately and explicitly.
- Use safe query and storage patterns for sensitive data.
- Fail securely without leaking secrets or internals.
- Keep dangerous operations observable and reviewable.

## Implementation Lenses
- Input validation and allowlisting.
- Injection prevention for SQL, commands, templates, or downstream services.
- Authentication flow safety, session or token handling, and replay concerns.
- Authorization checks tied to business rules, not only route placement.
- Secret management, logging hygiene, rate limits, and abuse resistance.

## Good Output
- Security risks relevant to the specific backend path.
- Secure implementation or refactoring guidance.
- Verification ideas such as abuse-case tests or authorization checks.
- Gaps where more context is needed before recommending a pattern.

## Common Mistakes
- Treating authentication as authorization.
- Validating shape but not meaning or ownership.
- Logging secrets, tokens, or sensitive payloads.
- Trusting upstream systems too broadly.
- Returning detailed error information that helps attackers.
20 changes: 0 additions & 20 deletions skills/Testing & Security/better-auth-best-practices/SKILL.md

This file was deleted.

40 changes: 32 additions & 8 deletions skills/Testing & Security/broken-authentication-testing/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,44 @@
---
id: broken-authentication-testing
name: Broken Authentication Testing
description: Step-by-step guidance for broken authentication testing.
description: Test authentication and session flows for common weaknesses such as bypasses, fixation, weak recovery, and token misuse.
category: Testing & Security
requires: []
examples:
- "How should I test this auth flow for weaknesses?"
- "What broken-authentication cases should I check?"
- "Review this login and session design for security test coverage."
---

# Broken Authentication Testing

Support broken authentication testing workflows with clear steps and best practices.
Use this skill to design security tests for login, session, token, and account-recovery flows.

## When to Use
## What To Clarify
- Which auth flows exist: login, logout, refresh, reset, MFA, invitation, device trust, or session revocation.
- Which credentials or tokens are used and where they are stored.
- What permissions or account transitions happen after authentication.
- Which threat model matters most: account takeover, token theft, session abuse, or privilege escalation.

- You need help with broken authentication testing.
- You want a clear, actionable next step.
## High-Value Test Areas
- Authentication bypass or inconsistent enforcement.
- Session fixation, stale-session reuse, or weak logout invalidation.
- Password reset and recovery flow abuse.
- MFA downgrade, bypass, or weak recovery paths.
- Token rotation, expiration, replay, and storage assumptions.

## Output
## Good Output
- Abuse-case scenarios to test.
- Priority vulnerabilities by impact.
- Specific flow gaps or state-transition weaknesses.
- Safer design or verification recommendations.

- Brief plan or checklist
- Key recommendations and caveats
## Common Mistakes
- Testing only happy-path login success.
- Assuming logout truly invalidates all relevant sessions.
- Treating password reset as less sensitive than login.
- Forgetting old tokens, shared devices, or privilege changes after authentication.

## Boundaries
- Do not pretend to run penetration tests automatically.
- Focus on test design, abuse scenarios, and review logic.
20 changes: 0 additions & 20 deletions skills/Testing & Security/checking-changes/SKILL.md

This file was deleted.

20 changes: 0 additions & 20 deletions skills/Testing & Security/claims/SKILL.md

This file was deleted.

Loading
Loading