factory-security-engineer

factory-security-engineer is a skill for Claude Code, Codex from nonlinear-xyz/factory-kit. It costs 106 tokens per session (1,452 once invoked), scanned A, original, MIT.

A security review guide for features, AI-generated code, and systems that handle sensitive information such as health, identity, or financial data.

In plain words
What is it for?
It helps threat-model requests, classify data, protect regulated information with encryption, review authentication boundaries, and check how data enters and leaves a system.
Why use it?
It helps identify risks in access control, data storage, redirects, logging, rate limits, and administrative shortcuts before they become security problems.

Skill for Claude CodeCodex

Part of the factory-kit plugin — 37 skills, 8 commands, 12 agents, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/nonlinear-xyz/factory-kit/factory-security-engineer
Any agent
npx skills add nonlinear-xyz/factory-kit --skill factory-security-engineer
Clone the repo
git clone --depth 1 https://github.com/nonlinear-xyz/factory-kit

Made for: Claude Code, Codex.

Or install factory-kit, the plugin that ships this one along with the rest of its 37 skills, 8 commands, 12 agents, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for factory-security-engineer

README.md
[![agentmods](https://agentmods.dev/badge/skills/nonlinear-xyz/factory-kit/factory-security-engineer.svg)](https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-security-engineer)
Your own site
<a href="https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-security-engineer"><img src="https://agentmods.dev/badge/skills/nonlinear-xyz/factory-kit/factory-security-engineer.svg" alt="Measured on agentmods" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,452 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00106 $0.01452
Opus 5 $0.00053 $0.00726
Sonnet 5 $0.00021 $0.00290
Haiku 4.5 $0.00011 $0.00145

Measured 4d ago against content hash 9c01190ee9af, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

factory-security-engineer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/factory-security-engineer/SKILL.md · 145 lines

How it starts

The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Apply the security-engineer specialist workflow. Threat-model and harden builds against concrete risks rather than producing generic security advice. Load factory-security through the host's skill capability when needed. The mandate is specific: PHI handling, AI-code risk, sensitive data at rest, and regulated industries.

How to think (in order)

  1. What data does this touch? Categorize:

    • Public — no concern
    • Internal — log and audit, no encryption needed at rest
    • Sensitive PII — names, addresses, phone numbers; redact in logs
    • Regulated — PHI (HIPAA), SSN, financial accounts, government IDs; encrypt at rest with KMS
    • If it's not clear, assume one tier higher than the request implies.
  2. What's the threat surface? Walk the request path:

    • Ingress — who can call this? Auth check? Rate limit?
    • Authz — what roles? Org context? Admin bypass risk?
    • Mutation — is this state-changing? Does it touch prod data?
    • Egress — does it leak data? Email, webhooks, logs, response body?
    • AI-generated code path — was this generated? Read-only by default? Reviewed?
  3. Is encryption-at-rest needed? If yes:

    • KMS encrypt on write, decrypt only at the handler that returns plaintext, mask elsewhere
    • Encryption context (e.g. { userId }) bound to ciphertext
    • Never decrypt at the API boundary "just in case"
  4. Is BAA required? If the data touched could be PHI and you're sending it via Resend / SendGrid / SMS:

    • Verify a signed BAA with the provider
    • Promote check from comment to runtime assertion (env flag + boot-time check)
    • Document the check in the email helper file
  5. Auth checks present? Audit:

    • requireAuth() at the entry point
    • requireRole() for role-gated operations
    • withOrgContext() for multi-tenant scoping
    • Admin client wrapped in withAdmin(fn) — never at module scope
    • JWT signature validated (not just decoded)
    • Allowlists are DB-backed, not hardcoded
  6. Rate limiting? If exposed publicly or to untrusted users:

    • Upstash Redis (or Cloudflare Rate Limit) for serverless
    • In-memory limiters are dev-only or single-instance-only
  7. AI-code risks? If this was AI-generated or is part of an AI-generated path:

    • Read-only by default — write access opt-in per feature, surfaces in review queue
    • Mandatory review — no prod-data mutation without explicit human approval
    • Version snapshots — rollback target for every change
    • Token budget — per-customer caps to prevent runaway loops
  8. Logging risk? Audit logger calls for PII leakage:

    • Actions and IDs are OK; raw payloads are not
    • PII in logs creates compliance scope creep
    • Redact at the logger layer if you can't avoid at the call site
  9. Trace ID present? Every request should have a x-request-id propagated through to response headers + logs. If absent, propose adding the middleware.

Read the full file on GitHub · 145 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 145 lines · 106 tokens per session scan A 9c01190ee9af

Subscribe to this mod's changes

factory-security-engineer is a skill published in the GitHub repository nonlinear-xyz/factory-kit (9 stars, last pushed 1mo ago), licensed MIT. It adds 106 tokens to every session and 1,452 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.