Native Rust primitives for the Tank SDK — integrity verification, tarball extraction, version resolution, permission checks
Project description
tank-core
Native Rust primitives for the Tank Python SDK. Provides SHA-512 integrity verification, tarball extraction with path traversal protection, semver resolution, and permission checks — built in Rust, exposed via pyo3.
Most users do not install this directly. Install the high-level SDK instead:
pip install "tank-sdk[native]"
That pulls tank-core as a dependency and the SDK loads it transparently. Installing tank-core alone is supported but exposes a low-level API that the SDK abstracts.
Install
pip install tank-core
Pre-built wheels ship for:
- Linux x86_64 and aarch64 (manylinux_2_28)
- macOS x86_64 (10.12+) and arm64 (11+)
- Windows x86_64
Built against Python's stable ABI (abi3), compatible with Python 3.11+. Unsupported platforms (e.g. musllinux, FreeBSD) fall back to an sdist build that requires a Rust toolchain.
Low-level API
import tankpkg_core
tankpkg_core.verify_integrity(data, "sha512-...")
tankpkg_core.extract_tarball(data, "/tmp/dest")
tankpkg_core.resolve_version(["1.0.0", "1.1.0", "2.0.0"], "^1.0.0")
tankpkg_core.is_path_allowed("/src/foo.ts", ["/src/**"])
tankpkg_core.is_domain_allowed("api.anthropic.com", ["*.anthropic.com"])
budget = tankpkg_core.Permissions(
network_outbound=["*.anthropic.com"],
fs_read=["/src/**"],
fs_write=["/output/**"],
subprocess=False,
)
skill_perms = tankpkg_core.Permissions(fs_read=["/src/**"])
tankpkg_core.check_permission_budget(budget, skill_perms, "@example/skill")
Errors use standard Python exceptions: ValueError for integrity failures, IOError for extraction failures, PermissionError for budget violations.
Building from source
Requires Rust and maturin:
cd packages/sdk-core/crates/python
maturin develop
Links
- Homepage: https://tankpkg.dev
- SDK: https://pypi.org/project/tank-sdk/
- Source: https://github.com/tankpkg/tank
- Issues: https://github.com/tankpkg/tank/issues
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
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 tank_core-0.14.3.tar.gz.
File metadata
- Download URL: tank_core-0.14.3.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cce79c328313cd25219cd018cb98c2f4d00e0faa4b8e1ff02faf907e8904271
|
|
| MD5 |
a307efcfbfbb452880fcf60bec09e9f5
|
|
| BLAKE2b-256 |
0d487c0072aafb3927a402f2a7dd787f208288f6fd3282cd5dc8f11c08c8f555
|
Provenance
The following attestation bundles were made for tank_core-0.14.3.tar.gz:
Publisher:
release.yml on tankpkg/tank
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tank_core-0.14.3.tar.gz -
Subject digest:
7cce79c328313cd25219cd018cb98c2f4d00e0faa4b8e1ff02faf907e8904271 - Sigstore transparency entry: 1341880301
- Sigstore integration time:
-
Permalink:
tankpkg/tank@e2d14592618c3b495a0e60435eed025efee087d4 -
Branch / Tag:
refs/tags/v0.14.3 - Owner: https://github.com/tankpkg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e2d14592618c3b495a0e60435eed025efee087d4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tank_core-0.14.3-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: tank_core-0.14.3-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 314.6 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68b46c634c7e918ff40332bf79717d08660597613245d44b9c4191c5176b032c
|
|
| MD5 |
9992c5b4b5d440b33202fbebd016ff99
|
|
| BLAKE2b-256 |
49190718bff92297e5b8bef109c2e5700988d1f9389926ff288e31ccf61d942b
|
Provenance
The following attestation bundles were made for tank_core-0.14.3-cp39-abi3-win_amd64.whl:
Publisher:
release.yml on tankpkg/tank
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tank_core-0.14.3-cp39-abi3-win_amd64.whl -
Subject digest:
68b46c634c7e918ff40332bf79717d08660597613245d44b9c4191c5176b032c - Sigstore transparency entry: 1341880640
- Sigstore integration time:
-
Permalink:
tankpkg/tank@e2d14592618c3b495a0e60435eed025efee087d4 -
Branch / Tag:
refs/tags/v0.14.3 - Owner: https://github.com/tankpkg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e2d14592618c3b495a0e60435eed025efee087d4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tank_core-0.14.3-cp39-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tank_core-0.14.3-cp39-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 398.5 kB
- Tags: CPython 3.9+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de90d083f8f821fa947dc25edbe7d43222682f0d5065d89a00f7d6465a62292d
|
|
| MD5 |
d56f49674bf36db378bd01f3c0436c38
|
|
| BLAKE2b-256 |
1751ef653efca91de7f1abb06edaedbe96937f3b7e88fe1d1125b83da623f644
|
Provenance
The following attestation bundles were made for tank_core-0.14.3-cp39-abi3-manylinux_2_28_x86_64.whl:
Publisher:
release.yml on tankpkg/tank
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tank_core-0.14.3-cp39-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
de90d083f8f821fa947dc25edbe7d43222682f0d5065d89a00f7d6465a62292d - Sigstore transparency entry: 1341880428
- Sigstore integration time:
-
Permalink:
tankpkg/tank@e2d14592618c3b495a0e60435eed025efee087d4 -
Branch / Tag:
refs/tags/v0.14.3 - Owner: https://github.com/tankpkg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e2d14592618c3b495a0e60435eed025efee087d4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tank_core-0.14.3-cp39-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: tank_core-0.14.3-cp39-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 381.8 kB
- Tags: CPython 3.9+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d59b1c8701952f40c9ea51b33fc5e37ceb0742b399e4a012b4a24f70e96441ff
|
|
| MD5 |
c25dcc80d85e2dda54d63439a70da93b
|
|
| BLAKE2b-256 |
b1a158457035940ba5b5a712faaa4c9caba406b675c9befe02230ae2eafbc62f
|
Provenance
The following attestation bundles were made for tank_core-0.14.3-cp39-abi3-manylinux_2_28_aarch64.whl:
Publisher:
release.yml on tankpkg/tank
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tank_core-0.14.3-cp39-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
d59b1c8701952f40c9ea51b33fc5e37ceb0742b399e4a012b4a24f70e96441ff - Sigstore transparency entry: 1341880362
- Sigstore integration time:
-
Permalink:
tankpkg/tank@e2d14592618c3b495a0e60435eed025efee087d4 -
Branch / Tag:
refs/tags/v0.14.3 - Owner: https://github.com/tankpkg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e2d14592618c3b495a0e60435eed025efee087d4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tank_core-0.14.3-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: tank_core-0.14.3-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 365.5 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e04121efd6bdca664863d6b105a665fd41fbd46e674bfe0970e0b67812a65243
|
|
| MD5 |
74d76814b5581d2fc919823fac62ee14
|
|
| BLAKE2b-256 |
cd3beb3b2002d8e3215630a27bc97382ed33af0845fa3e0c90f171b2eb14b287
|
Provenance
The following attestation bundles were made for tank_core-0.14.3-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on tankpkg/tank
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tank_core-0.14.3-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
e04121efd6bdca664863d6b105a665fd41fbd46e674bfe0970e0b67812a65243 - Sigstore transparency entry: 1341880580
- Sigstore integration time:
-
Permalink:
tankpkg/tank@e2d14592618c3b495a0e60435eed025efee087d4 -
Branch / Tag:
refs/tags/v0.14.3 - Owner: https://github.com/tankpkg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e2d14592618c3b495a0e60435eed025efee087d4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tank_core-0.14.3-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: tank_core-0.14.3-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 387.0 kB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ff8bfa42d812f38c89c4fbae6de8ab9ed8e296f890fc458320b8f0bac255be3
|
|
| MD5 |
4775c6ecc4cef03a9bf6554644a94314
|
|
| BLAKE2b-256 |
957e778d98b37c65483f2e91362a6dfb07393ee9bad513baf6673128b79ddc30
|
Provenance
The following attestation bundles were made for tank_core-0.14.3-cp39-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on tankpkg/tank
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tank_core-0.14.3-cp39-abi3-macosx_10_12_x86_64.whl -
Subject digest:
6ff8bfa42d812f38c89c4fbae6de8ab9ed8e296f890fc458320b8f0bac255be3 - Sigstore transparency entry: 1341880499
- Sigstore integration time:
-
Permalink:
tankpkg/tank@e2d14592618c3b495a0e60435eed025efee087d4 -
Branch / Tag:
refs/tags/v0.14.3 - Owner: https://github.com/tankpkg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e2d14592618c3b495a0e60435eed025efee087d4 -
Trigger Event:
push
-
Statement type: