Exclude @internal items from load --format json-full by default#874
Merged
Conversation
… default json-full is an inspection format, but every framework integration (Vite, Next.js, Cloudflare, Expo) shells out to exactly this command to get its injected config, then reuses the result as-is - so an @internal secret-zero credential (e.g. a service-account token) could reach client bundles and SSR runtime code, defeating the whole point of @internal. Only varlock run was actually safe, since it builds its own blob with includeInternal: false from the start. Add --include-internal to load (mirroring run's existing flag) for local debugging, and default json-full to excluding internal items like every other output format already does. Since no integration passes --include-internal, this fixes all of them without touching a single integration package.
Contributor
|
The changes in this PR will be included in the next version bump.
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
varlock-website | 8d2a377 | Commit Preview URL Branch Preview URL |
Jul 09 2026, 07:42 PM |
commit: |
theoephraim
added a commit
that referenced
this pull request
Jul 9, 2026
…longside this PR Removes the "known gap" caution about framework integrations not enforcing @internal exclusion - #874 fixes that at the CLI level (load --format json-full excludes internal items by default), so every integration inherits the guarantee with no code changes of their own. Both PRs are being merged together.
5 tasks
theoephraim
added a commit
that referenced
this pull request
Jul 11, 2026
…longside this PR Removes the "known gap" caution about framework integrations not enforcing @internal exclusion - #874 fixes that at the CLI level (load --format json-full excludes internal items by default), so every integration inherits the guarantee with no code changes of their own. Both PRs are being merged together.
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.


Summary
varlock load --format json-fullunconditionally included@internalitems (with real, unredacted values) - an inspection-format design choice that's fine for a human debugging locally, but every framework integration (Vite, Next.js, Cloudflare, Expo) shells out to exactly this command to fetch its config and reuses the result as-is for what gets injected into the app. That meant an@internalsecret-zero credential (e.g. a service-account token) could reach client bundles and SSR runtimeprocess.env/ENV, defeating the entire purpose of@internal.varlock runwas never affected - it builds its own blob withincludeInternal: falsefrom the start, independent ofload.--format json-fullto exclude@internalitems, matching every other output format (json,env,shell). Added--include-internaltoload(mirroringrun's existing flag) for local debugging when you deliberately want to see an internal item's value.--include-internal, this fixes Vite, Next.js, Cloudflare, and Expo without touching a single integration package - the leak was entirely upstream of them.Test plan
bun run --filter varlock typecheckbunx vitest runinpackages/varlock(939 tests passing)bun run lint:fixbun run --filter varlock-website astro buildsmoke-tests/tests/cli.test.ts) confirming--format json-fullexcludes@internalby default and includes it (flagged) with--include-internal- both pass against the built CLI@internal @sensitiveitem: absent from defaultjson-fulloutput, present with--include-internal