Skip to content

Commit 7b3cb23

Browse files
author
Bas Alberts
committed
taskflow agent public release
0 parents  commit 7b3cb23

File tree

78 files changed

+5292
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+5292
-0
lines changed

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
__pycache__
2+
docker/
3+
logs/**/*
4+
.env
5+
.venv
6+
.direnv
7+
.envrc
8+
.devcontainer
9+
.git

.gitignore

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
*.log
2+
.direnv
3+
.envrc
4+
5+
# https://github.com/github/gitignore/blob/main/Python.gitignore
6+
# Byte-compiled / optimized / DLL files
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
11+
# emacs backup files
12+
*~
13+
14+
# C extensions
15+
*.so
16+
17+
# Distribution / packaging
18+
.Python
19+
build/
20+
develop-eggs/
21+
dist/
22+
downloads/
23+
eggs/
24+
.eggs/
25+
parts/
26+
sdist/
27+
var/
28+
wheels/
29+
share/python-wheels/
30+
*.egg-info/
31+
.installed.cfg
32+
*.egg
33+
MANIFEST
34+
35+
# PyInstaller
36+
# Usually these files are written by a python script from a template
37+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
38+
*.manifest
39+
*.spec
40+
41+
# Installer logs
42+
pip-log.txt
43+
pip-delete-this-directory.txt
44+
45+
# Unit test / coverage reports
46+
htmlcov/
47+
.tox/
48+
.nox/
49+
.coverage
50+
.coverage.*
51+
.cache
52+
nosetests.xml
53+
coverage.xml
54+
*.cover
55+
*.py,cover
56+
.hypothesis/
57+
.pytest_cache/
58+
cover/
59+
60+
# Translations
61+
*.mo
62+
*.pot
63+
64+
# Django stuff:
65+
*.log
66+
local_settings.py
67+
db.sqlite3
68+
db.sqlite3-journal
69+
70+
# Flask stuff:
71+
instance/
72+
.webassets-cache
73+
74+
# Scrapy stuff:
75+
.scrapy
76+
77+
# Sphinx documentation
78+
docs/_build/
79+
80+
# PyBuilder
81+
.pybuilder/
82+
target/
83+
84+
# Jupyter Notebook
85+
.ipynb_checkpoints
86+
87+
# IPython
88+
profile_default/
89+
ipython_config.py
90+
91+
# pyenv
92+
# For a library or package, you might want to ignore these files since the code is
93+
# intended to run in multiple environments; otherwise, check them in:
94+
# .python-version
95+
96+
# pipenv
97+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
98+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
99+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
100+
# install all needed dependencies.
101+
#Pipfile.lock
102+
103+
# UV
104+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
#uv.lock
108+
109+
# poetry
110+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
111+
# This is especially recommended for binary packages to ensure reproducibility, and is more
112+
# commonly ignored for libraries.
113+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
114+
#poetry.lock
115+
116+
# pdm
117+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
118+
#pdm.lock
119+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
120+
# in version control.
121+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
122+
.pdm.toml
123+
.pdm-python
124+
.pdm-build/
125+
126+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
127+
__pypackages__/
128+
129+
# Celery stuff
130+
celerybeat-schedule
131+
celerybeat.pid
132+
133+
# SageMath parsed files
134+
*.sage.py
135+
136+
# Environments
137+
.env
138+
.venv
139+
env/
140+
venv/
141+
ENV/
142+
env.bak/
143+
venv.bak/
144+
145+
# Spyder project settings
146+
.spyderproject
147+
.spyproject
148+
149+
# Rope project settings
150+
.ropeproject
151+
152+
# mkdocs documentation
153+
/site
154+
155+
# mypy
156+
.mypy_cache/
157+
.dmypy.json
158+
dmypy.json
159+
160+
# Pyre type checker
161+
.pyre/
162+
163+
# pytype static type analyzer
164+
.pytype/
165+
166+
# Cython debug symbols
167+
cython_debug/
168+
169+
# PyCharm
170+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
171+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
172+
# and can be added to the global gitignore or merged into this file. For a more nuclear
173+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
174+
#.idea/
175+
176+
# Ruff stuff:
177+
.ruff_cache/
178+
179+
# PyPI configuration file
180+
.pypirc
181+
182+
#config.yaml
183+
config.yaml
184+
185+
#database
186+
*.db
187+
#logs
188+
logs/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 GitHub
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
The Security Lab Taskflow Agent is an MCP enabled multi-Agent framework.
2+
3+
While the [Security Lab Copilot Extensions Framework](https://github.com/github/seclab-copilot-extensions) was created for team-internal prototyping and exploring various Agentic workflow ideas and approaches, the Taskflow Agent is intended as a "production" implementation.
4+
5+
The Taskflow Agent is built on top of the [OpenAI Agents SDK](https://openai.github.io/openai-agents-python/) in contrast to the largely custom backend implementations of our original Copilot extensions framework.
6+
7+
As such the Taskflow Agent provides a more future-proof CLI focused Agent tool as we leverage the SDK for keeping pace with e.g. evolving MCP protocol specifications.
8+
9+
While the Taskflow Agent does not integrate into the dotcom Copilot UX, it does operate using the Copilot API (CAPI) as its backend.
10+
11+
# Core Concepts
12+
13+
The Taskflow Agent leverages a GitHub Workflow-esque YAML based grammar to perform a series of tasks using a set of Agents.
14+
15+
Agents are defined through [personalities](personalities/), that receive a [task](taskflows/) to complete given a set of [tools](toolboxes/).
16+
17+
Agents can cooperate to complete sequences of tasks through so-called [Taskflows](taskflows/GRAMMAR.md).
18+
19+
# Installation
20+
21+
```sh
22+
python -m venv .venv
23+
source .venv/bin/activate
24+
python -m pip install -r requirements.txt
25+
```
26+
27+
## System Requirements
28+
29+
Python >= 3.9
30+
31+
# Usage
32+
33+
Provide a Copilot entitled GitHub PAT via the `COPILOT_TOKEN` environment variable.
34+
35+
Run `python main.py` for help.
36+
37+
Example: deploying a prompt to an Agent Personality:
38+
39+
```
40+
python main.py -p assistant 'explain modems to me please'
41+
```
42+
43+
Example: deploying a Taskflow:
44+
45+
```
46+
python main.py -t example
47+
```
48+
49+
## Configuration
50+
51+
Set environment variables via an `.env` file in the project root as required.
52+
53+
# Personalities
54+
55+
Core characteristics for a single Agent. Configured through YAML files in `personalities/`.
56+
57+
These are system prompt level instructions.
58+
59+
Example:
60+
61+
```yaml
62+
# personalities define the system prompt level directives for this Agent
63+
personality: |
64+
You are a simple echo bot. You use echo tools to echo things.
65+
66+
task: |
67+
Echo user inputs using the echo tools.
68+
69+
# personality toolboxes map to mcp servers made available to this Agent
70+
toolboxes:
71+
- echo
72+
```
73+
74+
# Toolboxes
75+
76+
MCP servers that provide tools. Configured through YAML files in `toolboxes/`.
77+
78+
Example stdio config:
79+
80+
```yaml
81+
# stdio mcp server configuration
82+
server_params:
83+
kind: stdio
84+
command: python
85+
args:
86+
- toolboxes/echo/echo.py
87+
env:
88+
SOME: value
89+
```
90+
91+
Example sse config:
92+
93+
```yaml
94+
server_params:
95+
kind: sse
96+
# make sure you .env config the echo server, see echo_sse.py for example
97+
url: http://127.0.0.1:9000/echo
98+
headers:
99+
SomeHeader: "{{ env USER }}"
100+
```
101+
102+
# Taskflows
103+
104+
A sequence of interdependent tasks performed by a set of Agents. Configured through a YAML based [grammar](taskflows/GRAMMAR.md) in [taskflows/](taskflows/).
105+
106+
Example:
107+
108+
```yaml
109+
taskflow:
110+
- task:
111+
# taskflows can optionally choose any of the support CAPI models for a task
112+
model: gpt-4.1
113+
# taskflows can optionally limit the max allowed number of Agent task loop
114+
# iterations to complete a task, this defaults to 50 when not provided
115+
max_steps: 20
116+
must_complete: true
117+
# taskflows can set a primary (first entry) and handoff (additional entries) agent
118+
agents:
119+
- c_auditer
120+
- fruit_expert
121+
user_prompt: |
122+
Store an example vulnerable C program that uses `strcpy` in the
123+
`vulnerable_c_example` memory key and explain why `strcpy`
124+
is insecure in the C programming language. Do this before handing off
125+
to any other agent.
126+
127+
Then provide a summary of a high impact CVE ID that involved a `strcpy`
128+
based buffer overflow based on your GHSA knowledge as an additional
129+
example.
130+
131+
Finally, why are apples and oranges healthy to eat?
132+
133+
# taskflows can set temporary environment variables, these support the general
134+
# "{{ env FROM_EXISTING_ENVIRONMENT }" pattern we use elsewhere as well
135+
# these environment variables can then be made available to any stdio mcp server
136+
# through its respective yaml configuration, see memcache.yaml for an example
137+
# you can use these to override top-level environment variables on a per-task basis
138+
env:
139+
MEMCACHE_STATE_DIR: "example_taskflow/"
140+
MEMCACHE_BACKEND: "dictionary_file"
141+
# taskflows can optionally override personality toolboxes, in this example
142+
# kevin normally only has the memcache toolbox, but we extend it here with
143+
# the GHSA toolbox
144+
toolboxes:
145+
- ghsa
146+
- memcache
147+
- task:
148+
must_complete: true
149+
model: gpt-4.1
150+
agents:
151+
- c_auditer
152+
user_prompt: |
153+
Retrieve C code for security review from the `vulnerable_c_example`
154+
memory key and perform a review.
155+
156+
Clear the memory cache when you're done.
157+
env:
158+
MEMCACHE_STATE_DIR: "example_taskflow/"
159+
MEMCACHE_BACKEND: "dictionary_file"
160+
toolboxes:
161+
- memcache
162+
```
163+
164+
Taskflows support [Agent handoffs](https://openai.github.io/openai-agents-python/handoffs/). Handoffs are useful for implementing triage patterns where the primary Agent can decide to handoff a task to any subsequent Agents in the `Agents` list.
165+
166+
See the [taskflow examples](taskflows/examples) for other useful Taskflow patterns such as repeatable and asynchronous templated prompts.
167+
168+
# Docker based deployments
169+
170+
You can find a Docker image for the Seclab Taskflow Agent [here](https://github.com/GitHubSecurityLab/seclab-taskflow-agent/pkgs/container/seclab-taskflow-agent)
171+
172+
Note that this image is based on the public release of the Taskflow Agent, and you will have to mount any custom taskflows, personalities, or prompts into the image for them to be available to the Agent. See [docker/run.sh](docker/run.sh) for examples of use.

0 commit comments

Comments
 (0)