Skip to content

feat: add Vercel Sandbox backend#17445

Merged
kshitijk4poor merged 2 commits into
mainfrom
salvage/vercel-sandbox-17127
Apr 29, 2026
Merged

feat: add Vercel Sandbox backend#17445
kshitijk4poor merged 2 commits into
mainfrom
salvage/vercel-sandbox-17127

Conversation

@kshitijk4poor

@kshitijk4poor kshitijk4poor commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Salvage of #17127 by @scotttrinh — cherry-picked onto current main to avoid stale-branch regressions.

What this PR does: Adds Vercel Sandbox as a supported Hermes terminal backend alongside existing providers (Local, Docker, Modal, SSH, Daytona, Singularity). Uses the Vercel Python SDK to create/manage cloud microVMs, supports snapshot-based filesystem persistence keyed by task_id, and integrates with the existing BaseEnvironment shell contract and FileSyncManager for credential/skill syncing.

Why salvage was needed

The original PR was 115 commits behind main. Its gateway/run.py diff included 128 lines of unrelated deletions that would silently revert ~12 recently-merged features (platform connect timeout, cfg_get migration, tilde expansion, docker bridges, progress bubble reset, curator cron tick, etc.).

Changes from original PR

Commit 1 (cherry-pick by @scotttrinh):

  1. gateway/run.py: Only the 1 Vercel-specific line (vercel_runtime bridge) — all stale-branch regressions discarded
  2. cleanup(): Always stop sandbox after snapshot (was skipped on success), matching Modal/Daytona patterns to prevent resource leaks
  3. test_web_server.py: Replace snapshot-style runtime assertion with behavioral check
  4. status.py: Clean unused cfg_get import after conflict resolution
  5. Preserved all existing tests (TildeExpansion, doctor provider aliases)

Commit 2 (self-review follow-up):

  1. Add vercel_sandbox to hardline blocklist container bypass test
  2. Add vercel_sandbox to skills_tool remote backend parametrize test
  3. Deduplicate runtime set: doctor.py and setup.py now import _SUPPORTED_VERCEL_RUNTIMES from terminal_tool.py (was hardcoded 5×)
  4. Add docstring to _run_bash explaining timeout/stdin_data discards
  5. Update security.md: container bypass text, production tip, comparison table
  6. Update environment-variables.md: TERMINAL_ENV list, Vercel auth vars, TERMINAL_VERCEL_RUNTIME
  7. Update inline comments in cli.py and config.py to include vercel_sandbox

Test results

  • 111 Vercel-focused + hardline blocklist tests: ✅ all passed
  • 7890 total tests passed in broader suite run (45 pre-existing failures, 0 new)

Adds Vercel Sandbox as a supported Hermes terminal backend alongside
existing providers (Local, Docker, Modal, SSH, Daytona, Singularity).

Uses the Vercel Python SDK to create/manage cloud microVMs, supports
snapshot-based filesystem persistence keyed by task_id, and integrates
with the existing BaseEnvironment shell contract and FileSyncManager
for credential/skill syncing.

Based on #17127 by @scotttrinh, cherry-picked onto current main.
@github-actions

Copy link
Copy Markdown
Contributor

🚨 CRITICAL Supply Chain Risk Detected

This PR contains a pattern that has been used in real supply chain attacks. A maintainer must review the flagged code carefully before merging.

🚨 CRITICAL: Install-hook file added or modified

These files can execute code during package installation or interpreter startup.

Files:

hermes_cli/setup.py

Scanner only fires on high-signal indicators: .pth files, base64+exec/eval combos, subprocess with encoded commands, or install-hook files. Low-signal warnings were removed intentionally — if you're seeing this comment, the finding is worth inspecting.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have backend/vercel Vercel Sandbox terminal backend comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 29, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Salvage of #17127 with stale-branch regressions resolved. Prior PR should be closed in favor of this one.

@alt-glitch

Copy link
Copy Markdown
Collaborator

Salvage of #17127

