|
1 | | -# sdk |
| 1 | +<p align="center"> |
| 2 | + <img |
| 3 | + src="https://d1lppblt9t2x15.cloudfront.net/logos/5714928f3cdc09503751580cffbe8d02.png" |
| 4 | + alt="Logo" |
| 5 | + align="center" |
| 6 | + width="144px" |
| 7 | + height="144px" |
| 8 | + /> |
| 9 | +</p> |
2 | 10 |
|
3 | | -<!-- BEGIN_AUTO_BADGES --> |
4 | | -<div align="center"> |
| 11 | +<h3 align="center"> |
| 12 | +Dreadnode Strikes SDK |
| 13 | +</h3> |
5 | 14 |
|
6 | | -[](https://github.com/dreadnode/python-template/actions/workflows/pre-commit.yaml) |
7 | | -[](https://github.com/dreadnode/python-template/actions/workflows/renovate.yaml) |
| 15 | +<h4 align="center"> |
| 16 | + <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/dreadnode"> |
| 17 | + <img alt="PyPI - Version" src="https://img.shields.io/pypi/v/dreadnode"> |
| 18 | + <img alt="GitHub License" src="https://img.shields.io/github/license/dreadnode/sdk"> |
| 19 | + <img alt="Tests" src="https://img.shields.io/github/actions/workflow/status/dreadnode/sdk/tests.yaml"> |
| 20 | + <img alt="Pre-Commit" src="https://img.shields.io/github/actions/workflow/status/dreadnode/sdk/pre-commit.yaml"> |
| 21 | + <img alt="Renovate" src="https://img.shields.io/github/actions/workflow/status/dreadnode/sdk/renovate.yaml"> |
| 22 | +</h4> |
8 | 23 |
|
9 | | -</div> |
10 | | -<!-- END_AUTO_BADGES --> |
11 | | -Dreadnode SDK |
| 24 | +</br> |
| 25 | + |
| 26 | +Strikes is an platform for building, experimenting with, and evaluating AI security agent code. |
| 27 | + |
| 28 | +- **Experiment + Tasking + Observability** in a single place that's lightweight and scales. |
| 29 | +- **Track your data** with parameters, inputs, and outputs all connected to your tasks. |
| 30 | +- **Measure everything** with metrics throughout your code and anywhere you need them. |
| 31 | +- **Scale your code** from a single run to thousands. |
| 32 | + |
| 33 | +```python |
| 34 | +import dreadnode as dn |
| 35 | +import rigging as rg |
| 36 | + |
| 37 | +from .tools import reversing_tools |
| 38 | + |
| 39 | +dn.configure() |
| 40 | + |
| 41 | +@dataclass |
| 42 | +class Finding: |
| 43 | + name: str |
| 44 | + severity: str |
| 45 | + description: str |
| 46 | + exploit_code: str |
| 47 | + |
| 48 | +@dn.scorer(name="Score Finding") |
| 49 | +async def score_finding(finding: Finding) -> float: |
| 50 | + if finding.severity == "critical": |
| 51 | + return 1.0 |
| 52 | + elif finding.severity == "high": |
| 53 | + return 0.8 |
| 54 | + else: |
| 55 | + return 0.2 |
| 56 | + |
| 57 | +@dn.task(scorers=[score_finding]) |
| 58 | +@rg.prompt(tools=[reversing_tools]) |
| 59 | +async def analyze_binary(binary: str) -> list[Finding]: |
| 60 | + """ |
| 61 | + Analyze the binary for vulnerabilities. |
| 62 | + """ |
| 63 | + ... |
| 64 | + |
| 65 | +with dn.run(tags=["reverse-engineering"]): |
| 66 | + binary = "c2/downloads/service.exe" |
| 67 | + |
| 68 | + dn.log_params( |
| 69 | + model="gpt-4", |
| 70 | + temperature=0.5, |
| 71 | + binary=binary |
| 72 | + ) |
| 73 | + |
| 74 | + findings = await analyze_binary(binary) |
| 75 | + |
| 76 | + dn.log_metric("findings", len(findings)) |
| 77 | +``` |
| 78 | + |
| 79 | +## Installation |
| 80 | + |
| 81 | +We publish every version to PyPi: |
| 82 | +```bash |
| 83 | +pip install -U dreadnode |
| 84 | +``` |
| 85 | + |
| 86 | +If you want to build from source: |
| 87 | +```bash |
| 88 | +poetry install |
| 89 | +``` |
| 90 | + |
| 91 | +See our **[installation guide](https://docs.dreadnode.io/strikes/install)** for more options. |
| 92 | + |
| 93 | +## Getting Started |
| 94 | + |
| 95 | +Read through our **[introduction guide](https://docs.dreadnode.io/strikes/intro)** in the docs. |
| 96 | + |
| 97 | +## Examples |
| 98 | + |
| 99 | +Check out **[dreadnode/example-agents](https://github.com/dreadnode/example-agents)** to find your favorite use case. |
0 commit comments