Skip to main content

SuperTag Python SDK

The Python SDK has three parts:

  • supertag.harness_adapter: write a harness adapter that a SuperTag Worker Host starts to run one Task Attempt.
  • supertag.openai_agents_adapter: the OpenAI Agents harness adapter that a Worker Host starts for a Tag whose harness is openai-agents.
  • supertag.control_plane_client: call a SuperTag Control Plane from Python.

It also contains the Worker composition interfaces (create_worker, harnesses, execution environments, Runtime Inputs, and Session continuity) that the OpenAI Agents adapter is built on.

For the SuperTag CLI and Control Plane, see Requirements. Python dependencies are declared in pyproject.toml.

Install the published SDK from PyPI, pinned to the version of your CLI:

python -m pip install 'supertag==0.3.0'
python -m pip install 'supertag[runtime]==0.3.0'

The runtime extra installs gRPC and protobuf for the adapter and Control Plane clients. Add the harness integrations you use:

python -m pip install 'supertag[codex]==0.3.0'
python -m pip install 'supertag[agents]==0.3.0'
python -m pip install 'supertag[codex,agents]==0.3.0'

agents installs the OpenAI Agents SDK and codex the openai-codex SDK. For source development, see CONTRIBUTING.md.

Run a Python harness adapter with a Worker Host

A Worker Host is the machine or sandbox that provides execution. It launches a harness adapter to run one Task Attempt, which is a single try at completing a unit of work. Install the SDK with its runtime extra. Pass the executable to the Worker Host through its --adapter option.

import asyncio
import sys

from supertag.harness_adapter import open_harness, runtime

async def main():
    async with open_harness(sys.stdin.buffer) as harness:
        run = await harness.client.Attach(runtime.HarnessAttachRequest(), timeout=5)
        result = f"Received work for {run.task.tag_id}"
        await harness.client.Publish(
            runtime.HarnessPublishRequest(sequence=1, text=result), timeout=5
        )
        await harness.client.Complete(
            runtime.HarnessCompleteRequest(succeeded=True, result=result), timeout=5
        )

asyncio.run(main())

The Worker Host supplies a private execution connection on standard input. It records the outcome after the adapter exits successfully. Reuse the same sequence number and request body when retrying an event.

The OpenAI Agents adapter runs as python -m supertag.openai_agents_adapter; the Worker Host starts it for a Tag whose harness is openai-agents. It needs OPENAI_API_KEY and the agents extra.

Call the Control Plane

Use supertag.control_plane_client. The runtime extra installs gRPC and protobuf. This example lists Tags, the persistent AI actors in your organization.

import os

from supertag.control_plane_client import ControlPlaneClientSync, runtime

with ControlPlaneClientSync(
    os.environ["SUPERTAG_CONTROL_PLANE_URL"], os.environ["SUPERTAG_OPERATOR_TOKEN"]
) as client:
    response = client.operator.ListTags(runtime.ListTagsRequest(), timeout=5)
    for tag in response.tags:
        print(tag.name)

ControlPlaneClient exposes the same services with async with and awaitable unary calls. The generated gRPC methods use the protobuf RPC names, such as ListTags and Watch. Pass a timeout in seconds to bound a call. Watch streams can resume from their last resume_token. Use HTTPS for a remote Control Plane and a loopback IP address for local cleartext. Pass a PEM ca for private TLS and a PEM certificate chain and key as identity=(cert, key) if the Control Plane requires mutual TLS. The first call negotiates the SuperTag protocol version with the Control Plane and raises ControlPlaneProtocolError when the Control Plane runs an incompatible release.

Compose a Worker in process

create_worker(WorkerOptions(...)) composes Worker Profiles, harnesses, execution environment providers, and optional RuntimeInputProvider values into the Worker contract, and LocalWorklet runs Workers in the same process. The OpenAI Agents adapter uses them to run one Task Attempt; they do not connect to a Control Plane by themselves.

Each HarnessPlan separates private runtime staging from workspace execution staging. A harness receives both accesses. ContextResolver, WorkspaceResolver, and ToolProvider are focused convenience interfaces built on Runtime Inputs. A ToolAdapter turns an allowed ToolInput into the configuration expected by a particular harness. Pass an InMemorySessionStateStore or a FileSessionStateStore for Session continuity.

The built-in local environment provider is attempt-scoped and gives child processes only common process-launch plumbing variables plus values explicitly projected by the provider or process specification. It supports supertag.process-output-streaming version 1: pass ProcessSpec(stream_output=True) and consume async for chunk in process.output(). POSIX processes run in owned process groups; cancellation and timeouts escalate from termination to kill before cleanup. An environment must raise ExecutionCleanupError when it cannot confirm cleanup.

Custom harnesses can emit TaskProgress(...).event() to provide a bounded progress summary and checklist. Progress is a complete latest-wins snapshot, not a reasoning trace: never include prompts, commands, tool arguments, credentials, or runtime identifiers.

Metadata

Release files for supertag 0.3.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 supertag 0.3.0
File Size Uploaded Provenance Actions
supertag-0.3.0.tar.gz 336.9 kB With provenance Details for supertag-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 582.3 kB

Release files / supertag-0.3.0.tar.gz

Download URL supertag-0.3.0.tar.gz
Size 336.9 kB
Tags Source
SHA-256 checksum
How to use checksums
aeb74fa42783bb22e050ba7b630069b25d95ecb10d0840bbea1a67b5f98be9d9
BLAKE2b-256 checksum
How to use checksums
b25dcb211566153cfa0ff2219c66548d58ac4aa7b15089b4c95d891cb7ec879f
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 15, 2026.

Transparency log

Release files / supertag-0.3.0-py3-none-any.whl

Download URL supertag-0.3.0-py3-none-any.whl
Size 245.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
453532f3ebd711321a73c4d68b61e04386666ec7d76068079f4ffcde486ebbd1
BLAKE2b-256 checksum
How to use checksums
1dc0e7e9834d703c53173e6ad223369a7b9913b5c6b6b99c7fbf3e23bf3a9585
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 15, 2026.

Transparency log

Security for supertag 0.3.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 supertag-0.3.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 15, 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