Skip to content

fix(ai-red-teaming): resolve bare task names across accessible orgs + steer off the CLI (ENG-8434) - #142

Merged
rdheekonda merged 3 commits into
mainfrom
fix/eng-8434-provision-fallback
Sep 9, 2026
Merged

rdheekonda merged 3 commits into
mainfrom
fix/eng-8434-provision-fallback

Conversation

@rdheekonda

Copy link
Copy Markdown
Contributor

Problem (ENG-8434, reporter: Corch X)

With full traces on, the agent (weaker model, deepseek-v4-flash) shells out to the dreadnode env CLI to provision and guesses syntax — dreadnode env provision … (no such verb) then dreadnode env create ml-extraction-fraud-tabular404. Root cause: a bare task name resolves only within the caller's org, but bundled targets are owned by another org (dreadnode/ public catalog), so from a learner workspace (aisf-learner-aug-2026) it 404s.

Fix (capability — model-agnostic prevention)

  • provision_environment now resolves the owning org on a bare-name 404 and retries qualified as <org>/<name>, via _resolve_task_owner:
    • Efficient: one list_tasks(caller_org, search=name, include_public=True) call covers the common case (public catalog + caller org) in a single request.
    • Covers private cross-org: only if that misses does it fan out to the user's other accessible orgs (list_user_organizations), stopping at the first exact-name match — so a private task in an org the user belongs to also resolves. (Per reviewer/Corch note about private, cross-org targets.)
    • Safe: ambiguous names prefer the public catalog, else bail so the caller qualifies explicitly; org-qualified refs never fall back.
  • Agent prompt: never shell out to dreadnode env; always use provision_environment; bare public/bundled names work directly.

Bumps capability 1.14.0 → 1.15.0.

Tests

5 resolver tests (public hit / private-member fan-out / not-found / ambiguous→public / exact-name-only); full env suite 32 passed.

Companion PR

The dreadnode env CLI itself gets the provision alias + the same public fallback in tiger #2452 (that fixes the exact CLI path in the report; this makes the agent prefer the tool and resolves across the user's accessible orgs).

… steer off the CLI (ENG-8434)

Weaker models shell out to 'dreadnode env' and guess syntax, then hit a 404
because a bare task name resolves only within the caller's org. provision_environment
now resolves the owning org on that 404 and retries qualified as <org>/<name>:

- _resolve_task_owner: one list_tasks(caller_org, search, include_public=True) call
  covers the common case (public 'dreadnode/' catalog + caller org); only if that
  misses does it fan out to the user's other accessible orgs (covering a PRIVATE
  task in a member org), stopping at the first exact-name match. Ambiguous names
  prefer the public catalog, else bail so the caller qualifies explicitly.
- Agent prompt: never shell out to 'dreadnode env'; always use provision_environment;
  bare public/bundled names work directly.

Bumps capability 1.14.0 -> 1.15.0. 5 resolver tests (public hit / private-member
fan-out / not-found / ambiguous / exact-name-only); full env suite 32 passed.
…ardrails (ENG-8434)

Prod analysis of the aisf-learner-aug-2026 org (48h) showed the friction is
concentrated in the provision -> run -> teardown lifecycle: 76% of provisions used
bare task names (the ENG-8434 404), env-status was polled after teardown (top 4xx
class), and ~30% of sandboxes were never explicitly torn down. The tool layer
already resolves refs, picks endpoints, retries transients, and auto-tears-down;
the gap is agent KNOWLEDGE, so this adds a loadable playbook rather than a new tool.

- New skills/provisioning-and-lifecycle/SKILL.md: provisioning decision tree,
  bare-name resolution (never self-org-qualify a bundled task), endpoint-per-target
  map, teardown/billing, transient-vs-fatal interpretation (incl. 'a 404 on
  env-status = gone, stop polling'), ASR display, attribution.
- error-troubleshooting: added Provisioning & Sandbox Errors subsections
  (task-404, env-status-404, endpoint mismatch, billing, Note: vs Error:).
- agent md: register the skill in the lazy-load hint.
- environments.py: teardown_note now states teardown fires once every planned
  attack is recorded (pass or fail) and to reap explicitly on abandon; surfaces
  AIRT_ENV_TEARDOWN_GRACE_SEC.

Env test suite 32 passed.
…ill (ENG-8434)

Parity with the CLI simplification on tiger #2452, after review + prod evidence
showed a client-side task resolver cannot fix a real 404. The backend visibility
rule already resolves a bare name to a task in the caller's org OR any public
task, and the cross-org guard blocks a private task even when qualified as
<org>/<name>. So the retry was dead code: a public task never 404s bare, and a
private cross-org task 404s identically on the retry. Prod confirms bare-name
env creates already succeed (aisf org: mnist 16, fraud 16, imdb 13, no errors).

- Remove _resolve_task_owner (it was also wrongly wrapped in @safe_tool).
- provision_environment no longer retries; on a task-not-found it raises a clear
  hint (bare = your org or any public task; else qualify as <org>/<name>).
- Correct the provisioning-and-lifecycle skill Section 2 and the agent prompt so
  they no longer claim the tool resolves/retries internally.

Tests: dropped 5 resolver unit tests; env suite 27 passed.
@rdheekonda
rdheekonda merged commit 172e429 into main Sep 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant