mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[GH-ISSUE #33] Fork does not reseed guest entropy or session state — forked children are not cryptographically independent #13
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Billy1900 on GitHub (Jul 28, 2026).
Original GitHub issue: https://github.com/kvcache-ai/AgentENV/issues/33
Summary
fork_sandbox clones a running sandbox into N children from a single memory/disk snapshot. The only per-child differentiation applied before boot is the sandbox_id written into MMDS metadata. No mechanism reseeds guest entropy, rotates in-guest session tokens, or re-provisions credentials for the forked children — every sibling boots from a byte-identical cloned snapshot configuration.
Verified in code
Why this matters
Firecracker's own snapshotting documentation states that restoring the same snapshot into multiple VMs produces guests with identical PRNG state, and instructs integrators to reseed guest entropy after restore as a mandatory step. AgentENV's fork() performs exactly this operation — restoring one snapshot into multiple running VMs — and, per the code cited above, does not perform that reseed step at any layer: not in the orchestrator, not in the Firecracker sandbox backend, and not via any guest-side hook (envd receives no reseed payload on fork).
This is directly relevant to AgentENV's stated use case of parallel agent rollouts, where forked sandboxes are expected to behave as independent attempts from a shared checkpoint. Any value a forked child generates that depends on guest randomness available prior to the fork point — session identifiers, nonces, temporary credentials — is a candidate for correlation or reuse across siblings, consistent with the exact hazard Firecracker's documentation warns about. I have not independently measured guest RNG output across live AgentENV forks in this report; the finding here is that no code path exists to mitigate the documented hazard, which we consider sufficient to warrant investigation before this pattern is relied on for isolation-sensitive workloads.
Suggested direction
Introduce a mandatory reseal step between fork and the child transitioning to Running: reseed guest entropy (e.g., via a vsock-delivered payload consumed by envd at boot), invalidate and rotate any session tokens issued before the fork, and re-run credential provisioning where applicable. We encountered this same class of issue while building Arbor (https://github.com/Billy1900/Arbor) and would be glad to share our design or contribute a proof-of-concept if useful.
@yingdi-shan commented on GitHub (Jul 28, 2026):
Thanks for the detailed report.
We agree this is a real issue rather than only a theoretical hardening concern. Forked children can resume with identical guest RNG state, which may affect random-dependent runtime behavior and means the children are not cryptographically independent.
We intend to address this, but first need to evaluate the available reseeding mechanisms and their performance impact. Thanks again for raising this and for offering to share Arbor’s approach.
@Billy1900 commented on GitHub (Jul 28, 2026):
Sure thing. If you have the plan and need support, I would like to join in the plan.
@Bnjoroge1 commented on GitHub (Sep 12, 2026):
Following on this. Any update? Would love to see this supported
@Billy1900 commented on GitHub (Sep 12, 2026):
it seems like they do not. It depends on your needs.