Features
- Async parallel execution — Run engines concurrently
- Circuit breaker — Auto-disable failing engines
- Engine health monitoring — Track reliability
- Weighted consensus — Consider engine reliability
- Secure code execution — Python engine runs through the Docker sandbox only
Usage
Verification modes
The
high and maximum modes include the Python engine, which requires the secure Docker sandbox. If Docker is unavailable, these modes return blocked_secure_execution instead of falling back to in-process execution.The Python engine in
high and maximum modes requires Docker. If the secure Docker sandbox is unavailable, consensus verification returns HTTP 503 instead of falling back to in-process code execution.Async execution
Circuit breaker
When an engine fails repeatedly, it’s automatically disabled:Async failure handling
When an unexpected error occurs during async engine aggregation, the Consensus Engine records the failure as a dedicatedEngineResult entry rather than silently dropping it. This ensures that:
- The failure is visible in the
resultsarray returned to the caller - Aggregate confidence scores account for the failed engine
- The error is logged via
logger.exceptionfor post-mortem debugging
engine_name: "consensus_orchestrator", method: "async_aggregation", success: false, and includes the error message in the error field.
Engine selection
The consensus engine automatically selects which engines to run based on the verification mode:The fact engine is excluded from automatic engine selection. Fact verification requires external context, and including it in consensus without that context would create self-referential verification loops. If fact verification is invoked during consensus, it returns an error indicating that external context is required.
Consensus calculation
The engine uses weighted voting:
Final confidence = weighted average of agreeing engines.