Skip to main content

Python SDK for ATI (Agent Tools Interface) — token utilities and orchestrator provisioning

Project description

ati-client

Python SDK for ATI (Agent Tools Interface) — orchestrator provisioning and JWT token utilities.

Install

pip install ati-client

Quick Start

Orchestrator Provisioning

from ati import AtiOrchestrator

orch = AtiOrchestrator(
    proxy_url="https://ati-proxy.example.com",
    secret="17332cf135d362f79a2ed700b13e1215978be1d6ae6e133d25b6b3f21fa10299",
)

# Generate env vars to inject into a sandboxed agent
env_vars = orch.provision_sandbox(
    agent_id=f"sandbox:{sandbox_id}",
    tools=["finnhub_quote", "web_search", "github:*"],
    skills=["financial-analysis"],
    ttl_seconds=7200,
    rate={"tool:github:*": "10/hour"},
)

# env_vars = {
#     "ATI_PROXY_URL": "https://ati-proxy.example.com",
#     "ATI_SESSION_TOKEN": "eyJ...",
# }

Token Utilities

from ati import issue_token, validate_token, inspect_token

# Issue a token
token = issue_token(
    secret="17332cf135d362f79a...",
    sub="agent-7",
    scope="tool:web_search tool:finnhub_quote",
    ttl_seconds=3600,
)

# Validate (checks signature, expiry, audience)
claims = validate_token(token, secret="17332cf135d362f79a...")
print(claims.sub)      # "agent-7"
print(claims.scopes()) # ["tool:web_search", "tool:finnhub_quote"]

# Inspect without validation (debugging)
claims = inspect_token(token)

Scope Utilities

from ati import build_scope_string, check_scope, matches_wildcard

# Build scope strings
scope = build_scope_string(
    tools=["web_search", "github:*"],
    skills=["research-*"],
    extra=["help"],
)
# "tool:web_search tool:github:* skill:research-* help"

# Check if a tool is allowed
check_scope("tool:github:search_repos", ["tool:github:*"])  # True
check_scope("tool:secret_api", ["tool:web_search"])            # False

# Wildcard matching
matches_wildcard("tool:github:search", "tool:github:*")  # True
matches_wildcard("anything", "*")                           # True

JWT Format

Tokens are HS256-signed JWTs compatible with the ATI Rust proxy. The secret must be a hex-encoded 32-byte key (64 hex characters).

Claims payload:

{
  "sub": "agent-7",
  "aud": "ati-proxy",
  "iat": 1700000000,
  "exp": 1700003600,
  "jti": "550e8400-e29b-41d4-a716-446655440000",
  "iss": "ati-orchestrator",
  "scope": "tool:web_search tool:github:*",
  "ati": {
    "v": 1,
    "rate": {
      "tool:github:*": "10/hour"
    }
  }
}

Development

cd ati-client
pip install -e ".[dev]"
pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ati_client-0.5.1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ati_client-0.5.1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file ati_client-0.5.1.tar.gz.

File metadata

  • Download URL: ati_client-0.5.1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ati_client-0.5.1.tar.gz
Algorithm Hash digest
SHA256 c0c0fff54a67dda7d37578a15236eb804fcab72d9cc9ff04c6e00a9dc245e8de
MD5 8de978252d319475da57c8a0eecee78f
BLAKE2b-256 423dd550561a50041b956694d05162d410c94bbfe80e1b6ad29535654b30c57a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ati_client-0.5.1.tar.gz:

Publisher: release.yml on Parcha-ai/ati

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ati_client-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: ati_client-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ati_client-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a02847d38e36720b13b4ac78433bdacbd17a71ab97cde91ad190de3817548be
MD5 df15b0c7830e4c08f925af64fb2f8c09
BLAKE2b-256 09109fb73c88a4d65f6b718fb0197967287617d49b0a8b864c6959dc399154ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for ati_client-0.5.1-py3-none-any.whl:

Publisher: release.yml on Parcha-ai/ati

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page