Skip to content

ci(smoke): authenticate guardrail CLI against Alpha - #2227

Merged
apetraru-uipath merged 1 commit into
mainfrom
codex/guardrail-cli-alpha-auth
Jul 23, 2026
Merged

ci(smoke): authenticate guardrail CLI against Alpha#2227
apetraru-uipath merged 1 commit into
mainfrom
codex/guardrail-cli-alpha-auth

Conversation

@apetraru-uipath

Copy link
Copy Markdown
Contributor

What changed?

  • Replace the PR smoke workflow's client-credentials CLI auth with the existing Alpha bot-user ROPC helper already used by the nightly workflow.
  • Mount the standard UiPath auth file into the smoke image.
  • Fail setup early unless both uip login status and uip agent guardrails list succeed.

This PR changes only .github/workflows/smoke-skills.yml. It does not modify tests, task definitions, guardrail skills, review skills, docs, or Maestro files.

Why?

The previous service-account token could authenticate successfully but lacked the user-only access required by the agentsruntime_ guardrail definitions endpoint, causing guardrail catalog/list calls to return 401. The Alpha bot-user flow includes the required user scopes and was validated by the live pipeline on #2219.

How has this been tested?

Are there any breaking changes?

  • None
  • Yes

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Claude finished @apetraru-uipath's task in 2m 47s —— View job


PR Review: ci(smoke): authenticate guardrail CLI against Alpha

  • Gather context and read review criteria
  • Read the full diff
  • Read existing PR conversation
  • Read full changed file and related configs for surrounding context
  • Check for secrets, tokens, or personal paths
  • Post review findings

Summary

Replaces the smoke workflow's inline client_credentials token mint (curl + tenant resolution + env-var auth) with the existing ROPC bot-user helper (refresh-auth.sh) already used by the nightly workflow. Adds a preflight Docker step that asserts both uip login status and uip agent guardrails list succeed, failing early with a clear error instead of letting every guardrail task fail independently. Net removal of ~38 lines of brittle inline shell.

Change-by-Change Review

1. .github/workflows/smoke-skills.yml — Auth step replacement

Severity: OK (with two advisory notes below)

The new env block (lines 371–380) exactly mirrors the nightly workflow's ROPC step (run-coder-eval.yml:219-230) — same secret names, same refresh-auth.sh invocation. The preflight container (lines 387–394) mounts ~/.uipath:/.uipath:rw and runs both uip login status and uip agent guardrails list with set -eu, which correctly fails the step on either command's non-zero exit. This is a clean, well-motivated change.

Advisory notes (not blocking):

  1. Stale env_passthrough_extra in tests/experiments/smoke.yamlsmoke.yaml:22-27 still lists UIPATH_CLI_ENABLE_ENV_AUTH, UIPATH_CLI_AUTH_TOKEN, and the four UIPATH_CLI_ORGANIZATION_*/UIPATH_CLI_TENANT_* vars for passthrough into Docker containers. These env vars are no longer set in $GITHUB_ENV after this PR, so the entries are inert dead config. Auth is now file-based via the mounted ~/.uipath/.auth. This won't break anything (Docker just skips unset passthrough vars), but cleaning up smoke.yaml would prevent confusion for future maintainers about which auth mechanism is active.

  2. Stale redaction target — The "Redact secrets from eval report" step (line 482) still references "UIPATH_CLI_AUTH_TOKEN" for artifact scrubbing. After this PR, that env var is never set, so the entry silently no-ops. The ROPC access token now lives in ~/.uipath/.auth as UIPATH_ACCESS_TOKEN and is unlikely to leak into report artifacts (the file is mounted into sandboxes, not echoed), but the redaction list should ideally match the actual auth mechanism. Low risk given the mount path and Docker isolation.

What's Missing

  • tests/experiments/smoke.yaml cleanup — Dead env_passthrough_extra entries for the removed env-var auth should be cleaned up (ideally in this PR or a fast follow-up). See advisory note 1.
  • Otherwise nothing — this is a tightly scoped CI-only change with no impact on tests, task definitions, skills, or docs.

Area Ratings

Area Status Notes
Frontmatter N/A No skill files changed
E2E Tests N/A No test files changed
Skill Body N/A No skill files changed
References & Assets N/A No reference or asset files changed
Repo Hygiene OK No secrets, tokens, or personal paths. Change is scoped to the workflow file. Nightly parity confirmed.

Issues for Manual Review

  • Verify that the UIPATH_ROPC_CLIENT_ID, UIPATH_ROPC_CLIENT_SECRET, UIPATH_BOT_USERNAME, and UIPATH_BOT_PASSWORD secrets are configured in the repository's Actions settings (they are already used by the nightly workflow, so this should be the case).
  • Confirm the TRACES_SMOKE_PROCESS_KEY env var is still reachable by smoke tasks that need it — it was previously exported to $GITHUB_ENV by the old auth step but is no longer. The smoke.yaml experiment passes it through via env_passthrough_extra (line 28), so it would need to be in the runner's environment. The "Run smoke tests" step doesn't set it in its env: block. If any smoke-tagged task references this variable, it will be empty. (The traces tasks appear to be e2e-tagged, not smoke, so this is likely fine.)

Conclusion

