Skip to main content

Overview

The agent API provides four 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
POST /api/agent/run/auditvigolium agent auditSource-audit dispatcher (vigolium-audit and/or piolium)
GET /api/agent/status/list,List runs with in-memory status
GET /api/agent/status/:id,Get run status by ID
POST /api/agent/scans/:uuid/cancel,Cancel an in-flight agent run
GET /api/agent/sessionsvigolium agent sessionsPaginated session history from DB
GET /api/agent/sessions/:id,Full session detail with debug fields
GET /api/agent/sessions/:id/logs,Raw runtime.log (plain text or SSE tail)
GET /api/agent/sessions/:id/artifacts,List session artifact files
GET /api/agent/sessions/:id/artifacts/{name},Read a specific artifact (10 MiB default cap)
POST /api/agent/chat/completions,OpenAI-compatible chat completions
Concurrency is bounded by two pools (server.agent_heavy_max for autopilot/swarm/audit, server.agent_light_max for query and chat completions) plus a per-project heavy cap. New heavy runs return 409 Conflict once the cap is hit; light runs queue until server.agent_queue_timeout elapses and then return 429 Too Many Requests.
Server-default provider, BYOK per request. The server resolves the olium provider from agent.olium.* in vigolium-configs.yaml (which keeps prompt caches stable across requests), but every agent run endpoint also accepts per-request BYOK credentials. Provide any subset of api_key, oauth_token, oauth_cred_file, or oauth_cred_json on the same request to override per call. The audit dispatcher additionally accepts audit_auth and piolium_auth objects to apply different credentials to each driver.

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, vigolium-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, audit_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. Intensity preset overrides default: quick=150, balanced=500, deep=1500
browserboolNoEnable agent-browser for browser-based interactions
credentialsstringNoCredentials for auth preflight (e.g. "admin/admin123")
credential_setsobject[]NoMultiple credential sets keyed by role/persona
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)
audit_modestringNoVigolium-audit mode: "lite" (default, 3-phase), "balanced" (9-phase), "deep" (12-phase), "mock"
no_auditboolNoDisable automatic vigolium-audit (enabled by default when source is set)
auditstringNoShorthand for audit_mode/no_audit: "lite", "balanced", "deep", "mock", or "off"
pioliumstringNoRun a piolium audit in parallel with the autopilot prep. Same value set as audit
triageboolNoEnable an AI triage pass over the autopilot’s findings on completion
upload_resultsboolNoUpload session bundle to cloud storage on completion (requires storage config)
api_keystringNoBYOK API key for this request (overrides server config)
oauth_tokenstringNoBYOK OAuth token for this request
oauth_cred_filestringNoPath to an OAuth credential JSON file readable by the server
oauth_cred_jsonstringNoInline OAuth credential JSON
* 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, audit, concurrency, and duration settings
inputstringNo*Single input (URL, curl command, raw HTTP, Burp XML)
inputsstring[]No*Multiple inputs
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, 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")
auditstringNoBackground vigolium-audit: "lite", "balanced", "deep", "mock", "off". Requires source.
pioliumstringNoBackground piolium audit (run in parallel with vigolium-audit). Same value set as audit.
authobjectNoPer-host auth configuration (browser-driven login + token rules)
auth_requiredboolNoRequire auth/session preparation before the master agent starts
requires_browserboolNoRequire browser-assisted auth
browser_start_urlstringNoExplicit browser/login start URL
focus_routesstring[]NoProtected/browser-focused routes to prioritize
credentialsstringNoCredentials for auth preflight (e.g. "admin/admin123")
credential_setsobject[]NoMultiple credential sets keyed by role/persona
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 "12h")
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 vigolium-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,
    "audit": "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"
}

POST /api/agent/run/audit, Source-Audit Driver Dispatcher

Launches a multi-phase source-code audit driven by the embedded vigolium-audit harness and/or the standalone piolium harness against a single source tree under one AgenticScan. Per-driver child rows hang off the parent run; the dispatcher runs a project-wide findings dedup pass once its drivers exit. Request body, core fields:
FieldTypeRequiredDescription
sourcestringYesPath to source code, git URL (HTTPS or SSH), or archive file. Legacy alias: repo_path.
driverstringNo"auto" (default — run audit; fall back to piolium only if claude/codex CLI is missing), "both" (run audit then piolium unconditionally), "audit", or "piolium"
modestringNoHarness mode — see --list-modes on vigolium agent audit / vigolium agent audit. Under auto/both, restricted to shared modes (lite, balanced, deep, revisit, confirm, merge).
modesstring[]NoChain modes back-to-back (e.g. ["deep","confirm"]). Audit runs the chain natively in one subprocess; piolium chains via sequential runs collapsed into one aggregated child row.
intensitystringNo"quick"lite, "balanced"balanced, "deep" → chain [deep, confirm]
agentstringNoAudit-leg agent selector: "claude" or "codex". Layered on top of provider.
providerstringNoOlium provider name (e.g. anthropic-api-key). Resolves the audit-leg agent and forwards BYOK auth (anthropic-* → claude, openai-* → codex).
commit_depthintNoShallow-clone depth (0 = full history)
interactiveboolNoDrop into the audit harness interactively (audit-only). Skips NDJSON streaming and findings auto-import.
no_streamboolNoDisable streaming progress to the client
no_dedupboolNoSkip the post-pass project-wide findings dedup
no_preflightboolNoSkip per-driver preflight checks
upload_resultsboolNoUpload session bundle on completion (requires storage config)
streamboolNoIf true, returns an SSE stream with driver/chunk/phase/done/error events
timeoutstringNoGo duration string
project_uuidstringNoScope results to a project
scan_uuidstringNoLink results to a specific scan UUID
Per-driver BYOK overrides apply different credentials to each leg under auto/both:
FieldTypeDescription
audit_authobject{api_key, oauth_token, oauth_cred_file, oauth_cred_json} applied to the vigolium-audit leg
piolium_authobjectSame shape, applied to the piolium leg
Piolium-specific flags:
FieldTypeDescription
pi_providerstringOverride Pi’s provider for the piolium leg
pi_modelstringOverride Pi’s model for the piolium leg
plm_*variedPass-through flags to piolium’s session config
Examples:
# Default: auto — vigolium-audit, fall back to piolium if the CLI is missing
curl -s -X POST http://localhost:9002/api/agent/run/audit \
  -H "Content-Type: application/json" \
  -d '{"source": "/home/user/src/my-app"}' | jq .

