From 99ff91bdb29545b63cf125a7e51897ca85b4fbca Mon Sep 17 00:00:00 2001 From: shiva108 Date: Tue, 27 Jan 2026 16:33:25 +0100 Subject: [PATCH] feat: Update `pit scan` command invocations to include `run` subcommand and add a new model-specific test. --- tools/prompt_injection_tester/cli.py | 1 + .../run_pit_workflow.py | 23 +++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/tools/prompt_injection_tester/cli.py b/tools/prompt_injection_tester/cli.py index 4563b45..2dbd241 100755 --- a/tools/prompt_injection_tester/cli.py +++ b/tools/prompt_injection_tester/cli.py @@ -65,6 +65,7 @@ Security Note: "--model", "-m", help="Model identifier (e.g., gpt-4, llama3:latest, openai/gpt-oss-20b)", ) + target_group.add_argument( "--api-type", choices=["openai", "anthropic", "custom"], diff --git a/tools/prompt_injection_tester/run_pit_workflow.py b/tools/prompt_injection_tester/run_pit_workflow.py index 49f29c1..3f0ae57 100755 --- a/tools/prompt_injection_tester/run_pit_workflow.py +++ b/tools/prompt_injection_tester/run_pit_workflow.py @@ -41,7 +41,7 @@ def main(): # 2. Reconnaissance print("\n\033[1m## 2. Reconnaissance\033[0m") # Test Service Discovery (IP Only) - run_command("pit scan http://127.0.0.1 --auto --verbose") + run_command("pit scan run http://127.0.0.1 --auto --verbose") # List Available Attack Patterns run_command("pit list patterns") # Verify Target Authorization @@ -53,7 +53,7 @@ def main(): # Run Full Auto Scan print("Running Full Auto Scan...") run_command( - "pit scan http://localhost:11434/api/chat " + "pit scan run http://localhost:11434/api/chat " "--auto " "--output docs/reports/report.html " "--format html " @@ -64,7 +64,7 @@ def main(): # Test Specific Categories print("Testing Specific Categories...") run_command( - "pit scan http://localhost:11434/api/chat " + "pit scan run http://localhost:11434/api/chat " "--categories direct " "--max-concurrent 2 " "--authorize" @@ -73,7 +73,7 @@ def main(): # Test Output Formats (JSON/YAML) print("Testing Output Formats...") run_command( - "pit scan http://localhost:11434/api/chat " + "pit scan run http://localhost:11434/api/chat " "--patterns direct_instruction_override " "--output docs/reports/results.json " "--format json " @@ -84,7 +84,7 @@ def main(): # Test Configuration File Loading print("Testing Configuration File Loading...") run_command( - "pit scan http://localhost:11434/api/chat " + "pit scan run http://localhost:11434/api/chat " "--config examples/config.yaml " "--output docs/reports/report_custom.yaml " "--authorize" @@ -93,7 +93,7 @@ def main(): # Test Advanced Capabilities print("Testing Advanced Capabilities...") run_command( - "pit scan http://localhost:11434/api/chat " + "pit scan run http://localhost:11434/api/chat " "--config examples/config.yaml " "--output docs/reports/report_advanced.json " "--format json " @@ -103,11 +103,20 @@ def main(): # Target Specific Models print("Targeting Specific Models...") run_command( - "pit scan http://localhost:11434/api/chat " + "pit scan run http://localhost:11434/api/chat " "--config examples/config.yaml " "--output docs/reports/report_custom.json " "--authorize" ) + + # Test Specific Model (Fix Verification) + print("Testing Specific Model (gpt-oss-20b)...") + run_command( + "pit scan run http://localhost:11434/api/chat " + "--model openai/gpt-oss-20b " + "--output docs/reports/report_model_specific.json " + "--authorize" + ) # 4. Verification & Reporting print("\n\033[1m## 4. Verification & Reporting\033[0m")