Skip to main content

Sunder

An agentic zero-trust sandbox testing framework for enterprise codebases.

Overview

Sunder operates in two sequential phases to guarantee deep logic penetration without being blocked by surface-level authentication or state requirements. It utilizes a Baseline Mode for state seeding and an Adversarial Mode for chaos fuzzing and logic assertions.

Key Features:

Sunder was built to prioritize comprehensive test coverage, absolute host protection, and language agnosticism without exposing production environments to LLM hallucinations.

  • Zero-Trust Copy-on-Run Architecture: Mounts host codebases strictly as Read-Only (ro) and uses an in-memory tar stream to extract files into an ephemeral container workspace. This guarantees host protection while mimicking a physical project tree.
  • Relational AST Retrieval (Blast-Radius Context): Abandons traditional vector search in favor of Tree-sitter AST parsing and an in-memory SQLite database. This instantly maps exact call graphs, providing the LLM with the Target function, its Children (for accurate mocking), and its Parents (for input mimicry).
  • Two-Phase State Seeding: Overcomes surface-level authentication blockers. A Baseline Phase explicitly generates happy-path tests along with setup code to capture required state (e.g., valid JWTs, mock database IDs) before injecting them into the Adversarial Phase for deep logic fuzzing.
  • Evaluator-Optimizer Loop: Prevents context-window bloat and endless hallucination loops. A dedicated Evaluator node intercepts massive, raw Docker stack traces from failed runs and distills them into concise, actionable feedback for the Coder node.
  • Sandbox Config: Enforces default architectural containment (network_mode="none"), requiring explicit human opt-in via the TUI to configure resource limits (RAM, CPU, execution timeouts), inject environment variables, or allow external API routing.

High-Level Architecture

Sunder Architecture Diagram

For a detailed breakdown of the execution flow, component responsibilities, and architecture patterns, please read ARCHITECTURE.md.

Execution Flow

  1. State Seeding: The user defines a target function. The Knowledge Layer retrieves the context, and the Baseline Agent writes a "Happy Path" test. Upon a clean exit, the Evaluator extracts mock IDs and valid JWTs to save to the Environment State.
  2. Adversarial Attack: The Orchestrator injects the seeded state. The Adversary Agent studies the Parent context (usage patterns) and weaponizes it to fuzz the target with mutated inputs.
  3. Isolated Execution: The Sandbox runs the payload under specified constraints.
  4. Evaluation: The Evaluator declares a vulnerability if a hard crash (500/OOM) or silent logic flaw (AssertionError) occurs. Otherwise, it loops back to generate a new attack vector until the retry limit is reached.

Project Structure

sunder/
├── src/
│   └── sunder/
│       ├── schema.py                   # Pydantic models for state management
│       ├── client/                     # TUI and UX components
│       │   ├── app.py                  # Main Textual application
│       │   ├── config_panel.py         # Sandbox configuration UI
│       │   ├── credentials_modal.py    
│       │   ├── dashboard.py            # Telemetry and reporting
│       │   ├── hitl_search.py          # Target function search
│       │   └── model_picker.py         # LLM selection modal
│       ├── execution/                  # Docker sandbox layer
│       │   ├── bootstrapper.py         # Docker environment setup
│       │   └── sandbox.py              # Container execution logic
│       ├── knowledge/                  # AST parsing and retrieval
│       │   ├── context_manager.py  
│       │   ├── database.py             # SQLite AST storage
│       │   ├── ingestion.py            # Tree-sitter parsing
│       │   ├── retrieval.py            # Context fetching
│       │   └── queries/                # Language-specific AST queries
│       │       ├── python/
│       │       ├── typescript/
│       │       ├── rust/
│       │       └── ... (20+ language directories)
│       └── orchestration/              # LangGraph agent logic
│           ├── orchestrator.py         # State machine and nodes
│           └── prompts.py              # LLM prompt templates
├── tests/                              # Test suite
│   ├── test_e2e_polyglot.py
│   ├── test_execution_layer.py
│   ├── test_knowledge_layer.py
│   └── test_orchestration_layer.py
├── pyproject.toml                      # Python project configuration
├── README.md

Installation & Setup

Sunder is distributed as an isolated Python application via pipx.

pipx install sunder-cli

Prerequisites

Before using Sunder, you must have Docker installed and the Docker Daemon actively running in the background. Sunder's bootstrapper relies on the local daemon to dynamically build the isolated sandboxes.

Usage & API Keys (BYOK)

Sunder is strictly a local tool and operates on a Bring Your Own Key (BYOK) architecture.

  1. Launch the Application: Open your terminal in the root of your configured enterprise repository and type sunder to start the TUI.
  2. Configure Credentials: Upon your first launch, press the [p] hotkey to open the Model Picker. Here, you can input your LLM API keys into the credentials modal. These keys are saved securely and locally to your machine.

Repository Configuration

To use Sunder on your enterprise repository, you must create a configuration directory at the root of your project.

  1. Create a .sunder/ folder in the root of your target repository.
  2. Add a Dockerfile inside the .sunder/ folder to define your test environment.

Important Note regarding the Dockerfile

The Dockerfile must not contain any COPY statements for your source code. Sunder utilizes a secure copy-on-run architecture; it will automatically ingest your repository, filter it using your .gitignore, and extract it securely into the container at runtime.

Example .sunder/Dockerfile

FROM python:3.11-alpine
RUN pip install pytest
# Do NOT include COPY commands for your code.
# Do NOT define an ENTRYPOINT or CMD.

Licence

This project is licensed under the MIT Licence.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sunder_cli-0.1.1.tar.gz (219.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sunder_cli-0.1.1-py3-none-any.whl (54.2 kB view details)

Uploaded Python 3

File details

Details for the file sunder_cli-0.1.1.tar.gz.

File metadata

  • Download URL: sunder_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 219.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for sunder_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 78d72e60a7c8a4e73920c09ff1912e5b0e6b621f46d7d56d81e8c64782b2f666
MD5 1b53d1fcc773f05a3961b5c30ad77958
BLAKE2b-256 d00aa826b5af1aefa9b7d8b3035f26f68de1c4bf2d12428bcdd41e8c91efa01c

See more details on using hashes here.

File details

Details for the file sunder_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sunder_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 54.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for sunder_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 89dc09a9b0fd556cdb601b70bbef4d93d6b557acbc9e9894ba0ecc727210f993
MD5 da57d045f751f306864eddd725c47741
BLAKE2b-256 597901341df341bd078ac236b99fb7e6cc06b1ce3c92879305db6183bdd6f5d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page