Skip to content

feat: add langchain deepagents backend integration#1

Open
johannhartmann wants to merge 4 commits intomainfrom
feat-langchain-deepagents-backend
Open

feat: add langchain deepagents backend integration#1
johannhartmann wants to merge 4 commits intomainfrom
feat-langchain-deepagents-backend

Conversation

@johannhartmann
Copy link
Copy Markdown
Member

  • What: Adds langchain-agent-sandbox integration package for LangChain DeepAgents, including adapter implementation, tests, and docs.

    • Why: Keeps LangChain/DeepAgents dependencies optional while enabling DeepAgents tooling for agent-sandbox users.
    • How:
      • Implements SandboxBackendProtocol with protocol-compliant error mapping.
      • Adds unit tests + gated e2e test (via LANGCHAIN_* env vars).
      • Adds agentic_sandbox[langchain] extra and README usage snippet.

    Testing

    • ruff check …
    • mypy (root mypy.ini)
    • bandit -r …
    • make test-langchain (optional, not run on CI unless configured)
    • Optional e2e: python -m pytest test/e2e/clients/python/test_e2e_langchain_backend.py with LANGCHAIN_* vars

@johannhartmann johannhartmann force-pushed the feat-langchain-deepagents-backend branch 2 times, most recently from a943354 to d750e34 Compare January 25, 2026 18:41
@johannhartmann johannhartmann force-pushed the feat-langchain-deepagents-backend branch 3 times, most recently from a52322f to d3df291 Compare February 7, 2026 13:47
@johannhartmann johannhartmann force-pushed the feat-langchain-deepagents-backend branch 2 times, most recently from 26dd56c to 015ad58 Compare February 11, 2026 09:22
@johannhartmann johannhartmann force-pushed the feat-langchain-deepagents-backend branch from f202be6 to f7f6921 Compare February 19, 2026 18:10
@johannhartmann johannhartmann force-pushed the feat-langchain-deepagents-backend branch 3 times, most recently from daeb330 to 4bdb0c4 Compare March 13, 2026 07:37
@johannhartmann johannhartmann force-pushed the feat-langchain-deepagents-backend branch from 4bdb0c4 to 09e0021 Compare March 24, 2026 12:52
Implement SandboxBackendProtocol for langchain-deepagents, providing
sandbox lifecycle management, file I/O, and code execution via the
k8s-agent-sandbox Python SDK.

- AgentSandboxBackend wrapping Sandbox handles for execute, read, write,
  edit, grep, glob, upload, and download operations
- Path virtualization under configurable root_dir with escape detection
- SandboxPolicyWrapper for path and command restrictions
- WarmPoolBackend for pre-warmed sandbox pod adoption
- create_sandbox_backend_factory for dependency-injected construction
- 57 unit tests covering backend lifecycle, file ops, and policies
- Makefile test-langchain target and test-unit CI registration

Signed-off-by: Johann-Peter Hartmann <johann-peter.hartmann@mayflower.de>
End-to-end test exercising the LangChain backend against a kind
cluster: execute, write, read, edit, grep, glob, upload, and download.
Includes module-level skip guard when langchain-agent-sandbox is not
installed.

Updates dev/tools/test-e2e to install langchain-agent-sandbox in the
e2e test virtual environment.

Signed-off-by: Johann-Peter Hartmann <johann-peter.hartmann@mayflower.de>
Example application demonstrating the LangChain backend with sandbox
templates, skills definitions, and a kind cluster test script.

Includes README for the langchain-agent-sandbox package with usage
examples for direct sandbox, template-based, and warm pool modes.

Signed-off-by: Johann-Peter Hartmann <johann-peter.hartmann@mayflower.de>
@johannhartmann johannhartmann force-pushed the feat-langchain-deepagents-backend branch from 09e0021 to b5d2233 Compare April 3, 2026 15:33
…vior

Fix _to_internal() rejecting valid filenames starting with '..' (e.g.
'..foo') by tightening the escape check to match only '..' or '../'.

Propagate actual exception messages in read() errors instead of a
generic 'not found' message.

Use grep -Z for null-byte filename delimiters to correctly handle
filenames containing colons, with a fallback to colon splitting.

Preserve partial find results when non-zero exit codes come from
permission errors on individual subdirectories.

Use find -L to follow symlinks so symlinked directories are classified
correctly in glob_info().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant