From 0afaeaf25b8fe337d2a7c96762188e1239fe2b2c Mon Sep 17 00:00:00 2001 From: Raja Sekhar Rao Dheekonda Date: Thu, 30 Jul 2026 13:52:33 -0700 Subject: [PATCH] fix(ai-red-teaming): scope get_session_context to AIRT + make it pull-only (CAP-1169) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit get_session_context's docstring said "use this at the start of follow-up commands", which primed agents to open with it — including on non-red-teaming tasks when the AIRT capability is co-attached (agents spin on non-AIRT primitives / odd in demos). Reword to pull-only, red-teaming-only, resume-aid wording (do NOT call to start; not relevant to non-red-teaming work), soften the empty-return to "proceed with the task directly", and scope the agent-prompt description accordingly. No behavior change when genuinely resuming an attack. --- .../ai-red-teaming/agents/ai-red-teaming-agent.md | 2 +- capabilities/ai-red-teaming/capability.yaml | 2 +- capabilities/ai-red-teaming/tools/session.py | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/capabilities/ai-red-teaming/agents/ai-red-teaming-agent.md b/capabilities/ai-red-teaming/agents/ai-red-teaming-agent.md index c59631d..41e032a 100644 --- a/capabilities/ai-red-teaming/agents/ai-red-teaming-agent.md +++ b/capabilities/ai-red-teaming/agents/ai-red-teaming-agent.md @@ -176,7 +176,7 @@ The AI Red Teaming capability provides these tools: **Session Context (Iterative Refinement):** - **save_session_context** — Save current attack context (target, goal, results) for follow-up attacks -- **get_session_context** — Retrieve previous attack context to auto-fill parameters +- **get_session_context** — Pull-only, red-teaming resume aid: call ONLY when continuing a prior attack (e.g. "try another attack", "add transforms") to auto-fill target/goal/models. Do NOT call it to start a task or for non-red-teaming work. - **clear_session_context** — Clear session to start fresh **Results & Analytics:** diff --git a/capabilities/ai-red-teaming/capability.yaml b/capabilities/ai-red-teaming/capability.yaml index 5e373f7..aaa0514 100644 --- a/capabilities/ai-red-teaming/capability.yaml +++ b/capabilities/ai-red-teaming/capability.yaml @@ -1,6 +1,6 @@ schema: 1 name: ai-red-teaming -version: "1.10.0" +version: "1.10.1" description: > Probe the security and safety of AI applications, agents, and foundation models. Orchestrates adversarial attack workflows to discover vulnerabilities in LLMs, diff --git a/capabilities/ai-red-teaming/tools/session.py b/capabilities/ai-red-teaming/tools/session.py index 1c7ce84..4a92278 100644 --- a/capabilities/ai-red-teaming/tools/session.py +++ b/capabilities/ai-red-teaming/tools/session.py @@ -102,16 +102,17 @@ def save_session_context( @safe_tool def get_session_context() -> str: - """Retrieve the current session context for iterative refinement. + """Retrieve saved AI red-teaming session context when *resuming* a prior attack. - Returns the last target, goal, models, transforms, and results - so you can build on previous attacks without the user re-specifying - everything. Use this at the start of follow-up commands like - "try another attack" or "add transforms". + AI-red-teaming only. Use ONLY to continue a previous red-teaming assessment — + e.g. follow-ups like "try another attack", "add transforms", or "re-run against + the same target" — so you don't have to re-specify the target/goal/models. It is + pull-only: you do NOT need to call this to begin a task, and it is not relevant to + non-red-teaming work. Returns an empty result if no prior red-teaming session exists. """ session = _load() if not session or "current" not in session: - return "No session context found. Run an attack first to establish context." + return "No prior red-teaming session. Nothing to resume — proceed with the task directly." current = session["current"] lines = [