安全检查很适合做成 Skill,因为它有稳定 checklist,而且容易被普通开发任务忽略。
OpenAI 官方 skills 里也有 security 相关技能可以参考:
github.com
GitHub - openai/skills: Skills Catalog for Codex
Skills Catalog for Codex
我会检查这些点
- 是否误提交密钥、token、cookie。
- 是否把
.env、日志、私钥放进仓库。 - 新增接口有没有鉴权。
- 用户输入有没有校验。
- 文件上传有没有类型和大小限制。
- SQL/命令/路径拼接有没有注入风险。
- 依赖有没有明显高危包。
SKILL.md 草稿
---
name: security-check
description: Check code changes for secrets, authentication, authorization, input validation, injection risk, and unsafe file handling. Use before merging backend, auth, upload, payment, or infrastructure changes.
---
# Security Check
Focus on exploitable issues, not generic advice.
Check:
1. Secrets and credentials
2. Authentication and authorization
3. Input validation
4. SQL/command/path injection
5. File upload safety
6. Dependency and config risks
7. Logging of sensitive data
Output findings with severity, file path, impact, and minimal fix.
Do not suggest large rewrites unless required.
适合触发的场景
登录注册
权限控制
文件上传
支付回调
Webhook
数据库查询
脚本执行
CI/CD 配置
不适合触发的场景
普通文案、颜色、布局调整就没必要跑完整安全检查。
所以 description 里最好写清楚:什么时候用,什么时候不用。
我的经验是:安全 Skill 不需要很长,但 checklist 要硬。
2 个帖子 - 1 位参与者