Skip to content

feat(core): Implement Sandboxed Execution (ENH-001)#25

Merged
nadeem4 merged 1 commit into
mainfrom
feature/enh-001-sandboxed-execution
Jan 13, 2026
Merged

feat(core): Implement Sandboxed Execution (ENH-001)#25
nadeem4 merged 1 commit into
mainfrom
feature/enh-001-sandboxed-execution

Conversation

@nadeem4
Copy link
Copy Markdown
Owner

@nadeem4 nadeem4 commented Jan 13, 2026

This pull request introduces a robust sandboxing architecture for SQL execution and schema indexing, significantly improving crash isolation and reliability for the NL2SQL engine. The main changes include the addition of a global process pool manager for sandboxed execution, updates to the executor node to offload query execution to isolated processes, and documentation updates to reflect the new architecture and its operational invariants.

Sandboxed Execution Architecture

  • Added SandboxManager in nl2sql/common/sandbox.py to manage two global process pools: one for latency-sensitive SQL execution and another for high-throughput schema indexing. This ensures that unsafe operations (driver segfaults, OOMs) are isolated from the main application.
  • Updated settings in nl2sql/common/settings.py to configure the number of workers for both execution and indexing pools via environment variables.

Executor Node Refactor

  • Refactored the ExecutorNode in nl2sql/pipeline/nodes/executor/node.py to offload SQL execution to the sandboxed process pool. This includes re-instantiating adapters inside worker processes and handling worker crashes (segfaults, OOMs) with improved error reporting and safeguards. [1] [2] [3] [4]

Documentation and Architectural Updates

  • Revised README.md to describe the new multi-plane architecture (Control, Security, Data), sandboxed execution, and system invariants such as "No Unvalidated SQL" and "Zero Shared State".
  • Updated technical documentation in docs/core/architecture.md, docs/core/nodes.md, and docs/core/indexing.md to detail the sandboxed execution model, process pool isolation, and how indexing and query execution are offloaded. [1] [2] [3]
  • Clarified the phased rollout of sandboxing in the ADR for sandboxed execution (ADR-001_sandboxed_execution.md).

Adapter SDK Update

  • Minor update to the SQLAlchemy adapter to store connection arguments explicitly, supporting better process isolation.

- Added
l2sql.common.sandbox for Process Pool management
- Refactored ExecutorNode, PhysicalValidatorNode, and OrchestratorVectorStore to use isolated pools
- Updated README.md and Architecture Docs
- Added ADR-001
@nadeem4 nadeem4 merged commit 21b1f22 into main Jan 13, 2026
1 check passed
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