cai/examples/datasets/pentest-R1
UnaiAlias 1c79507140
CAI 1.1.5 release (#455)
2026-06-05 13:43:19 +02:00
..
findjsonl.sh CAI 1.1.5 release (#455) 2026-06-05 13:43:19 +02:00
load_to_pentestr1.py CAI 1.1.5 release (#455) 2026-06-05 13:43:19 +02:00
readme.MD CAI 1.1.5 release (#455) 2026-06-05 13:43:19 +02:00

readme.MD

Convert CAI-logs to walkthroughs to be loaded on Pentest-R1

Overview

This tool converts CAI logs with "history from jsonl format" into pentestR1 "walkthroughs" files. Then is possible to load the CAI walkthroughs on pentest-R1 and convert the files to the final text string for embeddings. The "history from jsonl format" of CAI were generated using the function in dataset.py

messages = cai.sdk.agents.run_to_json.load_history_from_jsonl(jsonl_path, system_prompt=True)

Quick Start

These commands use the paths in dev container where the main repository of cai is in /workspace folder

  1. Find the path logs of caiextensions-memory. A logs.txt file will be generated in the current folder.

    bash findjsonl.sh --path /path/to/caiextensions/caiextensions-memory
    
  2. Convert CAI-messages to walkthroughs with datasets.py. a folder called data with a subfolder called walkthroughs will be created.

    python3 /workspace/datasets/dataset.py --logs-path logs.txt --num-logs 5 --walkthroughs
    

    *Note: --num-logs optional parameter

  3. Run the load function of pentest r1 to visualize the CAI walkthrough in pentest-r1 step format:

    python load_to_pentestr1.py