Skip to content

[AIGTWY-4573] Use a static SP token for the managed integration job - #667

Closed
david-siqi-liu wants to merge 1 commit into
mainfrom
david/AIGTWY-4573-managed-mint-error
Closed

david-siqi-liu wants to merge 1 commit into
mainfrom
david/AIGTWY-4573-managed-mint-error

Conversation

@david-siqi-liu

@david-siqi-liu david-siqi-liu commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

What did you change, and why?

The managed integration jobs (Managed config · Claude/Codex) minted a service-principal OAuth
token against the managed e2e workspace from the CI runner. The workspace RBAC-denies that
(403 RBAC: access denied) even though the identical credentials mint fine from a trusted network,
so it is a network-conditional access policy on token issuance, not a code or IP-ACL problem.

Switch the managed job to pass a long-lived service-principal token directly as DATABRICKS_BEARER
(exactly how the existing e2e workspace's bearer already works), so nothing is minted on the runner.

  • .github/workflows/integration.yml: the managed job now reads secrets.E2E_ADMIN_BEARER instead
    of the client-credential secrets.
  • scripts/run_integration.py: also surface the mint failure detail (status, Server header, body)
    so any future mint failure names its cause instead of a bare "Forbidden". The runner-side mint path
    stays for workspaces that permit it.

Requires a new E2E_ADMIN_BEARER secret: a long-lived SP token for
eng-ml-agent-platform.staging, generated from a trusted network. The E2E_ADMIN_SP_CLIENT_ID and
E2E_ADMIN_SP_CLIENT_SECRET secrets become unused by CI.

How do you know it works?

Validated by the next Managed config run: with the bearer, the job skips the runner-side mint and
calls the workspace directly. If the workspace allows API calls from runners (as the us-east-1 e2e
workspace does), the managed cases run; if the same policy also blocks API calls from runners, the
run now says so clearly via the surfaced error. The managed jobs are non-blocking, so this cannot
gate merges either way.

This pull request and its description were written by Isaac.

The managed integration jobs minted a service-principal OAuth token against the managed e2e
workspace from the CI runner, which the workspace RBAC-denies (403 "RBAC: access denied") even
though the same credentials mint fine from a trusted network. Switch the job to pass a long-lived
service-principal token as DATABRICKS_BEARER (as the existing e2e workspace already does), so no
token is minted on the runner. Needs an `E2E_ADMIN_BEARER` secret; the `E2E_ADMIN_SP_CLIENT_ID`
/`E2E_ADMIN_SP_CLIENT_SECRET` secrets are no longer used by CI.

Also surface the token-mint failure detail (status, Server header, body) in run_integration, so any
future mint failure names its cause instead of a bare "Forbidden".

Co-authored-by: Isaac <no-reply@databricks.com>
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-managed-mint-error branch from b0f7cfb to 4d03220 Compare September 16, 2026 02:41
@david-siqi-liu david-siqi-liu changed the title [AIGTWY-4573] Surface the managed token-mint failure detail in integration runs [AIGTWY-4573] Use a static SP token for the managed integration job Sep 16, 2026
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