[PR #14889] x: harden bash approval prompts with parser-based analysis #25438

Open
opened 2026-04-19 18:13:12 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14889
Author: @EmilioSchi
Created: 3/16/2026
Status: 🔄 Open

Base: mainHead: x-bash-approval-more-security


📝 Commits (1)

  • b167142 harden bash approval prompts with parser-based analysis

📊 Changes

9 files changed (+2735 additions, -874 deletions)

View changed files

📝 go.mod (+1 -0)
📝 go.sum (+2 -0)
📝 x/agent/approval.go (+359 -645)
x/agent/approval_bash.go (+1425 -0)
x/agent/approval_bash_test.go (+575 -0)
x/agent/approval_browser.go (+46 -0)
📝 x/agent/approval_test.go (+228 -195)
📝 x/cmd/run.go (+36 -34)
📝 x/cmd/run_test.go (+63 -0)

📄 Description

Fixes #14766

Split approval handling into bash and browser helpers.

Replace static bash allow/deny checks with parser-based suspicious command analysis, surface explicit warnings and allowlist scope in approval prompts, and clean up tool output rendering and response formatting.

Add tests for bash analysis, selector behavior, and run output handling.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/14889 **Author:** [@EmilioSchi](https://github.com/EmilioSchi) **Created:** 3/16/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `x-bash-approval-more-security` --- ### 📝 Commits (1) - [`b167142`](https://github.com/ollama/ollama/commit/b16714231c9045029ee9c34cf48829da7f3acdb0) harden bash approval prompts with parser-based analysis ### 📊 Changes **9 files changed** (+2735 additions, -874 deletions) <details> <summary>View changed files</summary> 📝 `go.mod` (+1 -0) 📝 `go.sum` (+2 -0) 📝 `x/agent/approval.go` (+359 -645) ➕ `x/agent/approval_bash.go` (+1425 -0) ➕ `x/agent/approval_bash_test.go` (+575 -0) ➕ `x/agent/approval_browser.go` (+46 -0) 📝 `x/agent/approval_test.go` (+228 -195) 📝 `x/cmd/run.go` (+36 -34) 📝 `x/cmd/run_test.go` (+63 -0) </details> ### 📄 Description Fixes #14766 Split approval handling into bash and browser helpers. Replace static bash allow/deny checks with parser-based suspicious command analysis, surface explicit warnings and allowlist scope in approval prompts, and clean up tool output rendering and response formatting. Add tests for bash analysis, selector behavior, and run output handling. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 18:13:12 -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#25438