Overview
The agent API provides four run modes that mirror thevigolium agent CLI subcommands, plus session history and status endpoints:
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 fromagent.olium.*invigolium-configs.yaml(which keeps prompt caches stable across requests), but every agent run endpoint also accepts per-request BYOK credentials. Provide any subset ofapi_key,oauth_token,oauth_cred_file, oroauth_cred_jsonon the same request to override per call. The audit dispatcher additionally acceptsaudit_authandpiolium_authobjects 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. Returns202 Accepted (async) or an SSE stream when stream: true.
Request body:
* At least one of
prompt_template, prompt_file, or prompt is required.
POST /api/agent/run/autopilot, Autonomous Scanning Session
Launches an AI agent that autonomously discovers, scans, and triages vulnerabilities using vigolium CLI commands. Whensource is provided, vigolium-audit runs first, native context and planning artifacts are prepared, and then the autonomous operator session starts.
The HTTP schema intentionally keeps structured
focus, instruction, browser, and credential fields. v0.3.1 CLI preparation/debugging flags such as --resume, --prior-context, --knowledge-base, --burp-bridge-url, --session-dir, and --transcript are not fields on this endpoint.
* 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):
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:- Normalize: Parse and normalize inputs (native, no AI)
- Auth: Browser-based login (native, optional; the API uses
auth: true, and browser tooling is enabled by the intensity/config path) - Source Analysis: AI agents extract routes, auth flows, and extensions from source code (conditional, requires
source) - Code Audit: AI security code audit (conditional, requires
code_audit: true) - Discovery: Content discovery and spidering (conditional, requires
discoverflag) - Plan: Master agent analyzes targets, selects modules, generates quick checks and extensions
- Extension: Validate, merge, and write JS extensions to disk (native)
- Scan: Execute scanner modules with agent-selected filters and extensions (native)
- Triage: AI agent reviews findings, confirms or marks as false positive (optional, requires
triage: true) - Rescan: Targeted re-scanning based on triage follow-ups (conditional, triggered by triage)
master_batch_size records, the master agent runs in parallel batches (default 5 records per batch) with plan merging.
Request body, Inputs:
* At least one of
input, inputs, http_request_base64, source, diff, or prompt is required.
Source analysis:
Scanning parameters:
Concurrency tuning:
Output / scoping:
Examples:
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:
Per-driver BYOK overrides apply different credentials to each leg under
auto/both:
Piolium-specific flags:
Examples:
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 aprompt 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.
Explicit fields always take precedence. If you pass bothpromptandtarget/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.
Example SSE stream (swarm):
GET /api/agent/status/list, List Agent Runs
Returns all agent runs with their current status.GET /api/agent/status/:id, Agent Run Status
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 terminalcancelled status. This is the endpoint the workbench UI’s “Cancel run” button calls.
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.
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.
GET /api/agent/sessions/:id/logs, Session Console Logs
Returns the rawruntime.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-8dump of the entireruntime.logat request time. - Server-Sent Events (
Accept: text/event-stream): tails the file and emits each new byte range as achunkevent. Exits with adoneevent when the run reaches a terminal status, the client disconnects, or a 2-hour safety backstop fires.
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.GET /api/agent/sessions/:id/artifacts/, Read Artifact
Read a specific artifact file. Wildcard supports nesting (e.g.vigolium-audit/state.json).
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. Themodel 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).
