Hardened Podman container runner with gate server and shield integration
Project description
terok-sandbox
The hardened-Podman runtime — terok-sandbox launches per-task containers with a credential vault, a gated git server, and an egress firewall.
What it provides
- Hardened container lifecycle — rootless Podman containers.
- Credential vault — long-lived secrets stay in an encrypted database on the host. The container receives short-lived phantom tokens and never sees the real credentials.
- Per-task git gate — a token-authenticated HTTP mirror of an arbitrary upstream git repository. Tasks clone and push through the gate, and the gate forwards to upstream automatically (online mode) or after operator review (gatekeeping mode).
- Shield firewall — installs the terok-shield OCI hooks at setup time and drives the firewall at runtime.
- Clearance in-supervisor — each container's supervisor hosts the terok-clearance hub, verdict server, and desktop notifier, so the operator can authorise blocked outbound connections live.
- Setup as one call — idempotent
terok-sandbox setupinstalls the shield + supervisor OCI hooks and provisions the encrypted credentials DB;terok-sandbox uninstallreverses it.
Where it sits in the stack
terok-sandbox is the boundary layer. Above it, single-task callers (terok-executor) and multi-task orchestrators (terok) treat the sandbox as a black-box "give me a hardened container." Below it, it composes terok-shield for egress filtering and terok-clearance for the operator-in-the-loop verdict path.
Public API
from terok_sandbox import (
# Lifecycle
Sandbox, SandboxConfig, RunSpec, VolumeSpec, Sharing,
# Runtime backends
PodmanRuntime, KrunRuntime, NullRuntime, ContainerRuntime,
# Vault + credentials
CredentialDB, SSHManager, NoPassphraseError, WrongPassphraseError,
# Gate
GateServer, GitGate, mint_gate_token,
# Shield adapter
ShieldManager, ShieldHooks, check_environment,
# Per-container wiring / setup state
write_sidecar, remove_container_state, sandbox_uninstall, needs_setup,
)
The full export list lives in
src/terok_sandbox/__init__.py.
CLI
| Command | Purpose |
|---|---|
terok-sandbox setup |
Install shield + supervisor OCI hooks, provision the credentials DB; idempotent |
terok-sandbox uninstall |
Reverse of setup |
terok-sandbox prepare / run / cleanup |
Wire a user-owned container into the sandbox services |
terok-sandbox doctor |
Run host-side sandbox health checks |
terok-sandbox vault … |
Vault status / unlock / lock / passphrase-tier management |
terok-sandbox gate … |
Git gate inspection (gate path <project>) |
terok-sandbox shield … |
Shield hooks install / status / direct control |
terok-sandbox ssh … |
Per-scope SSH key management in the credentials DB |
terok-sandbox credentials encrypt-db |
Encrypt (migrate) a plaintext credentials DB |
Requirements
- Linux with Podman (rootless, ≥ 5.6 recommended)
- systemd ≥ 257 — optional; backs the
systemd-credsvault passphrase tier (gate / vault / clearance run inside the per-container supervisor, no systemd units) - nftables (
nftbinary) — provided by terok-shield's runtime - D-Bus session bus — for the clearance notifier path; the system degrades gracefully when D-Bus is absent
- Python 3.12+
Installation
pip install terok-sandbox
For most users this dependency is pulled in transitively by
terok-executor or terok. Install it directly only when building
a custom orchestrator on top of the sandbox API.
License
Apache-2.0 — see LICENSES/Apache-2.0.txt.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file terok_sandbox-0.4.0.tar.gz.
File metadata
- Download URL: terok_sandbox-0.4.0.tar.gz
- Upload date:
- Size: 261.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99e51f07f4b0f74814ff472a8a04c8cda0c486f05c392e6ccd63dd2d25bc157c
|
|
| MD5 |
221f18d61e5537a22c03a183cdee22c8
|
|
| BLAKE2b-256 |
a5e51012e33bec7ad47797df7455b5f621a62f158a97627920f498f425f9fa01
|
Provenance
The following attestation bundles were made for terok_sandbox-0.4.0.tar.gz:
Publisher:
release.yml on terok-ai/terok-sandbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
terok_sandbox-0.4.0.tar.gz -
Subject digest:
99e51f07f4b0f74814ff472a8a04c8cda0c486f05c392e6ccd63dd2d25bc157c - Sigstore transparency entry: 2071830320
- Sigstore integration time:
-
Permalink:
terok-ai/terok-sandbox@47829ef7ae765ed6ce3a4ebf126fd90d7b8173e7 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/terok-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@47829ef7ae765ed6ce3a4ebf126fd90d7b8173e7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file terok_sandbox-0.4.0-py3-none-any.whl.
File metadata
- Download URL: terok_sandbox-0.4.0-py3-none-any.whl
- Upload date:
- Size: 313.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eabbeeca8fc5daca8a62f1448cfd2061351ddf8d82690d75e3e7a7a9cc213a8e
|
|
| MD5 |
4722b05f59b50fa68c901204084831e8
|
|
| BLAKE2b-256 |
53d3c18cff83adcb03a25921ab09582a7e21d1817a513600cb9b3f39f617a227
|
Provenance
The following attestation bundles were made for terok_sandbox-0.4.0-py3-none-any.whl:
Publisher:
release.yml on terok-ai/terok-sandbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
terok_sandbox-0.4.0-py3-none-any.whl -
Subject digest:
eabbeeca8fc5daca8a62f1448cfd2061351ddf8d82690d75e3e7a7a9cc213a8e - Sigstore transparency entry: 2071830351
- Sigstore integration time:
-
Permalink:
terok-ai/terok-sandbox@47829ef7ae765ed6ce3a4ebf126fd90d7b8173e7 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/terok-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@47829ef7ae765ed6ce3a4ebf126fd90d7b8173e7 -
Trigger Event:
workflow_dispatch
-
Statement type: