Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vigolium.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The agent API provides three run modes that mirror the vigolium agent CLI subcommands, plus session history and status endpoints:
EndpointCLI EquivalentDescription
POST /api/agent/run/queryvigolium agent querySingle-shot prompt execution
POST /api/agent/run/autopilotvigolium agent autopilotAutonomous AI-driven scanning session
POST /api/agent/run/swarmvigolium agent swarmAI-guided multi-phase vulnerability swarm
GET /api/agent/status/listList runs with in-memory status
GET /api/agent/status/:idGet run status by ID
GET /api/agent/sessionsvigolium agent sessionsPaginated session history from DB
GET /api/agent/sessions/:idFull session detail with debug fields
GET /api/agent/sessions/:id/logsRaw runtime.log (plain text or SSE tail)
GET /api/agent/sessions/:id/artifactsList session artifact files
GET /api/agent/sessions/:id/artifacts/{name}Read a specific artifact (10 MiB default cap)
POST /api/agent/chat/completionsOpenAI-compatible chat completions
All run modes share a global concurrency lock (capped per-mode by server.agent_heavy_max / server.agent_light_max) — exceeding the cap returns 429 Too Many Requests after server.agent_queue_timeout.
Provider overrides are CLI-only. The server resolves the olium provider once from agent.olium.* in vigolium-configs.yaml and reuses it across requests. There is no per-request provider/model field — to switch providers on a server-side workload, edit the YAML and reload.

POST /api/agent/run/query — Single-Shot Agent Run

Starts an AI agent run with a prompt template, file, or inline prompt. Returns 202 Accepted (async) or an SSE stream when stream: true. Request body:
FieldTypeRequiredDescription
agentstringNoOptional descriptive label persisted to the run record (provider is server-side from agent.olium.*)
prompt_templatestringNo*Name of a prompt template (from ~/.vigolium/prompts/)
prompt_filestringNo*Path to a prompt file on disk
promptstringNo*Inline prompt text
sourcestringNoPath to source code for context. Legacy alias: repo_path.
filesstring[]NoSpecific files to include as context
appendstringNoAdditional text appended to the prompt
instructionstringNoCustom instruction appended to the prompt
source_labelstringNoSource label for findings ingested from agent output
scan_uuidstringNoLink results to a specific scan UUID
streamboolNoIf true, returns an SSE stream instead of 202 async response
* At least one of prompt_template, prompt_file, or prompt is required.
# Run with a prompt template
curl -s -X POST http://localhost:9002/api/agent/run/query \
  -H "Content-Type: application/json" \
  -d '{
    "prompt_template": "security-code-review",
    "source": "/home/user/src/my-app"
  }' | jq .

# Run with an inline prompt
curl -s -X POST http://localhost:9002/api/agent/run/query \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Analyze the authentication flow for vulnerabilities",
    "source": "/home/user/src/my-app",
    "files": ["src/auth/login.py", "src/auth/session.py"]
  }' | jq .
Response (202):
{
  "agentic_scan_uuid": "agt-550e8400-e29b-41d4-a716-446655440000",
  "status": "running",
  "message": "query run started"
}

POST /api/agent/run/autopilot — Autonomous Scanning Session

