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
sec0LocalMiddleware(...)for local defaultssec0HostedMiddleware(...)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 objectstring: YAML policy loaded at runtimeControlPlanePolicySource: 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: