Repository navigation
fix(sandbox): scope Daytona snapshots by account - #465
Closed
pawxnsingh wants to merge 1 commit into
Closed
pawxnsingh wants to merge 1 commit into
pawxnsingh wants to merge 1 commit into
Conversation
pawxnsingh
requested review from
bhaveshpatel640,
chiragjn,
debajyoti-truefoundry,
heerambavi1998,
sr07asthana and
thesujai
as code owners
August 27, 2026 01:38
🦋 Changeset detectedLatest commit: b4070e9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Author
|
Closing this PR because the change is outside the scope of our hackathon product work. Sorry for the noise. |
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
Daytona snapshot names are global, while TrueForge previously derived the snapshot build name from only the sandbox image digest. Two Daytona accounts using the same TrueForge image therefore converged on the same name, which could resolve to another account's inaccessible snapshot and return Access denied.
This scopes the derived name to both the Daytona credential and image digest using HMAC-SHA256. The credential is used only as the HMAC key and is never serialized into the snapshot name.
No maintainer approval or tracking issue is linked yet.
Changes
How was this tested?
pnpm --filter @truefoundry/trueforge-core exec jest --config jest.config.cjs packages/trueforge-core/tests/core/sandbox/daytonaSnapshotRegistration.test.ts --runInBand— 5 tests passed.pnpm --filter @truefoundry/trueforge-core typecheck— passed.Checklist
.env.exampleupdated if configuration or behavior changed (not applicable: no configuration shape changed)Note
Medium Risk
Changes sandbox snapshot registration naming on the Daytona provider path; deployments without a persisted build_ref may register under a new name and need a fresh build, but the fix addresses real cross-account snapshot collisions.
Overview
Daytona snapshot names are global, so TrueForge previously derived
trueforge-build-*names from the sandbox image digest alone. Different Daytona accounts sharing the same TrueForge image could collide on that name and hit another account’s snapshot (e.g. Access denied).This PR mixes the Daytona API key into derivation via HMAC-SHA256 over the digest (key material never appears in the name). Replicas with the same credential and image still get one deterministic name; omitted
buildRefnow resolves to a 40-character hex suffix instead of the raw digest. Persistedbuild_refbehavior is unchanged.Tests assert the new name shape and that different API keys produce different registration names; a patch changeset documents the fix.
Reviewed by Cursor Bugbot for commit b4070e9. Bugbot is set up for automated code reviews on this repo. Configure here.