hermes-agent/hermes_cli/subcommands
Teknium b088535c78 feat(plugins): capability declarations + install/update consent flow (#64228)
Unify the scattered per-plugin trust gates into one declared, diffable
capability model with an install/update-time consent flow. Consent +
audit over host API surfaces — explicitly NOT a sandbox.

New module hermes_cli/plugin_capabilities.py:
- Canonical CAPABILITY_REGISTRY mapping each capability id 1:1 to an
  EXISTING enforcing gate (no capability minted without a surface):
    tools.override          -> allow_tool_override
    llm.provider_override   -> llm.allow_provider_override
    llm.model_override      -> llm.allow_model_override
    llm.agent_id_override   -> llm.allow_agent_id_override
    llm.profile_override    -> llm.allow_profile_override
    llm.task_override       -> llm.allow_task_override
- plugin_capability_granted(plugin_id, capability): canonical check —
  granted set OR deprecated legacy allow_* key; fail closed on unknown
  ids and any unreadable/corrupt consent state; emits checked_by audit
  log lines on every decision.
- record_consent() persists plugins.entries.<id>.granted_capabilities +
  capabilities_consent {hash, granted_at} and mirrors grants into the
  legacy keys so existing enforcement sites keep working unchanged.
- capability_set_hash / pending_capabilities / declared_set_changed
  power the update-time re-consent diff.

Wiring:
- plugin.yaml manifest field `capabilities:` parsed into
  PluginManifest.capabilities (unknown ids dropped with a warning).
- hermes plugins install: consent screen (one Y/n) when the manifest
  declares capabilities; non-interactive installs proceed with
  capabilities ungranted (fail closed).
- hermes plugins update: when the new version declares capabilities the
  granted set lacks (hash diff), the additions are surfaced and require
  re-consent — an update can never silently widen access.
- hermes plugins enable: consent screen replaces the standalone
  tool-override prompt for capability-declaring plugins.
- hermes plugins capabilities [<id>]: declared vs granted per plugin,
  flags grants held via deprecated legacy keys.
- PluginContext.has_capability() probing API so plugins degrade
  gracefully; _tool_override_allowed migrated to the canonical
  plugin_capability_granted path (reference migration; legacy
  allow_tool_override still honored).

Tests: tests/hermes_cli/test_plugin_capabilities.py (38 tests) —
declaration parsing, consent grant/persist, update re-consent on added
capability, fail-closed on missing/corrupt state, legacy-gate backward
compat, consent CLI flow (grant / decline / non-interactive).

Docs: user-guide plugins.md consent section (with explicit not-a-sandbox
warning) + developer-guide plugin authoring capability note.

Salvages the intent of PR #37976 (@coygeek — require renewed review
before plugin updates), scoped to capability diffs.

Part of #64182.
2026-08-12 18:05:21 -07:00
..
__init__.py
…
_shared.py
…
acp.py
…
approvals.py feat(cli): add `hermes approvals test` — dry-run approval verdict CLI 2026-08-07 08:57:39 -07:00
auth.py
…
backup.py
…
claw.py
…
config.py fix(config): warn-after-write for unrecognized keys instead of refusing 2026-07-20 05:38:59 -07:00
console.py
…
cron.py feat(cron): per-job durable notepad — KV scratchpad surviving scheduled runs 2026-08-07 08:57:48 -07:00
dashboard.py feat(serve): add secure Desktop SSH bootstrap contract 2026-07-16 14:43:14 +02:00
debug.py
…
doctor.py feat(doctor): add opt-in `hermes doctor --live` real-call backend probes 2026-08-07 09:07:48 -07:00
dump.py
…
gateway.py fix(gateway): preserve external supervisor ownership 2026-07-16 05:08:56 -07:00
gui.py
…
hooks.py
…
import_agent.py feat(cli): hermes import-agent — import Claude Code and Codex CLI setups 2026-07-26 17:47:07 -07:00
import_cmd.py
…
insights.py
…
login.py
…
logout.py
…
logs.py
…
mcp.py
…
memory.py
…
model.py
…
monitoring.py refactor(monitoring): scope telemetry substrate to gateway health/diagnostics export 2026-07-24 18:54:45 +00:00
pairing.py fix(pairing): keep GUI approvals off the code brute-force lockout 2026-07-29 17:51:40 -05:00
pause.py feat(cli): global emergency stop — `hermes pause` / `hermes resume` 2026-08-07 08:58:14 -07:00
plugins.py feat(plugins): capability declarations + install/update consent flow (#64228) 2026-08-12 18:05:21 -07:00
profile.py
…
prompt_size.py
…
security.py
…
setup.py Reapply "feat(observability): integrate NeMo Relay runtime and shared metrics" 2026-07-27 21:10:51 -07:00
skills.py refactor(sync): put every Skill Sync verb under `hermes sync`; drop HSP naming 2026-07-29 07:47:06 +10:00
skin.py feat(themes): `hermes skin set` — deterministic one-color tweak, bg untouched 2026-07-21 21:00:43 -05:00
slack.py feat(slack): support long app descriptions in the manifest generator 2026-07-23 12:01:24 -07:00
status.py
…
sync.py refactor(sync): put every Skill Sync verb under `hermes sync`; drop HSP naming 2026-07-29 07:47:06 +10:00
tools.py
…
uninstall.py feat: add uninstall dry-run mode 2026-07-07 05:12:24 -07:00
update.py fix(update): consolidate pre-update backups into one gated mechanism (#65754) 2026-07-16 08:47:25 -07:00
verify.py Port from superagent-ai/grok-cli: verify subsystem (run-recipe detection + environment manifest + hermes verify smoke runner) 2026-08-07 10:11:05 -07:00
version.py
…
webhook.py feat(gateway): add webhook payload filters 2026-07-08 08:10:55 -07:00
whatsapp.py
…