Sandboxed tool runtime and provider abstraction for the ABI ecosystem
Project description
abi-runtime
Sandboxed file operations and model provider abstraction for AI agent execution. Enforce workspace boundaries, path allowlists, and provider-agnostic model calls.
Zero dependencies.
Install (after PyPI publication)
pip install abi-runtime
Status: Not yet published to PyPI. Install from source:
pip install -e .from the repo root.
Quick start
Workspace sandbox
from pathlib import Path
from abi_runtime.sandbox import WorkspaceSandbox
# Create a sandbox rooted at the current workspace
sandbox = WorkspaceSandbox(
workspace_root=Path("."),
allow_patterns=["src/**", "tests/**"],
deny_patterns=["*.env", ".git/**", "node_modules/**"],
)
# Safe file operations — path traversal and symlink escapes are blocked
content = sandbox.safe_read("src/main.py")
sandbox.safe_write("tests/output.txt", "result data")
files = sandbox.safe_list("src/")
Provider abstraction
from abi_runtime.providers import MockProvider, ProviderSettings
# Use the mock provider for deterministic testing
provider = MockProvider(default_response="Test output")
provider.set_response("auth", "OAuth2 implementation plan")
response = provider.generate("Design an auth system")
print(response.text) # "OAuth2 implementation plan"
print(response.usage) # {"input_tokens": ..., "output_tokens": ...}
# All invocations are recorded for assertions
assert len(provider.invocations) == 1
What's included
- WorkspaceSandbox -- sandboxed file operations with workspace root enforcement, path traversal blocking, and symlink escape detection
- Provider abstraction --
Providerprotocol withMockProviderfor testing andLocalProviderStubfor offline use - Allowlist/denylist -- declarative control over which files an agent can read and write
- Deterministic temp dirs -- hash-based temp directories for reproducible runs
- Runtime context capture -- environment metadata collection with secret redaction
ABI ecosystem
Related packages:
- abi-control-core -- contracts and audit trail SDK
- abi-policy -- policy evaluation engine
- abi-observability -- OTLP-compliant telemetry
Versioning
Follows Semantic Versioning. Current version: 0.1.2. See CHANGELOG.md for release notes.
License
MIT License (see LICENSE file).
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 Distribution
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 abi_runtime-0.1.2.tar.gz.
File metadata
- Download URL: abi_runtime-0.1.2.tar.gz
- Upload date:
- Size: 55.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a025086b75bdd2e9541c9d356601bcb6e8d995ae329f3c65eac19c6df85ae1de
|
|
| MD5 |
2693779bb0df87643187cf9c5711144d
|
|
| BLAKE2b-256 |
aa7eb1cfb1d053c7a2518d4b6be8afadbef12b7e136d7ccccafe33b617531d42
|
Provenance
The following attestation bundles were made for abi_runtime-0.1.2.tar.gz:
Publisher:
publish.yml on AbilityBI/abi-runtime
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abi_runtime-0.1.2.tar.gz -
Subject digest:
a025086b75bdd2e9541c9d356601bcb6e8d995ae329f3c65eac19c6df85ae1de - Sigstore transparency entry: 1102554105
- Sigstore integration time:
-
Permalink:
AbilityBI/abi-runtime@11f3023a62f20a157d35565e522eb4dca5fafd89 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/AbilityBI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@11f3023a62f20a157d35565e522eb4dca5fafd89 -
Trigger Event:
push
-
Statement type:
File details
Details for the file abi_runtime-0.1.2-py3-none-any.whl.
File metadata
- Download URL: abi_runtime-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f7c21815117e244d77aaf0dd4768e1e9561c508151c6e871f323665d17dbc3f
|
|
| MD5 |
f182a7fb150ddce00e1b924499f043bf
|
|
| BLAKE2b-256 |
518aaaeb2627ce860a6b08f20ceacb193d69e5f249ead6bb51965705361a9c8f
|
Provenance
The following attestation bundles were made for abi_runtime-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on AbilityBI/abi-runtime
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abi_runtime-0.1.2-py3-none-any.whl -
Subject digest:
0f7c21815117e244d77aaf0dd4768e1e9561c508151c6e871f323665d17dbc3f - Sigstore transparency entry: 1102554108
- Sigstore integration time:
-
Permalink:
AbilityBI/abi-runtime@11f3023a62f20a157d35565e522eb4dca5fafd89 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/AbilityBI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@11f3023a62f20a157d35565e522eb4dca5fafd89 -
Trigger Event:
push
-
Statement type: