fix(agents): durable no desktop hijack — gate Chrome CDP default off - #804
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Greptile SummaryThis PR adds a no-desktop-hijack rule for Hermes Mobile agent guidance. The main changes are:
|
| Filename | Overview |
|---|---|
| hermes-mobile/AGENTS.md | Adds mobile agent guidance that prohibits desktop hijacking and keeps interactive Chrome CDP gated off by default. |
Reviews (1): Last reviewed commit: "fix(agents): durable no desktop hijack —..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54ffbcc080
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if hermes_interactive_chrome_allowed; then | ||
| if [[ "$cdp_ipv4" -eq 1 && "$agent" -eq 1 ]]; then | ||
| ok=1 | ||
| fi | ||
| else | ||
| ok=1 |
There was a problem hiding this comment.
Do not report gated-off CDP as connected
When HERMES_ALLOW_INTERACTIVE_CHROME is unset, this branch makes --status and --apply --json exit 0 and print Bridge connected even when cdpIpv4=false and launchAgent=false; in this default state a health check can green-light a dead ws://127.0.0.1:9222 bridge instead of surfacing that browser control is gated off. Callers and install output use this command as verification, so the status should distinguish "gated off" from an actually connected CDP endpoint.
Useful? React with 👍 / 👎.
| repo_root_early="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | ||
| # shellcheck disable=SC1091 | ||
| source "${repo_root_early}/scripts/hermes-interactive-chrome-gate.sh" |
There was a problem hiding this comment.
Keep the curl installer from sourcing a local-only gate
For the advertised curl ... | bash install path, the script runs from stdin before any repo files have been fetched, so BASH_SOURCE[0] is unset/empty under set -u and the new source .../scripts/hermes-interactive-chrome-gate.sh fails before the existing fallback download block can run. This breaks even an explicitly opted-in remote install (HERMES_ALLOW_INTERACTIVE_CHROME=1 curl ... | bash) before it fetches the bridge scripts.
Useful? React with 👍 / 👎.
| const gateProbe = spawnSync( | ||
| '/bin/bash', | ||
| [ | ||
| '-c', | ||
| ` | ||
| set -euo pipefail | ||
| repo_root=${JSON.stringify(repoRoot)} | ||
| export HERMES_ALLOW_INTERACTIVE_CHROME=0 | ||
| if [[ "\${HERMES_ALLOW_INTERACTIVE_CHROME:-0}" == "1" && -x "\${repo_root}/scripts/install-hermes-chrome-cdp.sh" ]]; then | ||
| echo INSTALLED | ||
| else | ||
| echo "SKIP com.hermes.chrome-cdp (HERMES_ALLOW_INTERACTIVE_CHROME!=1)" | ||
| fi | ||
| `, | ||
| ], | ||
| { encoding: 'utf8' }, | ||
| ); |
1ed3764 to
cec49e2
Compare
Igor's daily driver must stay usable: ban interactive Chrome/Computer Use unless explicitly requested in that turn. Gate CDP scripts behind HERMES_ALLOW_INTERACTIVE_CHROME, skip auto-install from install-agent-launchagents, add alwaysApply Cursor rules and HEADLESS-BACKGROUND-OPS architecture doc. Co-authored-by: Cursor <cursoragent@cursor.com>
…ay check Install-browser-bridge --help must work without HERMES_ALLOW_INTERACTIVE_CHROME (macOS guard kit contract). Treat live free Play listing as warning, not hard fail, when HTML shows a real app page (store drift vs 2026-07-22 unpublished docs). Co-authored-by: Cursor <cursoragent@cursor.com>
Expand July 2026 headless ops doc, explicit Chrome opt-in phrases in the alwaysApply rule, and regression test that install-agent-launchagents skips com.hermes.chrome-cdp unless HERMES_ALLOW_INTERACTIVE_CHROME=1. Co-authored-by: Cursor <cursoragent@cursor.com>
cec49e2 to
71da382
Compare
Summary
hermes-chrome-cdp.sh, install scripts, prevention watchdog heal, andinstall-agent-launchagents.shbehindHERMES_ALLOW_INTERACTIVE_CHROME=1(default off)..cursor/rules/no-desktop-hijack.mdc+ prefer-headless rule; soften revenue/Apollo skill descriptions away from auto-Chrome.docs/HEADLESS-BACKGROUND-OPS.md(host roles + task matrix),docs/NO-DESKTOP-HIJACK.md.com.hermes.chrome-cdpunloaded; plist renamed to.disabled.Test plan
bash tests/test-hermes-chrome-cdp.shnode tests/test-hermes-prevention-watchdog.jsMade with Cursor