11# GitHub Security Lab Taskflow Agent
22
3- The Security Lab Taskflow Agent is an MCP enabled multi-Agent framework.
3+ The Security Lab Taskflow Agent is an MCP-enabled multi-Agent framework for
4+ declarative, YAML-driven agentic workflows.
45
5- The Taskflow Agent is built on top of the [ OpenAI Agents SDK] ( https://openai.github.io/openai-agents-python/ ) .
6+ Built on top of the [ OpenAI Agents SDK] ( https://openai.github.io/openai-agents-python/ ) ,
7+ it uses [ Pydantic] ( https://docs.pydantic.dev/ ) for grammar validation and
8+ [ Jinja2] ( https://jinja.palletsprojects.com/ ) for template rendering.
69
710## Core Concepts
811
@@ -16,6 +19,115 @@ Agents can cooperate to complete sequences of tasks through so-called [taskflows
1619
1720You can find a detailed overview of the taskflow grammar [ here] ( doc/GRAMMAR.md ) and example taskflows [ here] ( examples/taskflows/ ) .
1821
22+ ## Architecture
23+
24+ ```
25+ ┌─────────────────────────────────────────────────────┐
26+ │ CLI (cli.py) │
27+ │ Typer-based entry point: -p, -t, -l, -g, --resume │
28+ └─────────────────────┬───────────────────────────────┘
29+ │
30+ ┌─────────────────────▼───────────────────────────────┐
31+ │ Runner (runner.py) │
32+ │ Taskflow execution loop, model resolution, │
33+ │ template rendering, session checkpointing │
34+ └─────────────────────┬───────────────────────────────┘
35+ │
36+ ┌─────────────────────▼───────────────────────────────┐
37+ │ MCP Lifecycle (mcp_lifecycle.py) │
38+ │ Server connection, cleanup, process management │
39+ └─────────────────────┬───────────────────────────────┘
40+ │
41+ ┌─────────────────────▼───────────────────────────────┐
42+ │ Agent (agent.py) │
43+ │ TaskAgent wrapper, hooks, OpenAI Agents SDK bridge │
44+ └─────────────────────────────────────────────────────┘
45+
46+ Supporting modules:
47+ models.py — Pydantic v2 grammar models (validation)
48+ session.py — Task-level checkpoint / resume
49+ available_tools.py — YAML resource loader with caching
50+ template_utils.py — Jinja2 template environment
51+ mcp_utils.py — MCP client parameter resolution
52+ mcp_transport.py — MCP transport implementations (stdio, streamable)
53+ mcp_prompt.py — System prompt construction
54+ prompt_parser.py — Legacy prompt argument parser
55+ capi.py — AI API endpoint and token management
56+ path_utils.py — Platform-aware data/log directories
57+ ```
58+
59+ ### API Types
60+
61+ The agent supports both the ** Chat Completions** and ** Responses** OpenAI APIs.
62+ The API type can be configured globally or per model in a ` model_config ` file:
63+
64+ ``` yaml
65+ seclab-taskflow-agent :
66+ version : " 1.0"
67+ filetype : model_config
68+ api_type : chat_completions # default for all models
69+ models :
70+ gpt_default : gpt-4.1
71+ gpt_responses : gpt-5.1
72+ model_settings :
73+ gpt_responses :
74+ api_type : responses # override for this model
75+ endpoint : https://api.githubcopilot.com
76+ token : CAPI_TOKEN # env var name containing the API key
77+ ` ` `
78+
79+ Per-model ` model_settings` can include:
80+ - **`api_type`** — `"chat_completions"` (default) or `"responses"`
81+ - **`endpoint`** — API base URL override for this model
82+ - **`token`** — name of an environment variable containing the API key
83+
84+ # ## Session Recovery
85+
86+ Taskflow runs are automatically checkpointed at the task level. If a task
87+ fails after exhausting retries, the session is saved and can be resumed :
88+
89+ ` ` `
90+ ** 🤖💾 Session saved: abc123def456
91+ ** 🤖💡 Resume with: --resume abc123def456
92+ ` ` `
93+
94+ Resume from the last successful checkpoint :
95+
96+ ` ` ` bash
97+ python -m seclab_taskflow_agent --resume abc123def456
98+ ` ` `
99+
100+ Failed tasks are automatically retried up to 3 times with increasing backoff
101+ before the session is saved. Session checkpoints are stored in the
102+ platform-specific application data directory.
103+
104+ # ## Error Output
105+
106+ By default, errors are shown as concise one-line messages. Use `--debug` (or
107+ set `TASK_AGENT_DEBUG=1`) for full tracebacks :
108+
109+ ` ` ` bash
110+ # Concise (default)
111+ Error: [BadRequestError] model 'foo' not found
112+ (use --debug for full traceback)
113+
114+ # Full traceback
115+ python -m seclab_taskflow_agent --debug -t examples.taskflows.echo
116+ ` ` `
117+
118+ # ## MCP Environment Denylist
119+
120+ By default, MCP server subprocesses inherit the parent environment. To prevent
121+ specific variables from leaking to MCP servers, set `TASKFLOW_ENV_DENYLIST` to
122+ a comma-separated list of variable names :
123+
124+ ` ` ` bash
125+ export TASKFLOW_ENV_DENYLIST="MY_SECRET_TOKEN,PRIVATE_KEY,OTHER_CREDENTIAL"
126+ ` ` `
127+
128+ Toolbox-level `env:` declarations in YAML still inject exactly what each server
129+ needs, so explicitly configured variables are unaffected.
130+
19131# # Use Cases and Examples
20132
21133The Seclab Taskflow Agent framework was primarily designed to fit the iterative feedback loop driven work involved in Agentic security research workflows and vulnerability triage tasks.
0 commit comments