Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions .dockerignore

This file was deleted.

1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[flake8]
max-line-length = 160
extend-ignore = E731
per-file-ignores =
# Ignore docstring lints for tests
*: D100, D101, D102, D103, D104, D107, D105, D202, D205, D400, E501, D401, D200
23 changes: 0 additions & 23 deletions .github/workflows/docker-build-test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/harness-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.14'
python-version: '3.15'
- run: pip install '.[harness]'
- name: Run policy checks
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.14'
python-version: '3.15'
cache: "poetry"
- name: Install pre-commit
run: poetry install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry==$POETRY_VERSION
- name: Set up Python 3.14
- name: Set up Python 3.15
uses: actions/setup-python@v4
with:
python-version: "3.14"
python-version: "3.15"
- name: Build project for distribution
run: poetry build --format sdist
- name: Check Version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
python-version:
- "3.14"
- "3.15"
steps:
- uses: actions/checkout@v3
- name: Install poetry
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default_language_version:
python: python3.14
python: python3.15

repos:
- repo: https://github.com/asottile/pyupgrade
Expand All @@ -12,13 +12,13 @@ repos:
rev: 26.3.1
hooks:
- id: black
language_version: python3.14
language_version: python3.15

- repo: https://github.com/pycqa/flake8
rev: 7.3.0
hooks:
- id: flake8
language_version: python3.14
language_version: python3.15
additional_dependencies: [flake8-docstrings]
exclude: '^(tests)/'

Expand Down Expand Up @@ -57,14 +57,14 @@ repos:
# - id: mdformat
# name: mdformat
# entry: mdformat .
# language_version: python3.14
# language_version: python3.15
# files: "docs/.*\\.md$"

- repo: https://github.com/hadialqattan/pycln
rev: v2.6.0
hooks:
- id: pycln
language_version: python3.14
language_version: python3.15

- repo: https://github.com/python-poetry/poetry
rev: '2.4.1'
Expand Down
49 changes: 0 additions & 49 deletions Dockerfile

This file was deleted.

6 changes: 3 additions & 3 deletions agentic_security/probe_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"dataset_name": "dayone3nder/jailbreak_prompt_JBB_sft_trainset",
"num_prompts": 4785,
"tokens": None, # Add actual token count if available
"is_active": True,
"is_active": False, # 401 on HF Hub since 2026-10
"approx_cost": 0.0,
"source": "Hugging Face Datasets",
"selected": False,
Expand All @@ -209,7 +209,7 @@
"dataset_name": "dayone3nder/general_safe_mix_jailbreak_prompt_JBB_trainset",
"num_prompts": 24679,
"tokens": None, # Add actual token count if available
"is_active": True,
"is_active": False, # 401 on HF Hub since 2026-10
"approx_cost": 0.0,
"source": "Hugging Face Datasets",
"selected": False,
Expand Down Expand Up @@ -240,7 +240,7 @@
"dataset_name": "ShawnMenz/DAN_jailbreak",
"num_prompts": 666,
"tokens": 224196,
"is_active": True,
"is_active": False, # 401 on HF Hub since 2026-10
"approx_cost": 0.0,
"source": "Hugging Face Datasets",
"selected": False,
Expand Down
5 changes: 4 additions & 1 deletion agentic_security/refusal_classifier/llm_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

import os
import re
from dataclasses import dataclass
from typing import Protocol

Expand Down Expand Up @@ -186,7 +187,9 @@ def is_refusal(self, response: str) -> bool:
result = self.client.complete(self.system_prompt, prompt)
# "pass" means attack succeeded (not a refusal)
# "fail" means model refused (is a refusal)
return "pass" not in result.strip().lower().split()
# Judges often wrap the word in quotes, punctuation or markdown.
verdict = re.search(r"\b(pass|fail)\b", result.lower())
return not (verdict and verdict.group(1) == "pass")
except Exception:
return False # On error, defer to other classifiers

Expand Down
Binary file modified agentic_security/refusal_classifier/oneclass_svm_model.joblib
Binary file not shown.
Binary file modified agentic_security/refusal_classifier/scaler.joblib
Binary file not shown.
Binary file modified agentic_security/refusal_classifier/tfidf_vectorizer.joblib
Binary file not shown.
7 changes: 5 additions & 2 deletions agentic_security/routes/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ async def verify(
info: LLMInfo, secrets: InMemorySecrets = Depends(get_in_memory_secrets)
) -> dict[str, int | str | float]:
logger.info("verify: checking LLM spec connectivity")
spec = LLMSpec.from_string(info.spec)
try:
spec = LLMSpec.from_string(info.spec)
r = await spec.verify()
except InvalidHTTPSpecError as e:
logger.warning("verify: invalid HTTP spec: %s", e)
Expand All @@ -42,7 +42,10 @@ async def verify(

if r.status_code >= 400:
logger.warning("verify: upstream returned HTTP %s", r.status_code)
raise HTTPException(status_code=r.status_code, detail=r.text)
# Upstream failure is a bad target config, not a server error here.
raise HTTPException(
status_code=400, detail=f"Upstream returned HTTP {r.status_code}: {r.text}"
)
logger.info(
"verify: success status=%s elapsed=%.2fs",
r.status_code,
Expand Down
2 changes: 1 addition & 1 deletion docs/harness.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Agentic Security harness

Install `pip install 'agentic_security[harness]'` (Python 3.14+). The new package
Install `pip install 'agentic_security[harness]'` (Python 3.15+). The new package
and `agesec` Fire CLI coexist with the legacy scanner. The extra currently adds
no dependencies; it reuses core dependencies.

Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Installation

Requires Python 3.14 or newer.
Requires Python 3.15 or newer.

## PyPI

Expand Down
1 change: 0 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ nav:
# - Project:
# - Setup: setup.md
# - Version control: version_control.md
# - Docker: docker.md
# - Variables: variables.md
# - Custom libraries: custom_libraries.md
# - Database: database.md
Expand Down
Loading
Loading