Skip to content

feat(agent): add sandbox client for gVisor-isolated code execution#20

Closed
EtnDiaz wants to merge 1 commit intomainfrom
feature/agent-sandbox
Closed

feat(agent): add sandbox client for gVisor-isolated code execution#20
EtnDiaz wants to merge 1 commit intomainfrom
feature/agent-sandbox

Conversation

@EtnDiaz
Copy link
Copy Markdown

@EtnDiaz EtnDiaz commented Mar 24, 2026

What

Adds flymyai.agent — a thin client over the agent-sandbox REST API for running code in isolated Kubernetes pods.

Usage

from flymyai.agent import execute_code

result = execute_code(
    sandbox_url="http://agent-sandbox.sandboxes.svc:8080",
    code="print(sum(range(100)))",
)
print(result.stdout)    # 4950
assert result.ok

Async:

from flymyai.agent import async_execute_code

result = await async_execute_code(sandbox_url="...", code="print(42)")

Context managers (SandboxClient, AsyncSandboxClient) are also available for multiple executions sharing one HTTP client.

Files

  • flymyai/agent/sandbox.pySandboxClient, AsyncSandboxClient, SandboxResult, execute_code(), async_execute_code()
  • flymyai/agent/__init__.py — public exports
  • README.md — Agent Sandbox section

Notes

  • No new dependencies — uses httpx which is already in pyproject.toml
  • The sandbox service (agent-sandbox) must be deployed separately: gitlab.flymy.ai/fma/core/agent-sandbox
  • Supported languages: python, bash, javascript, sh

Adds flymyai.agent module — a thin client over the agent-sandbox REST API
that runs code in isolated Kubernetes pods (gVisor/runsc).

- sandbox.py: SandboxClient (sync), AsyncSandboxClient (async),
  SandboxResult dataclass, execute_code() and async_execute_code() helpers
- __init__.py: public exports
- README.md: Agent Sandbox section with sync/async usage examples
@EtnDiaz
Copy link
Copy Markdown
Author

EtnDiaz commented Mar 24, 2026

Closing — the client should call custom MCP tools through the backend API, not directly to agent-sandbox. Will reopen with the correct approach after the backend endpoint lands.

@EtnDiaz EtnDiaz closed this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant