Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ interface PresetTemplate {
}

const PRESET_TEMPLATES: PresetTemplate[] = [
{
name: "Claude (Danger Mode)",
description: "Claude Code with permissions auto-approved",
preset: {
name: "Claude Danger",
cwd: "",
commands: ["claude --dangerously-skip-permissions"],
},
},
Comment on lines +24 to +32
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx

Repository: superset-sh/superset

Length of output: 8312


🏁 Script executed:

# Search for preset execution logic
rg -n "executePreset|runPreset|ipcRenderer.invoke.*command" apps/desktop/src/renderer --type=ts --type=tsx -A 5

Repository: superset-sh/superset

Length of output: 91


🏁 Script executed:

# Search for warning or confirmation UI related to presets
rg -n "Dialog|confirm|warning|danger" apps/desktop/src/renderer --type=ts --type=tsx | grep -i "preset\|danger\|permission" -A 2 -B 2

Repository: superset-sh/superset

Length of output: 91


🏁 Script executed:

# Look for where the preset commands are actually executed
rg -n "\.commands\[" apps/desktop/src/renderer --type=ts --type=tsx -B 3 -A 3

Repository: superset-sh/superset

Length of output: 91


🏁 Script executed:

rg -n "executePreset|runPreset|exec.*command|spawn.*command" apps/desktop/src/renderer --type-list | head -20

Repository: superset-sh/superset

Length of output: 453


🏁 Script executed:

rg -n "commands\[" apps/desktop/src/renderer -C 3

Repository: superset-sh/superset

Length of output: 1027


🏁 Script executed:

# Search in main process for preset execution
rg -n "executePreset|runPreset|exec.*preset" apps/desktop/src/main -C 3

Repository: superset-sh/superset

Length of output: 46


🏁 Script executed:

# Check PresetRow component for any warnings
cat -n apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetRow.tsx

Repository: superset-sh/superset

Length of output: 188


🏁 Script executed:

# Look for where commands are actually run
rg -n "ipcRenderer.invoke|window.ipc" apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/ -C 5

Repository: superset-sh/superset

Length of output: 46


🏁 Script executed:

find apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings -type f -name "*.tsx" -o -name "*.ts"

Repository: superset-sh/superset

Length of output: 755


🏁 Script executed:

# Search for where presets are executed
rg -n "createPreset|preset" apps/desktop/src/main -C 3

Repository: superset-sh/superset

Length of output: 46


🏁 Script executed:

# Look for terminal or command execution logic
rg -n "spawn|exec|terminal" apps/desktop/src/main -C 2

Repository: superset-sh/superset

Length of output: 32033


🏁 Script executed:

# Check the presets hook/query
cat -n apps/desktop/src/renderer/react-query/presets.ts

Repository: superset-sh/superset

Length of output: 144


🏁 Script executed:

cat -n apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetRow/PresetRow.tsx

Repository: superset-sh/superset

Length of output: 3536


🏁 Script executed:

# Find the presets hook/query
find apps/desktop/src/renderer -name "*.ts" -o -name "*.tsx" | xargs grep -l "usePresets\|presets" | head -10

Repository: superset-sh/superset

Length of output: 645


🏁 Script executed:

# Search for where preset commands might be executed
rg -n "commands.*forEach|commands\.map|for.*commands" apps/desktop/src/renderer apps/desktop/src/main -C 3

Repository: superset-sh/superset

Length of output: 2260


🏁 Script executed:

# Check for any IPC handlers related to preset execution
rg -n "handle.*preset\|ipcMain\.handle" apps/desktop/src/main -C 3

Repository: superset-sh/superset

Length of output: 46


🏁 Script executed:

cat -n apps/desktop/src/renderer/react-query/presets/index.ts

Repository: superset-sh/superset

Length of output: 2230


🏁 Script executed:

cat -n apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabsCommandDialog/index.tsx

Repository: superset-sh/superset

Length of output: 2408


🏁 Script executed:

# Search for where presets are actually used/executed
rg -n "preset.*command|executeCommand\|runCommand" apps/desktop/src/renderer -C 5

Repository: superset-sh/superset

Length of output: 3652


🏁 Script executed:

# Look for confirmation dialogs or warnings in the codebase
rg -n "Dialog|Alert|Confirm" apps/desktop/src/renderer/screens/main/components/WorkspaceView -C 2

Repository: superset-sh/superset

Length of output: 18782


🏁 Script executed:

# Find Terminal component and how it executes commands
rg -n "initialCommands\|Terminal.*component" apps/desktop/src/renderer -C 5 | head -50

Repository: superset-sh/superset

Length of output: 46


🏁 Script executed:

# Search for where commands are actually written to terminal
rg -n "write.*command|\.write\(" apps/desktop/src/renderer/screens/main/components/WorkspaceView -C 3

Repository: superset-sh/superset

Length of output: 2952


🏁 Script executed:

cat -n apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx | head -100

Repository: superset-sh/superset

Length of output: 5020


🏁 Script executed:

# Find where initialCommands are sent to main process
rg -n "initialCommands" apps/desktop/src/renderer -B 3 -A 3

Repository: superset-sh/superset

Length of output: 8443


🏁 Script executed:

# Check createOrAttach method to see how initialCommands are handled
rg -n "createOrAttach" apps/desktop/src -B 5 -A 10

Repository: superset-sh/superset

Length of output: 50376


🏁 Script executed:

# Find where initialCommands are written to terminal
rg -n "initialCommands" apps/desktop/src/lib/trpc/routers/terminal -B 3 -A 3

Repository: superset-sh/superset

Length of output: 1737


🏁 Script executed:

# Check the terminal router implementation
cat -n apps/desktop/src/lib/trpc/routers/terminal/terminal.ts | head -150

Repository: superset-sh/superset

Length of output: 5069


🏁 Script executed:

# Check if initialCommands are actually used in createOrAttach
rg -n "initialCommands" apps/desktop/src/main/lib/terminal/session.ts -B 3 -A 3

Repository: superset-sh/superset

Length of output: 656


🏁 Script executed:

# Check the full CreateSessionParams type
rg -n "CreateSessionParams\|interface.*Params" apps/desktop/src/main/lib/terminal/types.ts -B 2 -A 8

Repository: superset-sh/superset

Length of output: 46


Add confirmation dialog when executing presets with dangerous flags.

These presets execute immediately without any warning or confirmation when selected:

  • "Claude (Danger Mode)" runs --dangerously-skip-permissions
  • "Codex (Danger Mode)" runs with --ask-for-approval never
  • "Gemini CLI (YOLO)" runs with --yolo

The commands are written directly to the terminal via setupDataHandler in session.ts (line 166-167) with no validation or user confirmation. Add an AlertDialog in TabsCommandDialog to warn users before executing presets containing dangerous flags.

{
name: "Codex (Danger Mode)",
description: "OpenAI Codex with full sandbox access and high reasoning",
Expand All @@ -33,12 +42,21 @@ const PRESET_TEMPLATES: PresetTemplate[] = [
},
},
{
name: "Claude (Danger Mode)",
description: "Claude Code with permissions auto-approved",
name: "Gemini CLI (YOLO)",
description: "Google Gemini CLI with auto-approve all actions",
preset: {
name: "Claude Danger",
name: "Gemini YOLO",
cwd: "",
commands: ["claude --dangerously-skip-permissions"],
commands: ["gemini --yolo"],
},
},
Comment on lines 44 to +52
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Google Gemini CLI --yolo flag documentation

💡 Result:

The --yolo (short: -y) flag enables "YOLO mode" in the Gemini CLI: it auto-approves all actions the agent would otherwise prompt for (file edits, shell commands, tool runs), i.e., it disables interactive permission prompts for rapid/headless automation. It can also be selected via --approval-mode=yolo. Use with extreme caution (run only in trusted/sandboxed environments). Example: gemini --yolo "Fix failing tests" or gemini -p "Refactor X" --approval-mode=yolo. [1][2][3]

Sources:

  • Gemini CLI docs (Google Developers / Code Assist). [1]
  • Official gemini-cli docs (GitHub Pages / config & CLI reference). [2]
  • gemini-cli repository / flag reference (shows -y, --yolo and --approval-mode). [3]

🌐 Web query:

Gemini CLI auto-approve actions command line flag

💡 Result:

Use the --yolo flag or the --approval-mode flag.

Examples:

  • gemini --yolo (auto-approve all actions). [1]
  • gemini --approval-mode=yolo (same as --yolo). [1][2]
  • gemini --approval-mode=auto_edit (auto-approve edit/write tools but still prompt for others). [1][2]

References: Gemini CLI docs and CLI API reference. [1] [2]


Remove or warn users about the inherent risks of the --yolo mode.

The gemini --yolo flag is a documented Gemini CLI feature that auto-approves all actions without prompts, as documented in the official Gemini CLI reference. However, the official documentation explicitly warns: "Use with extreme caution (run only in trusted/sandboxed environments)." Adding this preset without a prominent security disclaimer could lead users to inadvertently execute untrusted AI-generated commands. Consider either removing this preset or adding a clear warning in the UI that explains the severe risks of auto-approval mode.

🤖 Prompt for AI Agents
In
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
around lines 44 to 52, the preset exposing "gemini --yolo" provides an
auto-approve mode that is dangerous; either remove this preset or add a clear,
prominent security warning and require an explicit opt-in before use. Fix by (a)
removing the preset entry entirely or (b) keeping it only after adding metadata
fields like "danger: true" and "warningText" explaining "auto-approves all
actions — use only in trusted/sandboxed environments," display that warning in
the UI when the preset is selected, and require a checkbox/confirmation to
enable it; ensure the preset is not selected by default and update any preset
documentation/tests accordingly.

{
name: "Cursor Agent",
description: "Cursor AI agent for terminal-based coding assistance",
preset: {
name: "Cursor Agent",
cwd: "",
commands: ["cursor-agent"],
},
},
];
Expand Down