Commit Graph

662 Commits

Author SHA1 Message Date
zhanz5 4a5c2ddb54 fix: implement scan-csv route to actually use uploaded CSV data
The /scan-csv endpoint was reading the uploaded CSV file but discarding
the content (TODO comment), resulting in scans that ran with zero prompts.

Changes:
- routes/scan.py: parse uploaded CSV via parse_csv_content(), pass the
  extracted prompts as inline_datasets to the Scan model; also fix the
  maxBudget query parameter being silently ignored (hardcoded to 1000).
- probe_data/data.py: add parse_csv_content(bytes) -> ProbeDataset that
  looks for a 'prompt' column first, falls back to the first text column,
  and raises ValueError when no suitable column is found.
- primitives/models.py: add inline_datasets: list[dict] field to Scan
  model for carrying uploaded prompts through the scan pipeline.
- probe_actor/fuzzer.py: perform_single_shot_scan now accepts
  inline_datasets and appends them as ProbeDataset objects to the scan
  modules; scan_router transparently forwards the field.
2026-06-03 17:56:58 +08:00
Alexander Myasoedov d2bbad32b4 fix(fmt): 2026-05-27 22:05:37 +03:00
Alexander Myasoedov 40e59860c0 Merge pull request #302 from Carlos-Projects/main
fix: strip Content-Length and make hardcoded values configurable (closes #139, #167)
2026-05-27 22:00:20 +03:00
Carlos 4acf2a6539 refactor: move hardcoded values to configurable settings
Move hardcoded CSV output paths and max injection attempts to
configurable settings via agentic_security.toml using settings_var().

- failures_csv_path (default: failures.csv)
- full_log_csv_path (default: full_scan_log.csv)
- max_injection_attempts (default: 20)

Closes #167
2026-05-27 09:26:39 -04:00
Carlos faf4344f97 fix: strip Content-Length before sending to avoid LocalProtocolError
Removes Content-Length from request headers before sending with httpx
to prevent LocalProtocolError when placeholder replacement (e.g.
<<PROMPT>>) changes the body size. httpx calculates the correct
Content-Length from the actual content.

Closes #139
2026-05-27 09:17:19 -04:00
Alexander Myasoedov 2aabcef414 Merge pull request #291 from Dawn-Fighter/feat/pii-leak-detector
feat: add PII leak detector
2026-05-14 20:25:09 +03:00
Edneam be7fb1f370 fix: keep PII detection separate from refusal metrics 2026-05-14 22:42:28 +05:30
Edneam d734067ef6 test: cover PII leak detector 2026-05-14 22:31:50 +05:30
Edneam 81d2ee76c7 feat: add PII leak detector 2026-05-14 22:18:22 +05:30
Alexander Myasoedov 2896974005 fix(pc): 2026-05-14 19:23:22 +03:00
Alexander Myasoedov e38365c904 Merge pull request #290 from ykd007/feat/google-sheets-dataset-support
feat(datasets): support Google Sheets URLs in dataset loader
2026-05-14 19:20:49 +03:00
Alexander Myasoedov 669169bd11 feat(vercel): 2026-05-14 19:19:44 +03:00
Alexander Myasoedov cb64a3b70c fix(script): 2026-05-14 19:16:51 +03:00
Alexander Myasoedov e2bf837e00 fix(docs): 2026-05-14 19:15:12 +03:00
Alexander Myasoedov 0fba1ccadf feat(docs/vercel.sh): 2026-05-14 19:14:09 +03:00
Alexander Myasoedov d5cd85f8cb fix(ci): 2026-05-14 19:08:40 +03:00
Alexander Myasoedov 695eac4144 fix(build): 2026-05-14 19:04:16 +03:00
ykd007 dc24d91250 style: apply black formatting 2026-05-14 21:34:14 +05:30
Alexander Myasoedov 50785b9850 fix(pc): 2026-05-14 18:59:37 +03:00
Alexander Myasoedov a0b2b9ec70 feat(py upgrade): 2026-05-14 18:56:24 +03:00
Alexander Myasoedov 46ec775266 feat(deprecate ui): 2026-05-14 18:40:27 +03:00
ykd007 68ef73e528 fix: move import re to module level 2026-05-14 15:04:20 +05:30
ykd007 b4a5a5dc5a feat(datasets): support Google Sheets URLs in dataset loader 2026-05-14 15:02:24 +05:30
Alexander Myasoedov 5b90eb032a Merge pull request #277 from niveshdandyan/add-full-event-log
feat: add full event log export for all scan events
2026-02-03 18:54:09 +02:00
niveshdandyan 2c33451700 feat: add full event log export for all scan events
Add export_full_log() method to FuzzerState that exports a comprehensive
log of all events including errors, refusals, and successful outputs.

Previously only failures were exported. This change addresses issue #100
by creating a complete audit trail in full_scan_log.csv with event type,
module, prompt, status code, content, and refused flag columns.

Co-Authored-By: Nivesh Dandyan <niveshdandyan@gmail.com>
2026-02-03 12:00:13 +00:00
Alexander Myasoedov 796bd33432 Merge pull request #276 from msoedov/feat/research-enhancements
Feat/research enhancements
2026-01-28 21:09:00 +02:00
Alexander Myasoedov bc7fdd7cfa fix(pc): 2026-01-28 21:04:29 +02:00
Alexander Myasoedov 8d42a84a9d fix(cleanup): 2026-01-28 21:00:08 +02:00
Alexander Myasoedov 49b2243258 docs: Update PRD and progress for US-005 completion 2026-01-28 18:52:42 +02:00
Alexander Myasoedov b38a27d78c feat: US-005 - Enhanced Refusal Detection with Hybrid Approach
Implement hybrid refusal classifier combining multiple detection methods:
- Add confidence scoring to refusal detection (HybridResult)
- Implement weighted voting with configurable thresholds
- Support require_unanimous mode for strict classification
- Add factory function create_hybrid_classifier for common setup
- Include 32 unit tests with table-driven test patterns
2026-01-28 18:52:20 +02:00
Alexander Myasoedov d5e2746567 docs: Update PRD and progress for US-004 completion 2026-01-28 18:35:07 +02:00
Alexander Myasoedov 41567925aa feat: US-004 - Unified LLM Provider Abstraction
Create unified provider abstraction layer for direct LLM integrations beyond
HTTP specs, inspired by FuzzyAI's comprehensive provider system.

- Add BaseLLMProvider abstract class with standard interface (generate, chat,
  sync_generate, sync_chat methods)
- Implement OpenAIProvider supporting chat completions API
- Implement AnthropicProvider supporting messages API
- Create provider factory for instantiation by name (create_provider,
  get_provider_class)
- Add 60 unit tests covering all provider implementations
2026-01-28 18:34:38 +02:00
Alexander Myasoedov 29decc5c4e docs: Update PRD and progress for US-003 completion 2026-01-28 18:29:44 +02:00
Alexander Myasoedov f8e3f6f4a5 feat: US-003 - Composable Fuzzing Chain System
Implement FuzzNode and FuzzChain classes for multi-step attack chains
with pipe operator syntax, inspired by FuzzyAI architecture.

- FuzzNode: Single LLM call with {var} template substitution
- FuzzChain: Sequential execution passing output as input
- Pipe operator (|) for composing nodes into chains
- LLMProvider protocol for provider abstraction
- 22 unit tests covering composition and execution
2026-01-28 18:29:22 +02:00
Alexander Myasoedov d5ec249b6c docs: Update PRD and progress for US-002 completion 2026-01-28 18:23:30 +02:00
Alexander Myasoedov ef35c1f82e feat: US-002 - YAML-based Attack Rule System
Implement a YAML-based rule system for defining attack patterns and success
conditions, inspired by Promptmap's 50+ YAML rule definitions.

Features:
- AttackRule model with name, type, severity, prompt, pass/fail conditions
- RuleLoader for parsing YAML files with validation
- Support for recursive directory loading and filtering by type/severity
- Template variable substitution in prompts
- Dataset integration for converting rules to ProbeDataset format
- YAMLRulesDatasetLoader for loading rules from multiple directories

Tested with 47 unit tests covering models, loader, and dataset integration.
Successfully loads 69 rules from promptmap research directory.
2026-01-28 18:23:04 +02:00
Alexander Myasoedov 93a85029cb docs: Update PRD and progress for US-001 completion 2026-01-28 18:18:32 +02:00
Alexander Myasoedov 32f103acbc feat: US-001 - Dual-LLM Evaluation for Attack Success Detection
Add LLM-based refusal classifier inspired by Promptmap's dual-LLM
architecture. The controller LLM evaluates whether an attack succeeded
by analyzing the target's response against pass/fail conditions.

- Create LLMRefusalClassifier plugin integrating with existing system
- Support OpenAI and Anthropic providers with lazy initialization
- Add configurable system prompts and pass/fail conditions
- Include 20 unit tests for comprehensive coverage
2026-01-28 18:18:09 +02:00
Alexander Myasoedov ce7636fe9e feat(restruct tests): 2025-12-26 22:58:21 +02:00
Alexander Myasoedov 433c999600 feat(clean up obsolete agents): 2025-12-24 08:21:48 +02:00
Alexander Myasoedov 268f9ecf86 Merge pull request #275 from msoedov/poc-concurrency-reporting-unified
Poc concurrency reporting, general improvements
2025-12-24 08:20:42 +02:00
Alexander Myasoedov 5238d67846 feat(cleanup): 2025-12-24 08:18:17 +02:00
Alexander Myasoedov a9adb22458 fix(pc): 2025-12-24 08:16:21 +02:00
Alexander Myasoedov 2dc41af98d feat(cleanup): 2025-12-24 08:11:43 +02:00
Alexander Myasoedov 48125bd106 feat(add executor): 2025-12-24 08:10:08 +02:00
Alexander Myasoedov 5285fdd0a0 codex quality run #1 2025-12-10 23:06:40 +02:00
Alexander Myasoedov bf628db5c4 codex quality run #1 2025-12-10 22:53:55 +02:00
Alexander Myasoedov d56b406e1a fix(tests runtime): 2025-12-09 20:00:04 +02:00
Alexander Myasoedov b9dc5de708 feat(add cache dir): 2025-12-09 19:51:47 +02:00
Alexander Myasoedov 9a4fb05491 fix(pc): 2025-11-30 18:50:00 +02:00