Launches an AI agent that autonomously discovers, scans, and triages vulnerabilities using vigolium CLI commands. When source is provided, archon-audit runs first, native context and planning artifacts are prepared, and then the autonomous operator session starts. Request body:
FieldTypeRequiredDescription
promptstringNoNatural language scan prompt (parsed into target/source/focus when explicit fields are empty)
intensitystringNoScan intensity preset: "quick", "balanced" (default), or "deep". Bundles max_commands, timeout, archon_mode, and browser settings
targetstringNo*Target URL to scan (derived from input if not set)
inputstringNoRaw input (curl, raw HTTP, Burp XML, URL) — target extracted automatically
agentstringNoOptional descriptive label persisted to the run record
sourcestringNoPath to source code, git URL (with optional OAuth token), or archive file (.zip, .tar.gz, .tgz, .tar.bz2, .tar.xz). Legacy alias: repo_path.
filesstring[]NoSpecific files to include (relative to source). Auto-populated from diff when not set
diffstringNoFocus on changed code: GitHub PR URL (github.com/.../pull/123), git ref range (main...branch), or HEAD~N
last_commitsintNoFocus on last N commits (shorthand for diff: "HEAD~N")
focusstringNoFocus area hint (e.g. "API injection", "auth bypass")
instructionstringNoCustom instruction appended to the prompt
timeoutstringNoGo duration string (default "6h")
max_commandsintNoMax LLM turns the agent can take (default 100)
token_budgetintNoCap on cumulative input+output tokens (0 = no cap)
browserboolNoEnable agent-browser for browser-based interactions
credentialsstringNoCredentials for auth preflight (e.g. "admin/admin123")
auth_requiredboolNoRequire auth/session preparation before the operator starts
requires_browserboolNoRequire browser-assisted auth instead of HTTP-only preflight
browser_start_urlstringNoExplicit browser/login start URL
focus_routesstring[]NoProtected/browser-focused routes to prioritize
dry_runboolNoRender the prompt without executing the agent
streamboolNoIf true, returns an SSE stream
scan_uuidstringNoLink results to a specific scan UUID
project_uuidstringNoScope results to a project (falls back to X-Project-UUID header)
archon_modestringNoArchon audit mode: "lite" (default, 3-phase), "balanced" (6-phase), "deep" (10-phase), "mock"
no_archonboolNoDisable automatic archon-audit (enabled by default when source is set)
archonstringNoDEPRECATED — use no_archon + archon_mode instead. Legacy values: "lite", "balanced", "deep", "off"
upload_resultsboolNoUpload session bundle to cloud storage on completion (requires storage config)
* At least one of target, input, source, diff, or prompt is required. Source resolution: The source field accepts local paths, git URLs (HTTPS or SSH), git URLs with embedded OAuth tokens (https://oauth2:[email protected]/...), and archive files. Git repos are cloned with --depth 1 and archives are extracted into the session directory. OAuth tokens are stripped from logs. Diff resolution: When diff is set, the changed file list auto-populates files and the patch content is included in the agent prompt. For PR URLs without source, the repo is auto-cloned. GitHub PRs use the GitHub REST API directly (no gh CLI required). The GITHUB_TOKEN env var is used as a fallback. Quick scan (CI/PR review):
curl -s -X POST http://localhost:9002/api/agent/run/autopilot \
  -H "Content-Type: application/json" \
  -d '{
    "target": "http://localhost:3000",
    "source": "/home/user/src/my-app",
    "intensity": "quick",
    "diff": "https://github.com/org/repo/pull/42"
  }' | jq .
Balanced scan (default):
curl -s -X POST http://localhost:9002/api/agent/run/autopilot \
  -H "Content-Type: application/json" \
  -d '{
    "target": "http://localhost:3000",
    "source": "/home/user/src/my-app",
    "focus": "authentication bypass",
    "stream": true
  }'
Deep scan:
curl -s -X POST http://localhost:9002/api/agent/run/autopilot \
  -H "Content-Type: application/json" \
  -d '{
    "target": "http://localhost:3000",
    "source": "/home/user/src/my-app",
    "intensity": "deep",
    "instruction": "Test all API endpoints. Focus on IDOR, auth bypass, and injection.",
    "stream": true
  }'
Response (202):
{
  "agentic_scan_uuid": "agt-550e8400-e29b-41d4-a716-446655440000",
  "status": "running",
  "message": "autopilot run started"
}

POST /api/agent/run/swarm — AI-Guided Vulnerability Swarm

Launches an AI-guided multi-phase vulnerability swarm. The master agent analyzes inputs, selects scanner modules, generates custom JS extensions, executes scans, and optionally triages results. The swarm phases are:
  1. Normalize — Parse and normalize inputs (native, no AI)
  2. Auth — Browser-based login (native, optional, requires --browser-auth + --browser)
  3. Source Analysis — AI agents extract routes, auth flows, and extensions from source code (conditional, requires source)
  4. Code Audit — AI security code audit (conditional, requires code_audit: true)
  5. Discovery — Content discovery and spidering (conditional, requires discover flag)
  6. Plan — Master agent analyzes targets, selects modules, generates quick checks and extensions
  7. Extension — Validate, merge, and write JS extensions to disk (native)
  8. Scan — Execute scanner modules with agent-selected filters and extensions (native)
  9. Triage — AI agent reviews findings, confirms or marks as false positive (optional, requires triage: true)
  10. Rescan — Targeted re-scanning based on triage follow-ups (conditional, triggered by triage)
