Verification Checklist
After integrating Sec0, confirm each layer is working:Instrumentation
-
initializeSec0App()orloadStandardConfig()completes without errors - Decorated methods execute and return results normally
- Audit files appear in the configured
appenderDir
Middleware
-
sec0SecurityMiddleware(options)(server)wraps without errors - Tool calls succeed and audit envelopes are written to
sec0.dir - Registry freeze is active (registering new tools after wrapping throws)
Gateway
-
startGatewayServer()binds to the configured port -
POST /mcp/:server/:tool@versionreturns valid responses - Response headers include
x-trace-idandx-span-id - Audit envelopes are written for each gateway call
Adaptive Approvals
- Policy includes
security.side_effects.human_escalationfor the intended scope - Policy includes
security.side_effects.approve_high_risk: true -
enforcement.escalate_onis set (or omitted so it falls back toenforcement.deny_on) - Denied responses include
escalation_idandescalation_statuswhen escalation is created - Audit envelopes include
escalation_idfor escalated denials
Audit Output
Check your configured audit directory for daily-rotated files:Common Errors
[sec0] Config file not found
Cause: sec0.config.yaml is missing or the path is incorrect.
Fix: Ensure the file exists and the path is correct:
[sec0] localDir is required
Cause: Missing localDir in configuration or controlPlane.sec0Dir in standard config.
Fix: Add an absolute path:
[sec0] localSignerPath is required
Cause: Missing or invalid signing key path.
Fix:
- Generate a key:
- Set the key path in config:
[sec0] Signing key file not found
Cause: The key file doesn’t exist at the configured path.
Fix: Verify the file exists and has proper permissions:
[sec0] No hop configuration found for "ClassName.method"
Cause: The decorator can’t find a matching entry in app.hops.
Fix: Add the hop entry to sec0.config.yaml:
[sec0] app.environment must be dev, staging, or prod
Cause: Invalid environment value.
Fix: Set app.environment to one of dev, staging, or prod.
Control Plane Errors
API key validation failed: Verify yourSEC0_API_KEYis valid and the control plane is reachablecontrolPlaneUrl could not be resolved: SetSEC0_CONTROL_PLANE_URLenvironment variable or configurecontrolPlane.apiBaseUrl- Policy fetch fails: Ensure
auth.apiKeyorauth.bearerTokenis set when using control-plane policy source
Gateway Errors
audit.append must be a function: Pass a validSec0Appenderinstancequotas adapter required: UseInMemoryAdapterfor development- Missing
x-idempotency-key: The gateway requires this header on all requests
Approvals Errors
no_approvers_configured: Human review is required, but no reviewer group resolved for this request.- Frequent timeout decisions: Increase reviewer coverage or adjust strategy/quorum values in
human_escalation. - Unexpected approvals/rejections: Re-check
required_roles,veto_roles, andtimeout_actionin policy. - Missing
escalation_idon denied responses: Verifyapprove_high_riskis enabled and the denial reason is included inenforcement.escalate_on(orenforcement.deny_onwhenescalate_onis not set).
Middleware Errors
REGISTRY_FROZEN: Cannot register new tools after wrapping. Register all tools before callingsec0SecurityMiddleware(options)(server)HANDLER_SWAP: A tool handler was reassigned after wrapping. This is blocked for integrityCannot read properties of undefined (reading 'serviceName'):otelconfig is missing. Includeotel.endpoint,otel.serviceName, andotel.environmentin middleware options.
Environment Variables
| Variable | Purpose |
|---|---|
SEC0_API_KEY | API key for control plane authentication |
SEC0_CONTROL_PLANE_URL | Override control plane base URL |
SEC0_ESCALATION_TIMEOUT_MS | Timeout (ms) for escalation create calls |
SEC0_SIGNER_KEY_DIRS | Comma-separated allowed key directories for LocalDevSigner.fromKeyRef |
SVC_TOKEN | Service token for gateway auth |