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
2 changes: 1 addition & 1 deletion capabilities/ai-red-teaming/capability.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
schema: 1
name: ai-red-teaming
version: "1.2.1"
version: "1.2.2"
description: >
Probe the security and safety of AI applications, agents, and foundation models.
Orchestrates adversarial attack workflows to discover vulnerabilities in LLMs,
Expand Down
31 changes: 23 additions & 8 deletions capabilities/ai-red-teaming/tools/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,27 @@
from dreadnode.agents.tools import tool
from dreadnode.app.env import resolve_python_executable

WORKFLOWS_DIR = Path(
os.environ.get(
"AIRT_WORKFLOWS_DIR",
str(Path.home() / "workspace" / "airt" / "workflows"),
)
)
# Get org/workspace from active profile, with fallbacks
def _get_workspace_path() -> Path:
try:
from dreadnode.app.config import UserConfig
config = UserConfig.read()
profile_data = config.active_profile
if profile_data:
_, profile = profile_data
org_key = profile.organization or "default"
workspace_key = profile.workspace or "main"
else:
org_key = "default"
workspace_key = "main"
except Exception:
# Fallback if config system unavailable
org_key = "default"
workspace_key = "main"

return Path.home() / ".dreadnode" / "airt" / org_key / workspace_key / "workflows"

WORKFLOWS_DIR = Path(os.environ.get("AIRT_WORKFLOWS_DIR")) if os.environ.get("AIRT_WORKFLOWS_DIR") else _get_workspace_path()
METADATA_FILE = WORKFLOWS_DIR / ".workflow_metadata.json"


Expand All @@ -48,7 +63,7 @@ def save_workflow(
) -> str:
"""Save a Python attack workflow with syntax validation.

Validates the code compiles, saves to ~/workspace/airt/workflows/,
Validates the code compiles, saves to ~/.dreadnode/airt/[org]/[workspace]/workflows/,
and records metadata. Use execute_workflow to run saved workflows.
"""
if "/" in filename or "\\" in filename or ".." in filename:
Expand Down Expand Up @@ -81,7 +96,7 @@ def save_workflow(
def list_workflows() -> str:
"""List saved attack workflows with metadata.

Shows all Python scripts in ~/workspace/airt/workflows/ with
Shows all Python scripts in ~/.dreadnode/airt/[org]/[workspace]/workflows/ with
descriptions, sizes, and save timestamps.
"""
if not WORKFLOWS_DIR.exists():
Expand Down
Loading