skills/skills/langbot-testing/references/sandbox-skill-authoring.md
Verify that Local Agent can use sandbox tools to create, register, activate, and use a LangBot skill package through the same path a user would exercise in Debug Chat.
This flow applies to Docker, nsjail, and E2B backends. API calls are useful diagnostics, but the primary pass/fail signal is the model-driven Debug Chat tool sequence.
../.env and use LANGBOT_FRONTEND_URL and LANGBOT_BACKEND_URL.BOX_BACKEND=e2b when validating E2B.BOX_BACKEND=nsjail when validating nsjail.BOX_BACKEND=local or docker when validating local container fallback./api/v1/box/status reports available: true and the expected backend name.Do not store sandbox provider keys, JWTs, OAuth tokens, or localStorage values in the case or notes.
Use a unique skill name per run, for example:
lb-sandbox-agent-e2e-<timestamp>
Send a prompt that requires the model to do all of the following:
Use exec to create a multi-file skill under /workspace/<skill-name>.
Include at least:
SKILL.mdscripts/use.pydata/input.jsonIn the same first exec, run the script and verify a deterministic marker such as:
SANDBOX_COMPLEX_SKILL_OK sum=10 product=24
Call register_skill with path=/workspace/<skill-name>.
Call activate with skill_name=<skill-name>.
Call exec with workdir=/workspace/.skills/<skill-name> and run:
python3 scripts/use.py && echo SANDBOX_ACTIVATED_WRITEBACK_OK > activated_writeback.txt && cat activated_writeback.txt
Require the final answer to contain only an explicit success marker:
E2E_OK:<skill-name>
Keep the test script robust to working-directory changes. Prefer resolving data paths from __file__:
from pathlib import Path
data_path = Path(__file__).resolve().parent.parent / "data" / "input.json"
The UI should show an assistant final response containing E2E_OK:<skill-name>.
Backend logs should show:
exec tool invokedregister_skillactivateexec whose workdir is /workspace/.skills/<skill-name>backend=e2b, backend=nsjail, or the expected local backendAfter the run, verify the skill store through the UI or API:
SKILL.md, scripts, data, and activated_writeback.txt.scripts/use.py is readable.data/input.json is readable.activated_writeback.txt contains SANDBOX_ACTIVATED_WRITEBACK_OK./api/v1/box/errors is empty.The base sandbox-skill-authoring-e2e case only proves create, register,
activate, and use. To prove that an already activated skill can be modified,
run sandbox-skill-authoring-edit-existing-e2e or use its prompt pattern.
The edit variant must include these additional checks:
The second exec uses workdir=/workspace/.skills/<skill-name>.
The second exec overwrites SKILL.md, data/input.json, and
scripts/use.py under the activated skill path.
The modified script prints a deterministic marker such as:
SANDBOX_SKILL_MODIFIED_OK sum=11 product=56 marker=<updated-marker>
grep -q <updated-marker> SKILL.md scripts/use.py data/input.json succeeds
in the same activated-path command.
Filesystem evidence under the Box-managed skill store shows the updated marker, not only the original create marker.
If the model stops after activation and only reruns the original script, treat that run as a failed edit-existing E2E even when create/register/activate succeeded.
Use these only after the model-driven Debug Chat flow fails:
/api/v1/box/status to confirm backend selection and recent errors./api/v1/box/sessions to check leaked or conflicting sessions.For E2B raw HTTP diagnostics, include a valid template id such as base; a missing template can produce schema validation errors that are unrelated to authentication.
data/skills is the active source of truth./workspace; storing provider-internal paths can make later requests look incompatible.--disable_clone_new* flags and use --bindmount instead of --rw_bind.ALL_PROXY uses a SOCKS URL and socksio is not installed, some Python HTTP clients can fail during startup. Prefer consistent HTTP proxy variables unless SOCKS support is installed.sandbox-native-tools-unavailablee2b-extra-mount-sync-missingbox-session-conflict-logical-metadatansjail-cli-compatibilitysocks-proxy-without-socksio