Catalog PyPI
Back to packageRELEASE DETAILS

0.8.1

PyPI

agenttier

Python SDK for AgentTier — isolated, persistent Kubernetes sandboxes for humans and AI agents

agentsai-agentsdeveloper-toolskubernetessandbox
Published30 Jun 2026
Direct dependencies7
Transitive dependenciesNot calculated

README

Version 0.8.1 documentation

AgentTier Python SDK

Programmatic client for AgentTier — manage isolated, persistent Kubernetes sandboxes for humans and AI agents from Python.

pip install agenttier

Synchronous quick start

from agenttier import AgentTierClient

with AgentTierClient(api_url="https://agenttier.company.com") as client:
    sandbox = client.create_sandbox(template="general-coding", name="demo")
    sandbox.wait_until_running()

    result = sandbox.exec("echo 'hello from AgentTier'")
    print(result.stdout, "exit", result.exit_code)

    port = sandbox.forward_port(8080)
    print("Forwarded:", port.preview_url or port.internal_url)

    sandbox.terminate()

Async

import asyncio
from agenttier import AsyncAgentTierClient

async def main():
    async with AsyncAgentTierClient(api_url="https://agenttier.company.com") as client:
        sandbox = await client.create_sandbox(template="general-coding", name="demo")
        await sandbox.wait_until_running()
        result = await sandbox.exec("uname -a")
        print(result.stdout)
        await sandbox.terminate()

asyncio.run(main())

Authentication

The SDK auto-detects credentials in this order:

  1. AGENTTIER_API_KEY — sent as X-API-Key.
  2. AGENTTIER_TOKEN — sent as Authorization: Bearer <token> (OIDC JWT).
  3. In-cluster ServiceAccount token at /var/run/secrets/kubernetes.io/serviceaccount/token.
  4. Unauthenticated (accepted only in the Router's dev mode).

Or pass an explicit provider:

from agenttier import AgentTierClient, APIKeyAuth, BearerTokenAuth

client = AgentTierClient(
    api_url="https://agenttier.company.com",
    auth=APIKeyAuth("sk_live_..."),
)

Error handling

Every error inherits from AgentTierError so you can catch them all at once. The common subclasses you'll want to handle individually:

ExceptionWhen
AuthenticationError401 — token / API key missing or invalid
AuthorizationError403 — authenticated but not permitted
PolicyViolationError403 with governance body; exposes .violations
NotFoundError404 — resource doesn't exist
ConflictError409 — operation invalid for current state
SandboxTimeoutErrorwait_until_running timed out
SandboxErrorStatesandbox entered the Error phase while waiting
APIErroranything else; carries .status_code and .body

Supported API surface (v0.1.1)

Only endpoints that the Router server implements in v0.1.0 are exposed:

  • Sandboxes — create_sandbox, list_sandboxes, get_sandbox, stop, resume, terminate, exec, wait_until_running, status.
  • Port forwarding — forward_port, list_ports, remove_port.
  • Templates — list_templates, get_template.
  • Identity — current_user.

Endpoints that are not yet implemented on the server (file transfer, sharing, cloning, WebSocket terminal from Python) are not exposed by the SDK and will be added in a future release once the server ships them.

Supported Python versions

3.10, 3.11, 3.12, 3.13. Runtime dependencies: httpx and pydantic.

License

Apache-2.0. Source at github.com/agenttier/agenttier/tree/main/python-sdk.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 7

Native requirements
7 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
httpx
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
httpx<1.0,>=0.27.0runtime
pydantic
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pydantic<3.0,>=2.0.0runtime
mypy
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
mypy>=1.10; extra == "dev"runtime
pytest-asyncio
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pytest-asyncio>=0.23; extra == "dev"runtime
pytest-httpx
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pytest-httpx>=0.30; extra == "dev"runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pytest>=8.0; extra == "dev"runtime
ruff
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
ruff>=0.5; extra == "dev"runtime

Distribution files

2 collected
agenttier-0.8.1-py3-none-any.whl

bdist_wheel · 38.87 KB · Python py3

Source file
agenttier-0.8.1.tar.gz

sdist · 39.38 KB · Python source

Source file

Repository

PENDING
agenttier/agenttier

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:33 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:d4f8b11fa3ef2d12854b9e4e6cefa13e1010d6ce4e57090d4ebf4b22b376b373

Other collected versions

View all collected versions →