---
name: security
description: Threat-models a change that crosses a trust boundary, turns each abuse case into a failing test, triages a scanner or advisory finding, and writes a design review into the design doc. Use when adding or changing auth, login, sessions, cookies, passwords, tokens, JWT, permissions, roles, user input, file uploads, webhooks, a fetch of a user-supplied URL, secrets, API keys, CORS, CSRF, XSS, SQL injection, a vulnerability, a CVE, a dependency or npm audit finding, a threat model, personal data, PII, GDPR, or an LLM feature that handles untrusted text, or when the user asks whether something is secure. Not for reviewing a whole diff - use `review`; not for Go-specific APIs - use go; not for SQL or schema design - use database.
title: security
canonical_url: https://skilld.dev/gh/avik-creator/agent-skills/security
last_updated: 2026-11-17T15:45:41.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: [references/controls.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/controls.md), [references/dependencies-and-scanning.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/dependencies-and-scanning.md), [references/llm.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/llm.md), [references/privacy.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/privacy.md), [references/threat-model.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/threat-model.md).
>
> If the user asked to install this Skill, run `npx skilld install avik-creator/agent-skills/security`. 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`, 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/avik-creator/agent-skills/security) 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`. 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 --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/security --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.

# Security

Treat a value as trusted only because of who wrote it. Write the threat model and the abuse-case tests before the feature. Leave the result in chat, or as a section of the design doc. Do not create a security-output folder.

## Quick start

1. Pick a mode: building across a trust boundary, triaging a finding, or reviewing a design.
2. Stop for a yes on anything in the ask-first list.
3. Run the checks the project already has, plus the two checks under Scanners.
4. Hand over what ran, what did not, and a "Could improve" list.

## Building across a trust boundary

Use this when the change accepts input, decides who may act, sets a session, takes an upload, fetches a URL, reads a secret, opens a file named by data, or handles model output.

1. In chat, name the trust boundaries, the assets, the STRIDE letters for each interaction, and 2–5 abuse cases. Trust follows who wrote a value, not which channel delivered it. Read [threat-model.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/threat-model.md).
2. Turn each abuse case into a test and watch it fail, then write the code. Why: a control you have not seen fail is unproven.
3. Apply the controls in [controls.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/controls.md). A model feature also needs [llm.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/llm.md).
4. Personal, payment, or health data also needs [privacy.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/privacy.md).

**Example.** "Fetch the title of a URL the user pastes." Caller to process: all of STRIDE. Process to outbound call: tampering, information disclosure, denial of service, and the caller picks the destination. One abuse case: the URL resolves to a link-local address. The test expects that fetch to be refused, and it fails before the check exists.

## Triage a finding

A scanner hit, an advisory, or a reported bug. For each one, say whether the code is on a runtime, build, test, or deploy path, whether a fix is published, and which cell of the impact × likelihood grid it sits in. Propose one fix and apply it after a yes. A deferral records a reason and a review date. Do not run a forced remediation (`npm audit fix --force` or the equivalent). Why: it can change dependency ranges the project did not choose. Steps: [dependencies-and-scanning.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/dependencies-and-scanning.md).

## Design review

Write the STRIDE table, tag each control preventive, detective, or corrective, and write the residual risk. Add that section to the design doc through the design-docs skill, using the template in [threat-model.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/threat-model.md). Why: a review that exists only in chat disappears.

## Ask first

Stop for a yes before a new or changed auth flow, a new category of personal or sensitive data, a CORS change, an upload handler, a rate-limit change, granting a role or permission, or a new external integration. Why: each of these is hard to take back once it is live.

## Scanners

Run the scanners the project already configured. On a security-relevant change, also run the ecosystem's known-vulnerability check when that command is already available (govulncheck as the go skill describes, `npm audit`, `pnpm audit`, `pip-audit`, or `cargo audit`), and this secrets check, which prints file names only:

```sh
git diff --cached -i -G'password|secret|api_key|token' --name-only
```

A printed name is a file to open before you commit. Why: the check must not copy a secret into the tool log. Do not install a scanner, add one to CI, add a config, or suppress a finding unless asked. A suppression names the rule and the reason. Commands and the optional scanner set: [dependencies-and-scanning.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/dependencies-and-scanning.md).

## Hand over

- What ran, and the result. What you could not run, and why.
- The threat model, the triage, or the design-doc section.
- **Could improve:** each gap with a one-line setup. Propose it, and apply it after a yes.

## Replies

Talk to the user in simple English: short sentences, everyday words, and a technical term only where it is needed, explained the first time it appears.

## References

| File | Read when |
|---|---|
| [threat-model.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/threat-model.md) | starting a feature, rating a finding, or writing the design-review section |
| [controls.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/controls.md) | implementing a control |
| [llm.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/llm.md) | the feature calls a model or puts untrusted text in a prompt |
| [dependencies-and-scanning.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/dependencies-and-scanning.md) | a finding, a new dependency, a release, no scanners, or choosing the audit command |
| [privacy.md](https://skilld.dev/api/skills-raw/avik-creator/agent-skills/security/references/privacy.md) | personal, payment, or health data |
