Make unattended runs possible today, and show one running - #38
Merged
Conversation
ivanvyd
force-pushed
the
docs/positioning-after-cli-ask
branch
from
August 5, 2026 18:24
47c1742 to
4fc24e6
Compare
`databricks auth token` states plainly that M2M is unsupported, so a service principal cannot be brokered through the CLI. Implementing the client-credentials flow inside LakeSpeak would make it a credential broker, which is precisely what delegating auth was meant to avoid. The documented alternative needs no code. Databricks' M2M endpoint mints a token that the existing DATABRICKS_TOKEN path already accepts, so CI works now: docs/authentication.md carries the exact call, verified against Databricks' published flow rather than written from memory. Four caveats travel with it, because the ones that bite are not obvious. The token lasts an hour with no refresh, so it is minted immediately before the run and a long-running process cannot use it. The service principal sees only what it is granted and does not inherit the author's access. The token is never echoed. And the recipe is documented, not exercised live by this project -- said in the doc rather than left to be assumed. The GitHub Actions example ships under examples/ rather than .github/workflows/, because a live one here would need a real workspace's secrets in a public repository and would bill a warehouse on a cron. It pins its actions by commit for the same reason this repository's own workflows do: a moved tag in a workflow holding workspace credentials is someone else's code running with your secrets. It also closes on the two decisions worth making before using it -- that a committed report puts governed data wherever the repository is readable, and that exit 0 does not mean every answer was useful, since Genie can answer with a clarifying question.
ivanvyd
force-pushed
the
docs/service-principal-and-scheduled-pack
branch
from
August 5, 2026 18:41
aa43f19 to
b0cbd12
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #37, which is stacked on #36. Review those first; GitHub retargets this as each
merges.
Unattended runs work now, with no new auth surface
databricks auth tokenstates it plainly: "This command only works with U2M authentication. M2Mauthentication using a client ID and secret is not supported." So a service principal cannot be
brokered through the CLI, and a scheduled Question Pack was left needing someone's personal access
token.
Implementing the client-credentials flow inside LakeSpeak would make it a credential broker —
exactly what delegating authentication was meant to avoid, and what makes the security story short
enough to be credible.
The documented alternative needs no code. Databricks' M2M endpoint mints a token that the existing
DATABRICKS_TOKENpath already accepts:Verified against Databricks' published M2M flow (endpoint, parameters, and the
expires_in: 3600response) rather than written from memory — that check was the point of listing it as an assumption
in the plan rather than a fact.
Four caveats travel with it in the docs, because the ones that bite are not the obvious ones:
the token lasts an hour with no refresh, so it is minted immediately before the run and no
long-running process can use it; the service principal sees only what it is granted and inherits
nothing from you; the token is never echoed; and the recipe is documented, not exercised live by
this project.
A scheduled run you can copy
examples/github-actions/daily-brief.yml— installs the tool, mints and masks the token, runs thepack, commits the report.
It lives under
examples/and not in.github/workflows/. A live one here would need a realworkspace's secrets in a public repository and would bill a SQL warehouse on a cron.
It pins its actions by commit, matching this repository's own workflows. A moved tag in a
workflow holding workspace credentials is someone else's code running with your secrets, and an
example that taught otherwise would be worse than no example.
It closes on the two decisions worth making before using it: a committed report puts governed data
wherever the repository is readable — an artifact with a retention policy is often better — and
exit
0does not mean every answer was useful, because Genie can reply with a clarifying questionand that is a successful message.
Verification
224 tests pass. The docs-contract test from #36 picked up the new
lakespeak pack runexampleautomatically and parses it — the suite went from 82 to 83 cases without anyone wiring it up, which
is the behaviour that test was added for. The workflow parses as valid YAML. All relative markdown
links across the repository resolve.