hermes-agent/hermes_cli
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
..
dashboard_auth
…
observability
…
proxy
…
subcommands feat(plugins): capability declarations + install/update consent flow (#64228) 2026-08-12 18:05:21 -07:00
web_routers
…
__init__.py
…
_early_recovery.py
…
_parser.py
…
_scan_venv_blockers.py
…
_startup_fast.py
…
_subprocess_compat.py fix: Windows agent-loop papercuts — path splitting, hashing, autocomplete, screenshots, OS detection (#84419) 2026-08-12 01:45:18 -07:00
active_sessions.py
…
agent_import.py
…
agent_plugins.py
…
approval_mode.py
…
approval_transport.py fix(plugins): harden approval transport boundaries 2026-08-12 16:26:55 -07:00
approvals_suggest.py
…
approvals_test.py
…
auth.py
…
auth_commands.py
…
azure_detect.py
…
backup.py feat: auto-install gateway service during setup and import 2026-08-12 16:59:37 -07:00
bang_shell.py
…
banner.py
…
blueprint_cmd.py
…
browser_connect.py
…
build_info.py
…
bundles.py
…
callbacks.py
…
checkpoints.py
…
claw.py
…
cli_agent_setup_mixin.py
…
cli_billing_mixin.py
…
cli_commands_mixin.py
…
cli_output.py
…
clipboard.py
…
codex_models.py
…
codex_runtime_plugin_migration.py
…
codex_runtime_switch.py
…
colors.py
…
commands.py fix: Windows agent-loop papercuts — path splitting, hashing, autocomplete, screenshots, OS detection (#84419) 2026-08-12 01:45:18 -07:00
completion.py
…
config.py feat(voice): add configurable TUI draft submission 2026-08-12 16:42:07 -07:00
config_defaults.py Merge PR #41236 (Linux keychain auto-detect) onto current main 2026-08-12 17:07:45 -07:00
config_migrations.py
…
console_engine.py fix: Windows agent-loop papercuts — path splitting, hashing, autocomplete, screenshots, OS detection (#84419) 2026-08-12 01:45:18 -07:00
container_boot.py
…
context_switch_guard.py
…
copilot_auth.py
…
credential_lifecycle.py
…
cron.py
…
curator.py
…
curses_ui.py
…
dashboard_procs.py
…
dashboard_register.py
…
debug.py
…
default_soul.py
…
dep_ensure.py
…
diagnostics_upload.py
…
dingtalk_auth.py
…
doctor.py
…
doctor_live.py
…
dump.py
…
env_loader.py
…
fallback_cmd.py
…
fallback_config.py
…
focus_view.py
…
gateway.py feat: auto-install gateway service during setup and import 2026-08-12 16:59:37 -07:00
gateway_enroll.py
…
gateway_windows.py
…
goals.py
…
gui_uninstall.py
…
heartbeat.py
…
hooks.py
…
init_command.py
…
input_sanitize.py
…
inventory.py
…
journey.py
…
kanban.py fix(kanban): query show graph before closing database 2026-08-12 13:20:38 +05:30
kanban_db.py
…
kanban_decompose.py
…
kanban_diagnostics.py
…
kanban_specify.py
…
kanban_swarm.py
…
lifecycle.py
…
linux_desktop_entry.py
…
logs.py
…
main.py Merge PR #41236 (Linux keychain auto-detect) onto current main 2026-08-12 17:07:45 -07:00
managed_scope.py
…
managed_uv.py
…
mcp_catalog.py
…
mcp_config.py
…
mcp_picker.py
…
mcp_security.py
…
mcp_startup.py
…
mem_trim.py
…
memory_oauth.py
…
memory_setup.py
…
middleware.py
…
migrate.py
…
moa_cmd.py
…
moa_config.py
…
model_catalog.py
…
model_cost_guard.py
…
model_normalize.py
…
model_search.py
…
model_setup_flows.py
…
model_switch.py
…
models.py add grok 4.6 (#84837) 2026-08-12 21:52:31 +00:00
nous_account.py
…
nous_auth_keepalive.py
…
nous_billing.py
…
nous_subscription.py
…
npm_engine.py
…
onepassword_secrets_cli.py
…
oneshot.py
…
pairing.py
…
partial_compress.py
…
personality.py
…
pets.py
…
platforms.py
…
plugin_capabilities.py feat(plugins): capability declarations + install/update consent flow (#64228) 2026-08-12 18:05:21 -07:00
plugin_dev.py feat(plugins): add runtime-backed plugin Doctor 2026-08-12 16:27:07 -07:00
plugins.py feat(plugins): capability declarations + install/update consent flow (#64228) 2026-08-12 18:05:21 -07:00
plugins_cmd.py feat(plugins): capability declarations + install/update consent flow (#64228) 2026-08-12 18:05:21 -07:00
portal_cli.py
…
profile_describer.py
…
profile_distribution.py
…
profiles.py
…
projects_cmd.py
…
projects_db.py
…
prompt_size.py
…
prompt_stash.py
…
provider_catalog.py
…
providers.py
…
proxy_cli.py
…
psutil_android.py
…
pt_input_extras.py
…
pty_bridge.py
…
pty_session.py
…
relaunch.py
…
resource_limits.py
…
route_identity.py
…
runtime_provider.py
…
secret_prompt.py
…
secrets_cli.py
…
security_advisories.py
…
security_audit.py
…
security_audit_startup.py
…
send_cmd.py
…
service_manager.py
…
session_export.py
…
session_export_html.py
…
session_export_md.py
…
session_filters.py
…
session_listing.py
…
session_recap.py
…
session_recovery.py
…
sessions_cmd.py
…
setup.py feat: auto-install gateway service during setup and import 2026-08-12 16:59:37 -07:00
setup_hidden_env.py
…
setup_whatsapp_cloud.py
…
sizefmt.py
…
skills_config.py
…
skills_hub.py
…
skin_cmd.py
…
skin_engine.py
…
slack_cli.py
…
slash_exec.py
…
sqlite_runtime.py
…
sqlite_safe_read.py
…
sqlite_util.py
…
status.py
…
stdio.py
…
suggestions_cmd.py
…
telegram_managed_bot.py
…
timefmt.py
…
timeouts.py
…
tips.py
…
tools_config.py
…
toolset_validation.py
…
uninstall.py
…
update_cmd.py fix(windows): SSH ControlMaster gating + stop hijacking the user's python (#84452) 2026-08-12 02:56:33 -07:00
update_lock.py
…
urllib_security.py
…
vercel_auth.py
…
verify_cmd.py
…
voice.py
…
web_deps.py
…
web_git.py
…
web_models.py
…
web_server.py
…
webhook.py
…
win_pty_bridge.py
…
windows_ssh_runtime.py
…
write_approval_commands.py
…
xai_retirement.py
…