AI agents are called at phases 3, 4, 6, and 9. When inputs exceed master_batch_size records, the master agent runs in parallel batches (default 5 records per batch) with plan merging. Request body — Inputs:
FieldTypeRequiredDescription
promptstringNoNatural language scan prompt
intensitystringNo"quick", "balanced" (default), "deep" — bundles discover, triage, code_audit, max_iterations, archon, concurrency, and duration settings
inputstringNo*Single input (URL, curl command, raw HTTP, Burp XML, or record UUID)
inputsstring[]No*Multiple inputs
targetstringNoTarget URL (alias for input when given alone)
record_uuidstringNoHTTP record UUID from the database
http_request_base64stringNo*Base64-encoded raw HTTP request
http_response_base64stringNoBase64-encoded raw HTTP response (attached to the request above)
urlstringNoURL hint for parsing the base64 request
* At least one of input, inputs, target, record_uuid, http_request_base64, source, diff, or prompt is required. Source analysis:
FieldTypeRequiredDescription
sourcestringNoPath to source code, git URL, or archive file. Legacy alias: source_path.
filesstring[]NoSpecific source files to include (relative to source)
diffstringNoFocus on changed code: PR URL, git ref range, or HEAD~N
last_commitsintNoFocus on last N commits
source_analysis_onlyboolNoRun only the source analysis phase and exit
Scanning parameters:
FieldTypeRequiredDescription
vuln_typestringNoVulnerability type focus (e.g. "sqli", "xss")
focusstringNoBroad focus area hint
instructionstringNoCustom instruction appended to agent prompts
module_namesstring[]NoExplicit module IDs to use
only_phasestringNoIsolate a single phase
skip_phasesstring[]NoSkip specific phases
start_fromstringNoResume from a specific phase
max_iterationsintNoMax triage→rescan rounds (default depends on intensity)
discoverboolNoRun discovery+spidering before master agent planning
code_auditboolNoEnable AI security code audit phase (requires source)
triageboolNoEnable AI triage and rescan phases
force_extensionsboolNoForce extension agent to run even when the master returned no extensions
profilestringNoScanning profile name (e.g. "light", "thorough")
archonstringNoBackground archon-audit: "lite", "balanced", "deep", "mock", "off". Requires source.
Concurrency tuning:
FieldTypeRequiredDescription
batch_concurrencyintNoMax parallel master agent batches (0 = auto)
max_master_retriesintNoMax master agent retries on parse failure (default 3)
sa_max_concurrencyintNoMax parallel source analysis sub-agents (default 3)
max_plan_recordsintNoMax records sent to plan agent (0 = default 10)
master_batch_sizeintNoMax records per master agent batch (0 = default 5)
probe_concurrencyintNoMax parallel probe requests (0 = default 10)
probe_timeoutstringNoPer-request probe timeout as Go duration
max_probe_bodyintNoMax response body size in bytes during probing (0 = default 2 MB)
Output / scoping:
FieldTypeRequiredDescription
agentstringNoOptional descriptive label
dry_runboolNoRender prompts without executing agents
show_promptboolNoInclude rendered prompts in output
streamboolNoIf true, returns an SSE stream with phase events
timeoutstringNoGo duration string (default "15m")
project_uuidstringNoScope results to a project
scan_uuidstringNoLink results to a specific scan UUID
upload_resultsboolNoUpload session bundle to cloud storage on completion
Examples:
# Swarm a single URL
curl -s -X POST http://localhost:9002/api/agent/run/swarm \
  -H "Content-Type: application/json" \
  -d '{
    "input": "https://example.com/api/search?q=test"
  }' | jq .

# Swarm a curl command (auto-detected)
curl -s -X POST http://localhost:9002/api/agent/run/swarm \
  -H "Content-Type: application/json" \
  -d '{
    "input": "curl -X POST -H '\''Content-Type: application/json'\'' -d '\''{\"user\":\"admin\"}'\'' https://example.com/api/login"
  }' | jq .

# Source-aware with code audit + discovery — full pipeline
curl -s -X POST http://localhost:9002/api/agent/run/swarm \
  -H "Content-Type: application/json" \
  -d '{
    "input": "https://example.com",
    "source": "/home/user/src/my-app",
    "discover": true,
    "code_audit": true,
    "triage": true,
    "instruction": "Focus on business logic flaws in the payment flow",
    "profile": "thorough"
  }' | jq .

# Source-aware with background archon-audit
curl -s -X POST http://localhost:9002/api/agent/run/swarm \
  -H "Content-Type: application/json" \
  -d '{
    "input": "https://example.com",
    "source": "/home/user/src/my-app",
    "discover": true,
    "archon": "lite"
  }' | jq .

