You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`--lint`exits non-zero if any errors are found, so it can gate CI. The JSON
208
+
Schema for each grammar document type can be printed with `--schema` for editor
209
+
integration and external validation:
210
+
211
+
```bash
212
+
python -m seclab_taskflow_agent --schema
213
+
```
214
+
177
215
### MCP Environment Denylist
178
216
179
217
By default, MCP server subprocesses inherit the parent environment. To prevent
@@ -199,6 +237,28 @@ The framework includes a [CodeQL](https://codeql.github.com/) MCP server that ca
199
237
200
238
Instead of generating CodeQL queries itself, the CodeQL MCP Server is used to provide CodeQL-query based MCP tools that allow an Agent to navigate and explore code. It leverages templated CodeQL queries to provide targeted context for model driven code analysis.
201
239
240
+
### Model comparison and evaluation
241
+
242
+
The framework can also run the same prompt across several models and compare their answers, which is useful for evaluating models against each other on a given task. The [example_model_comparison](examples/taskflows/example_model_comparison.yaml) taskflow shows the pattern: a multi-model task fans the same question out across two models, captures each model's prose answer with `capture: response`, and a second "judge" task reads every captured answer by name (`outputs.answers`) and picks the best one.
243
+
244
+
Run it against your endpoint like any other taskflow:
Each model answers in its own labelled output block, and the judge task then compares them, for example:
251
+
252
+
```
253
+
** 🤖✏️ Output for gpt_alt
254
+
A use-after-free bug is a type of software vulnerability that occurs when a program continues to use a memory location after it has been freed ...
255
+
** 🤖✏️ Output for gpt_fast
256
+
A use-after-free bug occurs when a program continues to use memory after it has been freed ...
257
+
The gpt_fast answer is best because it is more concise while still clearly explaining ...
258
+
```
259
+
260
+
The two models are defined in [multi_model.yaml](examples/model_configs/multi_model.yaml); swap the provider IDs there to compare whatever models your endpoint exposes. `capture: response` is what makes the models' prose answers (rather than a tool result) available to the judge; see the "Capturing the response instead of a tool result" section of [doc/GRAMMAR.md](doc/GRAMMAR.md) for details.
Copy file name to clipboardExpand all lines: doc/GRAMMAR.md
+266Lines changed: 266 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,6 +103,86 @@ Parameters to the model can also be specified in the task using the `model_setti
103
103
104
104
If `model_settings` is absent, then the model parameters will fall back to either the default or the ones supplied in a `model_config`. However, any parameters supplied in the task will override those that are set in the `model_config`.
105
105
106
+
### Multiple Models (multi-model tasks)
107
+
108
+
A task can be run against several models at once using the `models` field. Each
109
+
model runs the task in parallel and its output is streamed as its own labelled
110
+
block, which makes it easy to compare how different models respond to the same
111
+
prompt (for example when evaluating an audit prompt across model families).
112
+
113
+
The simplest form is a list of logical model names (resolved through the
114
+
`model_config` exactly like the singular `model` field):
Unlike the task-level `if` condition (which treats undefined names as falsy and
260
+
skips the task), undefined variables inside a prompt raise, to catch typos. Use
261
+
`is defined` or the `default` filter for optional data:
262
+
`{{ globals.note | default('') }}`.
263
+
121
264
### Running templated tasks in a loop
122
265
123
266
Often we may want to iterate through the same tasks with different inputs. For example, we may want to fetch all the functions from a code base and then analyze each of the functions. This can be done using two consecutive tasks and with the help of the `repeat_prompt` field.
@@ -259,6 +402,129 @@ Example:
259
402
- seclab_taskflow_agent.toolboxes.codeql
260
403
```
261
404
405
+
### Typed named outputs
406
+
407
+
By default, data flows between tasks implicitly: `repeat_prompt` consumes the
408
+
*last tool result* of the previous task. That is positional (whichever tool
409
+
fired last) and untyped. A task can instead publish a **named, typed output**
410
+
that later tasks consume by name.
411
+
412
+
Three fields drive this:
413
+
414
+
- `id`names a task, exposing its output to later tasks as `outputs.<id>`. The
415
+
shape depends on whether the task fans out:
416
+
- A plain task (single model, no `repeat_prompt`) publishes its single
417
+
produced value (its final tool result).
418
+
- A task that fans out (`repeat_prompt`, multiple `models`, or their cross
419
+
product) publishes a per-branch fan-in list of
420
+
`{"model": <label>, "item": <index>, "result": <value>}` records, one per
421
+
branch. This is uniform across the item axis and the model axis, so a
422
+
single-model `repeat_prompt` and a multi-model task capture the same way.
423
+
- `outputs`declares an inline JSON Schema (Draft 2020-12). When present, the
424
+
task's value is validated against it before being stored. Validation is strict
425
+
and does not coerce, so a value whose types do not match the contract is a
426
+
failure. On a fan-out task the schema is applied to each branch's `result`
427
+
(a violation is a failed branch under the `completion` policy); on a plain
428
+
task it is applied to the single value (a violation is a hard failure). A
429
+
malformed schema is rejected when the taskflow is loaded, before any model
430
+
calls are made.
431
+
- `over` is an explicit iterable selector for `repeat_prompt`: a Jinja
432
+
expression evaluated against the template context (so it yields a real list,
433
+
not a re-parsed string).
434
+
435
+
Example: one task produces a typed list of functions, the next analyses each.
Toolboxes are MCP server configurations. They can be defined at the Agent level or overridden at the task level. These MCP servers are started and made available to the Agents in the Agents list during a Task. The `toolboxes` field should contain a list of files for the `toolboxes` that are available for the task:
0 commit comments