Skip to main content

TNG Python SDK

PyPI

中文文档

Trusted Network Gateway (TNG) Python SDK — encrypted HTTP requests with remote attestation.

Quick Start

pip install tng-sdk
from tng import Tng
import requests

# Create TNG client (no_ra = disable remote attestation for testing)
tng = Tng(no_ra=True)

# Wrap a requests session
session = requests.Session()
tng.wrap_requests(session)

# All requests flow through the encrypted TNG tunnel
resp = session.get("http://tng-server:10001/api/data")
print(resp.json())

tng.close()

Supported Clients

Client Method
requests tng.wrap_requests(session)
httpx tng.wrap_httpx(client)
openai tng.wrap_openai(client)

Security Options

# Disable remote attestation (testing only)
tng = Tng(no_ra=True)

# With verifier
tng = Tng(verify={"as_addr": "http://127.0.0.1:8080/", "policy_ids": ["default"]})

# With attester
tng = Tng(attest={"aa_addr": "unix:///run/aa.sock", "model": "passport"})

# Bidirectional attestation
tng = Tng(
    attest={"aa_addr": "unix:///run/aa.sock"},
    verify={"as_addr": "http://127.0.0.1:8080/", "policy_ids": ["default"]}
)

Encryption Protocol

# OHTTP is the default
tng = Tng(no_ra=True)

# Use rats-TLS instead of OHTTP (mutually exclusive)
tng = Tng(no_ra=True, rats_tls={"multiplex": True})

Documentation

Metadata

Release files for tng-sdk 2.13.0

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

Built distributions (wheels)

Table of built distributions (wheels) for tng-sdk 2.13.0
File Actions
tng_sdk-2.13.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for tng_sdk-2.13.0-py3-none-win_amd64.whl
tng_sdk-2.13.0-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for tng_sdk-2.13.0-py3-none-manylinux_2_17_x86_64.whl
tng_sdk-2.13.0-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for tng_sdk-2.13.0-py3-none-manylinux_2_17_aarch64.whl
tng_sdk-2.13.0-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for tng_sdk-2.13.0-py3-none-macosx_11_0_x86_64.whl
tng_sdk-2.13.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for tng_sdk-2.13.0-py3-none-macosx_11_0_arm64.whl

Total release size: 199.3 MB

Release files / tng_sdk-2.13.0-py3-none-win_amd64.whl

Download URL tng_sdk-2.13.0-py3-none-win_amd64.whl
Size 44.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
1016b3eaf3cca0ff8ddc8831e503fda8769bff7b0a854d26ee57e1f0a3d727ac
BLAKE2b-256 checksum
How to use checksums
584650a37c425e32036d89bd1a8e0a2138ee41f1a8abad970fe4730886882040
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 12, 2026.

Transparency log

Release files / tng_sdk-2.13.0-py3-none-manylinux_2_17_x86_64.whl

Download URL tng_sdk-2.13.0-py3-none-manylinux_2_17_x86_64.whl
Size 37.8 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
f141a2b80751af8329808a7996285b4b8ae445d34e27b7a82c271c2528a92c35
BLAKE2b-256 checksum
How to use checksums
59e651d5b6cdcf81008b7b6200334aeed0c0a5df24663c1cef4fbacc392cdee7
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 12, 2026.

Transparency log

Release files / tng_sdk-2.13.0-py3-none-manylinux_2_17_aarch64.whl

Download URL tng_sdk-2.13.0-py3-none-manylinux_2_17_aarch64.whl
Size 35.8 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
571d9db6587137dd64524d08bd9e40f504c6cf67bc89424ae6fa31361cbd25b5
BLAKE2b-256 checksum
How to use checksums
3d99ff58ff40787f5ce3675852808cd4751d6aea650094a7786e50717872f4d7
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 12, 2026.

Transparency log

Release files / tng_sdk-2.13.0-py3-none-macosx_11_0_x86_64.whl

Download URL tng_sdk-2.13.0-py3-none-macosx_11_0_x86_64.whl
Size 41.7 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
964fea3ec1c6f6ce1789477eca601a480bee859d5a5ae12509fae0fe0cc42e62
BLAKE2b-256 checksum
How to use checksums
4b5286c2231600564f81cb2124c1cd6ec7296e1d75cc9175c1cd76cdd1686678
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 12, 2026.

Transparency log

Release files / tng_sdk-2.13.0-py3-none-macosx_11_0_arm64.whl

Download URL tng_sdk-2.13.0-py3-none-macosx_11_0_arm64.whl
Size 39.8 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ec4ef884785261d596dfd571d3cac1b2dd4881ff868acf7bdc5d8d804296738e
BLAKE2b-256 checksum
How to use checksums
b7ee01c5c349c9db6adcd37b4233c4ff55ca8c839401f42fc46586bf9c6b964b
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 12, 2026.

Transparency log

Security for tng-sdk 2.13.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

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for tng_sdk-2.13.0-py3-none-win_amd64.whl

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 12, 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