Skip to content

Integrations

OpenAI Agents SDK integration

Give an OpenAI Agents SDK SandboxAgent a Promigence sandbox, so its shell and file tools run there instead of on your machine. Your agent code stays the same; only the client you pass in changes.

The package is promigence-openai-agents on PyPI, for Python.

Install

Install it and set your key.

Terminal
pip install promigence-openai-agents
export PROMIGENCE_API_KEY=prom_api_...
export PROMIGENCE_SPEND_CAP=5
Language: bash

Example

From the guide Run OpenAI Agents SDK agents in a Promigence sandbox, which goes on to the spend cap, cleaning up, and what the package does not support.

Python
import asyncio
from agents import RunConfig, Runner
from agents.sandbox import SandboxAgent, SandboxRunConfig
from promigence_openai_agents import PromigenceSandboxClient, PromigenceSandboxClientOptions

agent = SandboxAgent(name="coder", instructions="Use the shell.")

async def main() -> None:
    result = await Runner.run(
        agent,
        "Write a note to note.txt and read it back.",
        run_config=RunConfig(sandbox=SandboxRunConfig(
            client=PromigenceSandboxClient(),
            options=PromigenceSandboxClientOptions(image="python:3.12-slim", spend_cap=1),
        )),
    )
    print(result.final_output)

asyncio.run(main())
Language: python

Next

Get started

Leave your work email and we will get you started.

See our Privacy Policy for how we use your email.