Skip to main content
Vigolium is designed for extensibility. Whether you need to add a new vulnerability check, reshape scan behavior, or integrate AI-driven analysis, there are multiple extension points, each with different trade-offs. This guide covers every customization mechanism, explains when to use each one, and helps you pick the right approach for your use case.

Table of Contents


Extension Points at a Glance


1. JavaScript Extensions

JavaScript extensions are the most flexible way to add custom scanning logic without recompiling Vigolium. They run inside an embedded JS engine (Grafana Sobek) and have access to the full vigolium.* API, HTTP requests, database queries, parsing utilities, AI integration, and more.

What you can build

  • Active modules: send payloads to insertion points (parameters, headers, cookies, paths) and analyze responses for vulnerabilities.
  • Passive modules: analyze captured HTTP traffic without generating new requests.
  • Pre-hooks: mutate requests before they reach scanner modules (inject auth headers, skip paths).
  • Post-hooks: filter, tag, or escalate findings after detection.

Minimal example (active module)

Available APIs

Full TypeScript definitions: pkg/jsext/vigolium.d.ts

Setup

Drop .js files into ~/.vigolium/extensions/ and verify with vigolium extensions ls.

Pros

  • No recompilation: drop a file and scan.
  • Full API access: HTTP, database, AI, source code, parsing, and system utilities.
  • AI-augmented scanning: use vigolium.agent.generatePayloads() and vigolium.agent.analyzeResponse() for LLM-powered detection.
  • Rapid iteration: edit, save, rescan.
  • Sandboxed execution: file I/O constrained to sandbox_dir, exec() gated behind config.

Cons

  • Slower than Go: interpreted JS engine adds overhead per invocation.
  • No Go standard library: limited to vigolium.* APIs, no arbitrary imports.
  • Single-threaded per VM: each extension instance runs in its own VM (thread-safe via pooling, but no parallelism within a single extension).
  • Limited debugging: no step-through debugger, vigolium.log.* is your main tool.

When to use

  • You need a custom vulnerability check and don’t want to recompile.
  • You want AI-augmented payload generation or response analysis.
  • You need database or source code access in your check logic.
  • You’re building organization-specific checks (e.g., custom header validation, business-logic flaws).
See the full guide: Writing Extensions

2. YAML Extensions

YAML extensions (.vgm.yaml) are a declarative alternative to JavaScript. They’re ideal for simple payload-and-matcher rules where you don’t need programmatic control flow.

Minimal example (active module)

YAML hook example (pre-hook)

YAML hook example (post-hook)

Supported features

Pros

  • Zero coding: pure declarative YAML.
  • Fast to write: a payload list + matcher regex is often all you need.
  • Easy to audit: non-technical team members can review rules.
  • Same pipeline integration: loaded alongside JS extensions, same lifecycle.

Cons

  • Limited logic: no conditionals, loops, or state beyond what matchers offer.
  • No API access: no database queries, HTTP follow-ups, or AI calls (unless you use the script escape hatch, which is effectively JS).
  • No multi-step checks: can’t chain requests or compare responses across steps.
  • Coarser insertion control: payload injection is straightforward but you can’t dynamically generate payloads based on context.

When to use

  • Simple signature-based detection (error strings, header patterns, status codes).
  • Quick pre-hook rules (add auth headers, skip static assets).
  • Post-hook filtering (suppress low-severity findings on static paths).
  • When non-developers need to contribute scanning rules.
See the full guide: Writing Extensions

3. Custom Prompt Templates

Prompt templates drive Vigolium’s agent mode. They’re Markdown files with YAML frontmatter that define what an AI agent should analyze and how it should report results. Templates support Go template syntax and are automatically enriched with context from the database, module registry, and source code.

Template format

Available template variables

Only variables listed in the frontmatter variables array trigger database queries, keeping prompts fast.

Output schemas

findings: for code review, vulnerability detection:
http_records: for endpoint discovery, API input generation:

