Skip to main content

terok-executor

terok-executor

PyPI License: Apache-2.0 REUSE status Quality Gate Status

One command to run an AI coding agent inside a hardened, rootless Podman container.

terok-executor builds the container, launches the agent against the directory you point it at, and keeps real credentials on the host. Use it on its own as a CLI, or import its AgentRunner from Python when you want library-grade control.

terok ecosystem — terok-executor sits between project orchestration and the hardened runtime

Quick start

pip install terok-executor
terok-executor run claude ~/my-workspace -p "Fix the bug"

The first run interactively offers any missing prerequisites — sandbox services, container images, agent credentials. Mandatory items (services, images) block the launch if declined; optional ones (SSH key, auth) print the consequence and proceed.

Individual steps would be:

terok-executor setup                               # install sandbox services + build base images
terok-executor auth claude                         # authenticate (OAuth or API key)
terok-executor run claude <dir> -p "Fix the bug"   # run the agent with an initial prompt

Use as a library

from terok_executor import AgentRunner

runner = AgentRunner()
runner.run_headless(
    agent="claude",
    repo=".",
    prompt="Fix the failing test in test_auth.py",
)

AgentRunner exposes four launch methods — run_headless, run_interactive, run_web, run_tool — all with the same hardening guarantees.

Callers assembling their own launch can pass wayland=WaylandMode.MITM (wl-mitm) or WaylandMode.DIRECT (wl-direct) to launch_prepared (WaylandMode is provided by terok-sandbox). The default is NONE. Sandbox owns desktop-session discovery, proxy supervision and restart checks; executor does not install GUI software, grant GPUs or forward audio. Install wl-mitm on the host yourself. On SELinux hosts, the optional proxy policy can be inspected with terok-executor setup selinux --with-wayland --show and installed with the same command without --show.

Supported agents

Agent Auth Description
Claude Code OAuth*, API key Anthropic Claude Code
Codex OAuth*, API key OpenAI Codex CLI
Vibe API key Mistral Vibe
Copilot — GitHub Copilot (no vault route yet)
OpenCode — (uses provider keys) Harness that drives any OpenAI-compatible provider — curated configs for Helmholtz Blablador, KISSKI AcademicCloud, OpenRouter, and Opper (each authenticated with its own API key)
Pi — (uses provider keys) Multi-provider harness; routes through the phantom tokens of co-installed providers
gh OAuth, API key GitHub CLI
glab API key GitLab CLI
SonarCloud API key SonarCloud scanner
CodeRabbit API key CodeRabbit (sidecar tool)

* Claude and Codex OAuth are experimental.

terok-executor agents list lists the live roster (add --all to include tools and harness-driven providers).

Where it sits in the stack

terok-executor is the per-task layer. Above it, terok composes many concurrent runs across many projects. Below it, terok-executor delegates the host-side security boundary (terok-sandbox): the credential vault, the git gate, the egress firewall hooks, the per-container supervisor lifecycle (OCI createRuntime/poststop hooks).

Commands

Command Description
run Launch an agent (headless, interactive, or web)
setup Bootstrap sandbox services + container images
uninstall Remove sandbox services + container images
auth Authenticate a provider
agents Inspect the agent roster (list) and set the build-time default selection (set)
build Build base + agent images explicitly
run-tool Run a sidecar tool (CodeRabbit)
list List containers
start Start a stopped container
stop Stop a container (kept for a later start)
rm Remove a container and its host-side state
show-config Print the effective SandboxConfig as YAML (diffable across orchestrators)
vault Vault management (status, unlock, lock, list, passphrase, routes, clean)
sandbox Full terok-sandbox command tree (shield, vault, ssh, doctor, …)

Config override

Two top-level flags (precede the subcommand, like docker --config):

  • --config PATH — read this config.yml instead of the layered system/user paths (sets TEROK_CONFIG_FILE for the invocation).
  • --raw — ignore any config.yml; use sandbox/executor dataclass defaults only.

Higher-layer orchestrators (such as terok) typically construct a SandboxConfig from their own resolution chain and pass it into the executor as a library; the public expectation is that, for the fields they own in config.yml, the resulting sub-environment matches what standalone terok-executor would produce against the same file. Use show-config on both sides to verify.

Development

See the Developer Guide.

License

Apache-2.0

Metadata

Release files for terok-executor 0.5.1

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-executor 0.5.1
File Size Uploaded Provenance Actions
terok_executor-0.5.1.tar.gz 719.9 kB With provenance Details for terok_executor-0.5.1.tar.gz

Built distribution (wheel)

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

Total release size: 1.1 MB

Release files / terok_executor-0.5.1.tar.gz

Download URL terok_executor-0.5.1.tar.gz
Size 719.9 kB
Tags Source
SHA-256 checksum
How to use checksums
37cb3bfe1530d8c074fbd1ac45aa31954b4e7400552bc50e846866c732b532af
BLAKE2b-256 checksum
How to use checksums
113d2f01dd5be441f77aaf6f2dfcff57e47dec838a67e82af489a2ab7d3cec5a
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_executor-0.5.1-py3-none-any.whl

Download URL terok_executor-0.5.1-py3-none-any.whl
Size 331.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d8a207cd3bd0315246d2cf51ffc74e137720da30bfb4e3bad15b7b28f55cf73
BLAKE2b-256 checksum
How to use checksums
87f6884b70020b9bde37f95d7eb7f7f55c3cc298c4f10432505d7358914b3fbe
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-executor 0.5.1

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_executor-0.5.1.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