705 Commits

Author SHA1 Message Date
Alexander Myasoedov 42615e506a fix(build): 2026-06-23 10:20:10 +03:00
Alexander Myasoedov e6459a551a Merge pull request #321 from DevamShah/config-pluggable-detectors
feat: config-pluggable refusal classifiers and leak detectors
2026-06-23 10:12:26 +03:00
Devam Shah d28c4b4b1e feat: config-pluggable refusal classifiers and leak detectors
PIIDetector and SandboxEscapeDetector were wired directly in
probe_actor/refusal.py and the refusal classifier manager was populated from
a hardcoded list, so the only way to toggle a bundled detector or add an
organization-specific signature was to patch the module.

Add a DetectorRegistry mapping plugin names to factories, assembled from an
agentic_security.toml [detectors] section via build_from_config. Custom
detectors load by import path ("pkg.module:ClassName"). refusal.py gains
build_refusal_manager(config=None) reading the [detectors] table; all public
symbols are preserved. Built-in leak detectors ship registered but disabled,
so default refusal_heuristic behaviour is unchanged.

Closes #82

Signed-off-by: Devam Shah <devamshah91@gmail.com>
2026-06-22 19:40:33 +05:30
Alexander Myasoedov 8e12141df8 Merge pull request #318 from nakshaatraa/docs/fuzzer-module-docstring
docs: add module-level docstring and document constants in fuzzer.py
2026-06-15 12:55:19 +03:00
Alexander Myasoedov b90b80a0af Merge pull request #317 from nakshaatraa/fix/image-generator-matplotlib-warnings
fix: set matplotlib Agg backend and sanitize prompt whitespace
2026-06-15 12:54:41 +03:00
Alexander Myasoedov b827a0b186 Merge pull request #316 from jasoncobra3/chore/delete-agno-dead-code-v2
chore: delete Agno dead code (Phase 1)
2026-06-15 12:52:19 +03:00
Nakshatra Mote 30566b9d4d Add module-level docstring and document constants in fuzzer.py 2026-06-15 14:44:55 +05:30
Nakshatra Mote 6dec776700 Fix matplotlib warnings and TclError in image generator 2026-06-15 14:44:16 +05:30
Aniket 5ccab6ba3b chore: delete Agno dead code (Phase 1)
Closes #307

Agno was imported by nothing, had undefined-variable bugs,
and was not a declared dependency.

Removed:
- agentic_security/agents/ (operator_agno.py)
- docs/mcp_agno_integration.md
- .gitignore reference to operator_agno.py

