fix(ai-red-teaming): register provision_environment and generate_agentic_suite_attack as tools (ENG-8467) - #143
Merged
Conversation
…tic_suite_attack as tools (ENG-8467)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes ENG-8467. In the
ai-red-teamingcapability,provision_environment(and, found by a systematic variant scan,generate_agentic_suite_attack) were defined without the registration decorator. Dreadnode's capability loader (_discover_python_tools) only registers module attributes that areToolinstances (@tool/@safe_tool) orToolsetinstances — a bare function is silently dropped with no error.As a result, agents following the shipped skills and agent prompt hit:
on the first step of every hosted-target run (
ml-extraction-*,*-mesh), and the documented "run all possible attacks" path (generate_agentic_suite_attack) shipped with no executable tool. The skillprovisioning-and-lifecycleexplicitly forbids the CLI fallback ("provision_environmentis the only supported path"), so the workflow was hard-blocked.Root cause
tools/environments.py—provision_environmentlacked@safe_tool(its siblingslist_environments/teardown_environmenthave it). Introduced undecorated in236a798e; fixesa0b356b(fix(ai-red-teaming): recover cleanly from transient tool errors + right endpoint per target (ENG-8427) #141) and172e429(fix(ai-red-teaming): resolve bare task names across accessible orgs + steer off the CLI (ENG-8434) #142) referenced it by name without verifying registration.tools/attacks.py—generate_agentic_suite_attacklacked@safe_tooldespite being documented as a first-class tool inagents/ai-red-teaming-agent.md.Changes
tools/environments.py@safe_toolonprovision_environment; not-found task now returns a plainError:string with the resolution hint instead of raising (keptraisefor non-not-found sosafe_tool's transient-retry still applies); comment markingteardown_session_environmentsas intentionally not a tool; note documenting the test coupling at the lazyTaskEnvironmentimporttools/attacks.py@safe_toolongenerate_agentic_suite_attacktests/test_tool_surface.py(new)skills/error-troubleshooting/SKILL.md<org>/<name>automatically" claim — the tool does not auto-retry, and qualification does not bypass the visibility rulecapability.yaml1.15.0→1.16.0(two tools added to the public tool surface; repo convention bumps on every change)Tests
tests/test_tool_surface.py— four-layer coverage:provision_environmentandgenerate_agentic_suite_attackare registeredToolinstances with the expected names — fails pre-fix, passes post-fix (verified via stash).allowed-toolsname must resolve to a registeredToolor be explicitly allowlisted as platform-provided (PLATFORM_PROVIDED_TOOLS— the 5trace-analysis-advisoranalytics tools). Catches both the missing-decorator class and documented-but-implemented-nowhere phantom tools.Error:string with hint (never raises); other failures → formattedError:string viasafe_tool(never a traceback).load_capabilitydiscovery path registers both tools.Verification performed
provision_environment+generate_agentic_suite_attackregistered asToolinstances; fails on pre-fix tree (loader drops both), passes post-fix.origin/main(sandbox lacks~/.dreadnode/airt/my-org/other-wsscaffold,attack_runnerimage assertion vs installed SDK, missingpytest-asyncioplugin). Note: CI (ci.yml) runs ruff + YAML only; capability tests are author-owned and were run locally (pytestunder Python 3.13 + SDK editable).E9,F63,F7,F82: pass. The only E/F/W findings in the touched modules are 2 pre-existing (E402attacks.py:29, F541environments.py:359), both in untouched code. New test file is ruff-clean andruff format-clean.capability.yamlvalidation: pass.tools/*.py): the only two instances are fixed here; remaining public-undecorated defs are intentional helpers used by@tool_methods or assessment plumbing.Follow-ups (out of scope for this PR)
skills/trace-analysis-advisor/SKILL.mddocuments 5 tools (analyze_attack_effectiveness,suggest_optimal_transforms,predict_attack_success,identify_vulnerability_patterns,get_historical_metrics) that exist nowhere in the repo or SDK — documented placeholders for a platform ClickHouse analytics service. Now surfaced by the new invariant viaPLATFORM_PROVIDED_TOOLS; either the platform should expose them or the skill should be updated.Test plan