Skip to content

fix(approvals): suggest proposes only reviewed globs, counted from a person's approvals - #159307

Open
c2h5oh wants to merge 2 commits into
mainfrom
fix/158903-approvals-suggest
Open

c2h5oh wants to merge 2 commits into
mainfrom
fix/158903-approvals-suggest

Conversation

@c2h5oh

@c2h5oh c2h5oh commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

hermes approvals suggest proposed permanent command_allowlist entries for classes that should never be approved forever. Its description denylist let 33 of the 134 dangerous classes through: force pushes, reverse shells, gateway restarts and hermes update (which kill running agents), approval-setting changes, uninstalls and daemon redirects. These were often proposed as globs (git push *, hermes config *, nc *) that approve far more than the class they came from. It also counted every run that executed as one the user approved: smart-approved, allowlisted and YOLO runs, plus any run whose own output printed the words.

  • What can be proposed: proposals come only from an explicit allowlist of classes, each paired with the exact glob shape it allows. Today that is docker restart|stop|kill *, with docker bare or an absolute path. A command with no glob of that shape (timeout 30 docker …, env docker …, docker container stop, docker --debug restart) is not proposed at all.
  • No class keys: class keys are no longer proposed. The runtime matches a class key against the command's first finding only, so docker stop web && git push --force would pass under the docker key, and bash -c "$(curl …)" under the shell -c key. That runtime behaviour is unchanged on main and affects interactive "always" answers too; it belongs in its own PR.
  • What counts as an approval: only a result whose own approval note says a person approved it at the prompt, or approved it and then interrupted it. The command's output can't forge it.
  • Shared call ids: a call id used by more than one call is skipped. Ids repeat across sessions (derived ids, or ones numbered from call_0), and a result row isn't tied to its session, so one session's approval could otherwise be credited to another session's command. With those providers this can count too few approvals, never too many.

website/docs/user-guide/security.md is intentionally not edited here. Its approvals suggest example (git push *, a class-key line) and its denylist description no longer match what the command does.

Fixes #158903

…person's approvals

`hermes approvals suggest` filtered with a description denylist that 33 of
the 134 dangerous classes slipped past: force pushes, reverse shells,
gateway restarts and `hermes update` (they kill running agents),
approval-setting changes, uninstalls and daemon redirects were proposed for
the permanent allowlist, often as globs (`git push *`, `hermes config *`,
`nc *`) that approve far more than their class. It also counted every run
that executed as one the user approved, including smart-approved,
allowlisted and yolo runs, and any run whose output printed the words.

Proposals now come only from an explicit list of classes, each with the
exact glob shape it allows; today that is `docker restart|stop|kill *`
(bare or absolute docker path). A command with no glob of that shape is not
proposed, and neither is any class key: the runtime matches a class key
against the command's first finding only, so it would also approve what is
chained after it. Only runs whose result's own approval note says a person
approved them count, and only through a call id no other call uses
(ids repeat across sessions, and a result is not tied to its session).

Fixes #158903
@c2h5oh

c2h5oh commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai review

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 46da43f — test(approvals): check proposable classes against the detect

ℹ️ Info

CI caches · View report · View job

25 / 25 cache hits (0 misses)
4155.48 MiB restored
0 B not restored.

per-job cache results

hits

