Files
EvoSynth/jailbreak_toolbox/attacks/blackbox/base.py
T
dongdongunique f3af94df0b first commit
2025-12-10 00:54:02 +08:00

16 lines
505 B
Python

from ..base_attack import BaseAttack
from abc import ABC, abstractmethod
class BaseBlackBoxAttack(BaseAttack):
"""黑盒攻击的基类,可以提供通用工具。"""
@abstractmethod
def attack(self, target: str):
"""
执行攻击,返回攻击结果。
Args:
target: 攻击目标
Returns:
AttackResult: 攻击结果对象
"""
raise NotImplementedError("Subclasses must implement the attack method.")