Preset templates

Vigolium ships with 15 built-in templates:

Setup

Place custom templates in ~/.vigolium/prompts/ or set agent.templates_dir in config. User templates override built-in ones by ID.

Pros

  • No code: Markdown files with template syntax.
  • Context-aware: automatic enrichment with database findings, endpoints, scan stats.
  • Multiple AI backends: works with any of the eight olium providers (Anthropic API/OAuth/CLI/Vertex, OpenAI API/Codex-OAuth, Google Vertex, OpenAI-compatible local models).
  • Iterative refinement: autopilot and pipeline modes pass prior findings back for verification.
  • Two output modes: emit findings for code review or HTTP records for endpoint discovery.

Cons

  • AI dependency: requires a configured agent backend and API access.
  • Non-deterministic: LLM output varies between runs; false positives require tuning.
  • Latency: agent invocations are slower than pattern matching (seconds to minutes per run).
  • Token costs: large codebases consume significant tokens per analysis.

When to use

  • Code-level security review that needs semantic understanding (not just pattern matching).
  • Generating HTTP test inputs from source code (route extraction, API fuzzing seeds).
  • Framework-specific audits (Next.js, React, Django, Spring) where templates can embed domain knowledge.
  • Iterative analysis where the agent refines findings across multiple passes.

4. Scanning Profiles

Profiles are YAML files that overlay on top of the main configuration. They bundle scanning strategy, pace, phase settings, and module selection into a reusable preset.

Format

A profile is a subset of vigolium-configs.yaml. Only non-nil values override the base config.

Usage

Profiles are resolved from ~/.vigolium/profiles/ or public/presets/profiles/ by name.

Pros

  • Reusable presets: define once, use across targets and teams.
  • Composable: overlay on top of base config; only override what you need.
  • No code: pure YAML.
  • Team-friendly: share profiles in version control for consistent scan policies.

Cons

  • Config-only: can’t add new scanning logic, only tune existing settings.
  • No per-target logic: same profile applies to all targets in a scan.
  • Limited validation: typos in field names silently ignored.

When to use

  • You run different scan intensities for different contexts (CI/CD vs. full audit vs. quick check).
  • You want to enforce consistent scan settings across a team.
  • You need to toggle phases (e.g., skip discovery, only run passive modules).

5. Scope Rules

Scope rules control what gets scanned. They filter at the host, path, status code, content type, and body level. You can define them in the config, via CLI flags, or programmatically from JS extensions.

Configuration

Scope from extensions

Pros

  • Precision targeting: scan only what matters, skip noise.
  • Multiple filter types: host globs, path patterns, status codes, content types, body strings.
  • Runtime adjustable: extensions can modify scope during a scan.
  • Safety net: prevents accidental scanning of out-of-scope systems.

Cons

  • Config-only complexity: complex scope rules can be hard to debug.
  • No request-level conditions: you can’t scope by request header values or authentication state (use pre-hooks for that).

When to use

  • Restricting scans to specific subdomains or API paths.
  • Excluding health checks, static assets, or third-party endpoints.
  • Bug bounty programs with defined scope boundaries.
  • Filtering by response characteristics (status codes, content types).

6. Pre-Hooks and Post-Hooks

Hooks wrap the scanning pipeline. Pre-hooks transform requests before modules process them. Post-hooks filter or modify findings after detection.

Pre-hook use cases

Post-hook use cases

JS pre-hook example

JS post-hook example (AI false positive filter)

Pros

  • Pipeline integration: runs automatically on every request/finding.
  • Composable: multiple hooks chain sequentially.
  • Both JS and YAML: simple rules in YAML, complex logic in JS.
  • Non-invasive: doesn’t modify module code.

Cons

  • Sequential overhead: hooks run on the hot path; slow hooks slow everything.
  • Order-dependent: hook execution order matters but isn’t always obvious.
  • Pre-hooks can’t see responses: they only have access to the outbound request.

