---
name: security-first-review
description: Published skill from SDLC Skills Hub (SRS Architect themed). Extracted and structured for agent use.
source: https://sdlc.base44.app/skill/security-first-review
priority: foundation-first
title: security-first-review
canonical_url: https://skilld.dev/gh/imawais-engineer/skills/security-first-review
last_updated: 2026-11-14T09:15:25.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [agents/openai.yaml](https://skilld.dev/api/skills-raw/imawais-engineer/skills/security-first-review/agents/openai.yaml).
>
> If the user asked to install this Skill, run `npx skilld install imawais-engineer/skills/security-first-review`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/security-first-review`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/imawais-engineer/skills/security-first-review) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/security-first-review`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/security-first-review --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/security-first-review --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

V1.0.0
Security First Review

Review applications for security gaps after functional implementation and before stable release. Use when checking auth, authorization, API routes, database access, validation, secrets, file uploads, dependencies, AI features, deployment configuration, audit logs, rate limits, or whether an app is safe to release.

Security First Review

Skill SK-12 · Phase 5 — Hardening & Release (Security review) · Applies to: web apps, Android apps, APIs, AI apps Security is the second priority after a working app. Review in a fixed order, harden in layers, test after each layer.

1. Purpose

AI-generated apps often work and leak at the same time: open database rules, unprotected routes, secrets in the client, AI that obeys injected instructions. Asking an AI to "make it secure" produces vague, sweeping rewrites that break features — another loop. This skill is a structured review: a fixed order, a standard finding format with severity and a concrete fix, and a release gate.

2. When to use — and when not to

Use it after functional implementation and before any stable release; when checking auth, authorization, data access, input validation, secrets, APIs, uploads, AI features or deployment configuration.

Do not use it on a non-functional prototype — make it work first (SK-06). For payments, health/legal data, credentials, multi-tenant data, file processing, public APIs or high-impact automation, escalate to a deeper audit.

3. Inputs required
Input	Source	Required
Working app (prototype passed)	SK-06	Yes
Roles and access rules	SRS §3, §7	Yes
Sensitive data and compliance	SK-02 / SRS §6	Yes
Code, routes, database rules, deployment config	Repository / platform	Yes
4. Procedure — review order
Step	Area	What to check
1	Readiness	Core app is functional enough to review.
2	Threat model	Assets, users, roles, trust boundaries, sensitive data.
3	Authentication	Sign-in, sessions, token storage (Android: no tokens in plain SharedPreferences; use encrypted storage).
4	Authorization	Role checks, protected routes/screens, data ownership on every read and write.
5	Input/output	Validation, output encoding, structured errors.
6	Database	Access rules (RLS), migrations, indexes, seed data, policies.
7	APIs and jobs	API routes, server actions, background jobs, webhooks (signature verification).
8	Secrets and dependencies	Env vars, secret storage, dependency risks, build config (Android: no keys in the APK, ProGuard/R8, exported components).
9	Files and integrations	Upload type/size limits, downloads, third-party integrations, AI features.
10	Deployment	HTTPS, reverse proxy, ports, DNS, logs, process manager, backups.
11	Encapsulation	Apply SK-11 wherever public UI/APIs mention configuration, modes, credentials or provider internals.
AI-specific checks

Prompt-injection boundaries · separation of instructions and untrusted content · output validation before saving or acting · tool/action approval gates · data privacy and retention · usage abuse, rate limits and cost controls · audit logs for AI actions.

Finding format
Field	Content
ID	SEC-n
Severity	Critical / High / Medium / Low
Location	File, route, component or configuration (with line numbers when available)
Risk	Exploit scenario in one or two sentences
Fix	Concrete change
Validation	Test that proves the fix
Requirement	FR/NFR ID affected
5. Deliverables
Threat model summary (assets, roles, trust boundaries).
Findings table in the format above, sorted by severity.
Fix log with validation results, layer by layer.
6. Acceptance criteria
Given user A, when requesting user B's private data through UI or API, then access is denied.
Given an unauthenticated request to a protected route, then it is rejected.
Given the client bundle/APK, then no secrets are present.
Given every Critical and High finding, then it is fixed and its validation test passes.
7. Verification checklist — stable release gate
 Auth and authorization match the required roles.
 Critical inputs validated server-side.
 Secrets not exposed; backend configuration and provider internals not exposed (SK-11).
 Database rules prevent cross-user access.
 Sensitive routes protected.
 Rate limits and audit logs where relevant.
 AI checks passed where AI is used.
 Every fix tested; core workflow still passes.
8. Failure modes and anti-loop guards
Failure mode	Guard
"Make it secure" sweeping rewrites that break features	One finding → one fix → one test; re-run core workflow tests.
Security only in the UI (hidden buttons)	Authorization enforced server-side / in DB rules.
Findings without fixes	Finding format requires Fix and Validation.
Security added before the app works	Readiness step 1.
AI tools obeying injected text	AI-specific checks.
9. Prompt template
ROLE: Application security reviewer. Do not change code until findings are approved.
SCOPE: <app>, roles: <...>, sensitive data: <...>, platforms: <web/Android>.
REVIEW IN ORDER: threat model → authentication → authorization/ownership → input/output → database rules → APIs/jobs/webhooks → secrets/dependencies/build → files/integrations/AI → deployment → encapsulation.
OUTPUT: findings table: ID | Severity | Location (file:line) | Risk | Fix | Validation test | FR/NFR ID.
THEN (after approval): fix one finding at a time, run its validation test and the core workflow tests, report Pass/Fail.
NEVER: rewrite unrelated code; weaken a check to make a test pass.

10. Traceability to the SRS

Security requirements are NFR-SEC IDs; each finding cites the requirement it violates; each fix's validation is a TC ID in SRS §14. New security requirements found in review are added to the SRS first.

11. Definition of done

All Critical and High findings are fixed and validated, the release-gate checklist is fully ticked, the core workflow still passes, and verification and validation both pass.

Related skills

SK-11 Encapsulation · SK-13 Stable Release Hardening · SK-07 Data Persistence Design.

RELATED LEARNING

Vibe Coding & AI-Assisted Development

28 MIN READ

Ready to hand this to your AI?

Copy the skill, drop it into your project, and require the AI to read it before the first prompt.

COPY SKILL
DOWNLOAD .MD