maf-sandbox-terraform
Experimental. This package warns on import with
MafSandboxTerraformExperimentalWarning. Releases before 1.0 may change or remove APIs without notice.
Offline configuration validation for Terraform and OpenTofu, as a sibling of maf-sandbox-bicep. Not yet released; run from this workspace until the first package release.
The host calls make_terraform_tools(router, file_store, agent_id, context, engine="terraform", image=...). The accepted engine options are exactly terraform (default) and opentofu. They attach terraform_validate and opentofu_validate, respectively, with separate sandbox kinds. Each tool accepts files: list[str] and root_module: str = ".". No engine fallback or model-selected CLI flags are supported.
The tool stages the explicit manifest, runs init -backend=false -input=false -no-color, validate -json, and fmt -check -recursive -no-color, and returns separate validation and formatting verdicts. Initialization failure means validation is incomplete. Malformed or inconsistent reports never produce a pass. A supplied root .terraform.lock.hcl adds -lockfile=readonly; otherwise initialization may create a lock only inside that call's disposable guest. No files are written back to the store.
Include every configuration sibling in each selected directory, every local module, and referenced text assets. Select a root module containing at least one recognized configuration file. Relative paths preserve local references such as ../modules/child; uploads cannot contain .. segments. Terraform accepts .tf and .tf.json; OpenTofu also accepts .tofu and .tofu.json, with its native precedence. Terraform mode refuses .tofu files rather than silently validating an empty directory. The listing completeness check covers only files the host shares with this tool.
State, plans, variable files, CLI credential/configuration paths, plugin binaries, and reserved directories are refused. Files must be text and fit the core transfer limits (64 files, 8 MiB per file, 32 MiB total). Reads retain the listing's provenance and all reads and writes must succeed before execution begins. Guest results carry untrusted source integrity; fixed standing guidance is a separate item. When argument names contain hidden content, diagnostic prose and locations are withheld.
The spec requires POSIX, container isolation or stronger, closed egress, call isolation, and disposal. The host may configure a stronger router. The guest launcher clears inherited environment variables, uses a fixed filesystem provider mirror without a direct-install fallback, bounds combined CLI output to 128 KiB, and shares one deadline across CLI phases. exec_timeout_seconds defaults to 120 and accepts finite values in (0, 600]. Host execution allows an additional five seconds for transport and process cleanup. Cancellation waits for that bounded execution before core-owned disposal.
Provider validation executes native provider code. Expressions can read other guest files. Directory staging is not a confinement boundary: use a dedicated immutable image containing no credentials, host mounts, or sensitive content. This package does not support warm reuse, online dependency resolution, variable-dependent initialization, plan, apply, destroy, import, state commands, tests, or policy/security linting. A valid configuration does not establish that a deployment will succeed.
Build instructions, platform and dependency pins, and a runnable checkout example are in the image README. Python wheels contain no engine or provider binaries. The initial measured guest platform is Linux amd64 on Docker; ACAS and WSLC have not been verified for this workload. The kind guide describes the evidence and remaining work.
Release files for maf-sandbox-terraform 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| maf_sandbox_terraform-0.1.0.tar.gz | 10.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| maf_sandbox_terraform-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.5 kB
Release files / maf_sandbox_terraform-0.1.0.tar.gz
| Download URL | maf_sandbox_terraform-0.1.0.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
237f16afc2515a7db0d916fb365bbb17bbda53373a99e06572e5f1610fa48d34
|
|
BLAKE2b-256 checksum How to use checksums |
e9bc55e230832430dd63eca0e4026d546e2097788a7f94d036a7940772fc6b00
|
| 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 Sep 14, 2026.
Transparency logRelease files / maf_sandbox_terraform-0.1.0-py3-none-any.whl
| Download URL | maf_sandbox_terraform-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab6ced783d418e77db19861cef5bae717ca3ff0e04bd2ded00fd7e0dd01ab80a
|
|
BLAKE2b-256 checksum How to use checksums |
d3c0f3663e53adf831c1e65218ab1b5498c6a593b54e3b56ff6b633e98d1003c
|
| 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 Sep 14, 2026.
Transparency log