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.2.0.tar.gz (17.8 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.2.0-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for getstack-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7e051c25e7f6b40f4745358f3c0fcbf9becfcfdc426d6f15a96124346e283c0d
MD5 a9bed72163fa67ca9ac538d979ef3e30
BLAKE2b-256 e05e1be3cdc28a6db65ba960796dcf4e2050dd1277d6cb3ea516c3d068f0f22f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for getstack-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9bca7c6e174ef452bdbe454dc8a122a1120aafebf9915d2ac22e748f187c40e6
MD5 60e7a1feb05c2b7e2191fa524ffae7dc
BLAKE2b-256 4b6f048516ad5f50f235b7bb4e4d259dd5ceea48174484e583908338078c9099

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