[GH-ISSUE #13879] Security & Configuration: Granular Feature Control via .env #9080

Open
opened 2026-04-12 21:55:23 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @viba1 on GitHub (Jan 24, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/13879

Context:

Since version 0.15.0, the --experimental option allows the execution of system commands via the CLI.
Ollama also offers features like tools, thinking (model reasoning steps), and potentially others in the future.
Currently, controlling these features via the .env file is limited or inexistent.

It is not currently possible to:

  • Prevent the activation of --experimental mode ;
  • Restrict the execution of system commands in experimental mode ;
  • Disable individual features like tools or thinking via configuration.

Problem:

The execution of arbitrary system commands (via --experimental) presents a significant security risk, potentially allowing for destructive operations (e.g., format c:/).
Beyond this, the uncontrolled activation of features like tools and reasoning can introduce instability, unexpected behavior, or resource exhaustion in production environments.
A lack of granular control hinders the secure and reliable deployment of Ollama.

Proposed Solution:

Add configuration options (e.g., in ollama.env) to enable/disable individual features.
This would allow administrators to tailor Ollama's behavior to their specific needs and security requirements.

Examples:

  • OLLAMA_DISABLE_EXPERIMENTAL = true: Disables the execution of experimental mode.
  • OLLAMA_DISABLE_COMMANDS = true: Disables the execution of system commands via the CLI.
  • OLLAMA_DISABLE_TOOLS = true: Disables the use of tools.
  • OLLAMA_DISABLE_THINKING = true: Disables the "thinking" (reasoning steps) feature.

Ideally, these features could be disabled by default and explicitly enabled:

  • OLLAMA_ENABLE_EXPERIMENTAL = true
  • OLLAMA_ENABLE_COMMANDS = true
  • OLLAMA_ENABLE_TOOLS = true
  • OLLAMA_ENABLE_THINKING = true

This provides a flexible and secure approach to managing Ollama's functionality.

Benefits:

  • Enhanced Security: Reduces the potential attack surface and mitigates risks associated with uncontrolled feature usage.
  • Increased Flexibility: Allows administrators to customize Ollama’s behavior for different environments.
  • Improved Stability: Enables disabling potentially unstable or resource-intensive features in production.
  • Simplified Configuration: Provides a centralized and easy-to-manage configuration mechanism.
  • Future-Proofing: A scalable solution that can accommodate new features as Ollama evolves.
Originally created by @viba1 on GitHub (Jan 24, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/13879 **Context:** Since version 0.15.0, the `--experimental` option allows the execution of system commands via the CLI. Ollama also offers features like tools, thinking (model reasoning steps), and potentially others in the future. Currently, controlling these features via the `.env` file is limited or inexistent. It is not currently possible to: * Prevent the activation of `--experimental` mode ; * Restrict the execution of system commands in experimental mode ; * Disable individual features like tools or thinking via configuration. **Problem:** The execution of arbitrary system commands (via `--experimental`) presents a significant security risk, potentially allowing for destructive operations (e.g., `format c:/`). Beyond this, the uncontrolled activation of features like tools and reasoning can introduce instability, unexpected behavior, or resource exhaustion in production environments. A lack of granular control hinders the secure and reliable deployment of Ollama. **Proposed Solution:** Add configuration options (e.g., in `ollama.env`) to enable/disable individual features. This would allow administrators to tailor Ollama's behavior to their specific needs and security requirements. Examples: * `OLLAMA_DISABLE_EXPERIMENTAL = true`: Disables the execution of experimental mode. * `OLLAMA_DISABLE_COMMANDS = true`: Disables the execution of system commands via the CLI. * `OLLAMA_DISABLE_TOOLS = true`: Disables the use of tools. * `OLLAMA_DISABLE_THINKING = true`: Disables the "thinking" (reasoning steps) feature. Ideally, these features could be disabled by default and explicitly enabled: * `OLLAMA_ENABLE_EXPERIMENTAL = true` * `OLLAMA_ENABLE_COMMANDS = true` * `OLLAMA_ENABLE_TOOLS = true` * `OLLAMA_ENABLE_THINKING = true` This provides a flexible and secure approach to managing Ollama's functionality. **Benefits:** * **Enhanced Security:** Reduces the potential attack surface and mitigates risks associated with uncontrolled feature usage. * **Increased Flexibility:** Allows administrators to customize Ollama’s behavior for different environments. * **Improved Stability:** Enables disabling potentially unstable or resource-intensive features in production. * **Simplified Configuration:** Provides a centralized and easy-to-manage configuration mechanism. * **Future-Proofing:** A scalable solution that can accommodate new features as Ollama evolves.
GiteaMirror added the feature request label 2026-04-12 21:55:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#9080