No agno references remain in source code.
Pre-existing test failures (missing tabulate module) confirmed
unrelated to this change via git stash verification.
2026-06-11 23:22:36 +05:30
Alexander Myasoedov 21f7517ef9 Merge pull request #314 from JackSpiece/chore/remove-mcp
chore: delete MCP server and client
2026-06-11 17:46:04 +03:00
JackSpiece cb8bceb16a chore: delete MCP server and client (#308) 2026-06-10 21:30:07 +00:00
Alexander Myasoedov 438f30bfb2 Merge pull request #313 from JackSpiece/chore/remove-agno
chore: remove leftover Agno artifacts
2026-06-10 23:55:45 +03:00
JackSpiece 92e3feb42d chore: remove leftover Agno artifacts (#307) 2026-06-10 20:48:26 +00:00
Alexander Myasoedov 13b03b958f Merge pull request #310 from zhanz5/fix/cost-calculation-model-aware
fix: make cost calculation model-aware instead of hardcoded to deepseek-chat
2026-06-05 10:12:41 +03:00
zhanz5 ab33513561 style: apply black formatting to fuzzer.py 2026-06-05 14:19:33 +08:00
zhanz5 f25520869f merge: resolve conflict with upstream msoedov/agentic_security
Merged upstream/main into fix/cost-calculation-model-aware.

Conflict resolved in cost_module.py:
- Kept upstream's updated PRICING table (2026-06-03 verified prices)
- Kept upstream's DEFAULT_MODEL = "claude-sonnet"
- Kept upstream's 50/50 input/output token split
- Preserved our float | None return type for unknown models
- Preserved our logger.warning instead of raise ValueError
2026-06-05 14:15:08 +08:00
zhanz5 02b68b06ee fix: make cost calculation model-aware instead of hardcoded to deepseek-chat
Previously, calculate_cost() was always called without a model parameter,
causing all scans to report costs based on deepseek-chat pricing regardless
of the actual target model (e.g. gpt-4, claude-3-opus).

Changes:

- http_spec.py: Add 'model_name' property to LLMSpec that extracts the
  model field from the JSON request body. Returns 'unknown' if the body
  is not valid JSON or has no 'model' field.

- probe_data/image_generator.py: Add 'model_name' pass-through property
  to RequestAdapter, delegating to the underlying LLMSpec.

- probe_data/audio_generator.py: Same as above - add 'model_name'
  pass-through property to RequestAdapter.

- probe_actor/cost_module.py:
  - Change return type from float to float | None.
  - Unknown models now log a warning and return None instead of raising
    ValueError, so scans are not interrupted by unsupported model names.
  - Add logger import for the warning message.

- probe_actor/fuzzer.py: Pass model_name to calculate_cost() in both
  scan_module() and perform_many_shot_scan() using
  getattr(request_factory, 'model_name', 'unknown').

- primitives/models.py: Update ScanResult.cost type from float to
  float | None to accommodate unknown model pricing.
2026-06-05 13:59:59 +08:00
Alexander Myasoedov 6ae9ea8bfe fix(pc): 2026-06-04 18:32:42 +03:00
Alexander Myasoedov 40a8284656 feat(clean readme): 2026-06-04 18:29:25 +03:00
Alexander Myasoedov ead8f85836 feat(feat(refusal): detect Docker/K8s sandbox escape probes (#280)): 2026-06-04 18:28:12 +03:00
Alexander Myasoedov 6dcda7c931 fix(fix(security): bind server to 127.0.0.1 instead of 0.0.0.0 by default): 2026-06-04 17:53:35 +03:00
Alexander Myasoedov 7b8d238254 Merge pull request #305 from zhanz5/fix/remove-duplicate-probedataset-msj
fix: remove duplicate ProbeDataset class from msj_data.py
2026-06-04 17:47:17 +03:00
zhanz5 5e5469a1a7 fix: remove duplicate ProbeDataset class from msj_data.py
msj_data.py contained a full copy of the ProbeDataset dataclass that
was already defined canonically in probe_data/models.py, violating DRY
and leaving a stale TODO comment in the source.

Changes:
- probe_data/msj_data.py: delete the 19-line duplicate ProbeDataset
  definition and the now-unused 'from dataclasses import dataclass'
  import; replace with a single re-export:
    from agentic_security.probe_data.models import ProbeDataset
  All call-sites inside the file (load_dataset_generic, prepare_prompts)
  continue to work unchanged because the field signatures are identical.
  The TODO comment is removed as the refactor is now complete.

No changes required in consumers (fuzzer.py, test_msj_data.py) because
they access ProbeDataset through msj_data's re-export.
2026-06-04 21:46:22 +08:00
Alexander Myasoedov 3b26e57b9e fix(pc): 0.7.5 2026-06-03 15:13:19 +03:00
Alexander Myasoedov 5ce4ed5d91 Merge pull request #301 from JackSpiece/fix/tailwind-v4-static-classes
fix: migrate static UI to Tailwind v4
2026-06-03 15:10:49 +03:00
Alexander Myasoedov 816c8c6bc7 fix(make litellm optional import): 2026-06-03 15:08:23 +03:00
Alexander Myasoedov a193ef9c2c fix(pc): 2026-06-03 15:05:59 +03:00
Alexander Myasoedov 67cedfb116 Merge pull request #299 from RheagalFire/feat/add-litellm-provider
feat: add LiteLLM as provider for 100+ LLM backends
2026-06-03 15:04:18 +03:00
Alexander Myasoedov 50266554fe Merge pull request #297 from ykd007/feat/mcp-claude-docs-193
document Claude MCP usage in README
2026-06-03 15:02:59 +03:00
Alexander Myasoedov 1fa66bd292 Merge pull request #300 from JackSpiece/fix/mcp-client-usage-examples
docs: add MCP client usage examples
2026-06-03 15:01:02 +03:00
Alexander Myasoedov 1bfb7dcc20 fix(use_agg_backend): 2026-06-03 14:59:43 +03:00
Alexander Myasoedov c0322d1130 Merge pull request #303 from Carlos-Projects/feat/agno-mcp-integration
feat: add MCP+Agno integration docs and report chart tests
2026-06-03 14:55:58 +03:00
Alexander Myasoedov a47543e5e0 Merge pull request #304 from zhanz5/fix/scan-csv-route-implementation
fix: implement scan-csv route to actually use uploaded CSV data
2026-06-03 14:54:28 +03:00
Alexander Myasoedov 47ee4f09a6 fix(security alerts): 2026-06-03 14:52:45 +03:00
Alexander Myasoedov bcc12a9443 fix(cost fn): 2026-06-03 14:52:29 +03:00
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
Carlos bad38aeb87 fix: correct test expectations to match _generate_identifiers behavior, set Agg backend for headless CI 2026-05-30 14:15:59 -04:00
Carlos 312a4cee53 feat: add MCP+Agno integration docs and report chart tests 2026-05-30 12:16:06 -04: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
JackSpiece b2c4656e41 fix: migrate static UI to Tailwind v4 2026-05-19 19:42:14 +08:00
JackSpiece 72f0f63a89 docs: add MCP client usage examples 2026-05-19 19:16:11 +08:00
RheagalFire a4833908ef test: add 29 unit tests and remove lazy imports 2026-05-19 01:50:40 +05:30
RheagalFire 6e6fdbcf28 feat: add LiteLLM as provider for 100+ LLM backends 2026-05-19 01:38:07 +05:30
Yash Dhawan 8e3120c90d document Claude MCP usage in README
Closes #193

Expands the MCP server section with:
- what tools are exposed and what each one does
- step-by-step Claude Desktop setup
- the three built-in prompt templates and when to use them
- a short example conversation showing natural-language scan control
- Claude Code CLI setup for terminal-based workflows
2026-05-15 10:25:06 +05:30
Yash Dhawan 0086895db1 add prompt templates to MCP server for guided security workflows
Closes #192

Three prompt templates via @mcp.prompt():
- security_scan_prompt: full scan with configurable probe budget
- verify_llm_prompt: quick reachability check before committing to a scan
- adversarial_probe_prompt: multi-step attack session with findings summary

Placed before the tool definitions with a clear section comment.
No existing tool behaviour changed.
2026-05-15 10:23:42 +05:30
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