| name | guardian-ai-pentest-cli |
| description | Guardian is an AI-powered penetration testing automation CLI that leverages multiple AI providers (OpenAI, Claude, Gemini) and 19+ security tools to orchestrate intelligent, step-by-step penetration testing workflows with comprehensive evidence capture. |
| triggers | ["run a penetration test with guardian","automate security testing with ai","scan for vulnerabilities using guardian cli","create a pentest workflow with guardian","generate a security assessment report","configure guardian for ethical hacking","set up ai-powered vulnerability scanning","analyze web application security with guardian"] |
Guardian AI Pentest CLI
Skill by ara.so — Devtools Skills collection.
Guardian is an enterprise-grade AI-powered penetration testing automation framework that combines multiple AI providers (OpenAI GPT-4, Claude, Gemini, OpenRouter) with 19+ battle-tested security tools to deliver intelligent, adaptive security assessments with comprehensive evidence capture. It uses a multi-agent architecture where specialized AI agents (Planner, Tool Selector, Analyst, Reporter) collaborate to conduct penetration tests.
Installation
Prerequisites
- Python 3.11 or higher
- AI Provider API Key (OpenAI, Anthropic, Google, or OpenRouter)
- Git
Setup
git clone https://github.com/zakirkun/guardian-cli.git
cd guardian-cli
python3 -m venv venv
source venv/bin/activate
pip install -e .
python -m cli.main --help
Environment Variables
Set your AI provider API key:
export OPENAI_API_KEY="sk-your-key-here"
export ANTHROPIC_API_KEY="sk-ant-your-key-here"
export GOOGLE_API_KEY="your-gemini-key"
export OPENROUTER_API_KEY="your-router-key"
Configuration
Guardian uses config/guardian.yaml for configuration:
ai:
provider: openai
openai:
model: gpt-4o
api_key: null
claude:
model: claude-3-5-sonnet-20241022
api_key: null
gemini:
model: gemini-2.5-pro
api_key: null
temperature: 0.2
max_tokens: 8000
pentest:
safe_mode: true
require_confirmation: true
max_parallel_tools: 3
max_depth: 3
tool_timeout: 300
output:
format: markdown
save_path: ./reports
include_reasoning: true
[, , ]
Key Commands
Workflow Management
python -m cli.main workflow list
python -m cli.main workflow run --name web_pentest --target example.com
python -m cli.main workflow run --name network --target 192.168.1.0/24 --provider claude
python -m cli.main workflow run --name recon --target example.com --no-confirm
AI Provider Management
python -m cli.main models
python -m cli.main models --provider openai
Report Generation
python -m cli.main report --session 20260203_175905 --format markdown
python -m cli.main report --session 20260203_175905 --format html
python -m cli.main report --session 20260203_175905 --format json
python -m cli.main sessions list
Built-in Workflows
Guardian includes several pre-configured workflows:
1. Web Penetration Testing
python -m cli.main workflow run --name web_pentest --target https://example.com
What it does:
- HTTP probing with httpx
- Technology fingerprinting with WhatWeb
- WAF detection with Wafw00f
- Vulnerability scanning with Nuclei
- Directory enumeration with Gobuster
- Parameter discovery with Arjun
- XSS detection with XSStrike
2. Network Assessment
python -m cli.main workflow run --name network --target 192.168.1.0/24
What it does:
- Port scanning with Nmap/Masscan
- Service enumeration
- SSL/TLS testing with TestSSL/SSLyze
- Vulnerability assessment
3. Reconnaissance
python -m cli.main workflow run --name recon --target example.com
What it does:
- Subdomain discovery with Subfinder/Amass
- DNS enumeration with DNSRecon
- HTTP discovery
- Technology mapping
4. Autonomous Mode
python -m cli.main workflow run --name autonomous --target example.com
What it does:
- AI-driven decision making at each step
- Adaptive testing based on findings
- Dynamic tool selection
- Continuous analysis and pivoting
Creating Custom Workflows
Workflows are defined in config/workflows/ as YAML files:
name: my_custom_workflow
description: Custom security assessment workflow
version: 1.0.0
metadata:
author: Security Team
tags:
- custom
- web
- api
parameters:
httpx:
threads: 100
timeout: 15
nuclei:
severity: ["critical", "high"]
rate_limit: 150
steps:
- name: http_discovery
tool: httpx
description: Discover live HTTP services
parameters:
tech_detect: true
status_code: true
- name: vulnerability_scan
tool: nuclei
[, ]
Run your custom workflow:
python -m cli.main workflow run --name my_custom_workflow --target api.example.com
Creating Custom Tools
Define custom tools in config/tools/ as Python modules:
from core.tools.base import BaseTool, ToolResult
from typing import Dict, Any, Optional
import subprocess
import json
class MyCustomTool(BaseTool):
"""Custom security tool integration."""
name = "my_custom_tool"
description = "Performs custom security checks"
category = "web"
def __init__(self):
super().__init__()
self.required_params = ["target"]
self.optional_params = ["timeout", "verbose"]
async def execute(
self,
target: str,
timeout: int = 30,
verbose: bool = False,
**kwargs
) -> ToolResult:
"""Execute the custom tool."""
cmd = [
"my-custom-tool",
"--target", target,
"--timeout", str(timeout),
]
if verbose:
cmd.append("--verbose")
try:
result = subprocess.run(
cmd,
capture_output=,
text=,
timeout=timeout,
check=
)
findings = ._parse_output(result.stdout)
ToolResult(
success=result.returncode == ,
output=result.stdout,
error=result.stderr result.returncode != ,
data={
: findings,
: target,
: result.returncode
}
)
subprocess.TimeoutExpired:
ToolResult(
success=,
output=,
error=
)
Exception e:
ToolResult(
success=,
output=,
error=
)
() -> :
findings = []
line output.splitlines():
line.strip() line.startswith():
findings.append({
: line,
: ._detect_severity(line)
})
findings
() -> :
line_lower = line.lower()
(word line_lower word [, ]):
(word line_lower word [, ]):
(word line_lower word [, ]):
:
() -> [, []]:
params:
,
target = params[]
target (target, ):
,
,
Register your tool in config/tools/__init__.py:
from .my_tool import MyCustomTool
__all__ = ["MyCustomTool"]
Python API Usage
Guardian can be used programmatically:
from core.orchestrator import PentestOrchestrator
from core.ai.factory import AIProviderFactory
from core.config import Config
import asyncio
async def run_pentest():
config = Config.load("config/guardian.yaml")
ai_provider = AIProviderFactory.create_provider(
provider_type="openai",
config=config.ai
)
orchestrator = PentestOrchestrator(
ai_provider=ai_provider,
config=config
)
target = "https://example.com"
results = await orchestrator.run_workflow(
workflow_name="web_pentest",
target=target,
parameters={
"httpx": {"threads": 100},
"nuclei": {"severity": ["critical", "high"]}
}
)
print(f"Total findings: {len(results.findings)}")
for finding in results.findings:
print(f"\n[{finding.severity}] {finding.title}")
print(f"Tool: {finding.tool}")
print(f"Evidence: {finding.evidence[:]}...")
report = orchestrator.generate_report(
results=results,
=
)
(, ) f:
f.write(report)
asyncio.run(run_pentest())
Advanced Usage Patterns
Custom AI Agent Configuration
from core.ai.agents import PlannerAgent, ToolSelectorAgent, AnalystAgent
from core.ai.factory import AIProviderFactory
ai_provider = AIProviderFactory.create_provider("openai")
planner = PlannerAgent(
ai_provider=ai_provider,
temperature=0.3,
max_tokens=4000
)
plan = await planner.create_plan(
target="example.com",
objectives=[
"Identify web technologies",
"Discover subdomains",
"Scan for common vulnerabilities"
],
constraints={
"time_limit": 3600,
"scope": ["*.example.com"],
"exclude_tools": ["sqlmap"]
}
)
for step in plan.steps:
print(f"Step: {step.description}")
print(f"Tool: {step.tool}")
print(f"Parameters: {step.parameters}")
Evidence-Based Reporting
from core.reporting import ReportGenerator
from core.evidence import EvidenceCollector
evidence_collector = EvidenceCollector()
result = await tool.execute(target="example.com")
evidence_collector.add_evidence(
tool_name="nuclei",
command="nuclei -u https://example.com -severity critical",
output=result.output,
finding_id="VULN-001"
)
report_generator = ReportGenerator(evidence_collector)
report = report_generator.generate(
format="html",
include_evidence=True,
include_commands=True
)
Parallel Tool Execution
from core.tools.executor import ToolExecutor
import asyncio
async def parallel_scan(target: str):
executor = ToolExecutor(max_parallel=5)
tasks = [
executor.execute("httpx", target=target),
executor.execute("whatweb", target=target),
executor.execute("wafw00f", target=target),
executor.execute("nuclei", target=target),
]
results = await asyncio.gather(*tasks, return_exceptions=True)
for i, result in enumerate(results):
if isinstance(result, Exception):
print(f"Task {i} failed: {result}")
else:
print(f"Task {i} completed: {len(result.findings)} findings")
asyncio.run(parallel_scan("https://example.com"))
Scope Validation
Guardian includes built-in scope validation to prevent unauthorized scanning:
from core.scope import ScopeValidator
validator = ScopeValidator(
blacklist=[
"127.0.0.0/8",
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16"
]
)
is_valid, reason = validator.validate_target("192.168.1.1")
if not is_valid:
print(f"Target rejected: {reason}")
else:
print("Target is in scope")
validator.load_scope_file("scope.txt")
if validator.is_in_scope("example.com"):
pass
Troubleshooting
AI Provider Issues
python -m cli.main models --provider openai
echo $OPENAI_API_KEY
cat config/guardian.yaml | grep -A 5 "ai:"
Tool Execution Failures
which nmap
which nuclei
ls -la $(which nmap)
nmap -sV example.com
tail -f logs/guardian.log
Workflow Not Found
python -m cli.main workflow list
ls config/workflows/
python -c "import yaml; yaml.safe_load(open('config/workflows/web_pentest.yaml'))"
Report Generation Issues
python -m cli.main sessions list
ls -la results/sessions/
ls -ld reports/
python -m cli.main report --session 20260203_175905 --format markdown --verbose
Configuration Errors
from core.config import Config
try:
config = Config.load("config/guardian.yaml")
print("Configuration is valid")
except Exception as e:
print(f"Configuration error: {e}")
Legal and Ethical Use
Guardian is designed exclusively for authorized security testing.
Before using Guardian:
- Obtain explicit written permission to test the target system
- Understand applicable laws (CFAA, GDPR, etc.)
- Configure scope validation to prevent unauthorized scanning
- Enable safe mode to prevent destructive actions
- Maintain detailed audit logs
pentest:
safe_mode: true
require_confirmation: true
scope:
blacklist:
- 127.0.0.0/8
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
require_scope_file: true
You are fully responsible for ensuring you have authorization before testing any system.