security-and-hardening

Review and harden code handling untrusted input, authentication, and sensitive data.

Updated Aug 5, 2026
One-click install
npx skills add https://github.com/ahsanghalib/ai-workflow --skill security-and-hardening-ahsanghalib
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: security-and-hardening
Source: https://github.com/ahsanghalib/ai-workflow/tree/main/skills/security-and-hardening
Command: npx skills add https://github.com/ahsanghalib/ai-workflow --skill security-and-hardening-ahsanghalib

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Security-sensitive code changes often ship without a clear threat model, leaving gaps in input validation, authorization, secret handling, and dependency safety that only surface after an incident. ## Core Features & Use Cases - Threat Modeling: Records assets, actors, trust boundaries, abuse cases, and required invariants before any security-sensitive change. - Baseline Security Controls: Applies explicit checks for input validation, parameterized queries, output encoding, server-side authorization, secret hygiene, and safe file/URL handling. - Approval Gates and Review Workflow: Pauses for explicit approval before changing authentication, authorization, sensitive-data, or integration behavior, then verifies with tests, static analysis, and diff review. - Use Case: When adding a file upload endpoint, use this Skill to trace the input path, constrain file size and destination, enforce server-side authorization, and verify no secrets or stack traces leak in error responses. ## Quick Start Review this authentication change for security issues and list the trust boundaries, controls checked, and residual risks before I approve it.

Frequently Asked Questions about security-and-hardening

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review code for security vulnerabilities before merging?▼

Start with a threat model covering assets, actors, trust boundaries, and abuse cases, then trace input, validation, authorization, storage, and error paths. Test one threat at a time, apply the smallest hardening change, and review the final diff for secret exposure and missing authorization.

How to prevent SQL injection and command injection in application code?▼

Parameterize database queries and use the repository's safe data-access abstraction instead of concatenating untrusted values into queries or commands. Validate and size-limit input at every external boundary with an allowlist or schema.

When should a security review require explicit approval before changes?▼

Approval is required before changes altering authentication, authorization, sessions, sensitive-data handling, external integrations, CORS, webhooks, uploads, rate limits, or production data. Prepare the proposed change, affected boundary, rollback, and validation plan first.

Does this approach replace a full threat model for large changes?▼

No, it is not a substitute for a dedicated threat model on unrelated cosmetic or framework-independent changes. For AI-specific threats pair it with an AI security review, and for dependency or release-chain risks pair it with supply-chain security review.

Why should secrets never appear in logs or error responses?▼

Logging credentials, tokens, personal data, or sensitive request bodies creates information disclosure paths that attackers can exploit. Return safe, stable errors to callers and keep stack traces, SQL, and filesystem paths out of user-facing responses.