Clean, well-motivated change that aligns the smoke workflow with the proven nightly ROPC flow. The diff is a net simplification and the preflight assertion is a good practice. Approve — the two advisory notes about stale smoke.yaml passthrough entries and stale redaction targets are low-priority cleanup, not blockers.


|

@apetraru-uipath
apetraru-uipath force-pushed the codex/guardrail-cli-alpha-auth branch from f1b0e49 to 9b9ae77 Compare July 23, 2026 13:41
@uipreliga

Copy link
Copy Markdown
Collaborator

Code review — multi-model (Gemini 3 · GPT-5.3-Codex · Opus)

Reviewed the auth-strategy swap in smoke-skills.yml (client_credentials UIPATH_CLI_* env auth → ROPC bot login via refresh-auth.sh + .auth mount + fail-fast docker run). Findings below are synthesized across three reviewers and independently verified. Comment-only — nothing changed.

🔴 Blockers (secret hygiene — both cheap to fix)

1. Minted token is no longer masked, and the fail-fast prints CLI auth state to the run log
smoke-skills.yml:381-394 — The old step did echo "::add-mask::$TOKEN". The new path mints the token inside refresh-auth.sh with no ::add-mask:: anywhere, so the token is unmasked for the whole job. The fail-fast then runs uip login status --output json and uip agent guardrails list --output json straight to the console log. If login status emits the token it leaks in clear text; even if it doesn't today, losing the mask is a hygiene regression.
::add-mask:: the UIPATH_ACCESS_TOKEN/UIPATH_REFRESH_TOKEN after refresh-auth.sh, and/or redirect the fail-fast commands to /dev/null (they're run for exit code, not output).

2. Report-redaction step scrubs a var that no longer exists, and misses the one that does
smoke-skills.yml:481-487 — The names tuple keys on UIPATH_CLI_AUTH_TOKEN, which this PR stops setting (filtered out by the len(...) >= 8 guard → dead no-op). The real credential now lives in the mounted ~/.uipath/.auth as UIPATH_ACCESS_TOKEN/UIPATH_REFRESH_TOKEN (:rw into every sandbox). Those names are not redacted, so if a task cats /.uipath/.auth or a uip error echoes the token, it ships unredacted in the uploaded task.log/task.json/*.html artifacts (14-day retention).
→ Add UIPATH_ACCESS_TOKEN/UIPATH_REFRESH_TOKEN (sourced from ~/.uipath/.auth) to the names tuple; drop the dead UIPATH_CLI_AUTH_TOKEN entry.

🟡 Low — cleanup / follow-ups

  • Dead passthrough configtests/experiments/smoke.yaml:20-27 still lists UIPATH_CLI_ENABLE_ENV_AUTH, UIPATH_CLI_AUTH_TOKEN, UIPATH_CLI_ORGANIZATION_*, UIPATH_CLI_TENANT_* under env_passthrough_extra. The workflow no longer sets any of them → forwards nothing. Harmless no-op; prune for clarity (or note deferred).
  • TRACES_SMOKE_PROCESS_KEY no longer exported to $GITHUB_ENVno active regression (both consumers traces_e2e.yaml:7 / traces_feedback_e2e.yaml:8 are e2e-tagged; smoke runs --tags smoke). Latent only if those tasks are ever run here. Consider a one-line comment or re-adding the export.
  • Fail-fast relies on implicit image HOME=/smoke-skills.yml:387-394, mount target is absolute /.uipath, so uip finds /.uipath/.auth only if HOME=/. Matches the proven nightly mount, so likely fine; worth confirming HOME is baked into the coder-eval-agent image rather than set at sandbox launch.
  • Stale task proselowcode_review_guardrail_action_ineffective.yaml:13, lowcode_review_guardrail_unknown_validator.yaml:10 still say the runner passes UIPATH_CLI_* auth; now delivered via the .auth mount. Docs only.

✅ False positive discarded

  • "Redaction step raises KeyError on the unset UIPATH_CLI_AUTH_TOKEN" — incorrect. values = [os.environ[name] for name in names if len(os.environ.get(name, "")) >= 8]: the .get()-length guard evaluates first, so the unset var is filtered before os.environ[name] is ever indexed. No crash.

👍 Positives (all three reviewers)

  • Genuine simplification (77→39 lines): removed the run_uip_with_tenant wrapper, the tenant-list round trip, and the embedded Python.
  • Fail-fast exercises the real auth path (same ~/.uipath:/.uipath:rw mount tasks use), so a green check reflects what tasks see.
  • Correct scope rationale — guardrail discovery needs user scopes (StudioWebBackend) a client_credentials token lacks.
  • DRY with nightly (run-coder-eval.yml) via the shared refresh-auth.sh; atomic auth-file write (umask 077 + temp + mv -f); version-sync safe (UIPATH_CLI_DISABLE_VERSION_SYNC=1 baked in the image).

Verdict

Solid, well-motivated refactor that fixes the guardrail 401s and simplifies the step. Recommend addressing the two secret-hygiene blockers before merge; the rest are low-priority cleanups.

🤖 Multi-model review via /code-review (Gemini 3, GPT-5.3-Codex, Opus 4.8).

@apetraru-uipath
apetraru-uipath merged commit beeba18 into main Jul 23, 2026
15 checks passed
@apetraru-uipath
apetraru-uipath deleted the codex/guardrail-cli-alpha-auth branch July 23, 2026 15:25
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.

3 participants