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: 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: * At least one of prompt_template, prompt_file, or prompt is required.
Response (202):

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.
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.
Request body: * 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):
Balanced scan (default):
Deep scan:
Response (202):

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; the API uses auth: true, and browser tooling is enabled by the intensity/config path)
  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: * At least one of input, inputs, http_request_base64, source, diff, or prompt is required. Source analysis: Scanning parameters: Concurrency tuning: Output / scoping: Examples:
Response (202):

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:
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.
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. 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 terminal cancelled status. This is the endpoint the workbench UI’s “Cancel run” button calls.
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.

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 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.

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. 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).
See Agent Mode for full agent documentation.