用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/oyi77/1ai-skills --skill security-agent命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | security-agent |
| description | Use when bug bounty hunter and security auditor. Finds vulnerabilities before they find production. |
| domain | agents |
| author | oyi77 |
| license | Apache-2.0 |
| subdomain | ai-agents |
| tags | ["agent","ai-agent","automation","security","coding"] |
| version | 1.0.0 |
Quick Reference — see parent for full agent ecosystem.
The Security Agent scans code changes, endpoints, and configurations for vulnerabilities before they reach production. It combines static analysis (Semgrep, CodeQL), secret scanning (Gitleaks, TruffleHog), dependency auditing, and dynamic probing to surface findings ranked by severity with evidence and fix recommendations. Its adversarial mindset assumes every input is malicious and every exposed endpoint is an attack surface.
# Refer to the skill's usage section for specific commands
# Adapt these to your workflow
"""Minimal security agent pattern — scan a diff for vulnerabilities."""
import json, sys, re
def scan_diff(diff_text: str) -> dict:
findings = []
lines = diff_text.split("\n")
patterns = {
"P1": {
"eval": r"\beval\s*\(",
"exec": r"\bexec\s*\(",
"raw_sql": r"\.execute\(.*['\"].*SELECT|INSERT|UPDATE|DELETE",
"hardcoded_key": r"(?:sk-|pk-|AKIA|-----BEGIN (?:RSA |EC )?PRIVATE KEY-----)",
},
"P2": {
"pickle_load": r"pickle\.loads?\(",
"assert_true": r"assert True",
"debug_endpoint": r"@app\.route\(.*['\"]/debug",
"insecure_hash": r"hashlib\.md5|hashlib\.sha1",
}
}
for severity, checks in patterns.items():
for name, pattern in checks.items():
for i, line in enumerate(lines):
if line.startswith("+") and re.search(pattern, line):
findings.append({
"file": "changed_file", "line": i,
"severity": severity, "type": name,
"finding": f"Potential detected",
:
})
{
: findings,
: {
: ([f f findings f[] == ]),
: ([f f findings f[] == ]),
: ([f f findings f[] == ])
},
: (f[] == f findings) findings
}
__name__ == :
diff = sys.stdin.read()
result = scan_diff(diff)
(json.dumps(result, indent=))
| Rationalization | Reality |
|---|---|
| "It is an internal endpoint, no one can reach it" | Internal endpoints are one SSRF or compromised VPN away from public — protect everything |
| "We will add security later" | Security added after launch is exponentially more expensive and often ships incomplete |
| "The framework protects against XSS/SQLi by default" | ORMs and templating engines have escape hatches and edge cases — verify, do not assume |
Use before every deployment to production, on any commit touching auth/payments/PII/external APIs, when adding new dependencies, and as a recurring audit of existing code. Do NOT use on third-party code you cannot modify, for real-time decisions requiring human judgment, or when the agent lacks access to the full application context (auth flows, data model) needed to assess impact accurately.