Principle:0sec labs 0 Workflow Integration
| Knowledge Sources | |
|---|---|
| Domains | MCP, Workflow_Management, Persistence |
| Last Updated | 2026-10-30 00:00 GMT |
Overview
Technique for exposing workflow management capabilities (list, start, cancel runs; create and send sessions) to external AI agents via MCP, backed by SQLite persistence and a Zod-validated bindings schema.
Description
Workflow integration is the principle that an MCP server can expose not just individual tools but also workflow management — creating and running multi-step security workflows, managing sessions, and retrieving run results. When --workflows is set, the server extends its tool surface with MCP_WORKFLOW_TOOL_NAMES (list_workflows, start_run, get_run_results, cancel_run, list_sessions, create_session, send_message, resume_session, etc.). These are backed by SecurityWorkflowStore (SQLite persistence via @0/db) and the SecurityWorkflowBindingsSchema (Zod validation via @0/shared). The workflow runtime is shared between the CLI (0 workflow) and MCP exposure.
Usage
Use this principle when external AI agents need to manage and execute security workflows, not just call individual tools. The SQLite persistence ensures workflow state survives server restarts.
Theoretical Basis
The workflow tool surface:
# Abstract model (NOT real implementation)
WORKFLOW_TOOLS = [
# Template management
"list_templates", "get_template",
# Workflow CRUD
"list_workflows", "get_workflow", "save_workflow",
# Run lifecycle
"start_run", "get_run", "get_run_results", "cancel_run", "list_runs",
# Session management
"list_sessions", "create_session", "attach_session", "get_session",
"send_message", "continue_session", "cancel_session",
"resolve_decision", "list_saved_sessions", "resume_session",
"get_session_events", "get_capabilities",
"resume_scan", "start_assessment",
]
# Each tool call validated by SecurityWorkflowBindingsSchema (Zod)
# State persisted to SecurityWorkflowStore (SQLite)