# Both drivers, deep intensity (expands to mode chain [deep, confirm])
curl -s -X POST http://localhost:9002/api/agent/run/audit \
  -H "Content-Type: application/json" \
  -d '{
    "source": "/home/user/src/my-app",
    "driver": "both",
    "intensity": "deep"
  }' | jq .

# Per-driver BYOK
curl -s -X POST http://localhost:9002/api/agent/run/audit \
  -H "Content-Type: application/json" \
  -d '{
    "source": "/home/user/src/my-app",
    "driver": "both",
    "audit_auth":   {"api_key": "sk-ant-..."},
    "piolium_auth": {"api_key": "sk-..."}
  }' | jq .

# Streamed multi-driver run (SSE)
curl -N -X POST http://localhost:9002/api/agent/run/audit \
  -H "Content-Type: application/json" \
  -d '{
    "source": "/home/user/src/my-app",
    "driver": "both",
    "stream": true
  }'
SSE events for audit: Each chunk event includes a driver field ("audit" or "piolium"). The dispatcher brackets each driver’s stream with driver_start and driver_end events so a UI can group log lines by driver. The done event arrives once after both drivers (and the dedup pass) finish.

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 vigolium-audit level.
Intent FieldMaps To (Autopilot)Maps To (Swarm)Description
targettargetinputTarget URL
source_pathsourcesourceFilesystem path to source code
focusfocusfocusVulnerability focus area
instructioninstructioninstructionRemaining guidance
discover,discoverInferred when both target and source are present
code_audit,code_auditInferred when source-only (no target)
auditaudit_modeaudit"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 agent (audit adds a driver field)All
phasePhase transition (includes phase field)Swarm, audit
driver_startMulti-driver dispatcher began streaming a driverAudit (multi-driver)
driver_endMulti-driver dispatcher finished streaming a driverAudit (multi-driver)
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", "swarm", "audit", or "pipeline"
statusstring"running", "completed", "failed", or "cancelled"
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)

POST /api/agent/scans/:uuid/cancel, Cancel an Agent Run

Aborts an in-flight agent run (autopilot, swarm, query, or audit) by cancelling its context. The run unwinds and its finalization records the terminal cancelled status. This is the endpoint the workbench UI’s “Cancel run” button calls.
curl -s -X POST \
  http://localhost:9002/api/agent/scans/agt-661f9511-f3ac-52e5-b827-557766551111/cancel \
  -H "Authorization: Bearer my-secret-key" | jq .
{
  "agentic_scan_uuid": "agt-661f9511-f3ac-52e5-b827-557766551111",
  "status": "cancelling",
  "message": "cancellation requested"
}
Returns 404 with {"error": "run not found or already finished"} when no run with that UUID is currently running in this process (already finished, never started, or unknown). Cancellation only targets runs executing in the server process that receives the request.

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
modestring,Filter by mode: query, autopilot, swarm, audit
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, vigolium-audit output, plan/checkpoint files.
curl -s http://localhost:9002/api/agent/sessions/agt-550e8400-.../artifacts | jq .
{
  "agentic_scan_uuid": "agt-550e8400-e29b-41d4-a716-446655440000",
  "session_dir": "/home/user/.vigolium/agent-sessions/agt-550e8400-...",
  "artifacts": [
    {"name": "swarm-plan.json", "size": 2048, "modified_at": "2026-05-21T10:01:00Z", "kind": "file"},
    {"name": "extensions/sqli-custom.js", "size": 1024, "modified_at": "2026-05-21T10:02:00Z", "kind": "file"},
    {"name": "vigolium-audit/findings/p8-001.md", "size": 4096, "modified_at": "2026-05-21T10:03:00Z", "kind": "file"}
  ],
  "truncated": false
}

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

Read a specific artifact file. Wildcard supports nesting (e.g. vigolium-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.