Documentation
aisec is an autonomous AI-driven penetration testing agent. It uses large language models to plan and execute security assessments, combining traditional security tools (nmap, sqlmap, nikto, dirsearch, Playwright) with AI reasoning to discover vulnerabilities.
The agent operates in iterative cycles: each iteration it analyzes what it knows, decides which tool to run next, executes it, and interprets the results. This continues until it exhausts its iteration budget or determines the target has been thoroughly tested.
Interact via the web dashboard, the CLI (pip install git+https://github.com/stuseek/aisec-cli.git), or the REST API directly.
All API requests require a Bearer token:
Authorization: Bearer ask_xxxxxxxxxxxxxxxx
Generate keys in Developer → API Keys. For the CLI, set AISEC_TOKEN env variable. WebSocket connections pass the token as a query parameter: ?token=ask_xxx.
ask_ prefix. Each key can access all scans and data under your account. Revoke compromised keys immediately in the Developer panel.normalstealthaggressivefull/api/v1/statsDashboard stats, severity breakdown, cost, recent activity/api/v1/scansList scans — query: page, limit, status, search/api/v1/scansCreate and start a new scan/api/v1/scans/{id}Get full scan details/api/v1/scans/{id}Delete a scan and all associated data/api/v1/scans/{id}/cancelCancel a running scan/api/v1/scans/{id}/findingsList all findings for a scan/api/v1/scans/{id}/findings/{fid}Update finding verification status/api/v1/scans/{id}/logsAgent logs — query: page, limit, log_type/api/v1/scans/{id}/reconInfrastructure and browser recon data/api/v1/scans/{id}/technologiesDetected technologies and versions/api/v1/scans/{id}/endpointsDiscovered endpoints and parameters/api/v1/scans/{id}/report.pdfDownload PDF report/api/v1/billingCurrent plan, usage, billing history/api/v1/keysList API keys/api/v1/keysCreate new API key/api/v1/keys/{id}Revoke an API key/ws/scans/{id}?token=...Live scan event stream (WebSocket)POST /api/v1/scans — all fields except target are optional with sensible defaults.{
"target": "https://example.com",
"engine": "claude",
"model": "claude-sonnet-4-5-20250929",
"profile": "normal",
"max_iterations": 50,
"scope": "target",
"timeout_minutes": 0,
"temperature": 0.4,
"username": null,
"password": null,
"cookies_json": null,
"proxy": null,
"custom_headers": null,
"skip_recon": false,
"skip_browser": false
}/ws/scans/{id}?token=ask_xxx for real-time scan events. Server sends JSON with type, ts, data. Client can send {"type":"cancel"} or {"type":"ping"}.scan_startedScan has begun executingscan_iditeration_startNew AI iteration cycle startediteration, max_iterationsconsoleConsole output with ANSI formattingtext, ansitool_execTool being executed by the agenttool, commandtool_outputTool execution resulttool, command, output, exit_codethinkingAI reasoning / analysis texttextfindingVulnerability discoveredseverity, title, cwe, url, descriptioncost_updateToken usage and cost updatecost, tokens_in, tokens_outerrorError occurred during scanmessage, recoverablerecoveryAgent recovered from errormessage, strategyscan_completeScan finishedfindings_count, cost, duration_secondsdetail field.400Bad Request — invalid parameters or missing required fields401Unauthorized — missing or invalid Bearer token403Forbidden — valid token but insufficient permissions404Not Found — scan or resource doesn't exist409Conflict — scan already running or cancelled422Validation Error — request body failed schema validation429Rate Limited — too many requests, retry after delay500Internal Error — unexpected server error