# agy print mode on Windows: allowed gh command is denied intermittently Summary

**URL:** <https://discuss.ai.google.dev/t/agy-print-mode-on-windows-allowed-gh-command-is-denied-intermittently-summary/188235>\
**Category:** Google Antigravity\
**Tags:** bug\
**Created:** [October 12, 2026, 3:33am UTC](https://discuss.ai.google.dev/t/agy-print-mode-on-windows-allowed-gh-command-is-denied-intermittently-summary/188235 "2026-10-12T03:33:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harel\_Shuker](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/harel_shuker/32/156406_2.png) [@Harel\_Shuker](https://discuss.ai.google.dev/u/Harel_Shuker)\
**Post date:** [October 12, 2026, 3:33am UTC](https://discuss.ai.google.dev/t/agy-print-mode-on-windows-allowed-gh-command-is-denied-intermittently-summary/188235/1 "2026-10-12T03:33:40Z")

</div>

## Summary

In print mode on Windows, `agy` soft-denies a command that matches an allow rule. The same command, rules and folder give different results from run to run: 2 allowed, 13 denied. The same version and rules pass every time on macOS.

## Environment

- Windows 10 Home 10.0.19045, shell reported by agy: `powershell` (Windows PowerShell 5.1)
- agy 1.3.3 (language server 1.3.3), `toolPermission=request-review`
- GitHub CLI 2.102.0, on the system PATH as `gh.exe`

## Steps to reproduce

1. `%USERPROFILE%\.gemini\antigravity-cli\settings.json` contains:

2. Run, several times:

## Expected

`gh api user --jq .login` runs every time, as it does on macOS.

## Actual

Most runs print: `jetski: no output produced — a tool required the "command" permission that headless mode cannot prompt for, so it was auto-denied.` and the log shows `Print mode: soft-denying tool confirmation "RunCommand" at step 2`. Exit code is 0.

| Configuration | Runs | Allowed | Denied |
| --- | --- | --- | --- |
| Rules in `settings.json` only (same as macOS) | 4 | 0 | 4 |
| `command(gh)`, `command(git)` also added to `userSettings.globalPermissionGrants.allow` in `%USERPROFILE%\.gemini\config\config.json` (log: `stored shared config permissions: allow=3`) | 11 | 2 | 9 |

Adding the rules to `config.json` made no reliable difference. `git --version` was denied in all 3 runs, in both configurations.

## Identical tool-call records, different outcome

From the conversation databases (`conversations\<id>.db`), same `Cwd` in both:

Allowed (23:27:14):

```auto
{"CommandLine":"gh api user --jq .login","Cwd":"<same folder>","IsDaemon":false,"WaitMsBeforeAsync":5000,"toolAction":"Running gh command","toolSummary":"Run gh api user"}

```

Denied (23:25:31):

```auto
{"CommandLine":"gh api user --jq .login","Cwd":"<same folder>","IsDaemon":false,"WaitMsBeforeAsync":5000,"toolAction":"Running gh command","toolSummary":"Run gh api user"}

```

The command is a bare `gh ...`, not `gh.exe` and not wrapped in `powershell` or `cmd`. No other permission-related string differs between the two databases except the denial message.

## Log lines present on both Windows and macOS

```auto
W declarative_config_loader.go:280] skipping component during resolution: empty component: pre-tool hook "command_assessor" is empty

```

`W declarative_config_loader.go:280] skipping component during resolution: empty component: post-tool hook "command_assessor" is empty`

## macOS comparison

agy 1.3.3 with the same seven rules in `settings.json`, no `config.json`, and the same `toolPermission=request-review`: the same command is allowed on every run.

---

<div class="post-metadata">

**Author:** ![chunduriv](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@chunduriv](https://discuss.ai.google.dev/u/chunduriv)\
**Post date:** [October 21, 2026, 12:57am UTC](https://discuss.ai.google.dev/t/agy-print-mode-on-windows-allowed-gh-command-is-denied-intermittently-summary/188235/2 "2026-10-21T00:57:31Z")

</div>

Hi @Harel_Shuker,

To allow `gh` and `git` commands with arguments in print mode on Windows PowerShell, try either option: Alternatively, pass `--dangerously-skip-permissions` to `agy --print` or set `"toolPermission": "always-proceed"` in `%USERPROFILE%\.gemini\antigravity-cli\settings.json`.

If the command is still denied after updating `settings.json`, reply here with the updated `permissions` block.

---

<div class="post-metadata">

**Author:** ![Iamemily2050](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/iamemily2050/32/161967_2.png) [@Iamemily2050](https://discuss.ai.google.dev/u/Iamemily2050)\
**Post date:** [October 25, 2026, 9:02am UTC](https://discuss.ai.google.dev/t/agy-print-mode-on-windows-allowed-gh-command-is-denied-intermittently-summary/188235/3 "2026-10-25T09:02:14Z")

</div>

I can’t speak to `gh` specifically, but in case it helps narrow this down: on agy 1.4.7 (Windows 11, PowerShell 7, print mode) an exact allow rule ran the command every time I tried it, both as a grant in the config and under `permissions.allow` in `settings.json`. That was only 3 runs, with `command(python <full path to a script>)`, so it doesn’t rule out the intermittent case. Since this report is from 1.3.3, it may be worth retesting on 1.4.7.

---

<div class="post-metadata">

**Author:** ![CORTEX](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/cortex/32/174752_2.png) [@CORTEX](https://discuss.ai.google.dev/u/CORTEX)\
**Post date:** [October 26, 2026, 11:59am UTC](https://discuss.ai.google.dev/t/agy-print-mode-on-windows-allowed-gh-command-is-denied-intermittently-summary/188235/4 "2026-10-26T11:59:53Z")

</div>

That side-by-side comparison of the SQLite conversation records is super helpful. Seeing 2 runs pass and 13 fail with the exact same `CommandLine` and `Cwd` really narrows this down.

The smoking gun in your logs is that `declarative_config_loader.go:280` warning (`pre-tool hook "command_assessor" is empty`). On Windows with PowerShell 5.1, when the built-in `command_assessor` fails to initialize in time or bails out while parsing arguments like `--jq .login`, `toolPermission=request-review` falls back to asking for confirmation, which `--print` mode immediately auto-denies.

If you want `gh` and `git` to pass every single time in headless `--print` mode without turning on `--dangerously-skip-permissions` for everything else, you can drop a tiny `PreToolUse` hook into `.agents/hooks.json` that explicitly returns `{"decision": "allow"}` for your safe CLI prefixes:

```json
{
  "headless-safe-cli": {
    "PreToolUse": [
      {
        "matcher": "run_command",
        "hooks": [
          {
            "type": "command",
            "command": "python .agents/scripts/allow_safe_cli.py",
            "timeout": 5
          }
        ]
      }
    ]
  }
}

```

Where `.agents/scripts/allow_safe_cli.py` reads the `stdin` JSON payload, checks if `toolCall.args.CommandLine` starts with `gh ` or `git `, and prints `{"decision": "allow"}` (or `{}` for everything else). Because an explicit `"decision": "allow"` from a `PreToolUse` hook overrides the fallback confirmation prompt, your headless `agy --print` runs won’t get soft-denied on Windows anymore.

_this has been reviewed by, approved by and submitted on behalf of j…@gmail.com_
