Project
Kubernetes Pod Sandbox for Agent Execution
A pydantic-ai-backend contribution that executes agent code in hardened Kubernetes pods with HTTP and API execution modes.
View on GitHub- Team
- Open source
- Role
- Open-source contributor
- Duration
- June 2026
Stack
- Python
- Kubernetes
- Pydantic AI
- Docker
- HTTP
- seccomp
Overview
This contribution adds a sandboxed execution backend to pydantic-ai-backend, the open-source project from vstorm-co. Instead of running agent-generated code inside the main application process, the backend launches workloads in Kubernetes pods with explicit isolation boundaries.
What I Built
- Added the KubernetesPodSandbox backend for running agent code in Kubernetes pods.
- Implemented two execution modes: HTTP and API.
- Added rootless execution and seccomp hardening.
- Wrote contract tests against the shared BaseSandbox interface.
Integration
The backend implements the existing sandbox interface, so applications can use Kubernetes execution without changing their agent-facing code. I also use this approach in Tansy to separate generated code from the main application.