Skip to main content

GROTTE SDK that give agents cloud environments

Project description

GROTTE Python SDK

EU-sovereign code execution sandboxes for AI agents and developer workflows. Built by Parallactic AI SAS.

Install

pip install grotte

Quick start

from grotte import Sandbox

sbx = Sandbox.create("base")
result = sbx.commands.run("echo Hello GROTTE")
print(result.stdout)        # Hello GROTTE
sbx.kill()

Async variant:

from grotte import AsyncSandbox

sbx = await AsyncSandbox.create("base")
result = await sbx.commands.run("echo Hello GROTTE")
print(result.stdout)
await sbx.kill()

Authentication

Set your API key as an environment variable:

export GROTTE_API_KEY=grt_your_key_here

Get your API key at app.grotte.parallactic.fr.

API

Sandbox

sbx = Sandbox.create(template="base", timeout=60)

# Run a command
result = sbx.commands.run("ls -la")
result.stdout    # str
result.stderr    # str
result.exit_code # int

# File operations
sbx.files.write("/tmp/hello.txt", "hi")
content = sbx.files.read("/tmp/hello.txt")
files = sbx.files.list("/tmp")

sbx.kill()

Lifecycle control

# Extend the sandbox before it expires
sbx.set_timeout(600)        # set absolute timeout, seconds
sbx.refresh_ttl(60)         # add 60s to the current TTL

# Pause + resume (paused sandboxes keep filesystem state)
sbx.pause()
restored = Sandbox.connect(sbx.sandbox_id)

# Snapshot the running filesystem to a reusable template
snap = sbx.create_snapshot()
fresh = Sandbox.create(snap.snapshot_id)

Pass lifecycle={"on_timeout": "pause", "auto_resume": True} to Sandbox.create() to make the sandbox auto-pause on timeout and auto-resume on the next request.

Network isolation

Cut egress at runtime — useful for executing untrusted or AI-generated code without giving it internet access.

sbx = Sandbox.create("base")
sbx.set_network(internet_access=False)
sbx.commands.run("curl --max-time 3 https://example.com")  # times out
sbx.set_network(internet_access=True)                      # restore

To start a sandbox with no network from creation, pass allow_internet_access=False to Sandbox.create() (works the same as network={"deny_out": ["0.0.0.0/0"]}).

Templates

Available sandbox environments:

Template Description
base Ubuntu 22.04 + bash
python-3.12 Python 3.12 environment
node-22 Node.js 22 environment

Configuration

sbx = Sandbox.create(
    template="base",
    timeout=60,                # max sandbox lifetime, seconds
    api_key="grt_…",           # override env var
)

Links

License

MIT · Based on E2B SDK by FoundryLabs, Inc. See NOTICE for full attribution and a summary of significant changes.

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

grotte-0.1.6.tar.gz (160.9 kB view details)

Uploaded Source

Built Distribution

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

grotte-0.1.6-py3-none-any.whl (303.0 kB view details)

Uploaded Python 3

File details

Details for the file grotte-0.1.6.tar.gz.

File metadata

  • Download URL: grotte-0.1.6.tar.gz
  • Upload date:
  • Size: 160.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.0 CPython/3.12.3 Linux/6.17.0-23-generic

File hashes

Hashes for grotte-0.1.6.tar.gz
Algorithm Hash digest
SHA256 3d3a493ba091fd79fd4add30938901fef8c61e3bbb3f6556a116c7f8c48e0b15
MD5 419fc0996c19a90a9c16303776cb754b
BLAKE2b-256 f6cdeeafd4d9d478db9f8b8e2ef9a20305592cc589aea2bfc748e579833f05bf

See more details on using hashes here.

File details

Details for the file grotte-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: grotte-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 303.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.0 CPython/3.12.3 Linux/6.17.0-23-generic

File hashes

Hashes for grotte-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8fd4c5176dca12bedd3deafe2a90071cdeb55d78bd9270bc4acb7e7dc2d91005
MD5 78c8d7132ba51a21bbdb2b5acef331ad
BLAKE2b-256 c5a3d8b74eab65f6f983a09b0879e16df8febd3b63f3b92a5c55e8f84cfe4ab7

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