mirror of
https://github.com/dongdongunique/EvoSynth.git
synced 2026-06-03 05:28:07 +02:00
40 lines
1.6 KiB
Python
40 lines
1.6 KiB
Python
"""
|
|
Default configuration for Evosynth multi-agent attack system.
|
|
"""
|
|
|
|
from dataclasses import dataclass, field
|
|
from typing import Optional
|
|
import os
|
|
|
|
|
|
@dataclass
|
|
class EvosynthConfig:
|
|
"""Configuration for Evosynth multi-agent attack system."""
|
|
|
|
# Core attack parameters
|
|
max_iterations: int = 20
|
|
success_threshold: int = 5
|
|
pipeline: str = "full_pipeline" # Options: "start_reconnaissance", "start_tool_creation", "start_exploitation", "full_pipeline"
|
|
|
|
# Model configuration
|
|
attack_model_base: str = "deepseek-chat"
|
|
target_model_name: str = "gpt-4o-mini"
|
|
judge_model_name: str = "gpt-4o-mini"
|
|
openai_api_key: Optional[str] = field(default_factory=lambda: os.getenv("OPENAI_API_KEY"))
|
|
base_url: Optional[str] = field(default_factory=lambda: os.getenv("OPENAI_BASE_URL", "https://api.openai.com/v1"))
|
|
|
|
# Langfuse tracing (optional)
|
|
enable_langfuse: bool = False
|
|
langfuse_secret_key: Optional[str] = field(default_factory=lambda: os.getenv("LANGFUSE_SECRET_KEY"))
|
|
langfuse_public_key: Optional[str] = field(default_factory=lambda: os.getenv("LANGFUSE_PUBLIC_KEY"))
|
|
langfuse_host: Optional[str] = field(default_factory=lambda: os.getenv("LANGFUSE_HOST", "https://cloud.langfuse.com"))
|
|
|
|
def __post_init__(self):
|
|
"""Validate configuration after initialization."""
|
|
if self.pipeline not in ["start_reconnaissance", "start_tool_creation", "start_exploitation", "full_pipeline"]:
|
|
raise ValueError(f"Invalid pipeline: {self.pipeline}")
|
|
|
|
|
|
def get_default_config() -> EvosynthConfig:
|
|
"""Get default configuration for Evosynth."""
|
|
return EvosynthConfig() |