# Diff-focused on a GitHub PR
curl -s -X POST http://localhost:9002/api/agent/run/swarm \
  -H "Content-Type: application/json" \
  -d '{
    "input": "http://localhost:3000",
    "source": "/home/user/src/my-app",
    "diff": "https://github.com/org/repo/pull/42"
  }' | jq .

# SSE streaming with project scoping
curl -N -X POST http://localhost:9002/api/agent/run/swarm \
  -H "Content-Type: application/json" \
  -H "X-Project-UUID: proj-123" \
  -d '{
    "input": "https://example.com",
    "stream": true,
    "timeout": "30m",
    "intensity": "deep"
  }'
Response (202):
{
  "agentic_scan_uuid": "agt-550e8400-e29b-41d4-a716-446655440000",
  "status": "running",
  "message": "swarm run started"
}

Natural Language Prompts

The autopilot and swarm endpoints accept a prompt field for natural language scan requests. When prompt is provided and no explicit input fields are set (target, input, source), the prompt is parsed by an AI intent extractor that returns structured parameters. The intent extractor recognizes: target URLs, source code paths, vulnerability focus areas, custom instructions, discovery mode, code audit mode, and archon audit level.
Intent FieldMaps To (Autopilot)Maps To (Swarm)Description
targettargetinputTarget URL
source_pathsourcesourceFilesystem path to source code
focusfocusfocusVulnerability focus area
instructioninstructioninstructionRemaining guidance
discoverdiscoverInferred when both target and source are present
code_auditcode_auditInferred when source-only (no target)
archonarchon_modearchon"lite", "balanced", or "deep" when audit agent is mentioned
# Swarm with a natural language prompt
curl -s -X POST http://localhost:9002/api/agent/run/swarm \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "scan source at ~/src/VAmPI on localhost:3005 with audit agent"
  }' | jq .

# Dry run — preview extracted intent without launching a scan
curl -s -X POST http://localhost:9002/api/agent/run/autopilot \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "scan VAmPI source at ~/src/VAmPI on localhost:3005 with full audit agent",
    "dry_run": true
  }' | jq .
Explicit fields always take precedence. If you pass both prompt and target/input/source, the prompt is ignored.

SSE Streaming

All run endpoints support "stream": true, which returns a text/event-stream response. Each event is a JSON object on a data: line.
TypeDescriptionModes
chunkIncremental text output from the agentAll
phasePhase transition (includes phase field)Swarm only
doneFinal event with the complete result objectAll
errorAgent run failed; includes error messageAll
Example SSE stream (swarm):
data: {"type":"phase","phase":"native-normalize"}

data: {"type":"phase","phase":"plan"}

data: {"type":"chunk","text":"Analyzing targets for attack strategy..."}

data: {"type":"phase","phase":"native-extension"}

data: {"type":"phase","phase":"native-scan"}

data: {"type":"phase","phase":"triage"}

data: {"type":"done","swarm_result":{"total_findings":5,"confirmed":3,"false_positives":2,"iterations":2,"severity_counts":{"high":2,"medium":3}}}

GET /api/agent/status/list — List Agent Runs

Returns all agent runs with their current status.
curl -s http://localhost:9002/api/agent/status/list | jq .
[
  {
    "agentic_scan_uuid": "agt-550e8400-e29b-41d4-a716-446655440000",
    "mode": "query",
    "status": "completed",
    "agent_name": "olium",
    "template_id": "security-code-review",
    "finding_count": 3,
    "saved_count": 3,
    "completed_at": "2026-04-01T15:10:00Z"
  },
  {
    "agentic_scan_uuid": "agt-661f9511-f3ac-52e5-b827-557766551111",
    "mode": "swarm",
    "status": "running",
    "current_phase": "native-scan",
    "phases_run": ["native-normalize", "plan", "native-extension"]
  }
]

GET /api/agent/status/:id — Agent Run Status

FieldTypeDescription
agentic_scan_uuidstringUnique run identifier
modestring"query", "autopilot", or "swarm"
statusstring"running", "completed", or "failed"
agent_namestringAgent label recorded for the run
template_idstringPrompt template ID (query mode)
finding_countintNumber of findings produced
record_countintNumber of HTTP records produced (query/autopilot)
saved_countintNumber of records saved to DB (query/autopilot)
errorstringError message (failed runs only)
completed_atstringISO 8601 completion timestamp
resultobjectFull agent result (query/autopilot, completed runs)
current_phasestringCurrently executing phase (swarm, running)
phases_runstring[]Completed phases (swarm)
swarm_resultobjectFull swarm result (swarm, completed runs)

