Skip to main content
sec0SecurityMiddleware(...) is the main Sec0 integration point for a tool server. This page keeps the configuration a developer normally sets in an application and leaves adapter internals out of the main reference path.

Minimal shape

Preset wrappers are also available:
  • sec0LocalMiddleware(...) for local defaults
  • sec0HostedMiddleware(...) for control-plane defaults

MiddlewareOptions

The full internal adapter, raw-payload, and envelope extension hooks are intentionally left out of this page. Most app integrations do not need them.

policy

Accepted forms:
  • PolicyObject: parsed policy object
  • string: YAML policy loaded at runtime
  • ControlPlanePolicySource: fetch policy from the control plane

ControlPlanePolicySource

See Agent Scoped Policies for how scope, nodeId, and fallbackToBase affect runtime policy lookup.

signer

If you provide a custom signer, it must match this shape: For local development, use LocalDevSigner.fromKeyRef(...) from Signer & Tracing Reference.

otel

sec0

sec0.presign

apiKey and auth

apiKey is a convenience option. When it is set and sec0.presign is omitted, Sec0 can auto-discover hosted audit upload settings. Use auth when policy fetch should use explicit credentials:

runtime

The main runtime setting most developers care about is remote evaluation:

runtime.enforcement

telemetry

ap2

sast

dast

agentGuard

agentGuard.adapters[]

agentGuard.run_context