langshell

Execute stateful Python or TypeScript code in a sandbox with capability-scoped side effects.

2|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/ldclabs/langshell --skill langshell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: langshell
Source: https://github.com/ldclabs/langshell/tree/main
Command: npx skills add https://github.com/ldclabs/langshell --skill langshell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates unsafe and over-permissioned tool use by letting AI agents run multi-step Python or TypeScript logic inside a persistent sandbox where all side effects are gated by explicitly registered capabilities.

Core Features & Use Cases

  • Stateful session execution: Keep variables, caches, and helper functions across turns via persistent sessions.
  • Capability-scoped external access: Read/write files, fetch HTTP, and query databases only through host-registered functions (e.g., read_text, write_text, fetch_json).
  • Pre-run validation and safe error handling: Use validate/dry-run to catch unsupported features, unknown tools, and permission issues before side effects.
  • Structured results: Prefer returning JSON-serializable objects to produce reliable RunResult output for downstream systems.

Use case example: In an agent workflow that must transform data end-to-end, use LangShell to fetch approved JSON, filter and aggregate it, write a sanitized report into an authorized mount, and return a compact summary object.

Quick Start

Use the langshell skill to compute a safe, structured result and call only approved capabilities by writing Python or TypeScript code that assigns the final value to result.

Frequently Asked Questions about langshell

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run sandboxed code for AI agents with controlled file and HTTP access?

To run sandboxed code for AI agents with controlled access, use a persistent execution environment that gates side effects through explicitly registered capabilities like read_text, write_text, and fetch_json. This enforces capability-scoped access for safe multi-step computation.

What is capability-scoped execution for multi-step agent workflows?

Capability-scoped execution is a sandboxing mechanism that requires AI agents to discover registered tools and comply with validation rules before performing side effects, ensuring deterministic multi-step computation with controlled access to files, HTTP endpoints, and databases.

Can I maintain session state and variables across multiple turns in a Python or TypeScript sandbox?

Yes, you can maintain session state across multiple turns by using persistent sandboxed execution. This allows AI agents to keep variables, caches, and helper functions available throughout the same session for continuous multi-step data transformation.

How do I validate agent tool calls and catch permission errors before code execution?

You can validate agent tool calls and catch permission errors before execution by using a pre-run dry-run validation step. This process identifies unsupported features, unknown tools, and permission issues before any side effects occur in the sandbox.

What is the best way to return structured JSON results from sandboxed agent code?

The best way to return structured JSON results from sandboxed agent code is to assign the final computed value to a result variable, ensuring the output is JSON-serializable and produces a reliable RunResult object for downstream systems to consume.

Are there limitations when using a persistent sandbox for agent workflows?

Limitations of a persistent sandbox include strict enforcement of capability-scoped access, meaning agents cannot execute unregistered tools or perform unapproved side effects, and all results must adhere to serialization rules for structured result capture.