kubectl-ai icon indicating copy to clipboard operation
kubectl-ai copied to clipboard

Support container-based sandbox for agent execution to improve safety and portability

Open denverdino opened this issue 6 months ago • 6 comments

Do we have the plan for the container-based sandbox for agent execution?

By isolating each agent’s commands in its own container, we can protect the host to prevent potentially harmful or errant shell commands.

And it can improve portability to package the required kubectl, bash, jq tools container image to ensure consistent behavior across environment.

Thanks

denverdino avatar Jun 12 '25 01:06 denverdino

Yes, this is high on our list and we are exploring it and we will be very happy to see POC from community as well.

Can you share the host/environment (linux/mac/windows) container-engine (docker, podman, k8s) where you expect it to run. Recently apple published a container toolkit for running containers on mac, so that is also an interesting option.

/cc @justinsb

droot avatar Jun 12 '25 01:06 droot

@denverdino I also saw bunch of issues/PRs from you. Would you mind sharing -- how you are using kubectl-ai ? We are collecting some data point that will help us shape the roadmap better. Thanks.

droot avatar Jun 12 '25 01:06 droot

Thanks, kubectl-ai is a nice agent to simplify the daily O&M for kubernetes cluster. I’d love to see it become even more practical for common use cases, so that users without deep Kubernetes expertise can benefit from its capabilities.

denverdino avatar Jun 12 '25 01:06 denverdino

@droot just to make it clear for myself, this is actually the way how KPT call its functions right?

selimacerbas avatar Jun 12 '25 06:06 selimacerbas

Thanks, kubectl-ai is a nice agent to simplify the daily O&M for kubernetes cluster. I’d love to see it become even more practical for common use cases, so that users without deep Kubernetes expertise can benefit from its capabilities.

Ack. yes, sandboxing and isolation is high our list and you should see some progress on it soon.

@droot just to make it clear for myself, this is actually the way how KPT call its functions right?

Containers do address some of the issues but we have also learnt that dependency on docker/podman also comes with lot of UX friction. So worth exploring some alternatives.

droot avatar Jun 16 '25 16:06 droot

We can borrow ideas from the gemini-cli project. It has some very well thought sandbox options

droot avatar Jun 25 '25 23:06 droot