Skip to main content

terok

terok

PyPI License: Apache-2.0 REUSE status Quality Gate Status

An open, Podman-native runtime for sandboxing AI coding agents in YOLO mode.

Terok runs each agent task inside a hardened, rootless container with default-deny outbound networking, a credential vault that keeps real keys on the host, a per-task git checkpoint, and a desktop notification path for live allow/deny decisions. It ships a CLI and a Textual TUI on top of a stack of independently-released Python packages.

terok ecosystem at a glance

Acknowledgements

CASUS
HZDR
Terok was started at the
Center for Advanced Systems Understanding (CASUS), an institute of
Helmholtz-Zentrum Dresden-Rossendorf (HZDR) at the end of 2025.

See also
Terok at HELMHOLTZ.software and the
topic page at the
Scientific Computing Core (SCC) group of CASUS.

What you get

Hardening

  • Rootless Podman — no daemon, no privileged user namespace
  • Default-deny egress firewall — via terok-shield
  • Credential vault — secrets stay on the host
  • Per-task git gate — a git mirror that the agent pushes through; a human-review point before changes leave your machine
  • Live Allow / Deny prompts — desktop notifications on blocked outbound traffic

Features

  • Projects ⊃ Tasks — long-lived project config, ephemeral task containers; many tasks per project.
  • Headless / interactive / web interface — pick the launch mode per task; same agents, same hardening.
  • Layered images — base distro · agent CLIs · per-project snippet, cached and reused across projects; Ubuntu / Debian / Fedora / nvidia/cuda out of the box, GPU passthrough for projects whose base image supports it.
  • Multi-vendor agents: Terok supports Claude Code, Codex, Copilot, Vibe, OpenCode, and Pi. OpenCode and Pi support custom LLM endpoints.

The six-package stack

Package Role
terok (this repo) Project orchestration, TUI, sickbay
terok-executor Per-task agent runner, image factory, auth flows
terok-sandbox Hardened Podman runtime, credential vault, git gate
terok-shield nftables egress firewall + audit
terok-clearance Live allow/deny prompts via D-Bus + varlink
terok-util Shared foundations: CLI registry types, XDG paths, config stack

Quick Start

Prerequisites

Hard dependencies:

  • Podman (rootless)
  • nft (nftables CLI)
  • Python 3.12+
  • OpenSSH client — for private git repos

Optional but recommended:

  • systemd user session — enables the systemd-creds vault passphrase tier (TPM2-sealed on systemd ≥ 257); the gate / vault / clearance services themselves run per container, no systemd units
  • dnsmasq and dig — DNS plumbing the egress firewall uses
  • A desktop notification daemon — for the Allow / Deny popups path

Installation

pipx install terok

One-time setup

terok setup                             # idempotent; safe to re-run after upgrades

setup installs the supervisor + shield OCI hooks, sets up the encrypted credential store and its vault routes, and adds the XDG desktop entry for the TUI plus shell completions for your detected shell.

Interactive runs prompt for where the credentials-DB passphrase is stored; non-interactive hosts without systemd-creds must choose with terok setup --passphrase-tier <systemd-creds|desktop-keyring|session-cache>. The desktop keyring stores the passphrase persistently. The session cache uses the kernel keyring or a tmpfs session file and never survives reboot.

To remove everything later:

terok uninstall                         # reverse of setup; preserves credential DB

First project

Launch the TUI:

terok                                   # bare `terok` runs the TUI
  • Press n to run the project wizard (creates config, builds images, sets up SSH + gate)
  • Select your new project, press a to authenticate your agent
  • Tab to the task list, press c to start a CLI task

Or do the same from the command line:

terok auth claude                       # authenticate host-wide
terok auth                              # interactive menu — pick multiple providers
terok project wizard                    # interactive project setup
terok task run myproj                   # create a CLI task and attach (default on TTY)
terok task run myproj --mode toad       # web interface (browser access)
terok login myproj t3x                  # re-attach later by task ID prefix

