docs(sandbox): add Sandbox concept section#2851
Draft
agent-of-mkmeral wants to merge 1 commit into
Draft
Conversation
Document the sandbox feature as a new section under Concepts, alongside Tools and Plugins. Covers configuring a sandbox, the tools each sandbox vends (sandbox_bash, sandbox_file_editor), the built-in Docker and SSH sandboxes, driving a sandbox directly (including streaming), how the agent runtime and sandbox relate, building a custom sandbox from PosixShellSandbox, and the security boundary. Python is inlined; TypeScript lives in sibling snippet files included via --8<-- directives. All code verified against SDK source and the snippets typecheck against the built TypeScript SDK.
Contributor
Author
|
@mkmeral draft PR is up for the sandbox docs. New Sandbox concept section modeled on Tools/Plugins, covering the abstraction, the vended tools ( Verified the works: TS snippets typecheck against the built SDK, all APIs checked against |
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.
Description
Adds a Sandbox concept section to the docs, modeled on the existing Tools and Plugins sections. It documents the sandbox feature end to end: what a sandbox is, the tools each sandbox vends, the built-in backends, driving a sandbox from your own code, how the pieces fit together, and how to build a custom one.
Why now. The sandbox abstraction (
Sandbox,PosixShellSandbox,DockerSandbox,SshSandbox) and the sandbox-routed vended tools (sandbox_bash,sandbox_file_editor) shipped in both SDKs, but there was no conceptual page tying them together. A developer who seesAgent(sandbox=...)had nowhere to learn what it does, when to reach for it, or how the host fallback differs from a real isolation boundary.Page structure
NotASandboxLocalEnvironmentfallbacksandbox_bash/sandbox_file_editor, plus the same-name override ruleexecute, the file helpers, and streaming outputPosixShellSandbox(one method) vs. extendingSandbox, and vending tools viaget_tools/getToolsLands as a top-level Sandbox entry under Concepts in
navigation.yml, between Plugins and Interventions.Related Issues
Documents the sandbox feature shipped across the Python and TypeScript SDKs. No tracking issue in this repo.
Documentation PR
This is the documentation. New files under
site/src/content/docs/user-guide/concepts/sandbox/:index.mdx: the page (Python inlined, TypeScript via--8<--snippet includes)index.ts: runnable TypeScript snippet bodiesindex_imports.ts: matching import setsType of Change
Documentation update
Testing
TypeScript snippets typecheck. Built the TypeScript SDK (
strands-ts) and rantsc --noEmitfromsite/test-snippets. The sandbox snippets pass; the only error is a pre-existing, unrelatedpinomodule-resolution failure inlogs.tsonmain.Code verified against SDK source. Every API in the page was checked against
strands-py/src/strands/sandbox/andstrands-ts/src/sandbox/, and Python signatures were confirmed by introspection (DockerSandbox/SshSandboxconstructors,Agent(sandbox=...),get_tools()returningsandbox_file_editor+sandbox_bash,ExecutionResult/FileInfofields).Full site build passes.
npm run buildrenders the page: snippet includes resolve (no leftover--8<--markers), the mermaid diagram and both language tabs render, and frontmatter validates against the content collection schema.Voice and style gate. Ran the docs-reviewer checks: no em-dashes, no emoji, no banned phrases, terminology matches the lock file, and code examples are self-contained and claim-accurate.
I ran
hatch run prepare(docs-only change; not applicable)Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.