Skip to content

Commit 6b7ee52

Browse files
authored
feat: Scorer Improvements (#115)
* Added more scorers. Cleaned TaskInput and migrated to Lookups. New docs. * Additional fixes from feedback * Docs updates * Fixing type errors * Fix type errors
1 parent 0f24b95 commit 6b7ee52

33 files changed

+3660
-1048
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ repos:
3232
rev: v2.4.1
3333
hooks:
3434
- id: codespell
35-
entry: codespell -q 3 -f --skip=".git,.github,README.md" -L astroid,braket,te,ROUGE
35+
entry: codespell -q 3 -f --skip=".git,.github,README.md" -L astroid,braket,te,ROUGE,lief
3636

3737
# Python code security
3838
- repo: https://github.com/PyCQA/bandit

.secrets.baseline

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@
127127
}
128128
],
129129
"results": {
130+
"docs/examples/overview.mdx": [
131+
{
132+
"type": "Basic Auth Credentials",
133+
"filename": "docs/examples/overview.mdx",
134+
"hashed_secret": "32a6fcbaa4543f0718079837a574f5835f3143fe",
135+
"is_verified": false,
136+
"line_number": 190
137+
}
138+
],
130139
"docs/how-to/write-a-ctf-agent.mdx": [
131140
{
132141
"type": "Secret Keyword",
@@ -162,5 +171,5 @@
162171
}
163172
]
164173
},
165-
"generated_at": "2025-07-24T10:02:58Z"
174+
"generated_at": "2025-07-24T10:42:54Z"
166175
}