JobStepLogsRestoredΔ vs main
Python lints / Python lintsRun ./.github/actions/setup-pm / Restore verified PM tools without savingview step83.12 MiB+0 B
Repository guards / Repository guardsRun ./.github/actions/setup-pm / Restore verified PM tools without savingview step156.11 MiB+0 B
Repository guards / Repository guardsRun ./.github/actions/setup-pm / Restore uv dependency downloads and buildsview step43.14 MiB+0 B
Repository guards / Repository guardsRun ./.github/actions/setup-pm / Restore node dependency downloadsview step180.90 MiB+0 B
Python tests / Run tests (2/3)Set up locked Python and test dependencies / Restore verified PM tools without savingview step154.75 MiB+0 B
Python tests / Run tests (2/3)Set up locked Python and test dependencies / Restore uv dependency downloads and buildsview step43.14 MiB+0 B
Python tests / Run tests (2/3)Run testsview step0.10 MiBunknown
Python tests / Run tests (3/3)Set up locked Python and test dependencies / Restore verified PM tools without savingview step154.75 MiB+0 B
Python tests / Run tests (3/3)Set up locked Python and test dependencies / Restore uv dependency downloads and buildsview step43.14 MiB+0 B
Python tests / Run tests (3/3)Run testsview step0.10 MiB+65 B
Python tests / Run tests (1/3)Set up locked Python and test dependencies / Restore verified PM tools without savingview step154.75 MiB+0 B
Python tests / Run tests (1/3)Set up locked Python and test dependencies / Restore uv dependency downloads and buildsview step43.14 MiB+0 B
Python tests / Run tests (1/3)Run testsview step0.10 MiB-23 B
OS-specific tests / Windows-only testsSet up locked Python and test dependencies / Restore verified PM tools without savingview step236.13 MiB+0 B
OS-specific tests / Windows-only testsSet up locked Python and test dependencies / Restore uv dependency downloads and buildsview step102.91 MiB+0 B
OS-specific tests / macOS-only tests (1/2)Set up locked Python and test dependencies / Restore verified PM tools without savingview step107.16 MiB+0 B
OS-specific tests / macOS-only tests (1/2)Set up locked Python and test dependencies / Restore uv dependency downloads and buildsview step167.62 MiB+0 B
OS-specific tests / macOS-only tests (2/2)Set up locked Python and test dependencies / Restore verified PM tools without savingview step107.16 MiB+0 B
OS-specific tests / macOS-only tests (2/2)Set up locked Python and test dependencies / Restore uv dependency downloads and buildsview step167.62 MiB+0 B
OS-specific tests / Windows-only tests (arm64, 2/2)Set up native ARM64 build dependencies / Cache ARM64 OpenSSL development filesview step26.23 MiB+0 B
OS-specific tests / Windows-only tests (arm64, 2/2)Set up locked Python and test dependencies / Restore verified PM tools without savingview step222.55 MiB+0 B
OS-specific tests / Windows-only tests (arm64, 2/2)Set up locked Python and test dependencies / Restore uv dependency downloads and buildsview step856.03 MiB+0 B
OS-specific tests / Windows-only tests (arm64, 1/2)Set up native ARM64 build dependencies / Cache ARM64 OpenSSL development filesview step26.23 MiB+0 B
OS-specific tests / Windows-only tests (arm64, 1/2)Set up locked Python and test dependencies / Restore verified PM tools without savingview step222.55 MiB+0 B
OS-specific tests / Windows-only tests (arm64, 1/2)Set up locked Python and test dependencies / Restore uv dependency downloads and buildsview step856.03 MiB+0 B

misses

none

Compressed archive bytes. Not-restored bytes use the main-size reference; missing sizes remain unknown.


debug info

CI timings

CI timings · View report · View job

Wall time 7m24s vs 6m23s (+15.9%). 8 job(s) slower, 4 faster,

  • OS-specific tests / Windows-only tests (arm64, 2/2): +64.0s
  • Python lints / Python lints: +35.0s
  • Python tests / Run tests (2/3): -22.0s
  • OS-specific tests / Windows-only tests: -21.0s
  • Repository guards / Repository guards: +19.0s

@alt-glitch alt-glitch added P3 Low — cosmetic, nice to have tool/terminal Terminal execution and process management type/security Security vulnerability or hardening labels Nov 23, 2026
@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous test-contract finding is fixed.

Summary

hermes approvals suggest now proposes only reviewed Docker command patterns and counts approvals given by a person.

  • Approval suggestions count only commands a person approved at the prompt.
  • Suggestions offer only reviewed Docker lifecycle command globs.

Reviews (2) · Last reviewed commit: "test(approvals): check proposable classe..." · Reviewed by Greptile

@alt-glitch alt-glitch added comp/cli CLI entry point, hermes_cli/, setup wizard comp/tools Tool registry, model_tools, toolsets labels Nov 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have tool/terminal Terminal execution and process management type/security Security vulnerability or hardening

Projects

None yet

2 participants