Skip to content

Local Safe Code Executor with docker and output file capturing support #3075

Closed as not planned

Description

@AlexFierro9

** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.

Is your feature request related to a problem? Please describe.
As someone using ADK in corporate environments, I am surprised to see the UnSafeLocalCodeExecutor is only a exec tool, I think it is possible to make it more robust for a lot of usecases.

Describe the solution you'd like
I'd like to the current implementation more robust so that gives us a secure and isolated space to run our code. Here are my 2 ideas for how making it work:

Better Process Handling:

Running in a Sub-process: It could run code in a separate child process. That way, it's isolated from the main ADK tool process, and we can cleanly capture all the output (stdout, stderr) and exit codes without worrying about it interfering with anything else.

Docker Integration: For total isolation, it would be amazing if it could run code inside a Docker container. We could point it to a Dockerfile or a pre-built image, ensuring the environment is always clean and consistent, just like in our CI/CD pipelines.

Capturing Generated Files:

It would also be super helpful if the executor could grab files created during a run, like logs or reports. Maybe we could tell it which files or folders to look for, and it would pull them out of the execution environment for us to inspect.

Describe alternatives you've considered
Adding security checks to current execs just seems more like a band-aid, this could be something that over time may be developed or repurposed for other use cases. I also considered a VM but that is definitely an overkill

Activity

  1. added theissue type on Oct 2, 2025
  2. AlexFierro9 commented on Oct 11, 2025

    @AlexFierro9
    Author

    Hey Guys anything? can I be assigned to this if the other maintainers are busy? @seanzhou1023 @boyangsvl

  3. boyangsvl commented on Oct 15, 2025

    @boyangsvl
    Collaborator

    I've assigned the issue to you @AlexFierro9 , thank you for the contribution!

  4. AlexFierro9 commented on Oct 20, 2025

    @AlexFierro9
    Author
  5. klateefa commented on Nov 26, 2025

    @klateefa

    @AlexFierro9 Thank you for reporting this. I understand the request is currently under review. Please keep me posted if anything else is needed. Thanks for your patience.

  6. added
    needs review[Status] The PR/issue is awaiting review from the maintainer
    on Nov 26, 2025
  7. self-assigned this
    on Sep 22, 2026
  8. GWeale commented on Sep 22, 2026

    @GWeale
    Collaborator

    closing as a duplicate of #5302, which asks for the part still missing: ContainerCodeExecutor copying input files in and generated files back out. a pull request for it is open in #5321. the other two asks exist today. ContainerCodeExecutor runs code in docker from a prebuilt image or a Dockerfile path, and UnsafeLocalCodeExecutor runs each program in its own child python process and reports stdout, stderr and the exit code, 2.9.2 included. open a new issue if you want us to look at it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

needs review[Status] The PR/issue is awaiting review from the maintainertools[Component] This issue is related to tools

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions