Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:0sec labs 0 Workflow Integration

From Leeroopedia
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)

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment