Security best practices

From akillness/jeo-skills · View interactive version

Security best practices is an AI agent skill from the GitHub repository akillness/jeo-skills. Routing-first skill for web/application/API hardening. Use when the main job is classifying which security layer is missing — browser/perimeter policy, session/cookie/CSRF, abuse controls, validation/unsafe execution, secrets/runtime config, or verification — and turning vague OWASP/security asks in

How to use this skill

Skill file

Security Best Practices

Use this skill when the job is to name one missing security layer and turn it into a bounded hardening brief.

The job is not to dump a giant OWASP list, middleware catalog, or scanner parade.

The job is to:

  1. frame the surface and risk,
  2. choose one primary hardening mode,
  3. recommend the smallest credible first slice,
  4. name the verification ladder,
  5. route adjacent work honestly.

Read these support docs first:

When to use this skill

When not to use this skill

Instructions

Step 1: Frame the hardening job before naming tools

Capture the minimum facts first.

security_intake:
  surface: frontend | backend-api | fullstack | edge-worker | marketing-site | game-service-web | mixed | unknown
  workflow_type: new-build | hardening-pass | audit-review | launch-readiness | incident-follow-up | migration
  auth_session_model: cookie-session | bearer-token | mixed | unknown
  current_controls:
    - headers-csp
    - csrf
    - rate-limit
    - validation
    - secret-store
    - scanning
    - none
  primary_risk: xss-browser-policy | csrf-session | abuse-automation | injection-unsafe-execution | secret-exposure | verification-gap | mixed | unknown
  environments: local | preview | staging | prod | multi-env | unknown
  ownership: app-team | platform | security | shared | unknown

Rule: do not start with “install Helmet,” “turn on CORS,” or “just add WAF rules.”

First label the missing layer.

Step 2: Choose exactly one primary hardening mode

Use the router in references/mode-packets-and-route-outs.md.

Primary modes:

  1. browser-perimeter-policy
  2. session-cookie-csrf
  3. abuse-controls
  4. validation-unsafe-execution
  5. secrets-runtime-config
  6. review-verification

Pick the highest-risk missing layer as primary.

List everything else as follow-up, not as equal co-owners.

Step 3: Keep the invariants visible

These rules survive every answer:

Step 4: Build the security hardening brief

Return this structure:

# Security Hardening Brief

## Scope
- Surface: ...
- Workflow type: ...
- Primary mode: ...
- Confidence: high | medium | low

## Current control state
- Controls already present: ...
- Missing or untrusted controls: ...

## Highest-risk gaps
1. ...
2. ...
3. ...

## Recommended first slice
1. ...
2. ...
3. ...

## Verification plan
- Manual review: ...
- Static/policy checks: ...
- Dynamic/runtime verification: ...
- Operational evidence: ...

## Ownership and route-outs
- Primary owner: ...
- Adjacent skills / teams: ...

Step 5: Use the mode packet, not a giant checklist

Pull the packet from references/mode-packets-and-route-outs.md.

Mode rules:

Step 6: Route adjacent work explicitly

Use these route-outs when the problem crosses boundaries:

| If the real job is... | Route to... |

|---|---|

| auth vendor choice, enterprise SSO, org/member model, hosted-vs-native auth | authentication-setup |

| API auth/error/webhook contract design | api-design |

| schema constraints, token tables, migration/data-model safety | database-schema-design |

| backend security regression tests or CI gates | backend-testing |

| concrete vulnerability fix or risky diff review | debugging / code-review |

| environment bootstrap or secret injection wiring | system-environment-setup / environment-setup |

Output expectations

A strong answer from this skill should:

  1. identify the primary missing layer,
  2. recommend one bounded first slice,
  3. name the verification ladder,
  4. avoid pretending one library/tool solves everything,
  5. route adjacent work outward instead of absorbing it.

Examples

Example 1: cookie-based admin app hardening

Input

Our Next.js admin app uses cookie sessions. POST routes lack CSRF protection and staging/prod cookie flags drift.

Output direction

Example 2: marketing-site form abuse

Input

Our signup and demo-request forms are getting spammed even after adding a honeypot and CAPTCHA.

Output direction

Example 3: game-service secret leakage risk

Input

We have a game companion site plus backend APIs. I’m worried partner keys and admin tokens are drifting into CI logs and maybe client bundles.

Output direction

Example 4: scanner report with weak ownership

Input

The scanner says weak CSP and missing headers, but the app already added middleware and no one trusts the result.

Output direction

Best practices

  1. Choose the missing security layer before naming tools.
  2. Keep browser policy, session safety, abuse controls, validation, secrets, and verification separate.
  3. Pair every recommendation with evidence that would prove it worked.
  4. Treat framework defaults and scanners as inputs, not final answers.
  5. Prefer one bounded hardening brief over a giant compliance dump.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.