mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #127] [MERGED] feat(sandbox): add E2B-compatible secure sandbox support #196
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#196
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?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/127
Author: @LSX-s-Software
Created: 8/5/2026
Status: ✅ Merged
Merged: 8/14/2026
Merged by: @yingdi-shan
Base:
main← Head:feat/envd-access-token📝 Commits (4)
6c889d7feat(sandbox): generate envd access token for secure sandboxesdd45dddfeat(sandbox): generate envd access token seed when unconfigured244e2a5fix(sandbox): reject overriding reserved MMDS fields30340aefeat(sandbox): make shared access token seed optional📊 Changes
53 files changed (+1539 additions, -131 deletions)
View changed files
📝
Cargo.lock(+2 -0)📝
Cargo.toml(+2 -0)📝
config/default.toml(+6 -0)📝
crates/aenv/src/client/files.rs(+21 -3)📝
crates/aenv/src/client/mod.rs(+6 -2)📝
crates/aenv/src/client/sandboxes.rs(+31 -18)📝
crates/aenv/src/commands/connect.rs(+11 -8)📝
crates/aenv/src/commands/exec.rs(+2 -1)📝
crates/aenv/src/commands/start.rs(+23 -7)📝
crates/aenv/src/grpc/mod.rs(+36 -4)📝
deploy/k8s/base/agentenv-daemonset.yaml(+6 -0)📝
deploy/k8s/overlays/local-dev/kustomization.yaml(+10 -0)📝
docs/src/SUMMARY.md(+4 -0)📝
docs/src/concepts/sandboxes.md(+2 -0)📝
docs/src/configuration/env-vars.md(+1 -0)📝
docs/src/configuration/reference.md(+12 -0)📝
docs/src/deployment/docker-compose.md(+5 -0)📝
docs/src/deployment/kubernetes.md(+8 -0)📝
docs/src/deployment/pvm.md(+3 -0)📝
docs/src/deployment/static-multi-node.md(+4 -2)...and 33 more files
📄 Description
What
Introduce end-to-end support for E2B-compatible secure sandboxes. When a sandbox is created with
secure: true, AgentENV generates a sandbox-specific envd access token and enforces it across the complete sandbox lifecycle.securesandbox create field and returnenvdAccessTokenfrom create, get, connect, and fork responses.Why
AgentENV did not previously implement the E2B
securesandbox contract. Current E2B SDKs create secure sandboxes by default, so compatibility requires AgentENV to return an envd access token and enforce it transparently for SDK and CLI operations.Introducing secure support should not force existing or single-node users to add configuration before upgrading. AgentENV therefore creates and reuses a managed local seed when no explicit seed is supplied, while multi-node operators can configure one shared seed through their deployment secret mechanism.
Related issue
N/A - no linked issue.
Scope and non-goals
In E2B semantics,
secureauthenticates envd control communication. This PR does not add authentication to arbitrary application ports or implement cross-node sandbox migration. The install script remains unchanged.Design and behavior changes
/initreceives the token in bothX-Access-Tokenand the request body, matching envd's contract.false, so legacy sandbox records continue to restore as non-secure.$AENV_HOME/secrets/sandbox-access-token-hash-seed. The directory is0700, the file is0600, and malformed, unreadable, symlinked, or unexpectedly missing state fails instead of rotating silently.Compatibility and operations
securerequest fields and optionalenvdAccessTokenresponse fields. Omittingsecurepreserves the previous non-secure behavior.[sandbox].access_token_hash_seed/AENV_SANDBOX_ACCESS_TOKEN_HASH_SEED; single-node startup auto-generates a persistent seed when unset.securewith a legacy default offalse.$AENV_HOME/secrets/sandbox-access-token-hash-seedonce secure sandboxes exist; deleting or changing it invalidates their tokens.agentenv-runtime-secretsSecret; the local-dev overlay provides a test-only value.Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetSkipped checks and reasons:
make -C services testwas not run becauseservices/is unchanged.Risks and reviewer notes
src/sandbox/access.rsfor managed-secret durability, permissions, and concurrent startup behavior.Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.