Skip to main content

Python SDK for agentkernel — run AI coding agents in secure, isolated microVMs

Project description

agentkernel

Python SDK for agentkernel — run AI coding agents in secure, isolated microVMs.

Install

pip install agentkernel-sdk

Requires Python 3.10+.

Quick Start

from agentkernel import AgentKernel

with AgentKernel() as client:
    result = client.run(["echo", "hello"])
    print(result.output)  # "hello\n"

Async

from agentkernel import AsyncAgentKernel

async with AsyncAgentKernel() as client:
    result = await client.run(["echo", "hello"])
    print(result.output)

Sandbox Sessions

with AgentKernel() as client:
    with client.sandbox("test", image="python:3.12-alpine") as sb:
        sb.run(["pip", "install", "numpy"])
        result = sb.run(["python3", "-c", "import numpy; print(numpy.__version__)"])
        print(result.output)
    # sandbox auto-removed

Streaming

for event in client.run_stream(["python3", "script.py"]):
    if event.type == "output":
        print(event.data["data"], end="")

Configuration

client = AgentKernel(
    base_url="http://localhost:18888",  # default
    api_key="sk-...",                  # optional
    timeout=30.0,                      # default
)

Or use environment variables:

export AGENTKERNEL_BASE_URL=http://localhost:18888
export AGENTKERNEL_API_KEY=sk-...

License

MIT

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

agentkernel_sdk-0.7.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

agentkernel_sdk-0.7.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file agentkernel_sdk-0.7.0.tar.gz.

File metadata

  • Download URL: agentkernel_sdk-0.7.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agentkernel_sdk-0.7.0.tar.gz
Algorithm Hash digest
SHA256 44974c1d80108e8808d6b88db123ac5679600b7c41a3d7a84c4423b2a175d0b4
MD5 4b4d1b2f0a562a994875f60ba4800f85
BLAKE2b-256 c57587f4618c718545ad5e76e3ff4a31ca779a9f2ac15c476602e27e888c4ea2

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentkernel_sdk-0.7.0.tar.gz:

Publisher: sdk-publish.yml on thrashr888/agentkernel

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

File details

Details for the file agentkernel_sdk-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agentkernel_sdk-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c9659b2f02175ddfa057f57f065268602a835ffe2fb0b810c0f946d39eb155c4
MD5 d1dcc92bc3fcd4afb7646073d4223c12
BLAKE2b-256 bb2edb4b0adbf5ae8b430fef8b9c831af781d7b9656d2c281a75d40fcf302a5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentkernel_sdk-0.7.0-py3-none-any.whl:

Publisher: sdk-publish.yml on thrashr888/agentkernel

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