For manual project configuration or CI, see the User Guide.

Headless agent runs (unattended)

# Run an agent headlessly with a prompt (uses default_agent config; falls back to claude)
terok task run myproj --mode headless --prompt "Fix the authentication bug"

# With model override and timeout
terok task run myproj --mode headless --prompt "Add tests" --model opus --timeout 3600

# Use a specific agent
terok task run myproj --mode headless --prompt "Fix the bug" --agent codex

Common Commands

terok project list                      # List projects
terok config paths                      # Show resolved paths and config
terok task list <project>               # List tasks
terok task delete <project> <task_id>   # Delete a task
terok login <project> <id_prefix>       # Attach to running task
terok project init <project>            # Full setup: ssh + generate + build + gate
terok project wizard                    # Interactive project creation
terok image usage                       # Disk usage across projects and images
terok sickbay                           # In-container health checks
terok panic                             # Emergency kill-switch
terok image list [project]              # List terok images
terok image cleanup [--dry-run]         # Remove orphaned images
terok completions install               # Re-install shell completions

Notes

  • SELinux hosts: install the policy module with terok setup selinux, otherwise the shield + clearance services bind sockets as unconfined_t and podman will refuse to talk to them. terok setup points at the same command when the policy is missing; the subcommand shows the exact sudo invocation and, on request, the policy rules before anything runs.
  • AppArmor hosts: install the dnsmasq profile addendum with terok setup apparmor, otherwise the shield's dnsmasq cannot read its configuration and DNS falls back to a degraded tier. Same flow: the exact sudo command and the added rules are shown before anything runs.
  • Clipboard: If mouse selection doesn't copy to your clipboard, hold Shift while selecting, then Shift+Ctrl+C to copy. See Tips for details.

Configuration

Global Config

Location: ~/.config/terok/config.yml

git:
  human_name: "Your Name"
  human_email: "your@email.com"

image:
  agents: "all"   # default roster selection for every project

If git.human_name and git.human_email are omitted, terok falls through to your host git config. Setting them in config.yml is the way to override the host-level identity for container commits.

To see what you can pick from for image.agents:

terok agents list                       # list available AI coding agents

Officially-tested base images for image.base_image: ubuntu:24.04, fedora:44, quay.io/podman/stable, nvcr.io/nvidia/nvhpc. Other images in the same family (ubuntu:*, debian:*, fedora:*, nvcr.io/nvidia/*, quay.io/podman/*) work via auto-detection; anything else needs an explicit image.family: deb|rpm override. See docs/usage.md for the full mechanics.

Contributing

See the Developer Guide.

License

See LICENSE file.

Metadata

Release files for terok 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for terok 0.10.0
File Size Uploaded Provenance Actions
terok-0.10.0.tar.gz 1.6 MB With provenance Details for terok-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for terok 0.10.0
File Interpreter ABI Platform Actions
terok-0.10.0-py3-none-any.whl Python 3 none any Details for terok-0.10.0-py3-none-any.whl

Total release size: 2.3 MB

Release files / terok-0.10.0.tar.gz

Download URL terok-0.10.0.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
d760cfb3827e5798393dbbfc86528eccc68b0d2e5b84516ebe625dcaac1a4973
BLAKE2b-256 checksum
How to use checksums
76c9b20b5455013751dcc255464a4ddc42991b3f6ef70ad14d312a737e24f73c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / terok-0.10.0-py3-none-any.whl

Download URL terok-0.10.0-py3-none-any.whl
Size 678.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c2da9b07bd41e01076b86f1f8343282ce5f381e8920f9f68a69381d9151e935
BLAKE2b-256 checksum
How to use checksums
aa500db0c16ef033ea6f81df23d8b7658f559a0cb77fb21b640dfe5397d2c686
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Security for terok 0.10.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for terok-0.10.0.tar.gz

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 Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page