Skip to content

Allow gradle to run in sandbox #5228

Closed
Closed

Description

@esafak

What version of Codex is running?

codex-cli 0.46.0

What subscription do you have?

Plus

Which model were you using?

gpt-5-codex

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

codex does not want to use gradle due to its sandbox.

What steps can reproduce the bug?

Ask codex to use gradle

What is the expected behavior?

No response

Additional information

No response

Activity

  1. github-actions commented on Oct 15, 2025

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  2. IRus commented on Nov 4, 2025

    @IRus

    I've added this into ~/.codex/config.toml to solve this issue:

    sandbox_mode = "workspace-write"
    
    [sandbox_workspace_write]
    network_access = true
    writable_roots = ["/Users/user/.gradle"]
    

    Seems it's working for me

  3. wcarmon commented on Jan 2, 2026

    @wcarmon

    You are my hero @IRus 🙏

    on Linux, with gradle installed via sdkman, this worked: (small modification in writable_roots)

    sandbox_mode = "workspace-write"
    
    [sandbox_workspace_write]
    network_access = true
    writable_roots = [
      "/tmp/gradle-user-home",
      "/home/<my-user-name>/.gradle"
    ]
    
  4. Glavo commented on Apr 23, 2026

    @Glavo

    One solution is to require Codex to specify GRADLE_USER_HOME when executing Gradle in AGENTS.md:

    ## Gradle
    
    - When invoking Gradle in this repository, always set `GRADLE_USER_HOME` to the workspace-local `.gradle-user-home` directory.
    - Prefer commands such as `./gradlew -g .gradle-user-home ...` or the equivalent environment-variable-based configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsandboxIssues related to permissions or sandboxing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions