Skip to content

The agent that grows with you

fix(computer-use): name the stale TCC row when CuaDriver shows ON but is denied

kshitijk4poor42ae8b4410b2
diff --git a/hermes_cli/subcommands/computer_use.py b/hermes_cli/subcommands/computer_use.py
index 76476aca7dc..82c9472196a 100644
--- a/hermes_cli/subcommands/computer_use.py
+++ b/hermes_cli/subcommands/computer_use.py
@@ -89,7 +89,7 @@ def _cu_doctor(args) -> None:
def _cu_perms_status(args) -> None:
import json as _json
- from tools.computer_use.permissions import computer_use_status
+ from tools.computer_use.permissions import computer_use_status, stale_tcc_grant_hint
st = computer_use_status()
if bool(getattr(args, "json", False)):
print(_json.dumps(st, indent=2, sort_keys=True))
@@ -107,6 +107,9 @@ def _cu_perms_status(args) -> None:
print(f" {glyph(st['screen_recording'])} Screen Recording")
if not st["ready"]:
print(" Grant: hermes computer-use permissions grant")
+ missing = [f for f in ("accessibility", "screen_recording") if st[f] is False]
+ if missing:
+ print(f" {stale_tcc_grant_hint(*missing)}")
else: # no TCC model — readiness is driver health
print(f" {glyph(st['ready'])} driver health (no permission toggles on {st['platform']})")
for c in st["checks"]:
diff --git a/tests/computer_use/test_doctor.py b/tests/computer_use/test_doctor.py
index 89b524fd8f0..5cf1b09f20f 100644
--- a/tests/computer_use/test_doctor.py
+++ b/tests/computer_use/test_doctor.py
@@ -440,3 +440,17 @@ class TestDoctorVersionIdentity:
payload = json.loads(out.getvalue())
assert payload["hermes_identity"]["version_mismatch"] is False
+
+
+def test_fallback_tcc_row_hint_names_the_stale_row_reset_for_that_service():
+ """The fallback ``tcc_*`` fail row must carry the stale-grant recovery for its own TCC service (Screen Recording
+ is the ``ScreenCapture`` row), because System Settings can show the toggle ON while the daemon is denied."""
+ from tools.computer_use import doctor
+
+ ctx = {"perms": {"accessibility": True, "screen_recording": False}, "perm_err": None, "plat": "darwin"}
+ status, message, extra = doctor._tcc_row("screen_recording", "Screen Recording", True, ctx)
+
+ assert status == "fail"
+ assert "tccutil reset ScreenCapture com.trycua.driver" in extra["hint"]
+ assert "reset Accessibility" not in extra["hint"]
+ assert extra["data"] == {"screen_recording": False}
diff --git a/tests/hermes_cli/test_computer_use_cli.py b/tests/hermes_cli/test_computer_use_cli.py
index 756a26df268..ba85b452992 100644
--- a/tests/hermes_cli/test_computer_use_cli.py
+++ b/tests/hermes_cli/test_computer_use_cli.py
@@ -192,3 +192,23 @@ def test_computer_use_install_returns_nonzero_for_unrepairable_custom_override(
assert _invoke(monkeypatch, "install") == 1
install.assert_called_once_with(upgrade=False)
contract.assert_not_called()
+
+
+def test_permissions_status_names_the_stale_tcc_row_for_the_missing_grant(
+ monkeypatch: pytest.MonkeyPatch,
+ capsys: pytest.CaptureFixture[str],
+) -> None:
+ """A grant the daemon reports missing while System Settings shows it ON is a stale TCC row (trycua/cua#3170);
+ the status output must name the reset for exactly the missing service, never for one that is granted."""
+ from tools.computer_use import permissions
+
+ status = {"platform": "darwin", "platform_supported": True, "installed": True, "version": "cua-driver 0.28.2",
+ "ready": False, "can_grant": True, "checks": [], "source": None, "error": None,
+ "accessibility": False, "screen_recording": True, "screen_recording_capturable": True}
+ monkeypatch.setattr(permissions, "computer_use_status", lambda driver_cmd=None: status)
+
+ assert _invoke(monkeypatch, "permissions", "status") == 1
+ out = capsys.readouterr().out
+ assert "tccutil reset Accessibility com.trycua.driver" in out
+ assert "ScreenCapture" not in out
+ assert "hermes computer-use permissions grant" in out
diff --git a/tools/computer_use/doctor.py b/tools/computer_use/doctor.py
index 66d2832d4fd..62d322e730d 100644
--- a/tools/computer_use/doctor.py
+++ b/tools/computer_use/doctor.py
@@ -17,6 +17,7 @@ from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Tupl
from hermes_cli._subprocess_compat import windows_hide_flags
from tools.computer_use.permissions import _child_env as _sanitized_cua_env
+from tools.computer_use.permissions import stale_tcc_grant_hint
# Match the ALLOWED_STATUS_VALUES + ALLOWED_OVERALL_VALUES the cua-driver integration test pins.
_STATUS_GLYPH = {"pass": "✅", "fail": "❌", "skip": "⏭️"}
@@ -207,7 +208,7 @@ def _tcc_row(field: str, label: str, platform_bound: bool, ctx: Report) -> _Row:
off_platform = platform_bound and ctx["plat"] != "darwin"
return "skip", f"not applicable on {ctx['plat']}" if off_platform else f"{field} field absent from check_permissions", {}
if not granted:
- return "fail", f"{label} is not granted.", {"hint": _TCC_HINT.format(label), "data": {field: False}}
+ return "fail", f"{label} is not granted.", {"hint": f"{_TCC_HINT.format(label)} {stale_tcc_grant_hint(field)}", "data": {field: False}}
data = {field: True, **({"screen_recording_capturable": perms.get("screen_recording_capturable")} if field == "screen_recording" else {})}
if data.get("screen_recording_capturable") is False: # the granted-but-not-capturable row wins over plain pass
return "fail", "Screen Recording granted but not capturable.", {"hint": (
diff --git a/tools/computer_use/permissions.py b/tools/computer_use/permissions.py
index b4a68acd7ae..9a19cf0c9b9 100644
--- a/tools/computer_use/permissions.py
+++ b/tools/computer_use/permissions.py
@@ -18,6 +18,22 @@ from hermes_cli._subprocess_compat import windows_hide_flags
_RUNTIME_PLATFORMS = frozenset({"darwin", "win32", "linux"}) # mirrors the toolset platform_gate
_BOOLS = ("accessibility", "screen_recording", "screen_recording_capturable")
+_TCC_SERVICES = {"accessibility": "Accessibility", "screen_recording": "ScreenCapture"} # status field -> tccutil service
+
+def stale_tcc_grant_hint(*missing: str) -> str:
+ """Recovery text for grants the daemon reports missing while System Settings shows the CuaDriver toggle ON.
+
+ TCC keys each row to the app's code-signing requirement, so a row written for an earlier CuaDriver build can
+ stop matching after a driver update: the toggle stays ON, the daemon is denied, and flipping the toggle does
+ not rewrite the requirement (trycua/cua#3170; the cua-driver >= 0.22 installer repairs this on update). Only a
+ reset + re-grant recovers it, so the hint names the exact rows for the *missing* status fields.
+ """
+ resets = " && ".join(f"tccutil reset {_TCC_SERVICES[f]} com.trycua.driver" for f in missing if f in _TCC_SERVICES)
+ if not resets:
+ return ""
+ return ("If System Settings already shows CuaDriver ON, the stored grant is stale (it no longer matches the installed "
+ f"driver's signature): run `{resets}`, then `hermes computer-use permissions grant`. "
+ "`hermes computer-use install --upgrade` moves to a driver whose installer repairs stale rows on update.")
def _child_env() -> Dict[str, str]:
"""cua-driver child env (telemetry policy + provider secrets stripped); ``os.environ`` on import error.
diff --git a/website/docs/user-guide/features/computer-use.md b/website/docs/user-guide/features/computer-use.md
index dced6a9b6f2..8d382de99af 100644
--- a/website/docs/user-guide/features/computer-use.md
+++ b/website/docs/user-guide/features/computer-use.md
@@ -84,7 +84,7 @@ platform-appropriate prereqs:
| Platform | Prereqs |
|---|---|
-| **macOS** | System Settings → Privacy & Security → **Accessibility** + **Screen Recording**. Grant the identity named by `hermes computer-use doctor`. Standard mode uses CuaDriver.app; bounded and unrestricted modes use the Hermes host identity. |
+| **macOS** | System Settings → Privacy & Security → **Accessibility** + **Screen Recording**. Grant the identity named by `hermes computer-use doctor` (CuaDriver, `com.trycua.driver`, in every permission mode — the driver daemon always launches through `CuaDriver.app`). |
| **Windows** | None at install time. If you're driving over SSH (not RDP / console), you need the autostart pattern — see [cua.ai/docs/how-to-guides/driver/windows-ssh](https://cua.ai/docs/how-to-guides/driver/windows-ssh) for the Session 0 ↔ Session 1+ proxy. |
| **Linux** | A reachable display server: `DISPLAY` set for X11, or `XDG_SESSION_TYPE=wayland`. Wayland sessions need an XWayland bridge for capture. AT-SPI must be on (default on GNOME/KDE/Xfce). |
@@ -154,8 +154,8 @@ resetting or closing the Hermes session, cancellation cleanup, or process exit
closes that transport session. Hermes also stops private runtimes that it
launched for bounded or unrestricted access. One Hermes
conversation cannot change another runtime's mode or grants. Bounded and
-unrestricted modes use a private
-embedded service under the Hermes host identity.
+unrestricted modes use a private embedded daemon, launched through
+`CuaDriver.app` on macOS (see above).
`smart` approval remains `standard`: an LLM classification cannot stand in for
a reviewed manifest.
@@ -610,6 +610,22 @@ run `hermes tools` and enable the Computer Use toolset.
didn't see may be blocking input. Dismiss it with `escape` or the close
button.
+**macOS: System Settings shows CuaDriver ON, but `hermes computer-use
+permissions status` / `doctor` report Accessibility or Screen Recording as
+not granted** — the stored grant is stale. macOS keys each permission row to
+the app's code-signing requirement; a row written for an earlier CuaDriver
+build stops matching after a driver update, and flipping the toggle does not
+rewrite it. Reset the affected rows and re-grant:
+
+```
+tccutil reset Accessibility com.trycua.driver
+tccutil reset ScreenCapture com.trycua.driver
+hermes computer-use permissions grant
+```
+
+cua-driver 0.22+ installers repair this automatically on update, so
+`hermes computer-use install --upgrade` prevents a recurrence.
+
**Element indices are stale** — SOM indices are only valid until the
next `capture`. Re-capture after any state-changing action. The
wrapper carries opaque `element_token`s for stale detection — you'll