---
name: miosa-osa-harden
description: "Analyzes the project's current security posture and applies hardening measures: security headers, dependency updates, authentication improvements, input validation, and configuration tightening. Produces a before/after comparison."
metadata:
  decimalai-skill-id: "297e13bb-5a27-421b-97a4-85bee7e3a0de"
  decimalai-version-id: "45f785ab-b9f7-4e6e-bacc-033e8faefd2c"
  decimalai-version: "1"
  decimalai-body-sha256: "64432947ea7dd8ae02bb858900e713e07c54b3a0e57520d80df1271d8390689c"
  decimalai-name: "miosa-osa/harden"
  decimalai-format: "1"
  decimalai-invocation: "model"
  decimalai-category: "security"
  decimalai-source: "https://app.decimal.ai/s/miosa-osa-harden@1/SKILL.md"
---
# /harden

> Apply security hardening to a project -- headers, configs, dependencies, and best practices.

## Usage
```
/harden [path] [--focus <headers|deps|auth|all>] [--dry-run]
```

## What It Does
Analyzes the project's current security posture and applies hardening measures: security headers, dependency updates, authentication improvements, input validation, and configuration tightening. Produces a before/after comparison.

## Implementation
1. **Assess current state** -- scan for security headers, dependency versions, auth config, input validation.
2. **Generate hardening plan** -- prioritized list of improvements by impact.
3. **Apply changes** (unless `--dry-run`):
   - **Headers**: add HSTS, CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy.
   - **Dependencies**: update packages with known CVEs.
   - **Auth**: strengthen password policy, session config, token expiration.
   - **Input**: add validation schemas where missing.
   - **Config**: disable debug mode, hide server info, set secure cookie flags.
4. **Verify** -- run security scan to confirm improvements.
5. **Report** -- before/after security posture comparison.

## Examples
```bash
# Full hardening
/harden

# Dry run to see what would change
/harden --dry-run

# Focus on security headers only
/harden --focus headers

# Focus on dependency updates
/harden --focus deps
```
