Commit Graph
47 Commits
Author SHA1 Message Date
JR 43e4aa9fa7 fix(pii): detect encrypted PKCS#8 and OpenPGP private key headers
The private_key pattern required PRIVATE KEY----- after an optional
prefix, so the ENCRYPTED PRIVATE KEY label (RFC 7468, section 11) and
the PGP PRIVATE KEY BLOCK armor header (RFC 4880, section 6.2) were
not reported. The PGP alternative could never match real OpenPGP armor.
2026-11-22 20:43:46 +01:00
secretJod 464e12ac52 fix(sandbox): match /.dockerenv checks in the sandbox escape detector
The pattern was \b/\.dockerenv\b. A word boundary before '/' needs a word
character right before the slash, so '/.dockerenv' after a space, '=' or
the start of the text never matched; only paths like 'foo/.dockerenv' did.
2026-11-19 23:17:48 +05:30
whiteworthy 570f54778f feat: add AbliteratedLLM preset to LLM specs 2026-11-19 12:45:48 -03:00
Alexander Myasoedov ca69c88138 feat(owasp): map probe datasets to the OWASP LLM Top 10 2026 2026-11-19 15:07:40 +02:00
secretJod 041b582116 fix(pii): detect credit cards followed by a CVV or expiry
The credit-card candidate regex greedily took up to 19 digits across
spaces and dashes, so a card number followed by more digits (a CVV, an
expiry month) was checked together with them and failed Luhn. Match the
whole run of digit groups and check each contiguous span of groups that
holds 13-19 digits.
2026-11-18 23:16:50 +05:30
Alexander Myasoedov 27fb7df086 Merge pull request #385 from Johnbjoseph-cybersec/jbj/owasp-llm-top-10-2025
fix(owasp): tag probes with the OWASP LLM Top 10 2025 ids
2026-11-16 12:05:13 +02:00
Thibault Jaigu b45085d504 feat: add Requesty preset to LLM specs 2026-11-15 15:33:22 +00:00
John B Joseph 6495c671b2 fix(owasp): tag probes with the OWASP LLM Top 10 2025 ids
OWASP_LLM_TOP_10 used the 2023/24 v1.1 numbering while the badge links to the project, whose current list is the 2025 edition (https://genai.owasp.org/llm-top-10/). DataLeak now tags LLM02 Sensitive Information Disclosure, Malwaregen LLM05 Improper Output Handling, AgenticBackend LLM06 Excessive Agency, Hallucination and refuse-to-answer LLM09 Misinformation. The harness already uses LLM01:2025.
2026-11-13 07:41:51 +05:30
Aftabbs 9a4fd1467a style(http_spec): restore LF line endings and fix escape in test literal 2026-11-12 07:16:35 +05:30
Aftabbs dac5570397 fix(http_spec): escape all JSON control characters in <<PROMPT>> substitution
escape_special_chars_for_json only escaped backslash, quote, \n, \r and \t.
Other control characters below U+0020 (backspace, form feed, ESC, NUL...)
were inserted raw into the JSON request body, producing invalid JSON that
targets reject, so attack prompts containing them were never evaluated.
Delegate to json.dumps, which escapes every character JSON requires.
2026-11-12 07:16:01 +05:30
Alexander Myasoedov d522f8f8ad Merge pull request #369 from Ankit1478/fix/ci-exit-code
Make agentic_security ci fail a build when a module exceeds max_th
2026-11-11 16:18:06 +02:00
PSA-Team-source ad6001b10f feat: add UberLLM preset to LLM specs 2026-11-10 20:54:56 +07:00
Ankit1478 0def2ec061 Make agentic_security ci fail a build when a module exceeds max_th
`CLI.ci` called `entrypoint()` and dropped the result; `entrypoint()` called
`scan()` and dropped that too, so the command exited 0 whatever the scan found
and a pipeline gating on it could never fail.

`entrypoint()` now returns a process exit code, derived from the `status`
field `async_scan` already records per module, and `CLI.ci` raises
`SystemExit` with it. That mirrors `CLI.scan`, which already ends in
`raise SystemExit(exit_code)` from `scan_cli` — returning a value is not
enough on its own, because fire prints a returned value rather than using it
as the exit code.

Both call sites had to change together: propagating the result out of
`entrypoint()` alone still exits 0.

Fixes #367
2026-11-09 14:53:05 +05:30
Nicho Deng abfe075849 feat: add cheapaimodel preset to LLM specs 2026-11-03 12:21:58 +08:00
Nirupam Bhowmick 69a75b9329 feat: add Runcrate preset to LLM specs 2026-11-01 10:42:10 +00:00
Alexander Myasoedov 48a3374e6c fix(refusal_classifier): read judge verdict on word boundaries (#350) 2026-10-18 19:08:48 +03:00
Alexander Myasoedov 27c160eaa3 Merge pull request #326 from chiruu12/fix/hybrid-classifier-guards
fix(hybrid): guard zero total weight and log skipped detectors
2026-08-18 18:40:07 +03:00
Alexander Myasoedov de16779806 Merge pull request #328 from feiiiiii5/fix-circuit-breaker-half-open
fix(circuit-breaker): reopen on failure during half-open probation
2026-08-18 18:39:03 +03:00
Alexander Myasoedov 017ba7c168 Merge pull request #329 from feiiiiii5/fix-p95-percentile-index
fix(executor): compute p95 latency as a real 95th percentile
2026-08-18 18:38:25 +03:00
Chris (ChrisJr404) 79f450bbae Tag probe datasets with OWASP LLM Top 10 categories in the scan UI 2026-08-17 23:49:11 -04:00
fei cf3498264f fix(executor): compute p95 latency as a real 95th percentile
ExecutorMetrics.get_stats picked the p95 element with
int(n * 0.95), which collapses to the last index (the maximum)
for any batch of 20 or fewer requests, so the reported p95 was
actually the worst-case latency for typical scan batches. Use
ceil(n * 0.95) - 1, the standard nearest-rank index.
2026-08-16 18:39:10 +08:00
fei fcd1fd20ae fix(circuit-breaker): reopen on failure during half-open probation
record_failure ignored the half_open state: the minimum-sample gate
(total >= 10) and the success counter meant a failure during
probation neither re-opened the circuit nor prevented it from
closing. One failure followed by three successes closed the circuit
with the failure forgotten. Trip back to open on the first half-open
failure, with fresh counters.
2026-08-16 18:23:29 +08:00
chiruu12 2f411b90dc fix(hybrid): guard zero total weight and log skipped detectors 2026-08-14 17:04:47 +05:30
Alexander Myasoedov c8458d73c5 Merge pull request #320 from DevamShah/fix-cors-credentials-and-icon-traversal
fix: wildcard CORS + credentials spec violation, path-traversal guard on /icons proxy
2026-07-31 19:27:20 +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
Devam Shah dd59704fdf fix: wildcard CORS + credentials spec violation, path-traversal guard on /icons proxy
CORS: drop allow_credentials=True. With allow_origins=['*'] Starlette reflects
the request Origin and emits Access-Control-Allow-Credentials: true on any
credentialed request — a reflect-any-origin hole. The app authenticates with
Bearer tokens in the Authorization header, so credentialed CORS was never needed.

/icons/{icon_name}: validate against a strict allowlist (re.fullmatch
[A-Za-z0-9._-]+\.png) and assert the resolved path stays inside ICONS_DIR before
any filesystem write or outbound fetch. Closes the path-traversal / arbitrary-write
(CWE-22) and controlled-URL (CWE-73) surface on the unsanitized icon_name.

Adds CORS middleware tests and icon-name validation tests (traversal, encoded
slash, null byte, trailing newline, wrong extension).

Closes #298

Signed-off-by: Devam Shah <devamshah91@gmail.com>
2026-06-22 10:10:43 +05:30
JackSpiece cb8bceb16a chore: delete MCP server and client (#308) 2026-06-10 21:30:07 +00:00
Alexander Myasoedov ead8f85836 feat(feat(refusal): detect Docker/K8s sandbox escape probes (#280)): 2026-06-04 18:28:12 +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 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
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
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
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
Alexander Myasoedov a0b2b9ec70 feat(py upgrade): 2026-05-14 18:56:24 +03:00
Alexander Myasoedov bc7fdd7cfa fix(pc): 2026-01-28 21:04:29 +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 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 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 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 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