Command substitution block should be user-configurable, not a hardcoded wall
What would you like to be added?
A allowCommandSubstitution toggle in settings.json (defaulting to false) that lets users opt out of the hardcoded command substitution block. In YOLO mode, this should either default to true or surface a warning instead of a silent block so the model can adapt its approach.
Why is this needed?
The current hardcoded block creates two problems:
-
Token/turn waste — the model writes out a full command with
$()substitution, the CLI blocks it at execution time, and the entire turn is wasted with nothing to show for it. The model has no way to know in advance the command will be blocked. -
YOLO mode contradiction — in YOLO mode the user has explicitly opted into "run everything without asking me." Silently blocking an entire command class undercuts that contract without any warning.
A configurable toggle keeps the safe default for everyone while letting users who understand the risk opt out.
Additional context
Reproduction: run any agentic task that requires command substitution (e.g. security triage, process inspection) in YOLO mode. The model generates a valid command, the CLI blocks it silently, the turn is lost, and the tokens still count against the user's quota — making this a compounding cost with no output to show for it.
Found possible duplicate issues:
- #6436
If you believe this is not a duplicate, please remove the status/possible-duplicate label.
#6436 raised the same pain point but was closed without implementation. This issue proposes a concrete approach: a allowCommandSubstitution toggle in settings.json defaulting to false, rather than just overriding in YOLO mode. The scope is broader — YOLO mode is one part of it, but the configurable toggle gives all users control regardless of approval mode.
What would you like to be added?
A
allowCommandSubstitutiontoggle insettings.json(defaulting tofalse) that lets users opt out of the hardcoded command substitution block. In YOLO mode, this should either default totrueor surface a warning instead of a silent block so the model can adapt its approach.Why is this needed?
The current hardcoded block creates two problems:
- Token/turn waste — the model writes out a full command with
$()substitution, the CLI blocks it at execution time, and the entire turn is wasted with nothing to show for it. The model has no way to know in advance the command will be blocked.- YOLO mode contradiction — in YOLO mode the user has explicitly opted into "run everything without asking me." Silently blocking an entire command class undercuts that contract without any warning.
A configurable toggle keeps the safe default for everyone while letting users who understand the risk opt out.
Additional context
Reproduction: run any agentic task that requires command substitution (e.g. security triage, process inspection) in YOLO mode. The model generates a valid command, the CLI blocks it silently, the turn is lost, and the tokens still count against the user's quota — making this a compounding cost with no output to show for it.
I cannot reproduce the problem.
I cannot reproduce the problem.
/assign
@gemini-cli-robot "Assign Issue on Comment: All jobs have failed"
/assign
👋 @manohar-munna, you've been assigned to this issue! Thank you for taking the time to contribute. Make sure to check out our contributing guidelines.
This seems like a good place for a policy knob with a safe default and an audit trail. Users who need stricter protection can keep the block, but teams with known-good workflows should be able to tune it without fighting the whole agent. A simple allow/deny log would make the behavior easier to trust.
/assign
@mehul-q Thanks for taking interest but this issue is already assigned. We'd still love to have you contribute. Check out our Help Wanted list for issues where we need some extra attention.
assign
/assign
@CodeItAlone Thanks for taking interest but this issue is already assigned. We'd still love to have you contribute. Check out our Help Wanted list for issues where we need some extra attention.
/assign
@ChampionNinja Thanks for taking interest but this issue is already assigned. We'd still love to have you contribute. Check out our Help Wanted list for issues where we need some extra attention.
The current behavior is truly surprising. The harness displays the command it is about to execute and requests permission, yet when I respond with "yes," it denies the request. If the answer is "no" regardless of my input, why bother asking?
This whole process feels like security theater, especially since the model immediately rewrites the command in Python and prompts me again after triggering the "Blocked: command substitution detected in shell command" error.
While I understand that commands containing such substitutions might warrant caution under security policies, the system should honor the user’s "yes." The same applies to "yolo" mode; if I explicitly tell the system to run it, it should do so.
/assign
@jeelsoni01 Thanks for taking interest but this issue is already assigned. We'd still love to have you contribute. Check out our Help Wanted list for issues where we need some extra attention.
/assign