When to use

  • You need to inject authentication into every request (pre-hook).
  • You want to suppress known false positives across all modules (post-hook).
  • You need to tag or route findings based on URL patterns (post-hook).
  • AI-powered confirmation of findings before reporting (post-hook).
See the full guide: Writing Extensions

7. Agent Providers (Olium)

Every agent invocation in Vigolium is dispatched through the in-process olium runtime (pkg/olium/). There are no external SDK or ACP subprocess backends, instead you choose a provider (the LLM API olium dispatches to) and configure its credential.

Built-in providers

Default provider is openai-compatible with model gemma4:latest (a local Ollama endpoint), so a freshly initialized config works against http://localhost:11434/v1 out of the box. Pick a hosted provider when you want a frontier model:

Configuring a provider

Override per-run from any agent subcommand:
Server-side workloads: the REST API does not mirror these per-invocation flags. The server resolves the provider once from agent.olium.* and reuses it across requests so prompt caches stay stable.

Tool registry

The olium engine exposes eight built-in tools to the model: bash, read_file, write_file, edit_file, ls, grep, glob, web_fetch. Autopilot adds halt_scan, durable scratchpad tools, and a mode-dependent finding tool: report_finding in legacy/shadow, or verifier-gated propose_candidate in enforced. See Olium Agent for the full tool reference.

LLM config (for JS extensions)

The vigolium.agent.* APIs available to JavaScript extensions dispatch through the same in-process olium engine that powers the vigolium agent subcommands. Configure the provider once under agent.olium — see Olium Agent for the full provider/model options.
Note: The legacy agent.llm config block is deprecated and ignored. The JS extension agent API now resolves its provider from agent.olium; remove any agent.llm section from your config.

Pros

  • Eleven providers: pick the credential model that fits (OAuth for ChatGPT Plus / Claude Max, API keys for raw API access — Chat Completions or the OpenAI Responses API — CLI shellout or the Claude Code Agent-SDK bridge for a logged-in Claude subscription, Vertex for GCP, OpenAI- or Anthropic-compatible for local/self-hosted models).
  • Single in-process runtime: no subprocess startup overhead, prompt caching is reused across phases that share an engine (Anthropic + Codex providers only).
  • Per-invocation overrides: every CLI subcommand exposes --provider, --model, --oauth-cred, --oauth-token, --llm-api-key.
  • Global concurrency cap: max_concurrent keeps tier-1 plans from hitting 429s under fan-out.
  • Durable autopilot: autopilot_mode: shadow rotates context while preserving direct reports; enforced promotes only independently verified candidates. legacy remains the default.

Cons

  • Provider lock-in to supported drivers: only the eleven drivers above are recognised; arbitrary custom CLIs are not pluggable as backends anymore.
  • Cost: LLM API calls still have token costs; the --intensity preset (autopilot) caps the iteration budget — quick is the lightest, deep the heaviest.

When to use

  • Always, every agent subcommand goes through olium. The choice you actually make is which provider and model, not whether to use olium.

8. Configuration Overrides

The main vigolium-configs.yaml is the central control plane for all scan behavior. Every aspect of the scanner, phases, pace, modules, database, notifications, and more, is configurable.

Key configuration sections

Environment variable expansion

Pros

  • Comprehensive: controls every scanner behavior.
  • Environment-aware: variable expansion for secrets.
  • Layered: base config + profiles + CLI flags, in order of precedence.

Cons

  • No logic: pure configuration, can’t express conditional behavior.
  • Silent failures: unrecognized keys are ignored, not flagged.
  • Single file: large configs can become unwieldy.

When to use

  • Tuning scan speed and resource usage for your infrastructure.
  • Selecting which modules run by default.
  • Configuring database, notifications, and OAST.
  • Setting organization-wide defaults.

Decision Matrix

Use this table to quickly pick the right extension mechanism: