Skip to main content

Python SDK for inis.run agent sandboxes

Project description

inis.run Python SDK

Run untrusted or AI-generated code in its own isolated VM.

PyPI License: MIT Python

Install

pip install inis

Quickstart

from inis import Client

client = Client()  # reads INIS_API_KEY (and INIS_BASE_URL) from the environment

with client.session() as session:
    session.exec(["pip", "install", "httpx", "-q"])
    session.files.write("/workspace/out.txt", "hello")
    print(session.files.read("/workspace/out.txt"))

    preview = session.expose(8765)
    print(preview.preview_url)

# One-shot execution (throwaway session, no cleanup needed)
result = client.execute(language="python", code="print(42)")
print(result.stdout)

# Re-attach to a session created elsewhere, by ID
session = client.sessions.attach("ses_123")

client.session() returns a context manager that destroys the session on exit. Use client.sessions.create(...) directly if you want to manage its lifetime yourself, and client.sessions.attach(id) to reconnect to a session you don't own — that call never destroys it.

Timeouts

Client(timeout=...) and Session(timeout=...) are seconds (httpx convention). The TypeScript SDK's timeoutMs is milliseconds (JS convention) — a deliberate per-language idiom, not drift.

Links

Built and run in the EU. Your code and data never leave Europe.

License

MIT — see LICENSE.

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

inis-0.1.0.tar.gz (88.7 kB view details)

Uploaded Source

Built Distribution

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

inis-0.1.0-py3-none-any.whl (61.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: inis-0.1.0.tar.gz
  • Upload date:
  • Size: 88.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for inis-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f43db6453c0f5e6883e7663e801e523129e8b0ec23740523026787786969eb0c
MD5 6f824bd5c73dc476c978887d142e5786
BLAKE2b-256 f3226ccf574e53d70c9002e83163e942ce85fae2e33ba0c51c5c04ec853a1c76

See more details on using hashes here.

Provenance

The following attestation bundles were made for inis-0.1.0.tar.gz:

Publisher: sdk-python-publish.yml on 4ver/inis.run

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

File details

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

File metadata

  • Download URL: inis-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 61.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for inis-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ce56c0d24ecbc380a2e8782ac55cfa32a9b47f3963f64578d21fafe28f764ad
MD5 d2583f98a995ccacf0047bef9a1860d3
BLAKE2b-256 14e48e1f8611184a2a4054b4dbaf57cb57c8732bad5926d37590f5576db185f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for inis-0.1.0-py3-none-any.whl:

Publisher: sdk-python-publish.yml on 4ver/inis.run

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