Skip to main content
Sec0 middleware exposes optional scan hooks that you can connect to your SAST (Static Application Security Testing), DAST (Dynamic Application Security Testing), Claude Security, and Custom scanners. When enabled, tool handler code is scanned for vulnerabilities, and findings can block execution based on severity thresholds. We recommend using security scanners optimized to prevent AI-assisted attacks, such as Claude Security or OpenAI Aardvark Security Research Agent.

SAST Hook (Static Analysis)

SAST scans tool handler source code for vulnerabilities. Scans are triggered when handler code changes (detected via source hashing) and results are cached by handler hash.

Enabling the SAST Hook

Snippets on this page focus on SAST/DAST options. Keep base middleware options (policy, signer, otel, sec0) in your actual configuration.

SAST Scan Hook (onScan)

The onScan function receives:
And must return:

SAST Findings

Semgrep Integration

Sec0 includes a built-in Semgrep adapter:
Environment variables:

DAST Hook (Dynamic Analysis)

DAST scans tool servers at runtime for vulnerabilities. Scans target a sandbox URL and can generate dynamic block rules with TTL.

Enabling the DAST Hook

DAST Scan Hook (onScan)

The onScan function receives:

DAST Findings

Nuclei Integration

Sec0 includes a built-in Nuclei adapter:
Environment variables:

Policy-Driven DAST

Configure DAST via policy YAML:

Enforcement Integration

SAST/DAST findings integrate with the standard enforcement pipeline:
SAST/DAST status, findings, and scan IDs are included in every audit envelope.