Skip to main content

Python SDK for STACK — trust infrastructure for AI agents

Project description

getstack

Python SDK for STACK — trust infrastructure for AI agents.

Install

pip install getstack

Quick start

from getstack import Stack

stack = Stack(api_key="sk_live_...")

# Register an agent
agent = stack.agents.register("my-agent", accountability_mode="enforced")

# Run a mission with automatic checkpoints and checkout
with stack.passports.mission(
    agent_id=agent.id,
    intent="Process invoices from Slack",
    services=["slack", "stripe"],
    checkpoint_interval="5m",
) as mission:
    mission.log("slack", "read_channel", "#invoices")
    mission.log("stripe", "create_invoice")
    # Checkpoints are submitted automatically on schedule
# Checkout is submitted automatically when the block exits

Authentication

# API key (most common)
stack = Stack(api_key="sk_live_...")

# OAuth with auto-refresh
stack = Stack.from_oauth(
    client_id="...",
    client_secret="...",
    access_token="...",
    refresh_token="...",
)

# Session JWT (dashboard integrations)
stack = Stack.from_session(session_token="...")

Continuous missions (24/7 agents)

for mission in stack.passports.continuous_mission(
    agent_id=agent.id,
    intent="Monitor Slack channels",
    services=["slack"],
    rotation_interval="4h",
    checkpoint_interval="5m",
):
    while not mission.should_rotate:
        event = wait_for_event()
        mission.log("slack", "read_message")
        process(event)
    # Passport rotates automatically at the boundary

Services

# Agents
stack.agents.register(name, description=None, accountability_mode="enforced")
stack.agents.get(agent_id)
stack.agents.list()
stack.agents.update(agent_id, **fields)
stack.agents.unblock(agent_id)

# Passports
stack.passports.issue(agent_id, intent=None, services=None, ...)
stack.passports.verify(token)
stack.passports.revoke(jti, reason=None)
stack.passports.checkpoint(jti, services_used, actions_count, ...)
stack.passports.checkout(jti, services_used, actions_count, ...)
stack.passports.report(jti)

# Credentials
stack.credentials.get(provider)
stack.credentials.get_by_connection(connection_id)

# Services
stack.services.list()
stack.services.connect_custom(name, credential, ...)
stack.services.verify(connection_id)
stack.services.disconnect(connection_id)

# Reviews
stack.reviews.list(status="flagged")
stack.reviews.decide(checkout_id, decision, notes=None, block_future=False)

# Drop-offs
stack.dropoffs.create(from_agent_id, to_agent_id, schema, ...)
stack.dropoffs.deposit(dropoff_id, data, agent_id)
stack.dropoffs.collect(dropoff_id, agent_id)

# Notifications
stack.notifications.list()
stack.notifications.create(channel_type, destination, ...)
stack.notifications.delete(channel_id)

# Audit
stack.audit.list(page=1, limit=50, action=None, agent_id=None)

Links

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

getstack-0.1.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

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

getstack-0.1.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file getstack-0.1.0.tar.gz.

File metadata

  • Download URL: getstack-0.1.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for getstack-0.1.0.tar.gz
Algorithm Hash digest
SHA256 45e998dfa1f60390243e75e2058634f959439c6a79fa57ed6baf6089c0cff925
MD5 6fab135177e26ef4da7c5663bbfa17e4
BLAKE2b-256 7277e56e6b2f90ea909ac225a2abba00572eec0573f2a6e427fd1e4e827d0775

See more details on using hashes here.

File details

Details for the file getstack-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: getstack-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for getstack-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 520b1483a0385ea023a5d49867388cce67a4f77194bd16db30b0256fc77e8577
MD5 acb3f1e0cb184daa40a9743e458aaa74
BLAKE2b-256 24a99864b72406edc729e342ebcd69494f63b9868f7e2c533aaa7b5afc83ceb6

See more details on using hashes here.

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