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.
npx agentmods add skills/nonlinear-xyz/factory-kit/factory-security-engineernpx skills add nonlinear-xyz/factory-kit --skill factory-security-engineergit clone --depth 1 https://github.com/nonlinear-xyz/factory-kitWrote 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.
[](https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-security-engineer)<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>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.
| Model | Per session | Once 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 |
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.
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)
-
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.
-
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?
-
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"
-
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
-
Auth checks present? Audit:
requireAuth()at the entry pointrequireRole()for role-gated operationswithOrgContext()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
-
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
-
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
-
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
-
Trace ID present? Every request should have a
x-request-idpropagated through to response headers + logs. If absent, propose adding the middleware.
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.
- 4d ago First seen · 145 lines · 106 tokens per session scan A 9c01190ee9af
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.
Other skills, from other repositories
hook-template
Generate hook script from template. Use when adding a new hook, wiring a PreToolUse/PostToolUse/Stop/Notification hook, or scaffolding hook config for settings.json.
prompt-sensei
Stage-aware prompt coaching, prompt improvement, lookback analysis, prompting habit feedback, and local reports about prompt quality for AI coding agents such as Claude Code or Codex.
agent-template
Generate custom agent from template. Use when creating a new subagent from scratch, or scaffolding an agent file with correct frontmatter.
skill-template
Generate custom skill/command from template. Use when creating a new skill or slash command from scratch, or scaffolding a skill file with correct frontmatter.
check-environment
Verify Claude, Codex, and Grok availability plus Director guidance, relay, agents, and skills. Audit optional hooks only when selected. Use after installation or when a native surface misbehaves.
doc-writer
Documentation templates and standards: README structure, API reference format, changelog (Keep a Changelog), and comment guidelines. Use when creating or updating documentation. Loaded automatically by the doc-writer agent.