- Add vercel_sandbox to hardline blocklist container bypass test
- Add vercel_sandbox to skills_tool remote backend parametrize test
- Deduplicate runtime set: doctor.py and setup.py now import
  _SUPPORTED_VERCEL_RUNTIMES from terminal_tool.py
- Add docstring to _run_bash explaining timeout/stdin_data discards
- Always stop sandbox during cleanup (unconditional, matching Modal/Daytona)
- Update security.md: container bypass text, production tip, comparison table
- Update environment-variables.md: TERMINAL_ENV list, Vercel auth vars,
  TERMINAL_VERCEL_RUNTIME
- Update inline comments in cli.py and config.py to include vercel_sandbox
@github-actions

Copy link
Copy Markdown
Contributor

🚨 CRITICAL Supply Chain Risk Detected

This PR contains a pattern that has been used in real supply chain attacks. A maintainer must review the flagged code carefully before merging.

🚨 CRITICAL: Install-hook file added or modified

These files can execute code during package installation or interpreter startup.

Files:

hermes_cli/setup.py

Scanner only fires on high-signal indicators: .pth files, base64+exec/eval combos, subprocess with encoded commands, or install-hook files. Low-signal warnings were removed intentionally — if you're seeing this comment, the finding is worth inspecting.

@scotttrinh scotttrinh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good! 🏆

@kshitijk4poor kshitijk4poor merged commit 13c2383 into main Apr 29, 2026
11 of 13 checks passed
@kshitijk4poor kshitijk4poor deleted the salvage/vercel-sandbox-17127 branch April 29, 2026 14:22
kylemclaren added a commit to kylemclaren/hermes-agent that referenced this pull request May 22, 2026
Several cross-cutting registrations only listed the prior sandboxed
backends (docker / singularity / modal / daytona / vercel_sandbox);
Sprites is also a remote, hardware-isolated sandbox and needs the same
treatment. Without this, the agent path on a Sprites backend hits false
dangerous-command approval prompts, leaks SPRITES_TOKEN to local-
backend subprocesses, and silently drops container_persistent overrides
from the code_execution_tool / file_tools dispatch paths.

- tools/approval.py: add "sprites" to both sandboxed-backend skip sets
  (the agent's command is running inside the Sprite, not on the host —
  same isolation guarantee as the other cloud backends).
- tools/environments/local.py: add SPRITES_TOKEN / SPRITE_TOKEN to the
  provider env blocklist so they are stripped from local-backend child
  process environments (matches the VERCEL_*, DAYTONA_API_KEY, and
  MODAL_TOKEN_* treatment).
- tools/skills_tool.py: add "sprites" to _REMOTE_ENV_BACKENDS so the
  skills tool routes its remote/local distinction correctly.
- tools/file_tools.py: add "sprites" to the container_config dispatch
  set so container_persistent: false can take effect through the
  file-tool code path.
- tools/code_execution_tool.py: same dispatch fix (I had removed it
  in 015e4fe5b on the grounds that sprites ignores CPU/memory/disk —
  but container_persistent IS honored).
- hermes_cli/web_server.py: add "sprites" to the dashboard's
  terminal.backend select-control options.

Surfaced by comparing this branch against NousResearch#17445
(the Vercel Sandbox backend PR), which had to make every one of these
registrations explicitly. Same audit applies here.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
kylemclaren added a commit to kylemclaren/hermes-agent that referenced this pull request May 22, 2026
Mirrors the placement vercel_sandbox got in PR NousResearch#17445:

- features/tools.md: row in the backend comparison table, "sprites"
  added to the backend-enum comment, and a dedicated "Sprites (Fly.io)"
  subsection covering install + auth, the hermes-{task_id} resume
  model, the restricted-token recommendation for CI / shared envs,
  the persistence semantics, and the "no sync-back, by design"
  rationale.
- security.md: container-bypass info note and production-tip
  paragraph both mention sprites; comparison table gains a row
  showing dangerous-command checks are skipped (because the Sprite
  is the security boundary).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend/vercel Vercel Sandbox terminal backend comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants