dbwarden-sandbox
Safe declaration parsing and model loading for dbwarden.
dbwarden discovers configuration by scanning your project for database_config() calls. Files found at the project root are isolated: they are not part of any package, so importing them normally would execute arbitrary code found by a filesystem scan. This plugin parses those files without executing them.
Hooks
| Hook | Behavior |
|---|---|
load_config_module |
Rejects path traversal and paths outside the project tree, then parses literal database_config() declarations without executing the file. |
load_model_module |
Rejects path traversal. Model paths are user-declared in database_config(), so they import normally otherwise. |
sandbox_provider_start |
Starts a testcontainers database for the configured database_type (PostgreSQL, MySQL, ClickHouse) and returns the connection URL and container id. |
sandbox_provider_stop |
Tears down the running testcontainers database. |
An isolated config file may contain a docstring, from dbwarden import database_config, and direct database_config() calls with literal keyword values. Other code raises SecurityError; there is no environment-variable bypass. Config files that live inside your application package are imported normally, since they are already part of code you ship.
Installation
dbwarden plugin add dbwarden-sandbox
Trust tier
This is an official dbwarden plugin. Its distribution name is classified before any of its code is imported, and dbwarden plugin add verifies the PyPI Trusted-Publishing attestation (PEP 740) against dbwarden-org/dbwarden-sandbox before installing. It loads automatically once installed, with no dbwarden plugin trust step.
Development
uv venv && uv pip install -e . -e ../dbwarden pytest
pytest -q
The tests/test_conformance.py suite runs dbwarden's shared conformance harness (dbwarden.plugin_conformance): entry point resolution, no import-time side effects, hook signatures, public-API-only imports, and idempotent setup().
License
MIT
Release files for dbwarden-sandbox 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dbwarden_sandbox-0.2.1.tar.gz | 13.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dbwarden_sandbox-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.0 kB
Release files / dbwarden_sandbox-0.2.1.tar.gz
| Download URL | dbwarden_sandbox-0.2.1.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b7aea464b81ee1c5bbad8a3bd9bff209ae884184ad4c86d6ed226022faa9da1f
|
|
BLAKE2b-256 checksum How to use checksums |
21a0c656a3f86d6e2602b28b6fede02ae49e5bea9c5bd95f8a369ba11f3cde55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / dbwarden_sandbox-0.2.1-py3-none-any.whl
| Download URL | dbwarden_sandbox-0.2.1-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a35673f58639cd77dbb6a3bbdf47ebacc3d65318a0f575faff6afe4f7600dd0c
|
|
BLAKE2b-256 checksum How to use checksums |
360c2c4c353836c71cdca1f836e63d6ed213fb0c83c2354efffb316becec5e95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency log