Skip to content

feat(ai-red-teaming): guardrail hook to block CLI/shell provisioning (ENG-8477), release 1.16.2 - #145

Merged
rdheekonda merged 1 commit into
mainfrom
fix/airt-block-cli-provisioning
Sep 15, 2026
Merged

rdheekonda merged 1 commit into
mainfrom
fix/airt-block-cli-provisioning

Conversation

@rdheekonda

Copy link
Copy Markdown
Contributor

Summary

Addresses the guardrail part of ENG-8477. The provisioning-and-lifecycle skill tells the agent to provision only via the provision_environment tool and to never run dreadnode env ... in a shell. Skill prose is advisory - a weaker driver model (qwen-3.7-max in the report) can ignore it and fall back to the CLI.

This adds a structural guardrail: a ToolStart hook that inspects shell tool calls (bash, shell, sh, python, ...) and, if the command matches dreadnode|dn env[ironment], denies the call before it runs and redirects the agent to provision_environment. The runtime turns RetryWithFeedback(tool_call_id=...) into a [POLICY DENIED] tool result and skips the real execution, so the model cannot fall through to the shell.

Scope is deliberately narrow (only environment-provisioning CLI), so legitimate shell/dn airt usage is unaffected.

Changes

  • hooks/block_cli_provisioning.py - the guardrail hook
  • capability.yaml - register the hook; bump 1.16.1 -> 1.16.2
  • tests/test_block_cli_provisioning.py - unit tests (blocks provisioning variants, allows benign shell + dn airt, ignores non-shell tools and the real provision_environment)

Notes

  • This complements the tool-registration fix in 1.16.0/1.16.1 (which removed the loop that caused the fallback). Together: 1.16.x makes provision_environment available and prevents the CLI fallback if the model still tries.
  • RetryWithFeedback.tool_call_id requires a modern runtime SDK (2.0.4x, which prod runs); on older SDKs the field is ignored and the feedback is injected as a user message - the tool is still blocked either way.

Test plan

  • pytest tests/test_block_cli_provisioning.py - 4 passed
  • load_capability shows v1.16.2, hook block_cli_provisioning loaded, 0 degraded components, provision_environment still registered (37 tools)

…rovisioning (ENG-8477)

The provisioning-and-lifecycle skill tells the agent to provision only via the
provision_environment tool and never via `dreadnode env` in a shell, but skill
prose is advisory - a weak driver can ignore it and fall back to the CLI. Add a
ToolStart hook that structurally enforces the rule: shell tool calls
(bash/shell/python/...) whose command matches `dreadnode|dn env[ironment]` are
denied before execution and redirected to provision_environment (via
RetryWithFeedback, which the runtime turns into a [POLICY DENIED] tool result).
Bump to 1.16.2.
@rdheekonda
rdheekonda merged commit 61ec18c into main Sep 15, 2026
4 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