#23383: Skills: gate command-dispatch tool targets and args
docs
size: L
Cluster:
Tool and Plugin Enhancements
## Summary
- add `skills.commandDispatch` config with `allowTools`, `maxArgLength`, and `requireStructuredArgsTools`
- enforce skill `command-dispatch: tool` policy checks before tool execution (default-deny high-risk targets)
- add dispatch-policy unit tests and inline-action integration tests
- document command-dispatch security controls in skills docs
## Security behavior
- default blocked tool targets for skill command dispatch: `exec`, `system.run`, `nodes.run`, `gateway/*`
- explicit allowlist support via `skills.commandDispatch.allowTools`
- argument-size guard via `skills.commandDispatch.maxArgLength`
- optional JSON-object arg enforcement for selected tools via `skills.commandDispatch.requireStructuredArgsTools`
## Validation
- `pnpm test src/auto-reply/skill-command-dispatch-policy.test.ts src/auto-reply/reply/get-reply-inline-actions.skill-command-dispatch.test.ts src/config/config.skills-entries-config.test.ts`
- `pnpm test:e2e src/agents/skills.e2e.test.ts -t "includes tool-dispatch metadata from frontmatter"`
- `pnpm exec oxfmt --check docs/tools/skills-config.md docs/tools/skills.md src/auto-reply/reply/get-reply-inline-actions.skill-command-dispatch.test.ts src/auto-reply/reply/get-reply-inline-actions.ts src/auto-reply/skill-command-dispatch-policy.test.ts src/auto-reply/skill-command-dispatch-policy.ts src/config/config.skills-entries-config.test.ts src/config/schema.help.ts src/config/schema.labels.ts src/config/types.skills.ts src/config/zod-schema.ts`
## Notes
- `pnpm check` is currently blocked by existing unrelated format issues in `docs/gateway/security/index.md`.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds security controls for skill `command-dispatch: tool` invocations with a default-deny policy for high-risk tools (`exec`, `system.run`, `nodes.run`, `gateway/*`). The implementation introduces three configuration options under `skills.commandDispatch`:
- `allowTools`: explicit allowlist that overrides the default denylist
- `maxArgLength`: caps argument size (default 4000 chars)
- `requireStructuredArgsTools`: enforces JSON object arguments for specified tools
The changes integrate cleanly into the existing skill command execution flow in `get-reply-inline-actions.ts`, applying policy checks before tool execution and returning user-friendly error messages when blocked.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The implementation is well-designed with comprehensive test coverage for the security policy logic, proper schema validation, thorough documentation updates, and follows secure defaults (deny-by-default for high-risk tools). The pattern matching logic correctly handles wildcards and edge cases, and the integration preserves existing behavior while adding the new security layer.
- No files require special attention
<sub>Last reviewed commit: 17a5cbd</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#23758: Skills: gate deterministic dispatch with allowTools
by bmendonca3 · 2026-02-22
91.9%
#23743: Auto-reply: enforce tools.allow/tools.deny on deterministic skill t...
by bmendonca3 · 2026-02-22
83.0%
#23754: Skills: enforce capability manifest requirements
by bmendonca3 · 2026-02-22
78.4%
#8075: fix(skills): add --ignore-scripts to all package managers
by yubrew · 2026-02-03
76.5%
#16244: feat(gateway): add session files API and external skill management
by wanquanY · 2026-02-14
75.2%
#23413: Skills: gate remote eligibility expansion behind explicit opt-in
by bmendonca3 · 2026-02-22
75.0%
#8150: fix(skills): block dangerous environment variables from skill config
by yubrew · 2026-02-03
74.5%
#23749: fix some issues
by tronpis · 2026-02-22
74.5%
#22198: fix(skills): treat empty allowBundled array as block-all
by haitao-sjsu · 2026-02-20
74.1%
#17502: feat: normalize skill scanner reason codes and trust messaging
by ArthurzKV · 2026-02-15
74.1%