Merge branch 'main' of https://github.com/Praveenk8051/agentic_security into feat/extension-with-sample-tests

This commit is contained in:
Praveenk8051
2025-02-16 15:45:10 +01:00
30 changed files with 1488 additions and 111 deletions
+44 -1
View File
@@ -1,2 +1,45 @@
.git/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# Distribution / packaging
build/
dist/
*.egg-info/
# Virtual environments
.venv/
env/
ENV/
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml
# PyInstaller
*.spec
# macOS specific files
.DS_Store
# Windows specific files
Thumbs.db
desktop.ini
# Tools and editors
.idea/
.vscode/
cmder/
# Output directories
Output/
te/
+21
View File
@@ -0,0 +1,21 @@
name: Pre-Commit Checks
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files
+7
View File
@@ -9,3 +9,10 @@ logs/
modal_agent.py
sandbox.py
site/
agesec.toml
.clinerules
garak_rest.json
2025.*.json
inv/
scripts/
docx/
+8 -4
View File
@@ -43,6 +43,10 @@ repos:
- id: check-shebang-scripts-are-executable
- id: check-added-large-files
args: ['--maxkb=100']
- id: trailing-whitespace
types: [python]
- id: end-of-file-fixer
types: [python]
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
@@ -52,10 +56,10 @@ repos:
entry: mdformat .
language_version: python3.11
- repo: https://github.com/hadialqattan/pycln
rev: v2.4.0
hooks:
- id: pycln
# - repo: https://github.com/hadialqattan/pycln
# rev: v2.4.0
# hooks:
# - id: pycln
- repo: https://github.com/isidentical/teyit
rev: 0.4.3
+4
View File
@@ -21,6 +21,10 @@ RUN pip install --no-cache-dir -r requirements.txt
# Runtime stage
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Copy only the necessary files from the builder stage
+17 -12
View File
@@ -6,25 +6,30 @@
The open-source Agentic LLM Vulnerability Scanner
<br />
<br />
<p>
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/msoedov/agentic_security" />
<img alt="GitHub Last Commit" src="https://img.shields.io/github/last-commit/msoedov/agentic_security" />
<img alt="" src="https://img.shields.io/github/repo-size/msoedov/agentic_security" />
<img alt="Downloads" src="https://static.pepy.tech/badge/agentic_security" />
<img alt="GitHub Issues" src="https://img.shields.io/github/issues/msoedov/agentic_security" />
<img alt="GitHub Pull Requests" src="https://img.shields.io/github/issues-pr/msoedov/agentic_security" />
<img alt="Github License" src="https://img.shields.io/github/license/msoedov/agentic_security" />
</p>
</p>
<p align="center">
<a href="https://github.com/msoedov/agentic_security/commits/main">
<img alt="GitHub Last Commit" src="https://img.shields.io/github/last-commit/msoedov/agentic_security?style=for-the-badge&logo=git&labelColor=000000&logoColor=FFFFFF&label=Last Commit&color=6A35FF" />
</a>
<a href="https://github.com/msoedov/agentic_security">
<img alt="GitHub Repo Size" src="https://img.shields.io/github/repo-size/msoedov/agentic_security?style=for-the-badge&logo=database&labelColor=000000&logoColor=FFFFFF&label=Repo Size&color=yellow" />
</a>
</a>
<a href="https://github.com/msoedov/agentic_security/blob/master/LICENSE">
<img alt="GitHub License" src="https://img.shields.io/github/license/msoedov/agentic_security?style=for-the-badge&logo=codeigniter&labelColor=000000&logoColor=FFFFFF&label=License&color=FFCC19" />
</a>
<a href="https://discord.com/channels/1340010688764051499/1340010689309315247"><img alt="Join the community" src="https://img.shields.io/badge/Join%20the%20community-black.svg?style=for-the-badge&logo=lightning&labelColor=000000&logoColor=FFFFFF&label=&color=DD55FF&logoWidth=20" /></a>
</p>
## Features
- Customizable Rule Sets or Agent based attacks🛠️
- Multi modal attacks and vulnerability scanners🛠️
- Multi-Step/multi-round Jailbreaks 🌀
- Comprehensive fuzzing for any LLMs 🧪
- LLM API integration and stress testing 🛠️
- Wide range of fuzzing and attack techniques 🌀
- RL based attacks 📡
Note: Please be aware that Agentic Security is designed as a safety scanner tool and not a foolproof solution. It cannot guarantee complete protection against all possible threats.
+12
View File
@@ -0,0 +1,12 @@
import asyncio
from typing import Protocol
class IntegrationProto(Protocol):
def __init__(
self, prompt_groups: list, tools_inbox: asyncio.Queue, opts: dict = {}
):
...
async def apply(self) -> list:
...
@@ -0,0 +1,58 @@
def calculate_cost(tokens: int, model: str = "deepseek-chat") -> float:
"""Calculate API cost based on token count and model.
Args:
tokens (int): Number of tokens used
model (str): Model name to calculate cost for
Returns:
float: Cost in USD
"""
# API pricing as of 2024-03-01
pricing = {
"deepseek-chat": {
"input": 0.0007 / 1000, # $0.70 per million input tokens
"output": 0.0028 / 1000, # $2.80 per million output tokens
},
"gpt-4-turbo": {
"input": 0.01 / 1000, # $10 per million input tokens
"output": 0.03 / 1000, # $30 per million output tokens
},
"gpt-4": {
"input": 0.03 / 1000, # $30 per million input tokens
"output": 0.06 / 1000, # $60 per million output tokens
},
"gpt-3.5-turbo": {
"input": 0.0015 / 1000, # $1.50 per million input tokens
"output": 0.002 / 1000, # $2.00 per million output tokens
},
"claude-3-opus": {
"input": 0.015 / 1000, # $15 per million input tokens
"output": 0.075 / 1000, # $75 per million output tokens
},
"claude-3-sonnet": {
"input": 0.003 / 1000, # $3 per million input tokens
"output": 0.015 / 1000, # $15 per million output tokens
},
"claude-3-haiku": {
"input": 0.00025 / 1000, # $0.25 per million input tokens
"output": 0.00125 / 1000, # $1.25 per million output tokens
},
"mistral-large": {
"input": 0.008 / 1000, # $8 per million input tokens
"output": 0.024 / 1000, # $24 per million output tokens
},
"mixtral-8x7b": {
"input": 0.002 / 1000, # $2 per million input tokens
"output": 0.006 / 1000, # $6 per million output tokens
},
}
if model not in pricing:
raise ValueError(f"Unknown model: {model}")
# For now, assume 1:1 input/output ratio
input_cost = tokens * pricing[model]["input"]
output_cost = tokens * pricing[model]["output"]
return round(input_cost + output_cost, 4)
+3 -4
View File
@@ -10,6 +10,7 @@ from skopt.space import Real
from agentic_security.http_spec import Modality
from agentic_security.models.schemas import Scan, ScanResult
from agentic_security.probe_actor.cost_module import calculate_cost
from agentic_security.probe_actor.refusal import refusal_heuristic
from agentic_security.probe_data import audio_generator, image_generator, msj_data
from agentic_security.probe_data.data import prepare_prompts
@@ -38,8 +39,6 @@ def multi_modality_spec(llm_spec):
return llm_spec
case _:
return llm_spec
# case _:
# raise NotImplementedError(f"Modality {llm_spec.modality} not supported yet")
async def process_prompt(
@@ -143,7 +142,7 @@ async def perform_single_shot_scan(
module_failures += 1
failure_rate = module_failures / max(processed_prompts, 1)
failure_rates.append(failure_rate)
cost = round(tokens * 1.5 / 1000_000, 2)
cost = calculate_cost(tokens)
yield ScanResult(
module=module.dataset_name,
@@ -274,7 +273,7 @@ async def perform_many_shot_scan(
failure_rate = module_failures / max(processed_prompts, 1)
failure_rates.append(failure_rate)
cost = round(tokens * 1.5 / 1000_000, 2)
cost = calculate_cost(tokens)
yield ScanResult(
module=module.dataset_name,
+15
View File
@@ -408,6 +408,21 @@ REGISTRY = REGISTRY_V0 + [
},
"modality": "text",
},
{
"dataset_name": "Reinforcement Learning Optimization",
"num_prompts": 0,
"tokens": 0,
"approx_cost": 0.0,
"source": "Cloud hosted model",
"selected": False,
"url": "",
"dynamic": True,
"opts": {
"port": 8718,
"modules": ["encoding"],
},
"modality": "text",
},
{
"dataset_name": "InspectAI",
"num_prompts": 0,
+30 -2
View File
@@ -52,11 +52,37 @@ def generate_audio_mac_wav(prompt: str) -> bytes:
return audio_bytes
def generate_audio_cross_platform(prompt: str) -> bytes:
"""
Generate an audio file from the provided prompt using gTTS for cross-platform support.
Parameters:
prompt (str): Text to convert into audio.
Returns:
bytes: The audio data in MP3 format.
"""
from gtts import gTTS # Import gTTS for cross-platform support
tts = gTTS(text=prompt, lang="en")
temp_mp3_path = f"temp_audio_{uuid.uuid4().hex}.mp3"
tts.save(temp_mp3_path)
try:
with open(temp_mp3_path, "rb") as f:
audio_bytes = f.read()
finally:
if os.path.exists(temp_mp3_path):
os.remove(temp_mp3_path)
return audio_bytes
@cache_to_disk()
def generate_audioform(prompt: str) -> bytes:
"""
Generate an audio file from the provided prompt in WAV format.
Uses macOS 'say' command if the operating system is macOS.
Uses macOS 'say' command if the operating system is macOS, otherwise uses gTTS.
Parameters:
prompt (str): Text to convert into audio.
@@ -67,9 +93,11 @@ def generate_audioform(prompt: str) -> bytes:
current_os = platform.system()
if current_os == "Darwin": # macOS
return generate_audio_mac_wav(prompt)
elif current_os in ["Windows", "Linux"]:
return generate_audio_cross_platform(prompt)
else:
raise NotImplementedError(
"Audio generation is only supported on macOS for now."
"Audio generation is only supported on macOS, Windows, and Linux for now."
)
+6
View File
@@ -16,6 +16,7 @@ from agentic_security.probe_data.modules import (
fine_tuned,
garak_tool,
inspect_ai_tool,
rl_model,
)
@@ -265,6 +266,11 @@ def prepare_prompts(dataset_names, budget, tools_inbox=None, options=[]):
garak_tool.Module(group, tools_inbox=tools_inbox, opts=opts).apply(),
lazy=True,
),
"Reinforcement Learning Optimization": lambda opts: dataset_from_iterator(
"Reinforcement Learning Optimization",
rl_model.Module(group, tools_inbox=tools_inbox, opts=opts).apply(),
lazy=True,
),
"InspectAI": lambda opts: dataset_from_iterator(
"InspectAI",
inspect_ai_tool.Module(group, tools_inbox=tools_inbox).apply(),
+52 -13
View File
@@ -38,12 +38,13 @@ def generate_image_dataset(
@cache_to_disk()
def generate_image(prompt: str) -> bytes:
def generate_image(prompt: str, variant: int = 0) -> bytes:
"""
Generate an image based on the provided prompt and return it as bytes.
Parameters:
prompt (str): Text to display on the generated image.
variant (int): The variant style of the image.
Returns:
bytes: The image data in JPG format.
@@ -51,18 +52,56 @@ def generate_image(prompt: str) -> bytes:
# Create a matplotlib figure
fig, ax = plt.subplots(figsize=(6, 4))
# Customize the plot (background color, text, etc.)
ax.set_facecolor("lightblue")
ax.text(
0.5,
0.5,
prompt,
fontsize=16,
ha="center",
va="center",
wrap=True,
color="darkblue",
)
# Customize the plot based on the variant
if variant == 1:
# Dark Theme
ax.set_facecolor("darkgray")
text_color = "white"
fontsize = 18
elif variant == 2:
# Artistic Theme
ax.set_facecolor("lightpink")
text_color = "black"
fontsize = 20
# Add a border around the text
ax.text(
0.5,
0.5,
prompt,
fontsize=fontsize,
ha="center",
va="center",
wrap=True,
color=text_color,
bbox=dict(
facecolor="lightyellow", edgecolor="black", boxstyle="round,pad=0.5"
),
)
elif variant == 3:
# Minimalist Theme
ax.set_facecolor("white")
text_color = "black"
fontsize = 14
# Add a simple geometric shape (circle) behind the text
circle = plt.Circle((0.5, 0.5), 0.3, color="lightblue", fill=True)
ax.add_artist(circle)
else:
# Default Theme
ax.set_facecolor("lightblue")
text_color = "darkblue"
fontsize = 16
if variant != 2:
ax.text(
0.5,
0.5,
prompt,
fontsize=fontsize,
ha="center",
va="center",
wrap=True,
color=text_color,
)
# Remove axes for a cleaner look
ax.axis("off")
@@ -0,0 +1,247 @@
import asyncio
import os
import random
import uuid as U
from abc import ABC, abstractmethod
from collections import deque
from typing import Deque
import numpy as np
import requests
from loguru import logger
AUTH_TOKEN: str = os.getenv("AS_TOKEN", "gh0-5f4a8ed2-37c6-4bd7-a0cf-7070eae8115b")
class PromptSelectionInterface(ABC):
"""Abstract base class for prompt selection strategies."""
@abstractmethod
def select_next_prompt(self, current_prompt: str, passed_guard: bool) -> str:
"""Selects the next prompt based on current state and guard result."""
pass
@abstractmethod
def select_next_prompts(self, current_prompt: str, passed_guard: bool) -> list[str]:
"""Selects the next prompts based on current state and guard result."""
pass
@abstractmethod
def update_rewards(
self,
previous_prompt: str,
current_prompt: str,
reward: float,
passed_guard: bool,
) -> None:
"""Updates internal rewards based on the outcome of the last selected prompt."""
pass
class RandomPromptSelector(PromptSelectionInterface):
"""Random prompt selector with cycle prevention using history."""
def __init__(self, prompts: list[str], history_size: int = 300):
if not prompts:
raise ValueError("Prompts list cannot be empty")
self.prompts = prompts
self.history: Deque[str] = deque(maxlen=history_size)
def select_next_prompts(self, current_prompt: str, passed_guard: bool) -> list[str]:
return [self.select_next_prompt(current_prompt, passed_guard)]
def select_next_prompt(self, current_prompt: str, passed_guard: bool) -> str:
self.history.append(current_prompt)
available = [p for p in self.prompts if p not in self.history]
if not available:
available = self.prompts
self.history.clear()
return random.choice(available)
def update_rewards(
self,
previous_prompt: str,
current_prompt: str,
reward: float,
passed_guard: bool,
) -> None:
pass # No learning in random selection
class CloudRLPromptSelector(PromptSelectionInterface):
"""Cloud-based reinforcement learning prompt selector with fallback."""
def __init__(
self,
prompts: list[str],
api_url: str,
auth_token: str = AUTH_TOKEN,
history_size: int = 300,
timeout: int = 5,
run_id: str = "",
):
if not prompts:
raise ValueError("Prompts list cannot be empty")
self.prompts = prompts
self.api_url = api_url
self.headers = {"Authorization": f"Bearer {auth_token}"}
self.timeout = timeout
self.run_id = run_id or U.uuid4().hex
def select_next_prompt(self, current_prompt: str, passed_guard: bool) -> list[str]:
return self.select_next_prompts(current_prompt, passed_guard)[0]
def select_next_prompts(self, current_prompt: str, passed_guard: bool) -> str:
try:
response = requests.post(
f"{self.api_url}/rl-model/select-next-prompt",
json={
"run_id": U.uuid4().hex,
"current_prompt": current_prompt,
"passed_guard": passed_guard,
},
headers=self.headers,
timeout=self.timeout,
)
response.raise_for_status()
return response.json().get("next_prompts", [])
except requests.exceptions.RequestException as e:
logger.error(f"Cloud request failed: {e}")
return [self._fallback_selection()]
def _fallback_selection(self) -> str:
return random.choice(self.prompts)
def update_rewards(
self,
previous_prompt: str,
current_prompt: str,
reward: float,
passed_guard: bool,
) -> None:
...
class QLearningPromptSelector(PromptSelectionInterface):
"""Q-Learning based prompt selector with exploration/exploitation tradeoff."""
def __init__(
self,
prompts: list[str],
learning_rate: float = 0.1,
discount_factor: float = 0.9,
initial_exploration: float = 1.0,
exploration_decay: float = 0.995,
min_exploration: float = 0.01,
history_size: int = 300,
):
if not prompts:
raise ValueError("Prompts list cannot be empty")
self.prompts = prompts
self.learning_rate = learning_rate
self.discount_factor = discount_factor
self.exploration_rate = initial_exploration
self.exploration_decay = exploration_decay
self.min_exploration = min_exploration
self.history: Deque[str] = deque(maxlen=history_size)
# Initialize Q-table with small random values
self.q_table: dict[str, dict[str, float]] = {
state: {
action: np.random.uniform(0, 0.1)
for action in prompts
if action != state
}
for state in prompts
}
def select_next_prompts(self, current_prompt: str, passed_guard: bool) -> list[str]:
return [self.select_next_prompt(current_prompt, passed_guard)]
def select_next_prompt(self, current_prompt: str, passed_guard: bool) -> str:
self.history.append(current_prompt)
available = [a for a in self.prompts if a not in self.history]
if not available:
available = self.prompts
self.history.clear()
# Exploration-exploitation tradeoff
if np.random.random() < self.exploration_rate:
selected = random.choice(available)
else:
q_values = {a: self.q_table[current_prompt][a] for a in available}
selected = max(q_values, key=q_values.get) # type: ignore
# Decay exploration rate
self.exploration_rate = max(
self.min_exploration, self.exploration_rate * self.exploration_decay
)
return selected
def update_rewards(
self,
previous_prompt: str,
current_prompt: str,
reward: float,
passed_guard: bool,
) -> None:
if (
previous_prompt not in self.q_table
or current_prompt not in self.q_table[previous_prompt]
):
return
# Calculate temporal difference error
max_future_q = max(self.q_table[current_prompt].values(), default=0.0)
td_target = reward + self.discount_factor * max_future_q
td_error = td_target - self.q_table[previous_prompt][current_prompt]
# Update Q-value
self.q_table[previous_prompt][current_prompt] += self.learning_rate * td_error
class Module:
def __init__(
self, prompt_groups: list[str], tools_inbox: asyncio.Queue, opts: dict = {}
):
self.tools_inbox = tools_inbox
self.opts = opts
self.prompt_groups = prompt_groups
self.max_prompts = self.opts.get("max_prompts", 10) # Default max M prompts
self.run_id = U.uuid4().hex
self.batch_size = self.opts.get("batch_size", 500)
self.rl_model = CloudRLPromptSelector(
prompt_groups, "https://edge.metaheuristic.co", run_id=self.run_id
)
async def apply(self):
current_prompt = "What is AI?"
passed_guard = False
for _ in range(max(self.max_prompts, 1)):
# Fetch prompts from the API
prompts = await asyncio.to_thread(
lambda: self.rl_model.select_next_prompts(
current_prompt, passed_guard=passed_guard
)
)
if not prompts:
logger.error("No prompts retrieved from the API.")
return
logger.info(f"Retrieved {len(prompts)} prompts.")
for i, prompt in enumerate(prompts):
logger.info(f"Processing prompt {i+1}/{len(prompts)}: {prompt}")
yield prompt
current_prompt = prompt
while not self.tools_inbox.empty():
ref = await self.tools_inbox.get()
print(ref, "ref")
message, _, ready = ref["message"], ref["reply"], ref["ready"]
yield message
ready.set()
@@ -0,0 +1,215 @@
import asyncio
from collections import deque
from unittest.mock import Mock, patch
import numpy as np
import pytest
import requests
# Import the classes to be tested
from agentic_security.probe_data.modules.rl_model import (
CloudRLPromptSelector,
Module,
QLearningPromptSelector,
RandomPromptSelector,
)
# Fixtures for reusable test data
@pytest.fixture
def dataset_prompts() -> list[str]:
return [
"What is AI?",
"How does RL work?",
"Explain supervised learning.",
"What is reinforcement learning?",
]
@pytest.fixture
def mock_requests() -> Mock:
with patch("requests.post") as mock_requests:
yield mock_requests
@pytest.fixture
def mock_rl_selector() -> Mock:
return CloudRLPromptSelector(
dataset_prompts,
api_url="https://edge.metaheuristic.co",
)
@pytest.fixture
def tools_inbox() -> asyncio.Queue:
return asyncio.Queue()
# Tests for RandomPromptSelector
class TestRandomPromptSelector:
def test_initialization(self, dataset_prompts):
selector = RandomPromptSelector(dataset_prompts)
assert selector.prompts == dataset_prompts
assert isinstance(selector.history, deque)
assert selector.history.maxlen == 300
def test_select_next_prompt(self, dataset_prompts):
selector = RandomPromptSelector(dataset_prompts)
current_prompt = "What is AI?"
next_prompt = selector.select_next_prompt(current_prompt, passed_guard=True)
assert next_prompt in dataset_prompts
assert next_prompt != current_prompt
def test_update_rewards_no_op(self, dataset_prompts):
selector = RandomPromptSelector(dataset_prompts)
selector.update_rewards("What is AI?", "How does RL work?", 1.0, True)
assert len(selector.history) == 0
# Tests for CloudRLPromptSelector
class TestCloudRLPromptSelector:
def test_initialization(self, dataset_prompts):
selector = CloudRLPromptSelector(dataset_prompts, "http://example.com", "token")
assert selector.prompts == dataset_prompts
assert selector.api_url == "http://example.com"
assert selector.headers == {"Authorization": "Bearer token"}
def test_select_next_prompt_success(self, dataset_prompts, mock_requests):
mock_requests.return_value.status_code = 200
mock_requests.return_value.json.return_value = {"next_prompts": ["What is AI?"]}
selector = CloudRLPromptSelector(dataset_prompts, "http://example.com", "token")
next_prompt = selector.select_next_prompt(
"How does RL work?", passed_guard=True
)
assert next_prompt == "What is AI?"
mock_requests.assert_called_once()
def test_fallback_on_failure(self, dataset_prompts, mock_requests):
mock_requests.side_effect = requests.exceptions.RequestException
selector = CloudRLPromptSelector(dataset_prompts, "http://example.com", "token")
next_prompt = selector.select_next_prompt("What is AI?", passed_guard=True)
assert next_prompt in dataset_prompts
def test_select_next_prompt_success_service(self, dataset_prompts):
selector = CloudRLPromptSelector(
dataset_prompts,
api_url="https://edge.metaheuristic.co",
)
next_prompt = selector.select_next_prompt(
"How does RL work?", passed_guard=True
)
assert next_prompt
# Tests for QLearningPromptSelector
class TestQLearningPromptSelector:
def test_initialization(self, dataset_prompts):
selector = QLearningPromptSelector(dataset_prompts)
assert selector.prompts == dataset_prompts
assert selector.exploration_rate == 1.0
assert len(selector.q_table) == len(dataset_prompts)
assert all(
len(v) == len(dataset_prompts) - 1 for v in selector.q_table.values()
)
def test_select_next_prompt_exploration(self, dataset_prompts):
selector = QLearningPromptSelector(dataset_prompts, initial_exploration=1.0)
next_prompt = selector.select_next_prompt("What is AI?", passed_guard=True)
assert next_prompt in dataset_prompts
assert next_prompt != "What is AI?"
def test_select_next_prompt_exploitation(self, dataset_prompts):
selector = QLearningPromptSelector(dataset_prompts, initial_exploration=0.0)
selector.q_table["What is AI?"]["How does RL work?"] = 10.0
next_prompt = selector.select_next_prompt("What is AI?", passed_guard=True)
assert next_prompt == "How does RL work?"
def test_update_rewards(self, dataset_prompts):
selector = QLearningPromptSelector(dataset_prompts)
selector.update_rewards("What is AI?", "How does RL work?", 1.0, True)
assert selector.q_table["What is AI?"]["How does RL work?"] > 0.0
def test_exploration_rate_decay(self, dataset_prompts):
selector = QLearningPromptSelector(
dataset_prompts, initial_exploration=1.0, exploration_decay=0.9
)
assert selector.exploration_rate == 1.0
selector.select_next_prompt("What is AI?", passed_guard=True)
assert selector.exploration_rate == 0.9
selector.select_next_prompt("How does RL work?", passed_guard=True)
assert selector.exploration_rate == 0.81
# Edge Cases and Error Handling
def test_empty_prompts():
with pytest.raises(ValueError, match="Prompts list cannot be empty"):
RandomPromptSelector([])
def test_cloud_rl_selector_invalid_url(dataset_prompts):
selector = CloudRLPromptSelector(dataset_prompts, "invalid_url", "token")
next_prompt = selector.select_next_prompt("What is AI?", passed_guard=True)
assert next_prompt in dataset_prompts
def test_q_learning_selector_invalid_reward(dataset_prompts):
selector = QLearningPromptSelector(dataset_prompts)
selector.update_rewards("What is AI?", "How does RL work?", np.nan, True)
# Tests for Module class
class TestModule:
@pytest.fixture
def mock_uuid(self):
with patch("uuid.uuid4") as mock:
mock.return_value.hex = "test_run_id"
yield mock
def test_initialization(self, dataset_prompts, tools_inbox, mock_uuid):
module = Module(dataset_prompts, tools_inbox)
assert module.prompt_groups == dataset_prompts
assert module.tools_inbox == tools_inbox
assert module.max_prompts == 10
assert module.batch_size == 500
assert module.run_id == "test_run_id"
assert isinstance(module.rl_model, CloudRLPromptSelector)
def test_initialization_with_options(self, dataset_prompts, tools_inbox, mock_uuid):
opts = {
"max_prompts": 100,
"batch_size": 50,
}
module = Module(dataset_prompts, tools_inbox, opts)
assert module.max_prompts == 100
assert module.batch_size == 50
@pytest.mark.asyncio
async def test_apply_basic_flow(
self, dataset_prompts, tools_inbox, mock_rl_selector
):
module = Module(dataset_prompts, tools_inbox)
count = 0
async for prompt in module.apply():
assert prompt
count += 1
if count >= 3: # Test a few iterations
break
@pytest.mark.asyncio
async def test_apply_rl_with_tools_inbox(self, dataset_prompts, tools_inbox):
# Add a test message to the tools inbox
test_message = {
"message": "Test message",
"reply": None,
"ready": asyncio.Event(),
}
await tools_inbox.put(test_message)
module = Module(dataset_prompts, tools_inbox)
async for output in module.apply():
if output == "Test message":
test_message["ready"].set()
break
@@ -3,6 +3,7 @@ import platform
import pytest
from agentic_security.probe_data.audio_generator import (
generate_audio_cross_platform,
generate_audio_mac_wav,
generate_audioform,
)
@@ -24,6 +25,13 @@ def test_generate_audioform_mac():
audio_bytes = generate_audioform(prompt)
assert isinstance(audio_bytes, bytes)
assert len(audio_bytes) > 0
def test_generate_audio_cross_platform():
if platform.system() in ["Windows", "Linux"]:
prompt = "This is a cross-platform test."
audio_bytes = generate_audio_cross_platform(prompt)
assert isinstance(audio_bytes, bytes)
assert len(audio_bytes) > 0
else:
with pytest.raises(NotImplementedError):
generate_audioform("This should raise an error on non-macOS systems.")
pytest.skip("Test is only applicable on Windows and Linux.")
@@ -1,5 +1,7 @@
from unittest.mock import patch
import pytest
from agentic_security.probe_data.image_generator import (
generate_image,
generate_image_dataset,
@@ -7,9 +9,10 @@ from agentic_security.probe_data.image_generator import (
from agentic_security.probe_data.models import ImageProbeDataset, ProbeDataset
def test_generate_image():
@pytest.mark.parametrize("variant", [0, 1, 2, 3])
def test_generate_image(variant):
prompt = "Test prompt"
image_bytes = generate_image(prompt)
image_bytes = generate_image(prompt, variant)
assert isinstance(image_bytes, bytes)
assert len(image_bytes) > 0
+26 -1
View File
@@ -1,6 +1,6 @@
from datetime import datetime
from fastapi import APIRouter, BackgroundTasks, HTTPException
from fastapi import APIRouter, BackgroundTasks, File, HTTPException, Query, UploadFile
from fastapi.responses import StreamingResponse
from ..core.app import get_stop_event, get_tools_inbox, set_current_run
@@ -52,3 +52,28 @@ async def scan(scan_parameters: Scan, background_tasks: BackgroundTasks):
async def stop_scan():
get_stop_event().set()
return {"status": "Scan stopped"}
@router.post("/scan-csv")
async def scan_csv(
background_tasks: BackgroundTasks,
file: UploadFile = File(...),
llmSpec: UploadFile = File(...),
optimize: bool = Query(False),
maxBudget: int = Query(10_000),
enableMultiStepAttack: bool = Query(False),
):
# TODO: content dataset to fuzzer
content = await file.read() # noqa
llm_spec = await llmSpec.read()
scan_parameters = Scan(
llmSpec=llm_spec,
optimize=optimize,
maxBudget=1000,
enableMultiStepAttack=enableMultiStepAttack,
)
return StreamingResponse(
streaming_response_generator(scan_parameters), media_type="application/json"
)
+22
View File
@@ -0,0 +1,22 @@
from fastapi.testclient import TestClient
import agentic_security.test_spec_assets as test_spec_assets
from agentic_security.routes.scan import router
client = TestClient(router)
def test_upload_csv_and_run():
# Create a sample CSV content
csv_content = "id,prompt\nspec1,value1\nspec2,value3"
# Send a POST request to the /upload-csv endpoint
response = client.post(
"/scan-csv?optimize=false&enableMultiStepAttack=false&maxBudget=1000",
files={
"file": ("test.csv", csv_content, "text/csv"),
"llmSpec": ("spec.txt", test_spec_assets.SAMPLE_SPEC, "text/plain"),
},
)
assert response.status_code == 200
assert "Scan completed." in response.text
+1 -1
View File
@@ -437,7 +437,7 @@
<th class="p-3">Vulnerability Module</th>
<th class="p-3">% Strength</th>
<th class="p-3">Number of Tokens</th>
<th class="p-3">Cost (in gpt-3 tokens)</th>
<th class="p-3">Approx Cost (in tokens)</th>
</tr>
</thead>
<tbody>
Executable
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
# Get the last tag
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null)
if [ -z "$LAST_TAG" ]; then
echo "No tags found. Retrieving all commits."
LOG_RANGE="HEAD"
else
echo "Generating changelog from last tag: $LAST_TAG"
LOG_RANGE="$LAST_TAG..HEAD"
fi
# Retrieve commit messages excluding merge commits and format them with author names and stripped email domain as nickname
CHANGELOG=$(git log --pretty=format:"- %s by %an, @%ae)" --no-merges $LOG_RANGE | sed -E 's/@([^@]+)@([^@]+)\..*/@\1/')
# Output the changelog
if [ -n "$CHANGELOG" ]; then
echo "# Changelog"
echo "
## Changes since $LAST_TAG"
echo "$CHANGELOG"
else
echo "No new commits since last tag."
fi
+55
View File
@@ -0,0 +1,55 @@
# Abstractions in Agentic Security
This document outlines the key abstractions used in the Agentic Security project, providing insights into the classes, interfaces, and design patterns that form the backbone of the system.
## Key Abstractions
### AgentSpecification
- **Purpose**: Defines the specification for a language model or agent, including its name, version, description, capabilities, and configuration settings.
- **Usage**: Used to initialize and configure the `OperatorToolBox` and other components that interact with language models.
### OperatorToolBox
- **Purpose**: Serves as the main class for managing dataset operations, including validation, execution, and result retrieval.
- **Methods**:
- `get_spec()`: Returns the agent specification.
- `get_datasets()`: Retrieves the datasets for operations.
- `validate()`: Validates the toolbox setup.
- `run_operation(operation: str)`: Executes a specified operation.
### DatasetManagerAgent
- **Purpose**: Provides tools for managing and executing operations on datasets through an agent-based approach.
- **Tools**:
- `validate_toolbox`: Validates the `OperatorToolBox`.
- `execute_operation`: Executes operations on datasets.
- `retrieve_results`: Retrieves operation results.
- `retrieve_failures`: Retrieves any failures encountered.
### ProbeDataset
- **Purpose**: Represents a dataset used in security scans, including metadata, prompts, and associated costs.
- **Methods**:
- `metadata_summary()`: Provides a summary of the dataset's metadata.
### Refusal Classifier
- **Purpose**: Analyzes responses from language models to detect potential security vulnerabilities.
- **Design**: Utilizes predefined rules and machine learning models for classification.
## Design Patterns
### Modular Architecture
- **Description**: The system is designed with a modular architecture, allowing for easy integration of new components and features.
- **Benefits**: Enhances flexibility, extensibility, and scalability.
### Agent-Based Design
- **Description**: Utilizes an agent-based approach for managing and executing operations on datasets.
- **Benefits**: Provides a structured framework for interacting with language models and datasets.
## Conclusion
The abstractions in Agentic Security are designed to provide a flexible and extensible framework for managing and executing security scans on language models. This document highlights the key classes, interfaces, and design patterns that contribute to the system's architecture and functionality.
+51
View File
@@ -0,0 +1,51 @@
# Design Document
This document provides an overview of the design and architecture of the Agentic Security project. It outlines the key components, their interactions, and the design principles guiding the development of the system.
## Overview
Agentic Security is an open-source LLM vulnerability scanner designed to identify and mitigate potential security threats in language models. It integrates various modules and datasets to perform comprehensive security scans.
## Architecture
The system is built around a modular architecture, allowing for flexibility and extensibility. The core components include:
- **Agentic Security Core**: The main application responsible for orchestrating the security scans and managing interactions with external modules.
- **Probe Actor**: Handles the execution of fuzzing and attack techniques on language models.
- **Probe Data**: Manages datasets used for testing and validation, including loading and processing data.
- **Refusal Classifier**: Analyzes responses from language models to identify potential security issues.
## Key Components
### Agentic Security Core
The core application is responsible for initializing the system, managing configurations, and coordinating the execution of security scans. It provides a command-line interface for users to interact with the system.
### Probe Actor
The Probe Actor module implements various fuzzing and attack techniques. It is designed to test the robustness of language models by simulating different attack scenarios.
### Probe Data
The Probe Data module manages datasets used in security scans. It supports loading data from local files and external sources, providing a flexible framework for testing different scenarios.
### Refusal Classifier
The Refusal Classifier analyzes responses from language models to detect potential security vulnerabilities. It uses predefined rules and machine learning models to classify responses.
## Design Principles
- **Modularity**: The system is designed to be modular, allowing for easy integration of new components and features.
- **Extensibility**: New modules and datasets can be added to the system without significant changes to the core architecture.
- **Scalability**: The system is built to handle large datasets and complex security scans efficiently.
## Interaction Flow
1. **Initialization**: The system is initialized with the necessary configurations and datasets.
1. **Execution**: The Probe Actor executes security scans on the language models using the datasets provided by the Probe Data module.
1. **Analysis**: The Refusal Classifier analyzes the responses to identify potential security issues.
1. **Reporting**: Results are compiled and presented to the user, highlighting any vulnerabilities detected.
## Conclusion
The design of Agentic Security emphasizes flexibility, extensibility, and scalability, providing a robust framework for identifying and mitigating security threats in language models. This document serves as a guide to understanding the system's architecture and key components.
+123
View File
@@ -0,0 +1,123 @@
# Operator Module
The `operator.py` module provides tools for managing and operating on datasets using an agent-based approach. It is designed to facilitate the execution of operations on datasets through a structured and validated process.
## Classes
### AgentSpecification
Defines the specification for an LLM/agent:
- `name`: Name of the LLM/agent
- `version`: Version of the LLM/agent
- `description`: Description of the LLM/agent
- `capabilities`: List of capabilities
- `configuration`: Configuration settings
### OperatorToolBox
Main class for dataset operations:
- `__init__(spec: AgentSpecification, datasets: list[dict[str, Any]])`: Initialize with agent spec and datasets. This sets up the toolbox with the necessary specifications and datasets for operation.
- `get_spec()`: Get the agent specification. Returns the `AgentSpecification` object associated with the toolbox.
- `get_datasets()`: Get the datasets. Returns a list of datasets that the toolbox operates on.
- `validate()`: Validate the toolbox. Checks if the toolbox is correctly set up with valid specifications and datasets.
- `stop()`: Stop the toolbox. Halts any ongoing operations within the toolbox.
- `run()`: Run the toolbox. Initiates the execution of operations as defined in the toolbox.
- `get_results()`: Get operation results. Retrieves the results of operations performed by the toolbox.
- `get_failures()`: Get failures. Provides a list of any failures encountered during operations.
- `run_operation(operation: str)`: Run a specific operation. Executes a given operation on the datasets, returning the result or failure message.
## Agent Tools
The `dataset_manager_agent` provides these tools:
### validate_toolbox
Validates the OperatorToolBox:
```python
@dataset_manager_agent.tool
async def validate_toolbox(ctx: RunContext[OperatorToolBox]) -> str
```
### execute_operation
Executes an operation on a dataset:
```python
@dataset_manager_agent.tool
async def execute_operation(ctx: RunContext[OperatorToolBox], operation: str) -> str
```
### retrieve_results
Retrieves operation results:
```python
@dataset_manager_agent.tool
async def retrieve_results(ctx: RunContext[OperatorToolBox]) -> str
```
### retrieve_failures
Retrieves failures:
```python
@dataset_manager_agent.tool
async def retrieve_failures(ctx: RunContext[OperatorToolBox]) -> str
```
## Usage Examples
### Initializing the OperatorToolBox
To initialize the `OperatorToolBox`, you need to provide an `AgentSpecification` and a list of datasets:
```python
spec = AgentSpecification(
name="GPT-4",
version="4.0",
description="A powerful language model",
capabilities=["text-generation", "question-answering"],
configuration={"max_tokens": 100},
)
datasets = [{"name": "dataset1"}, {"name": "dataset2"}]
toolbox = OperatorToolBox(spec=spec, datasets=datasets)
```
### Synchronous Usage
```python
def run_dataset_manager_agent_sync():
prompts = [
"Validate the toolbox.",
"Execute operation on 'dataset2'.",
"Retrieve the results.",
"Retrieve any failures."
]
for prompt in prompts:
result = dataset_manager_agent.run_sync(prompt, deps=toolbox)
print(f"Response: {result.data}")
```
### Asynchronous Usage
```python
async def run_dataset_manager_agent_async():
prompts = [
"Validate the toolbox.",
"Execute operation on 'dataset2'.",
"Retrieve the results.",
"Retrieve any failures."
]
for prompt in prompts:
result = await dataset_manager_agent.run(prompt, deps=toolbox)
print(f"Response: {result.data}")
```
These updates provide a more detailed and comprehensive understanding of the `operator.py` module, its classes, and its usage.
+57
View File
@@ -50,6 +50,50 @@ The `probe_data` module is a core component of the Agentic Security project, res
- `base64_encode(data)`: Encodes data in base64 format.
- `mirror_words(text)`: Mirrors words in the text.
### rl_model.py
- **Classes:**
- `PromptSelectionInterface`: Abstract base class for prompt selection strategies.
- Methods:
- `select_next_prompt(current_prompt: str, passed_guard: bool) -> str`: Selects next prompt
- `select_next_prompts(current_prompt: str, passed_guard: bool) -> list[str]`: Selects multiple prompts
- `update_rewards(previous_prompt: str, current_prompt: str, reward: float, passed_guard: bool) -> None`: Updates rewards
- `RandomPromptSelector`: Basic random selection with history tracking.
- Parameters:
- `prompts: list[str]`: List of available prompts
- `history_size: int = 3`: Size of history to prevent cycles
- `CloudRLPromptSelector`: Cloud-based RL implementation with fallback.
- Parameters:
- `prompts: list[str]`: List of available prompts
- `api_url: str`: URL of RL service
- `auth_token: str = AUTH_TOKEN`: Authentication token
- `history_size: int = 300`: Size of history
- `timeout: int = 5`: Request timeout
- `run_id: str = ""`: Unique run identifier
- `QLearningPromptSelector`: Local Q-learning implementation.
- Parameters:
- `prompts: list[str]`: List of available prompts
- `learning_rate: float = 0.1`: Learning rate
- `discount_factor: float = 0.9`: Discount factor
- `initial_exploration: float = 1.0`: Initial exploration rate
- `exploration_decay: float = 0.995`: Exploration decay rate
- `min_exploration: float = 0.01`: Minimum exploration rate
- `history_size: int = 300`: Size of history
- `Module`: Main class that uses CloudRLPromptSelector.
- Parameters:
- `prompt_groups: list[str]`: Groups of prompts
- `tools_inbox: asyncio.Queue`: Queue for tool communication
- `opts: dict = {}`: Configuration options
## Usage Examples
### Generating Audio
@@ -68,6 +112,19 @@ from agentic_security.probe_data.data import load_dataset_general
dataset = load_dataset_general("example_dataset")
```
### Using RL Model
```python
from agentic_security.probe_data.modules.rl_model import QLearningPromptSelector
prompts = ["What is AI?", "Explain machine learning"]
selector = QLearningPromptSelector(prompts)
current_prompt = "What is AI?"
next_prompt = selector.select_next_prompt(current_prompt, passed_guard=True)
selector.update_rewards(current_prompt, next_prompt, reward=1.0, passed_guard=True)
```
## Conclusion
The `probe_data` module provides essential functionality for handling and transforming datasets within the Agentic Security project. This documentation serves as a guide to understanding and utilizing the module's capabilities.
+65
View File
@@ -0,0 +1,65 @@
# Quickstart Guide
Welcome to the Quickstart Guide for Agentic Security. This guide will help you set up and start using the project quickly.
## Installation
To get started with Agentic Security, install the package using pip:
```shell
pip install agentic_security
```
## Initial Setup
After installation, you can start the application using the following command:
```shell
agentic_security
```
This will initialize the server and prepare it for use.
## Basic Usage
To run the main application, use:
```shell
python -m agentic_security
```
You can also view help options with:
```shell
agentic_security --help
```
## Running as a CI Check
Initialize the configuration for CI checks:
```shell
agentic_security init
```
This will generate a default configuration file named `agesec.toml`.
## Additional Commands
- List available modules:
```shell
agentic_security ls
```
- Run a security scan:
```shell
agentic_security ci
```
## Further Information
For more detailed information, refer to the [Documentation](index.md) or the [API Reference](api_reference.md).
This quickstart guide should help you get up and running with Agentic Security efficiently.
+194
View File
@@ -0,0 +1,194 @@
# RL Model Module
The RL Model module provides reinforcement learning-based prompt selection strategies for the probe system.
## Overview
The module implements several prompt selection strategies that use reinforcement learning techniques to optimize prompt selection based on guard results and rewards.
## Classes
### PromptSelectionInterface
Abstract base class defining the interface for prompt selection strategies.
**Methods:**
- `select_next_prompt(current_prompt: str, passed_guard: bool) -> str`
- `select_next_prompts(current_prompt: str, passed_guard: bool) -> list[str]`
- `update_rewards(previous_prompt: str, current_prompt: str, reward: float, passed_guard: bool) -> None`
### RandomPromptSelector
Basic random selection strategy with cycle prevention using history.
**Configuration:**
- `prompts`: List of available prompts
- `history_size`: Size of history buffer to prevent cycles (default: 300)
### CloudRLPromptSelector
Cloud-based reinforcement learning prompt selector with fallback to random selection.
**Configuration:**
- `prompts`: List of available prompts
- `api_url`: URL of the RL service
- `auth_token`: Authentication token (default: AS_TOKEN environment variable)
- `history_size`: Size of history buffer (default: 300)
- `timeout`: Request timeout in seconds (default: 5)
- `run_id`: Unique identifier for the run
### QLearningPromptSelector
Q-Learning based prompt selector with exploration/exploitation tradeoff.
**Configuration:**
- `prompts`: List of available prompts
- `learning_rate`: Learning rate (default: 0.1)
- `discount_factor`: Discount factor (default: 0.9)
- `initial_exploration`: Initial exploration rate (default: 1.0)
- `exploration_decay`: Exploration decay rate (default: 0.995)
- `min_exploration`: Minimum exploration rate (default: 0.01)
- `history_size`: Size of history buffer (default: 300)
### Module
Main class that implements the RL-based prompt selection functionality.
**Configuration:**
- `prompt_groups`: List of prompt groups
- `tools_inbox`: asyncio.Queue for tool communication
- `opts`: Additional options
- `max_prompts`: Maximum number of prompts to generate (default: 10)
- `batch_size`: Batch size for processing (default: 500)
## Usage Example
```python
from agentic_security.probe_data.modules.rl_model import (
Module,
CloudRLPromptSelector,
QLearningPromptSelector
)
# Initialize with prompt groups
prompt_groups = ["What is AI?", "Explain ML", "Describe RL"]
module = Module(prompt_groups, asyncio.Queue())
# Use the module
async for prompt in module.apply():
print(f"Selected prompt: {prompt}")
```
## API Reference
### PromptSelectionInterface
```python
class PromptSelectionInterface(ABC):
@abstractmethod
def select_next_prompt(self, current_prompt: str, passed_guard: bool) -> str:
"""Select next prompt based on current state and guard result."""
@abstractmethod
def select_next_prompts(self, current_prompt: str, passed_guard: bool) -> list[str]:
"""Select next prompts based on current state and guard result."""
@abstractmethod
def update_rewards(
self,
previous_prompt: str,
current_prompt: str,
reward: float,
passed_guard: bool,
) -> None:
"""Update internal rewards based on outcome of last selected prompt."""
```
### RandomPromptSelector
```python
class RandomPromptSelector(PromptSelectionInterface):
def __init__(self, prompts: list[str], history_size: int = 300):
"""Initialize with prompts and history size."""
def select_next_prompt(self, current_prompt: str, passed_guard: bool) -> str:
"""Select next prompt randomly with cycle prevention."""
def update_rewards(
self,
previous_prompt: str,
current_prompt: str,
reward: float,
passed_guard: bool,
) -> None:
"""No learning in random selection."""
```
### CloudRLPromptSelector
```python
class CloudRLPromptSelector(PromptSelectionInterface):
def __init__(
self,
prompts: list[str],
api_url: str,
auth_token: str = AUTH_TOKEN,
history_size: int = 300,
timeout: int = 5,
run_id: str = "",
):
"""Initialize with cloud RL configuration."""
def select_next_prompts(self, current_prompt: str, passed_guard: bool) -> list[str]:
"""Select next prompts using cloud RL with fallback."""
def _fallback_selection(self) -> str:
"""Fallback to random selection if cloud request fails."""
```
### QLearningPromptSelector
```python
class QLearningPromptSelector(PromptSelectionInterface):
def __init__(
self,
prompts: list[str],
learning_rate: float = 0.1,
discount_factor: float = 0.9,
initial_exploration: float = 1.0,
exploration_decay: float = 0.995,
min_exploration: float = 0.01,
history_size: int = 300,
):
"""Initialize Q-Learning configuration."""
def select_next_prompt(self, current_prompt: str, passed_guard: bool) -> str:
"""Select next prompt using Q-Learning with exploration/exploitation."""
def update_rewards(
self,
previous_prompt: str,
current_prompt: str,
reward: float,
passed_guard: bool,
) -> None:
"""Update Q-values based on reward."""
```
### Module
```python
class Module:
def __init__(
self, prompt_groups: list[str], tools_inbox: asyncio.Queue, opts: dict = {}
):
"""Initialize module with prompt groups and configuration."""
async def apply(self):
"""Apply the RL model to generate prompts."""
```
+31 -4
View File
@@ -8,9 +8,13 @@ repo_name: msoedov/agentic_security
copyright: Maintained by <a href="https://msoedov.github.io">Agentic Security Team</a>.
nav:
- Home: index.md
- Adventure starts here:
- Overview: index.md
- Quickstart: quickstart.md
- Design: design.md
- Abstractions: abstractions.md
- Features: probe_data.md
- Core Concepts:
- Concepts:
- Probe Actor: probe_actor.md
- Refusal Actor: refusal_classifier_plugins.md
- Agent Spec: http_spec.md
@@ -25,10 +29,33 @@ nav:
- Bayesian Optimization: optimizer.md
- Image Generation: image_generation.md
- Stenography Functions: stenography.md
- Reinforcement Learning Optimization: rl_model.md
- WIP:
- Agent Operator: operator.md
- Reference:
- API Reference: api_reference.md
- Community:
- Contributing: contributing.md
# - Project:
# - Setup: setup.md
# - Version control: version_control.md
# - Docker: docker.md
# - Variables: variables.md
# - Custom libraries: custom_libraries.md
# - Database: database.md
# - Credentials: credentials.md
# - Code execution: code_execution.md
# - Settings: settings.md
# - Version upgrades: version_upgrades.md
# - Contributing:
# - Overview: contributing_overview.md
# - Dev environment: dev_environment.md
# - Backend: backend.md
# - Frontend: frontend.md
# - Documentation: documentation.md
# - About:
# - Code of conduct: code_of_conduct.md
# - Usage statistics: usage_statistics.md
# - FAQ: faq.md
# - Changelog: changelog.md
plugins:
- search
Generated
+76 -58
View File
@@ -1,4 +1,4 @@
# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand.
# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand.
[[package]]
name = "aiohappyeyeballs"
@@ -252,33 +252,33 @@ lxml = ["lxml"]
[[package]]
name = "black"
version = "24.10.0"
version = "25.1.0"
description = "The uncompromising code formatter."
optional = false
python-versions = ">=3.9"
files = [
{file = "black-24.10.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e6668650ea4b685440857138e5fe40cde4d652633b1bdffc62933d0db4ed9812"},
{file = "black-24.10.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1c536fcf674217e87b8cc3657b81809d3c085d7bf3ef262ead700da345bfa6ea"},
{file = "black-24.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:649fff99a20bd06c6f727d2a27f401331dc0cc861fb69cde910fe95b01b5928f"},
{file = "black-24.10.0-cp310-cp310-win_amd64.whl", hash = "sha256:fe4d6476887de70546212c99ac9bd803d90b42fc4767f058a0baa895013fbb3e"},
{file = "black-24.10.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5a2221696a8224e335c28816a9d331a6c2ae15a2ee34ec857dcf3e45dbfa99ad"},
{file = "black-24.10.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f9da3333530dbcecc1be13e69c250ed8dfa67f43c4005fb537bb426e19200d50"},
{file = "black-24.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4007b1393d902b48b36958a216c20c4482f601569d19ed1df294a496eb366392"},
{file = "black-24.10.0-cp311-cp311-win_amd64.whl", hash = "sha256:394d4ddc64782e51153eadcaaca95144ac4c35e27ef9b0a42e121ae7e57a9175"},
{file = "black-24.10.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b5e39e0fae001df40f95bd8cc36b9165c5e2ea88900167bddf258bacef9bbdc3"},
{file = "black-24.10.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d37d422772111794b26757c5b55a3eade028aa3fde43121ab7b673d050949d65"},
{file = "black-24.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:14b3502784f09ce2443830e3133dacf2c0110d45191ed470ecb04d0f5f6fcb0f"},
{file = "black-24.10.0-cp312-cp312-win_amd64.whl", hash = "sha256:30d2c30dc5139211dda799758559d1b049f7f14c580c409d6ad925b74a4208a8"},
{file = "black-24.10.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1cbacacb19e922a1d75ef2b6ccaefcd6e93a2c05ede32f06a21386a04cedb981"},
{file = "black-24.10.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1f93102e0c5bb3907451063e08b9876dbeac810e7da5a8bfb7aeb5a9ef89066b"},
{file = "black-24.10.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ddacb691cdcdf77b96f549cf9591701d8db36b2f19519373d60d31746068dbf2"},
{file = "black-24.10.0-cp313-cp313-win_amd64.whl", hash = "sha256:680359d932801c76d2e9c9068d05c6b107f2584b2a5b88831c83962eb9984c1b"},
{file = "black-24.10.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:17374989640fbca88b6a448129cd1745c5eb8d9547b464f281b251dd00155ccd"},
{file = "black-24.10.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:63f626344343083322233f175aaf372d326de8436f5928c042639a4afbbf1d3f"},
{file = "black-24.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfa1d0cb6200857f1923b602f978386a3a2758a65b52e0950299ea014be6800"},
{file = "black-24.10.0-cp39-cp39-win_amd64.whl", hash = "sha256:2cd9c95431d94adc56600710f8813ee27eea544dd118d45896bb734e9d7a0dc7"},
{file = "black-24.10.0-py3-none-any.whl", hash = "sha256:3bb2b7a1f7b685f85b11fed1ef10f8a9148bceb49853e47a294a3dd963c1dd7d"},
{file = "black-24.10.0.tar.gz", hash = "sha256:846ea64c97afe3bc677b761787993be4991810ecc7a4a937816dd6bddedc4875"},
{file = "black-25.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:759e7ec1e050a15f89b770cefbf91ebee8917aac5c20483bc2d80a6c3a04df32"},
{file = "black-25.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0e519ecf93120f34243e6b0054db49c00a35f84f195d5bce7e9f5cfc578fc2da"},
{file = "black-25.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:055e59b198df7ac0b7efca5ad7ff2516bca343276c466be72eb04a3bcc1f82d7"},
{file = "black-25.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:db8ea9917d6f8fc62abd90d944920d95e73c83a5ee3383493e35d271aca872e9"},
{file = "black-25.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a39337598244de4bae26475f77dda852ea00a93bd4c728e09eacd827ec929df0"},
{file = "black-25.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:96c1c7cd856bba8e20094e36e0f948718dc688dba4a9d78c3adde52b9e6c2299"},
{file = "black-25.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bce2e264d59c91e52d8000d507eb20a9aca4a778731a08cfff7e5ac4a4bb7096"},
{file = "black-25.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:172b1dbff09f86ce6f4eb8edf9dede08b1fce58ba194c87d7a4f1a5aa2f5b3c2"},
{file = "black-25.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4b60580e829091e6f9238c848ea6750efed72140b91b048770b64e74fe04908b"},
{file = "black-25.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1e2978f6df243b155ef5fa7e558a43037c3079093ed5d10fd84c43900f2d8ecc"},
{file = "black-25.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3b48735872ec535027d979e8dcb20bf4f70b5ac75a8ea99f127c106a7d7aba9f"},
{file = "black-25.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:ea0213189960bda9cf99be5b8c8ce66bb054af5e9e861249cd23471bd7b0b3ba"},
{file = "black-25.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8f0b18a02996a836cc9c9c78e5babec10930862827b1b724ddfe98ccf2f2fe4f"},
{file = "black-25.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:afebb7098bfbc70037a053b91ae8437c3857482d3a690fefc03e9ff7aa9a5fd3"},
{file = "black-25.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:030b9759066a4ee5e5aca28c3c77f9c64789cdd4de8ac1df642c40b708be6171"},
{file = "black-25.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:a22f402b410566e2d1c950708c77ebf5ebd5d0d88a6a2e87c86d9fb48afa0d18"},
{file = "black-25.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a1ee0a0c330f7b5130ce0caed9936a904793576ef4d2b98c40835d6a65afa6a0"},
{file = "black-25.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f3df5f1bf91d36002b0a75389ca8663510cf0531cca8aa5c1ef695b46d98655f"},
{file = "black-25.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d9e6827d563a2c820772b32ce8a42828dc6790f095f441beef18f96aa6f8294e"},
{file = "black-25.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:bacabb307dca5ebaf9c118d2d2f6903da0d62c9faa82bd21a33eecc319559355"},
{file = "black-25.1.0-py3-none-any.whl", hash = "sha256:95e8176dae143ba9097f351d174fdaf0ccd29efb414b362ae3fd72bf0f710717"},
{file = "black-25.1.0.tar.gz", hash = "sha256:33496d5cd1222ad73391352b4ae8da15253c5de89b93a80b3e2c8d9a19ec2666"},
]
[package.dependencies]
@@ -645,21 +645,21 @@ tests = ["pytest", "pytest-cov", "pytest-xdist"]
[[package]]
name = "datasets"
version = "3.2.0"
version = "3.3.0"
description = "HuggingFace community-driven open-source library of datasets"
optional = false
python-versions = ">=3.9.0"
files = [
{file = "datasets-3.2.0-py3-none-any.whl", hash = "sha256:f3d2ba2698b7284a4518019658596a6a8bc79f31e51516524249d6c59cf0fe2a"},
{file = "datasets-3.2.0.tar.gz", hash = "sha256:9a6e1a356052866b5dbdd9c9eedb000bf3fc43d986e3584d9b028f4976937229"},
{file = "datasets-3.3.0-py3-none-any.whl", hash = "sha256:22312d09626f8fc3aa0a237b0c164997f5903bddd4c4c9e27dbaf563754c681b"},
{file = "datasets-3.3.0.tar.gz", hash = "sha256:54c607b06f6eaa1572e21e200d2870d89d50e3bcc622dc2021a53a6ce4f684c2"},
]
[package.dependencies]
aiohttp = "*"
dill = ">=0.3.0,<0.3.9"
filelock = "*"
fsspec = {version = ">=2023.1.0,<=2024.9.0", extras = ["http"]}
huggingface-hub = ">=0.23.0"
fsspec = {version = ">=2023.1.0,<=2024.12.0", extras = ["http"]}
huggingface-hub = ">=0.24.0"
multiprocess = "<0.70.17"
numpy = ">=1.17"
packaging = "*"
@@ -673,15 +673,15 @@ xxhash = "*"
[package.extras]
audio = ["librosa", "soundfile (>=0.12.1)", "soxr (>=0.4.0)"]
benchmarks = ["tensorflow (==2.12.0)", "torch (==2.0.1)", "transformers (==4.30.1)"]
dev = ["Pillow (>=9.4.0)", "absl-py", "decorator", "decord (==0.6.0)", "elasticsearch (>=7.17.12,<8.0.0)", "faiss-cpu (>=1.8.0.post1)", "jax (>=0.3.14)", "jaxlib (>=0.3.14)", "joblib (<1.3.0)", "joblibspark", "librosa", "lz4", "moto[server]", "polars[timezone] (>=0.20.0)", "protobuf (<4.0.0)", "py7zr", "pyspark (>=3.4)", "pytest", "pytest-datadir", "pytest-xdist", "rarfile (>=4.0)", "ruff (>=0.3.0)", "s3fs", "s3fs (>=2021.11.1)", "soundfile (>=0.12.1)", "soxr (>=0.4.0)", "sqlalchemy", "tensorflow (>=2.16.0)", "tensorflow (>=2.6.0)", "tensorflow (>=2.6.0)", "tiktoken", "torch", "torch (>=2.0.0)", "torchdata", "transformers", "transformers (>=4.42.0)", "zstandard"]
dev = ["Pillow (>=9.4.0)", "absl-py", "decorator", "decord (==0.6.0)", "elasticsearch (>=7.17.12,<8.0.0)", "faiss-cpu (>=1.8.0.post1)", "jax (>=0.3.14)", "jaxlib (>=0.3.14)", "joblib (<1.3.0)", "joblibspark", "librosa", "lz4", "moto[server]", "polars[timezone] (>=0.20.0)", "protobuf (<4.0.0)", "py7zr", "pyspark (>=3.4)", "pytest", "pytest-datadir", "pytest-xdist", "rarfile (>=4.0)", "ruff (>=0.3.0)", "s3fs", "s3fs (>=2021.11.1)", "soundfile (>=0.12.1)", "soundfile (>=0.12.1)", "soxr (>=0.4.0)", "sqlalchemy", "tensorflow (>=2.16.0)", "tensorflow (>=2.6.0)", "tensorflow (>=2.6.0)", "tiktoken", "torch", "torch (>=2.0.0)", "torchdata", "transformers", "transformers (>=4.42.0)", "zstandard"]
docs = ["s3fs", "tensorflow (>=2.6.0)", "torch", "transformers"]
jax = ["jax (>=0.3.14)", "jaxlib (>=0.3.14)"]
quality = ["ruff (>=0.3.0)"]
s3 = ["s3fs"]
tensorflow = ["tensorflow (>=2.6.0)"]
tensorflow-gpu = ["tensorflow (>=2.6.0)"]
tests = ["Pillow (>=9.4.0)", "absl-py", "decorator", "decord (==0.6.0)", "elasticsearch (>=7.17.12,<8.0.0)", "faiss-cpu (>=1.8.0.post1)", "jax (>=0.3.14)", "jaxlib (>=0.3.14)", "joblib (<1.3.0)", "joblibspark", "librosa", "lz4", "moto[server]", "polars[timezone] (>=0.20.0)", "protobuf (<4.0.0)", "py7zr", "pyspark (>=3.4)", "pytest", "pytest-datadir", "pytest-xdist", "rarfile (>=4.0)", "s3fs (>=2021.11.1)", "soundfile (>=0.12.1)", "soxr (>=0.4.0)", "sqlalchemy", "tensorflow (>=2.16.0)", "tensorflow (>=2.6.0)", "tiktoken", "torch (>=2.0.0)", "torchdata", "transformers (>=4.42.0)", "zstandard"]
tests-numpy2 = ["Pillow (>=9.4.0)", "absl-py", "decorator", "decord (==0.6.0)", "elasticsearch (>=7.17.12,<8.0.0)", "jax (>=0.3.14)", "jaxlib (>=0.3.14)", "joblib (<1.3.0)", "joblibspark", "lz4", "moto[server]", "polars[timezone] (>=0.20.0)", "protobuf (<4.0.0)", "py7zr", "pyspark (>=3.4)", "pytest", "pytest-datadir", "pytest-xdist", "rarfile (>=4.0)", "s3fs (>=2021.11.1)", "soundfile (>=0.12.1)", "soxr (>=0.4.0)", "sqlalchemy", "tiktoken", "torch (>=2.0.0)", "torchdata", "transformers (>=4.42.0)", "zstandard"]
tests = ["Pillow (>=9.4.0)", "absl-py", "decorator", "decord (==0.6.0)", "elasticsearch (>=7.17.12,<8.0.0)", "faiss-cpu (>=1.8.0.post1)", "jax (>=0.3.14)", "jaxlib (>=0.3.14)", "joblib (<1.3.0)", "joblibspark", "librosa", "lz4", "moto[server]", "polars[timezone] (>=0.20.0)", "protobuf (<4.0.0)", "py7zr", "pyspark (>=3.4)", "pytest", "pytest-datadir", "pytest-xdist", "rarfile (>=4.0)", "s3fs (>=2021.11.1)", "soundfile (>=0.12.1)", "soundfile (>=0.12.1)", "soxr (>=0.4.0)", "sqlalchemy", "tensorflow (>=2.16.0)", "tensorflow (>=2.6.0)", "tiktoken", "torch (>=2.0.0)", "torchdata", "transformers (>=4.42.0)", "zstandard"]
tests-numpy2 = ["Pillow (>=9.4.0)", "absl-py", "decorator", "decord (==0.6.0)", "elasticsearch (>=7.17.12,<8.0.0)", "jax (>=0.3.14)", "jaxlib (>=0.3.14)", "joblib (<1.3.0)", "joblibspark", "lz4", "moto[server]", "polars[timezone] (>=0.20.0)", "protobuf (<4.0.0)", "py7zr", "pyspark (>=3.4)", "pytest", "pytest-datadir", "pytest-xdist", "rarfile (>=4.0)", "s3fs (>=2021.11.1)", "soundfile (>=0.12.1)", "soundfile (>=0.12.1)", "soxr (>=0.4.0)", "sqlalchemy", "tiktoken", "torch (>=2.0.0)", "torchdata", "transformers (>=4.42.0)", "zstandard"]
torch = ["torch"]
vision = ["Pillow (>=9.4.0)"]
@@ -770,13 +770,13 @@ files = [
[[package]]
name = "executing"
version = "2.1.0"
version = "2.2.0"
description = "Get the currently executing AST node of a frame, and other information"
optional = false
python-versions = ">=3.8"
files = [
{file = "executing-2.1.0-py2.py3-none-any.whl", hash = "sha256:8d63781349375b5ebccc3142f4b30350c0cd9c79f921cde38be2be4637e98eaf"},
{file = "executing-2.1.0.tar.gz", hash = "sha256:8ea27ddd260da8150fa5a708269c4a10e76161e2496ec3e587da9e3c0fe4b9ab"},
{file = "executing-2.2.0-py2.py3-none-any.whl", hash = "sha256:11387150cad388d62750327a53d3339fad4888b39a6fe233c3afbb54ecffd3aa"},
{file = "executing-2.2.0.tar.gz", hash = "sha256:5d108c028108fe2551d1a7b2e8b713341e2cb4fc0aa7dcf966fa4327a5226755"},
]
[package.extras]
@@ -784,13 +784,13 @@ tests = ["asttokens (>=2.1.0)", "coverage", "coverage-enable-subprocess", "ipyth
[[package]]
name = "fastapi"
version = "0.115.7"
version = "0.115.8"
description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"
optional = false
python-versions = ">=3.8"
files = [
{file = "fastapi-0.115.7-py3-none-any.whl", hash = "sha256:eb6a8c8bf7f26009e8147111ff15b5177a0e19bb4a45bc3486ab14804539d21e"},
{file = "fastapi-0.115.7.tar.gz", hash = "sha256:0f106da6c01d88a6786b3248fb4d7a940d071f6f488488898ad5d354b25ed015"},
{file = "fastapi-0.115.8-py3-none-any.whl", hash = "sha256:753a96dd7e036b34eeef8babdfcfe3f28ff79648f86551eb36bfc1b0bf4a8cbf"},
{file = "fastapi-0.115.8.tar.gz", hash = "sha256:0ce9111231720190473e222cdf0f07f7206ad7e53ea02beb1d2dc36e2f0741e9"},
]
[package.dependencies]
@@ -1055,6 +1055,25 @@ python-dateutil = ">=2.8.1"
[package.extras]
dev = ["flake8", "markdown", "twine", "wheel"]
[[package]]
name = "gtts"
version = "2.5.4"
description = "gTTS (Google Text-to-Speech), a Python library and CLI tool to interface with Google Translate text-to-speech API"
optional = false
python-versions = ">=3.7"
files = [
{file = "gTTS-2.5.4-py3-none-any.whl", hash = "sha256:5dd579377f9f5546893bc26315ab1f846933dc27a054764b168f141065ca8436"},
{file = "gtts-2.5.4.tar.gz", hash = "sha256:f5737b585f6442f677dbe8773424fd50697c75bdf3e36443585e30a8d48c1884"},
]
[package.dependencies]
click = ">=7.1,<8.2"
requests = ">=2.27,<3"
[package.extras]
docs = ["sphinx", "sphinx-autobuild", "sphinx-click", "sphinx-mdinclude", "sphinx-rtd-theme"]
tests = ["pytest (>=7.1.3,<8.4.0)", "pytest-cov", "testfixtures"]
[[package]]
name = "h11"
version = "0.14.0"
@@ -1113,13 +1132,13 @@ zstd = ["zstandard (>=0.18.0)"]
[[package]]
name = "huggingface-hub"
version = "0.28.0"
version = "0.28.1"
description = "Client library to download and publish models, datasets and other repos on the huggingface.co hub"
optional = false
python-versions = ">=3.8.0"
files = [
{file = "huggingface_hub-0.28.0-py3-none-any.whl", hash = "sha256:71cff4e500efe68061d94b7f6d3114e183715088be7a90bf4dd84af83b5f5cdb"},
{file = "huggingface_hub-0.28.0.tar.gz", hash = "sha256:c2b18c02a47d4384763caddb4d0ab2a8fc6c16e0800d6de4d55d0a896244aba3"},
{file = "huggingface_hub-0.28.1-py3-none-any.whl", hash = "sha256:aa6b9a3ffdae939b72c464dbb0d7f99f56e649b55c3d52406f49e0a5a620c0a7"},
{file = "huggingface_hub-0.28.1.tar.gz", hash = "sha256:893471090c98e3b6efbdfdacafe4052b20b84d59866fb6f54c33d9af18c303ae"},
]
[package.dependencies]
@@ -1183,18 +1202,18 @@ files = [
[[package]]
name = "inline-snapshot"
version = "0.19.3"
version = "0.20.1"
description = "golden master/snapshot/approval testing library which puts the values right into your source code"
optional = false
python-versions = ">=3.8"
files = [
{file = "inline_snapshot-0.19.3-py3-none-any.whl", hash = "sha256:81ed10eedb593aee630d2fc0cfe5d10a843c4bd507c2d96ea058c28413985452"},
{file = "inline_snapshot-0.19.3.tar.gz", hash = "sha256:1e40f34da64fe2406c6bba3f473905e22386da43e16c85060610692325aa94d7"},
{file = "inline_snapshot-0.20.1-py3-none-any.whl", hash = "sha256:5b5c3fd037f340dff5adee1c2c58db9038325937a8190dedbba98e37b87c979a"},
{file = "inline_snapshot-0.20.1.tar.gz", hash = "sha256:c56c871e59973500eca00610022eac19e79cd2c1b0b2d7a18abe14dde11a1431"},
]
[package.dependencies]
asttokens = ">=2.0.5"
executing = ">=2.1.0"
executing = ">=2.2.0"
rich = ">=13.7.1"
[package.extras]
@@ -1880,13 +1899,13 @@ pygments = ">2.12.0"
[[package]]
name = "mkdocs-material"
version = "9.5.50"
version = "9.6.4"
description = "Documentation that simply works"
optional = false
python-versions = ">=3.8"
files = [
{file = "mkdocs_material-9.5.50-py3-none-any.whl", hash = "sha256:f24100f234741f4d423a9d672a909d859668a4f404796be3cf035f10d6050385"},
{file = "mkdocs_material-9.5.50.tar.gz", hash = "sha256:ae5fe16f3d7c9ccd05bb6916a7da7420cf99a9ce5e33debd9d40403a090d5825"},
{file = "mkdocs_material-9.6.4-py3-none-any.whl", hash = "sha256:414e8376551def6d644b8e6f77226022868532a792eb2c9accf52199009f568f"},
{file = "mkdocs_material-9.6.4.tar.gz", hash = "sha256:4d1d35e1c1d3e15294cb7fa5d02e0abaee70d408f75027dc7be6e30fb32e6867"},
]
[package.dependencies]
@@ -1920,23 +1939,22 @@ files = [
[[package]]
name = "mkdocstrings"
version = "0.27.0"
version = "0.28.1"
description = "Automatic documentation from sources, for MkDocs."
optional = false
python-versions = ">=3.9"
files = [
{file = "mkdocstrings-0.27.0-py3-none-any.whl", hash = "sha256:6ceaa7ea830770959b55a16203ac63da24badd71325b96af950e59fd37366332"},
{file = "mkdocstrings-0.27.0.tar.gz", hash = "sha256:16adca6d6b0a1f9e0c07ff0b02ced8e16f228a9d65a37c063ec4c14d7b76a657"},
{file = "mkdocstrings-0.28.1-py3-none-any.whl", hash = "sha256:a5878ae5cd1e26f491ff084c1f9ab995687d52d39a5c558e9b7023d0e4e0b740"},
{file = "mkdocstrings-0.28.1.tar.gz", hash = "sha256:fb64576906771b7701e8e962fd90073650ff689e95eb86e86751a66d65ab4489"},
]
[package.dependencies]
click = ">=7.0"
Jinja2 = ">=2.11.1"
Markdown = ">=3.6"
MarkupSafe = ">=1.1"
mkdocs = ">=1.4"
mkdocs-autorefs = ">=1.2"
platformdirs = ">=2.2"
mkdocs-autorefs = ">=1.3"
mkdocs-get-deps = ">=0.2"
pymdown-extensions = ">=6.3"
[package.extras]
@@ -3064,13 +3082,13 @@ dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments
[[package]]
name = "pytest-asyncio"
version = "0.25.2"
version = "0.25.3"
description = "Pytest support for asyncio"
optional = false
python-versions = ">=3.9"
files = [
{file = "pytest_asyncio-0.25.2-py3-none-any.whl", hash = "sha256:0d0bb693f7b99da304a0634afc0a4b19e49d5e0de2d670f38dc4bfa5727c5075"},
{file = "pytest_asyncio-0.25.2.tar.gz", hash = "sha256:3f8ef9a98f45948ea91a0ed3dc4268b5326c0e7bce73892acc654df4262ad45f"},
{file = "pytest_asyncio-0.25.3-py3-none-any.whl", hash = "sha256:9e89518e0f9bd08928f97a3482fdc4e244df17529460bc038291ccaf8f85c7c3"},
{file = "pytest_asyncio-0.25.3.tar.gz", hash = "sha256:fc1da2cf9f125ada7e710b4ddad05518d4cee187ae9412e9ac9271003497f07a"},
]
[package.dependencies]
@@ -4365,4 +4383,4 @@ propcache = ">=0.2.0"
[metadata]
lock-version = "2.0"
python-versions = "^3.11"
content-hash = "fc11e4f6e8eaaf7fb2f5337598134f24c090576d2f70afcb3d19161904cb4a12"
content-hash = "9f04c27a16a385191dc91ac21012ea2a48b54d9e4380bcaba72f3106979b4219"
+8 -7
View File
@@ -1,13 +1,13 @@
[tool.poetry]
name = "agentic_security"
version = "0.4.3"
version = "0.4.5"
description = "Agentic LLM vulnerability scanner"
authors = ["Alexander Miasoiedov <msoedov@gmail.com>"]
maintainers = ["Alexander Miasoiedov <msoedov@gmail.com>"]
repository = "https://github.com/msoedov/agentic_security"
homepage = "https://github.com/msoedov/agentic_security"
documentation = "https://github.com/msoedov/agentic_security/blob/main/README.md"
license = "MIT"
license = "Apache-2.0"
readme = "Readme.md"
keywords = [
"LLM vulnerability scanner",
@@ -28,14 +28,14 @@ agentic_security = "agentic_security.__main__:main"
[tool.poetry.dependencies]
python = "^3.11"
fastapi = "^0.115.6"
fastapi = "^0.115.8"
uvicorn = "^0.34.0"
fire = "0.7.0"
loguru = "^0.7.3"
httpx = "^0.28.1"
cache-to-disk = "^2.0.0"
pandas = ">=1.4,<3.0"
datasets = ">=1.14,<4.0"
datasets = "^3.3.0"
tabulate = ">=0.8.9,<0.10.0"
colorama = "^0.4.4"
matplotlib = "^3.9.2"
@@ -47,6 +47,7 @@ jinja2 = "^3.1.4"
python-multipart = "^0.0.20"
tomli = "^2.2.1"
rich = "13.9.4"
gTTS = "^2.5.4"
# garak = { version = "*", optional = true }
@@ -54,19 +55,19 @@ rich = "13.9.4"
# Pytest
pytest = "^8.3.4"
pytest-asyncio = "^0.25.2"
inline-snapshot = ">=0.13.3,<0.20.0"
inline-snapshot = ">=0.13.3,<0.21.0"
pytest-httpx = "^0.35.0"
pytest-mock = "^3.14.0"
# Rest
black = "^24.10.0"
black = ">=24.10,<26.0"
mypy = "^1.12.0"
pre-commit = "^4.0.1"
huggingface-hub = ">=0.25.1,<0.29.0"
# Docs
mkdocs = ">=1.4.2"
mkdocs-material = ">=8.5.10"
mkdocs-material = "^9.6.4"
mkdocstrings = ">=0.26.1"
mkdocs-jupyter = ">=0.25.1"