Security Standards
Priority: P0 (CRITICAL)
Always-Apply Rules
Apply these on every code write, regardless of context:
- No hardcoded secrets: Use environment variables or secret managers. Never commit keys,
passwords, or tokens to source control.
- No raw SQL strings: Use parameterized queries or ORMs —
WHERE id = ${userId} is always
wrong.
- No stacktraces in prod: Return generic error codes; log full detail server-side only.
Workflow
Activate when: implementing auth, encryption, authorization, input handling, or any
security-sensitive feature.
- Identify trust boundaries — map every data entry point (API, UI, CSV, webhook).
- Validate and sanitize all external input at each boundary.
- Apply least privilege to users, services, and containers.
- Verify with SAST/DAST scanners in CI before merge.
Context-Specific Rules
Data Safeguarding
- Zero Trust: Never trust external input. Sanitize and validate every data boundary.
- Least Privilege: Grant minimum necessary permissions to users, services, and containers.
- Encryption: AES-256 for data-at-rest; TLS 1.3 for data-in-transit.
- PII Logging: Never log PII (email, phone, names). Mask sensitive fields before logging.
See implementation examples for parameterized queries and secret
management.
Secure Coding
- Injection Prevention: Use parameterized queries or ORMs to stop SQL, Command, and XSS
injections.
- Dependency Management: Regularly scan (
npm audit, pip audit) and update third-party
libraries to patch CVEs.
- Secure Auth: Implement Multi-Factor Authentication (MFA) and secure session management.
- Error Privacy: Never leak stack traces or internal implementation details to the end-user.
Continuous Security
- Shift Left: Integrate security scanners (SAST/DAST) early in the CI/CD pipeline.
- Data Minimization: Collect and store only the minimum data required for business logic.
- Audit Logging: Maintain logs for sensitive operations (Auth, Deletion, Admin changes).
Anti-Patterns
- No default passwords: Force rotation on first use with strong entropy requirements.
References
- Injection Testing Protocols (SQLi/HTMLi)
- Vulnerability Remediation & Secure Patterns
Source: li-lance/android-seraphim-framework — distributed by TomeVault.
1---2name: li-lance-android-seraphim-framework-common-security-standard3description: Security Standards4---56# Security Standards78## **Priority: P0 (CRITICAL)**910## Always-Apply Rules1112Apply these on **every code write**, regardless of context:1314- **No hardcoded secrets**: Use environment variables or secret managers. Never commit keys,15 passwords, or tokens to source control.16- **No raw SQL strings**: Use parameterized queries or ORMs — `WHERE id = ${userId}` is always17 wrong.18- **No stacktraces in prod**: Return generic error codes; log full detail server-side only.1920## Workflow2122Activate when: implementing auth, encryption, authorization, input handling, or any23security-sensitive feature.24251. **Identify trust boundaries** — map every data entry point (API, UI, CSV, webhook).262. **Validate and sanitize** all external input at each boundary.273. **Apply least privilege** to users, services, and containers.284. **Verify** with SAST/DAST scanners in CI before merge.2930## Context-Specific Rules3132### Data Safeguarding3334- **Zero Trust**: Never trust external input. Sanitize and validate every data boundary.35- **Least Privilege**: Grant minimum necessary permissions to users, services, and containers.36- **Encryption**: AES-256 for data-at-rest; TLS 1.3 for data-in-transit.37- **PII Logging**: Never log PII (email, phone, names). Mask sensitive fields before logging.3839See [implementation examples](references/implementation.md) for parameterized queries and secret40management.4142### Secure Coding4344- **Injection Prevention**: Use parameterized queries or ORMs to stop SQL, Command, and XSS45 injections.46- **Dependency Management**: Regularly scan (`npm audit`, `pip audit`) and update third-party47 libraries to patch CVEs.48- **Secure Auth**: Implement Multi-Factor Authentication (MFA) and secure session management.49- **Error Privacy**: Never leak stack traces or internal implementation details to the end-user.5051### Continuous Security5253- **Shift Left**: Integrate security scanners (SAST/DAST) early in the CI/CD pipeline.54- **Data Minimization**: Collect and store only the minimum data required for business logic.55- **Audit Logging**: Maintain logs for sensitive operations (Auth, Deletion, Admin changes).5657## Anti-Patterns5859- **No default passwords**: Force rotation on first use with strong entropy requirements.6061## References6263- [Injection Testing Protocols (SQLi/HTMLi)](references/INJECTION_TESTING.md)64- [Vulnerability Remediation & Secure Patterns](references/VULNERABILITY_REMEDIATION.md)6566---67> Source: [li-lance/android-seraphim-framework](https://github.com/li-lance/android-seraphim-framework) — distributed by [TomeVault](https://tomevault.io).68<!-- tomevault:4.0:skill_md:2026-06-16 -->