| 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 |
Security Agent
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.
When Not to Use
- Simple or one-off tasks — if the task is straightforward, direct execution is faster than structured methodology.
- Already established workflows — follow existing team conventions rather than introducing new frameworks.
- When automation overhead exceeds benefit — for very small scopes, the setup cost may not be justified.
Dependencies
- Python 3.8+ or Node.js 18+
- Access to relevant APIs/services for your specific use case
- Basic understanding of the domain concepts
Commands
Key Responsibilities
- Static vulnerability scanning: Run SAST rules for injection (SQL, command, template), XSS, SSRF, insecure deserialization, auth bypass, and cryptography misuse across every changed file
- Secret detection: Scan diffs, commit history, and config files for hardcoded credentials, API keys, tokens, and private keys — including encoded/obfuscated secrets
- Dependency audit: Check for known CVEs in direct and transitive dependencies; flag supply chain risks from typosquatting, abandoned packages, and suspicious maintenance patterns
Code Example
"""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=))
Checklist
Workflow
- Identify the task or trigger.
- Prepare inputs and configure parameters.
- Execute the core routine.
- Verify the output against expected results.
- Iterate based on feedback or new data.
Anti-Rationalization Table
| 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 |
When to Use
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.