DeepTeam is a framework to red team LLMs and AI agents.
update telemetry logging to add framework
A-Vamshi0be6236c6f0f
diff --git a/deepteam/red_teamer/red_teamer.py b/deepteam/red_teamer/red_teamer.pyindex a6cb05c8..ec0dba38 100644--- a/deepteam/red_teamer/red_teamer.py+++ b/deepteam/red_teamer/red_teamer.py@@ -118,7 +118,7 @@ class RedTeamer:with capture_red_teamer_run(vulnerabilities=[v.get_name() for v in vulnerabilities] if vulnerabilities else [],attacks=[a.get_name() for a in attacks] if attacks else [],- framework=framework.get_name() if framework and framework._has_dataset else None+ framework=framework.get_name() if framework else None):# Generate attacksif (@@ -257,7 +257,7 @@ class RedTeamer:with capture_red_teamer_run(vulnerabilities=[v.get_name() for v in vulnerabilities] if vulnerabilities else [],attacks=[a.get_name() for a in attacks] if attacks else [],- framework=framework.get_name() if framework and framework._has_dataset else None+ framework=framework.get_name() if framework else None):# Generate attacksif (diff --git a/deepteam/telemetry.py b/deepteam/telemetry.pyindex a70c2e94..db0ccf22 100644--- a/deepteam/telemetry.py+++ b/deepteam/telemetry.py@@ -131,7 +131,11 @@ IS_RUNNING_IN_JUPYTER = (@contextmanager-def capture_red_teamer_run(vulnerabilities: List[str], attacks: List[str]):+def capture_red_teamer_run(+ vulnerabilities: List[str],+ attacks: List[str],+ framework: str = None+):if not telemetry_opt_out():with tracer.start_as_current_span(f"Invoked redteamer") as span:posthog.capture(@@ -144,6 +148,8 @@ def capture_red_teamer_run(vulnerabilities: List[str], attacks: List[str]):"feature_status.redteaming",get_feature_status(Feature.REDTEAMING),)+ if framework is not None:+ span.set_attribute(f"framework.{framework}", 1)for vulnerability in vulnerabilities:span.set_attribute(f"vulnerability.{vulnerability}", 1)for attack in attacks: