Skip to content

fix(skills): replace nonexistent auth can-i with --check-scopes - #885

Merged
discostu105 merged 1 commit into
Dynatrace:mainfrom
VfourTwenty:fix/879-skills-no-auth-can-i
Dec 4, 2026
Merged

discostu105 merged 1 commit into
Dynatrace:mainfrom
VfourTwenty:fix/879-skills-no-auth-can-i

Conversation

@VfourTwenty

Copy link
Copy Markdown
Contributor

Description

the skill tells agents to run dtctl auth can-i <verb> <resource> before mutating anything, but that command doesn't exist. dtctl auth only has login/logout/refresh/status/whoami, so auth can-i ... prints the auth help and exits 0, and in agent mode it returns {"ok":true,"result":null}. an agent following the skill gets no answer and can read it as a pass

  • Updated skills/dtctl/SKILL.md (Permissions & safety) to point at --check-scopes on the exact command. it prints required vs granted scopes and exits without running it: ok, insufficient_scope (exit 5), or unknown when dtctl can't verify (token scopes not readable, no context, apply since its scopes depend on the file, exec api when the API spec has no scope for the path)
  • Added --dry-run where the command's --help lists it (it's per-command since fix!: make --dry-run opt-in per command #561) and dtctl create settings ... --validate-only as the preview options, plus a note that none of these applies the safety level
  • Updated the same line in skills/dtctl/references/troubleshooting.md (401/403 section), which the issue didn't mention
  • Didn't touch docs/dev/API_DESIGN.md, the auth can-i line came from there but check_prose.py skips docs/dev/ since it describes proposed commands

i went with pointing at the existing flags instead of adding auth can-i, since --check-scopes already checks the exact invocation including flag-dependent scopes. can switch if you'd rather have the command)

  • check_prose.py already catches this when pointed at skills/, but make docs-check only runs it on docs/. can open a follow-up for that if useful

Related Issues

Closes #879

Testing

  • python3 scripts/gen-docs/check_prose.py ./bin/dtctl skills: on main it reports the two auth can-i lines (dtctl auth has no subcommand 'can-i'), with this change it's clean. same script on docs: clean
  • go test ./cmd -run 'Skill|CheckScopes|DryRun' and go test ./pkg/skills/...: pass
  • make markdownlint: clean
  • ran what the skill now names against a local build: --check-scopes on create settings and apply, create settings --dry-run, and --dry-run on get slos (exits 2, no dry run there)
  • Tests pass (make test)
  • Linting passes (make lint)

@VfourTwenty
VfourTwenty requested review from a team and discostu105 as code owners December 4, 2026 13:05

@discostu105 discostu105 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Pointing at --check-scopes is the better choice than adding an auth can-i: it checks the exact invocation, including scopes that depend on flags. I checked the claims against main: the ok / insufficient_scope (exit 5) / unknown statuses come from cmd/check_scopes.go, and --validate-only exists on create settings.

Nits, none blocking:

  • The SKILL.md bullet is now one ~120-word sentence chain in a file every agent loads. Consider splitting it into 2–3 sub-bullets: scopes, preview, safety level. Agents skim bullets better than run-ons.
  • Yes to the follow-up that runs check_prose.py on skills/ in make docs-check. That gap is how auth can-i got into the skill.

@discostu105
discostu105 merged commit c0fb227 into Dynatrace:main Dec 4, 2026
14 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.

Skill recommends dtctl auth can-i, which does not exist in 0.47.0

2 participants