GET /api/agent/sessions — List Agent Sessions

Paginated list of agent sessions from the database. Unlike /api/agent/status/list (which includes in-memory running state), this returns persisted historical sessions with structured metadata — but without large debug fields (prompt_sent, agent_raw_output, etc.) to keep responses lightweight.
ParameterTypeDefaultDescription
modestringFilter by mode: query, autopilot, swarm
limitint50Page size (max 500)
offsetint0Offset for pagination
curl -s 'http://localhost:9002/api/agent/sessions?mode=swarm&limit=10' | jq .

GET /api/agent/sessions/:id — Agent Session Detail

Full detail of a single agent session, including large debug fields: prompt_sent, agent_raw_output, attack_plan, triage_result, result_json.
FieldTypeDescription
input_rawstringRaw input provided to the agent run
module_namesstring[]Scanner modules used or selected
source_pathstringSource code path used for the run
source_typestringHow source was provided: local, git-url, or gcs
session_idstringSession ID (for autopilot resume)
prompt_sentstringFull prompt text sent to the agent
agent_raw_outputstringComplete raw output from the agent
attack_planstringJSON attack plan (swarm mode)
triage_resultstringJSON triage result (swarm mode)
result_jsonstringFull result object as JSON

GET /api/agent/sessions/:id/logs — Session Console Logs

Returns the raw runtime.log file for a session — the same live console stream the CLI user sees. ANSI colors are preserved by default so browser terminal emulators (xterm.js, etc.) render it exactly like the CLI. Works while the run is in progress and after it finishes. Two modes, selected via the Accept header:
  • Plain text (default): text/plain; charset=utf-8 dump of the entire runtime.log at request time.
  • Server-Sent Events (Accept: text/event-stream): tails the file and emits each new byte range as a chunk event. Exits with a done event when the run reaches a terminal status, the client disconnects, or a 2-hour safety backstop fires.
Query paramTypeDescription
stripboolIf truthy (1, true, yes), strip ANSI escape sequences server-side. Default: false (preserve ANSI).
# Plain text dump
curl -s http://localhost:9002/api/agent/sessions/agt-550e8400-.../logs

# Live tail via SSE
curl -N -H 'Accept: text/event-stream' \
  http://localhost:9002/api/agent/sessions/agt-550e8400-.../logs

GET /api/agent/sessions/:id/artifacts — List Session Artifacts

Returns a recursive list of files inside the session directory, capped at 500 entries. Useful for browsing generated extensions, archon output, plan/checkpoint files.
curl -s http://localhost:9002/api/agent/sessions/agt-550e8400-.../artifacts | jq .
{
  "files": [
    {"path": "swarm-plan.json", "size": 2048},
    {"path": "extensions/sqli-custom.js", "size": 1024},
    {"path": "archon-audit/findings/p8-001.md", "size": 4096}
  ]
}

GET /api/agent/sessions/:id/artifacts/ — Read Artifact

Read a specific artifact file. Wildcard supports nesting (e.g. archon-audit/state.json).
Query paramTypeDescription
max_bytesintOverride per-request size cap (default 10 MiB, hard cap 100 MiB).
curl -s 'http://localhost:9002/api/agent/sessions/agt-550e8400-.../artifacts/swarm-plan.json' | jq .

POST /api/agent/chat/completions — OpenAI-Compatible Chat Completions

Accepts an OpenAI-compatible Chat Completions request and returns an OpenAI-compatible response. This allows any OpenAI-compatible client to use the in-process olium engine by changing the base URL. The model field is currently informational — every request is dispatched through the olium engine using the provider configured under agent.olium.* in vigolium-configs.yaml. This endpoint is synchronous — it blocks until the agent completes. It shares the concurrency lock with the run endpoints (returns 409 Conflict if an agent is already running).
FieldTypeRequiredDescription
modelstringYesRequired by the OpenAI schema; value is informational
messagesarrayYesArray of {role, content} message objects
curl -s -X POST http://localhost:9002/api/agent/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <api-key>" \
  -d '{
    "model": "vigolium-olium",
    "messages": [
      { "role": "user", "content": "What are common JWT vulnerabilities?" }
    ]
  }' | jq .
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:9002/api/agent",
    api_key="<api-key>",
)
response = client.chat.completions.create(
    model="vigolium-olium",
    messages=[{"role": "user", "content": "Explain CSRF attacks"}],
)
See Agent Mode for full agent documentation.