docs(commands): document reconnecting to a background command - #318
Open
beran-t wants to merge 1 commit into
Open
docs(commands): document reconnecting to a background command#318beran-t wants to merge 1 commit into
beran-t wants to merge 1 commit into
Conversation
| @@ -43,3 +43,71 @@ for stdout, stderr, _ in command: | |||
| command.kill() | |||
There was a problem hiding this comment.
🔒 Agentic Security Review
Severity: HIGH
The JavaScript example interpolates JSON.stringify(prompt) directly into a shell command. JSON.stringify is not shell-safe, so command substitution payloads like `...` or $(...) can still execute when the command is parsed by the shell.
If this documented pattern is reused in an API/serverless handler with attacker-controlled prompt, it can lead to arbitrary command execution in the sandbox job context.
Reviewed by Cursor Security Reviewer for commit 1fc014a. Configure here.
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
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.


Adds a "Reconnect to a background command" section to
docs/commands/background.mdxshowing how to start a long-running command in one process, persist the sandbox ID and process ID, and reattach from a separate process withcommands.connect(pid)andhandle.wait(). Includes both JavaScript/TypeScript and Python examples plus notes on redirecting output to a file, disabling the command timeout, and persisting the IDs.