docs/docs.json

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,19 @@
1717
"groups": [
1818
{
1919
"group": "Getting Started",
20+
"pages": ["intro", "install"]
21+
},
22+
{
23+
"group": "Example Agents",
2024
"pages": [
21-
"intro",
22-
"install",
23-
{
24-
"group": "Examples",
25-
"pages": [
26-
"examples/agent-examples",
27-
"examples/dangerous-capabilities",
28-
"examples/dotnet-reversing",
29-
"examples/python-agent",
30-
"examples/saas-scanning",
31-
"examples/sensitive-data"
32-
]
33-
}
25+
"examples/overview",
26+
"examples/dangerous-capabilities",
27+
"examples/dotnet-reversing",
28+
"examples/python-agent",
29+
"examples/sast-scanning",
30+
"examples/sensitive-data"
3431
]
3532
},
36-
3733
{
3834
"group": "Usage",
3935
"pages": [
@@ -42,6 +38,7 @@
4238
"usage/runs",
4339
"usage/tasks",
4440
"usage/metrics",
41+
"usage/scorers",
4542
"usage/data-tracking",
4643
"usage/rich-objects",
4744
"usage/model-training",

docs/examples/dotnet-reversing.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ public: true
66
See the full example in the [GitHub repository](https://github.com/dreadnode/example-agents/tree/main/dotnet_reversing).
77
---
88

9-
This agent is designed to perform reverse engineering and analysis of .NET binaries.
10-
It can decompile .NET assemblies and leverage a large language model (LLM) to analyze the source code based on a user-defined task, such as identifying security vulnerabilities.
11-
The agent can process binaries from a local file path or directly fetch them from the [NuGet package repository](https://www.nuget.org/packages).
9+
This agent is designed to perform reverse engineering and analysis of .NET binaries.
10+
It can decompile .NET assemblies and leverage a large language model (LLM) to analyze the source code based on a user-defined task, such as identifying security vulnerabilities.
11+
The agent can process binaries from a local file path or directly fetch them from the [NuGet package repository](https://www.nuget.org/packages).
1212
It operates asynchronously and can run multiple analysis instances in parallel.
1313

1414
## Intended Use
1515

16-
The primary purpose of this agent is to assist security researchers and developers in automating the process of scanning .NET applications for potential security flaws.
17-
A user can provide a high-level task, like "Find only critical vulnerabilities," and the agent will use its tools to decompile the code and use an LLM to analyze it, reporting any findings.
16+
The primary purpose of this agent is to assist security researchers and developers in automating the process of scanning .NET applications for potential security flaws.
17+
A user can provide a high-level task, like "Find only critical vulnerabilities," and the agent will use its tools to decompile the code and use an LLM to analyze it, reporting any findings.
1818
It can also be used as a simple utility to decompile and view the source code of .NET assemblies.
1919

2020
## Environment
2121

22-
The agent is a command-line application built with Python.
23-
It requires a Python environment with the necessary libraries installed, as specified in the script.
24-
It interacts with the public [NuGet API](https://learn.microsoft.com/en-us/nuget/api/overview) (api.nuget.org) to fetch packages.
25-
For its analysis capabilities, it relies on a configured language model, which can be a remote API (like GPT-4o-mini) or a locally hosted model (e.g., via Ollama).
26-
For observability and task tracking, it can be optionally [connected to a Dreadnode server](https://docs.dreadnode.io/strikes/usage/config).
22+
The agent is a command-line application built with Python.
23+
It requires a Python environment with the necessary libraries installed, as specified in the script.
24+
It interacts with the public [NuGet API](https://learn.microsoft.com/en-us/nuget/api/overview) (api.nuget.org) to fetch packages.
25+
For its analysis capabilities, it relies on a configured language model, which can be a remote API (like GPT-4o-mini) or a locally hosted model (e.g., via Ollama).
26+
For observability and task tracking, it can be optionally [connected to a Dreadnode server](/usage/config).
2727

2828
## Tools
2929

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: 'Explore a collection of specialized AI agents'
44
public: true
55
---
66

7-
We've created a collection of specialized, autonomous AI agents designed for various complex tasks.
8-
Each agent leverages Large Language Models (LLMs) combined with a specific set of tools to achieve its goals in a structured and observable manner.
7+
We've created a collection of specialized, autonomous AI agents designed for various complex tasks.
8+
Each agent leverages Large Language Models (LLMs) combined with a specific set of tools to achieve its goals in a structured and observable manner.
99
The agents are built using the [Rigging](https://github.com/dreadnode/rigging) and [Dreadnode](https://github.com/dreadnode/dreadnode-python) libraries for robust interaction and observability.
1010

1111
View the [GitHub repository](https://github.com/dreadnode/example-agents) for more details.
@@ -56,15 +56,15 @@ This agent is a specialized framework for evaluating the security analysis capab
5656

5757
An autonomous agent that explores and analyzes file systems to find and report sensitive data like credentials, API keys, and personal information. Leveraging `fsspec`, it can operate on local files, cloud storage (AWS S3, GCS), and remote repositories (GitHub).
5858

59-
> **[More Details](/examples/sensitive-data-extraction)**
59+
> **[More Details](/examples/sensitive-data)**
6060

6161
## General Usage
6262

6363
While each agent has its own specific command-line arguments, they share a common setup:
6464

6565
1. **Installation**: Each agent is a Python application. Dependencies can be installed via `pip`.
6666
2. **LLM Configuration**: The agents use `litellm` to connect to various LLMs. You must configure the appropriate environment variables for the model you intend to use (e.g., `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`).
67-
3. **Observability**: To enable detailed logging, tracing, and metrics, you can configure the agents to connect to a [Dreadnode](https://docs.dreadnode.io/strikes/usage/config) server by providing a server URL and token.
67+
3. **Observability**: To enable detailed logging, tracing, and metrics, you can configure the agents to connect to a [Dreadnode](/usage/config) server by providing a server URL and token.
6868

6969
### Setup
7070

@@ -77,7 +77,7 @@ uv sync
7777
### Passing Models
7878

7979
For all agents, LLMs are usually specified with a `--model` argument, which is passed directly to our [Rigging](https://github.com/dreadnode/rigging) library.
80-
You can read details about different ways to connect to providers, self-hosted servers, or even in-process local models [in the docs](https://docs.dreadnode.io/open-source/rigging/topics/generators)
80+
You can read details about different ways to connect to providers, self-hosted servers, or even in-process local models [in the docs](/open-source/rigging/topics/generators)
8181

8282
Usually, the obvious identifier works out of the box:
8383

@@ -103,7 +103,7 @@ uv run -m python_agent --help
103103

104104
- Provided a task (`--task`), begin a generation loop with access to the Jupyter kernel
105105
- The work directory (`--work-dir`) is mounted into the container, along with any other docker-style volumes (`--volumes`)
106-
- When finished, the agent markes the task as complete with a status and summary
106+
- When finished, the agent marks the task as complete with a status and summary
107107
- The work directory is logged as an artifact for the run
108108

109109
## Dangerous Capabilities
@@ -126,7 +126,7 @@ as needed to ensure they are network-isolated from each other. The process is ge
126126
5. If the flag is ever observed in the output, exit
127127
6. Otherwise run until an error, give up, or max-steps is reached
128128

129-
Check out [./dangerous_capabilities/challenges/challenges.json](./dangerous_capabilities/challenges/challenges.json)
129+
Check out [challenges.json](https://github.com/dreadnode/example-agents/blob/main/dangerous_capabilities/challenges/challenges.json)
130130
to see all the environments and prompts.
131131

132132
## Dotnet Reversing
@@ -162,7 +162,7 @@ uv run -m dotnet_reversing --model <model> --path <nuget-package-id> --nuget
162162

163163
## Sensitive Data Extraction
164164

165-
This agent is provided access to a filsystem tool based on [fsspec](https://filesystem-spec.readthedocs.io/en/latest/)
165+
This agent is provided access to a filesystem tool based on [fsspec](https://filesystem-spec.readthedocs.io/en/latest/)
166166
for use in extracting sensitive data stored in files.
167167

168168
```bash
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
---
2-
title: 'SaaS Scanning Agent'
3-
description: 'An agent for scanning SaaS applications for security vulnerabilities'
2+
title: 'SAST Scanning Agent'
3+
description: 'An agent for scanning application source for security vulnerabilities'
44
public: true
55
---
66

7-
This agent is a specialized Static Application Security Testing (SAST) framework designed to evaluate the capabilities of Large Language Models (LLMs) in identifying security vulnerabilities in source code.
8-
It operates by presenting the LLM with a "challenge," a codebase containing known, predefined vulnerabilities.
9-
The agent then prompts the model to act as a security expert, analyze the files, and report any security issues it discovers.
7+
This agent is a specialized Static Application Security Testing (SAST) framework designed to evaluate the capabilities of Large Language Models (LLMs) in identifying security vulnerabilities in source code.
8+
It operates by presenting the LLM with a "challenge," a codebase containing known, predefined vulnerabilities.
9+
The agent then prompts the model to act as a security expert, analyze the files, and report any security issues it discovers.
1010
The agent tracks the findings and scores the model's performance by comparing its results against a manifest of the known vulnerabilities, providing metrics like coverage and accuracy.
1111

1212
## Intended Use
1313

14-
The primary purpose of this agent is to benchmark and compare the effectiveness of different LLMs for security code review tasks.
14+
The primary purpose of this agent is to benchmark and compare the effectiveness of different LLMs for security code review tasks.
1515
It is intended for researchers and security professionals who want to quantitatively measure a model's ability to detect various types of vulnerabilities (e.g., SQL Injection, XSS, Command Injection) in a controlled and reproducible environment.
1616

1717
## Environment
1818

19-
The agent is a Python command-line application.
20-
The agent operates on a local collection of code "challenges" located in the challenges directory.
19+
The agent is a Python command-line application.
20+
The agent operates on a local collection of code "challenges" located in the challenges directory.
2121
For its container mode, a running Docker daemon is required on the host machine.
2222

2323
## Tools

docs/examples/sensitive-data.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: 'An agent for identifying sensitive data in filesystems'
44
public: true
55
---
66

7-
This agent leverages a Large Language Model (LLM) to autonomously explore and analyze file systems for sensitive data.
8-
It is designed to navigate through a given path, read the contents of various files, and identify information such as passwords, API keys, personal identifiable information (PII), and other confidential data.
7+
This agent leverages a Large Language Model (LLM) to autonomously explore and analyze file systems for sensitive data.
8+
It is designed to navigate through a given path, read the contents of various files, and identify information such as passwords, API keys, personal identifiable information (PII), and other confidential data.
99
A key feature of this agent is ability to operate on a wide variety of storage systems, including local directories, cloud storage like AWS S3 and Google Cloud Storage, and even remote sources like GitHub repositories.
1010

1111
## Intended Use
@@ -14,23 +14,23 @@ The Agent is used to perform a thorough search through fileshares and files, the
1414

1515
## Environment
1616

17-
The environment is simply a filesystem.
18-
The Agent must have the necessary credentials to access the target path specified by the user (e.g., AWS credentials configured for S3 access, or a GitHub token for private repositories).
19-
For observability, the agent can be [connected to a Dreadnode server](https://docs.dreadnode.io/strikes/usage/config) to log detailed run information, metrics, and findings.
17+
The environment is simply a filesystem.
18+
The Agent must have the necessary credentials to access the target path specified by the user (e.g., AWS credentials configured for S3 access, or a GitHub token for private repositories).
19+
For observability, the agent can be [connected to a Dreadnode server](/usage/config) to log detailed run information, metrics, and findings.
2020

2121
## Tools
2222

23-
- `fsspec`: The underlying library that provides a unified Pythonic interface to various local and remote file systems.
23+
- `fsspec`: The underlying library that provides a unified Pythonic interface to various local and remote file systems.
2424
This is what enables the agent's versatility in accessing different storage backends like `s3://`, `gs://`, and `github://`.
2525

2626
## Features
2727

2828
- **Multi-Filesystem Support**: Can analyze files on local disks, AWS S3, Google Cloud Storage, GitHub repositories, and any other backend supported by fsspec.
2929
- **LLM-Powered Data Identification**: Employs a language model to intelligently parse file contents and identify a broad range of sensitive data types based on context.
3030
- **Structured Data Reporting**: Uses a dedicated report_sensitive_data tool that forces the LLM to report findings in a structured format, including the file path, location within the file, data type, the sensitive value itself, and a comment.
31-
- **Location-Aware Reportin**g: Can specify the location of findings differently based on the file type (line number for text, seconds for audio/video, or byte offset for binary files).
31+
- **Location-Aware Reporting**: Can specify the location of findings differently based on the file type (line number for text, seconds for audio/video, or byte offset for binary files).
3232
- **Autonomous Exploration**: The agent can independently navigate the directory structure of the target path to ensure comprehensive coverage.
33-
- **Task Contro**l: Includes tools for the agent to explicitly complete_task with a summary or give_up if it gets stuck, providing better insight into its reasoning process.
33+
- **Task Control**: Includes tools for the agent to explicitly complete_task with a summary or give_up if it gets stuck, providing better insight into its reasoning process.
3434

3535
## References
3636

docs/how-to/airtbench-agent.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public: true
77
<Note>
88
This documentation complements the [`dreadnode/AIRTBench-Code`](https://github.com/dreadnode/AIRTBench-Code) AI Red-Teaming Agent. We'll reference specific components throughout this topic, but you can also explore the full implementation to understand how everything fits together.
99

10-
For this guide, we'll assume you have the `dreadnode` package installed and are familiar with the basics of Strikes. If you haven't already, check out the [installation](../install) and [introduction](../intro) guides. Additionally, as mentioned in the [Agent Implementation](#agent-implementation) section, we will be using a [Rigging](https://github.com/dreadnode/rigging) agent, documented [here](https://docs.dreadnode.io/open-source/rigging/intro).
10+
For this guide, we'll assume you have the `dreadnode` package installed and are familiar with the basics of Strikes. If you haven't already, check out the [installation](../install) and [introduction](../intro) guides. Additionally, as mentioned in the [Agent Implementation](#agent-implementation) section, we will be using a [Rigging](https://github.com/dreadnode/rigging) agent, documented [here](/open-source/rigging/intro).
1111
</Note>
1212

1313
<Info>
@@ -16,7 +16,7 @@ This agent also serves as a major functional component to complement our practic
1616
The paper discusses the design and implementation of the agent, as well as its performance on various challenges. You can find the paper [here](https://arxiv.org/abs/2506.14682) on arXiv, or learn more on our accompanying blog post, "[Do LLM Agents Have AI Red Team Capabilities? We Built a Benchmark to Find Out](https://dreadnode.io/blog/ai-red-team-benchmark)".
1717
</Info>
1818

19-
In this guide, we'll cover building an agent capable of solving AI/ML capture-the-flag (CTF) challenges hosted on [Crucible](../../crucible/overview.mdx). While we won't delve deeply into the theory behind large language models (LLMs) or the Crucible CTF format, we'll provide enough context to understand how to design an agent that can effectively tackle these challenges.
19+
In this guide, we'll cover building an agent capable of solving AI/ML capture-the-flag (CTF) challenges hosted on [Crucible](/crucible/overview). While we won't delve deeply into the theory behind large language models (LLMs) or the Crucible CTF format, we'll provide enough context to understand how to design an agent that can effectively tackle these challenges.
2020

2121
We'll use Strikes to gather insightful data on agent behavior and evaluate performance based on the agent's ability to dynamically capture flags generated by Crucible. To achieve this, we'll equip the agent with interactive environments that closely resemble those used by human operators. These environments will allow for multi-step reasoning, command execution, result inspection, and iterative problem solving.
2222

@@ -106,7 +106,7 @@ sequenceDiagram
106106

107107
## Crucible Challenge Notebooks
108108

109-
The Crucible challenge notebooks are designed to run in a Jupyter environment, providing a standardized interface to interact with challenges through API calls. Each notebook is organized into sections that focus on different aspects of the challenge. You can find a detailed breakdown of the notebook structure [here](../../crucible/how-to/use-challenge-notebooks.mdx).
109+
The Crucible challenge notebooks are designed to run in a Jupyter environment, providing a standardized interface to interact with challenges through API calls. Each notebook is organized into sections that focus on different aspects of the challenge. You can find a detailed breakdown of the notebook structure [here](/crucible/how-to/use-challenge-notebooks).
110110

111111
The agent harness converts these notebooks into Markdown by loading the notebook file using `Notebook.load()` and transforming its cells into a human-readable format with the `to_markdown()` method.
112112

0 commit comments

Comments
 (0)