The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(debug): URL credentials in a fallback base_url never reach hermes dump or an upload
John Paul Soliva139876e72755
diff --git a/tests/hermes_cli/test_debug.py b/tests/hermes_cli/test_debug.pyindex b2a5eccc2c4..7dae2a18d59 100644--- a/tests/hermes_cli/test_debug.py+++ b/tests/hermes_cli/test_debug.py@@ -435,6 +435,32 @@ class TestRunDebugShareRedaction:assert any("backup-model" in text for text in uploads) # the dump really ranassert not [text for text in uploads if fallback_key in text]+ @pytest.mark.parametrize("base_url", [+ "https://user:{s}@backup.example/v1",+ "https://backup.example/v1?key={s}",+ "https://backup.example/v1?X-Amz-Signature={s}",+ "https://backup.example/v1#access_token={s}&view=public",+ ])+ def test_fallback_base_url_credential_never_reaches_upload_bound_content(self, hermes_home_with_secret, base_url):+ """A fallback ``base_url`` can carry its credential in the URL (userinfo, query, fragment). The+ dump is config made to be pasted, so ``hermes dump`` itself and every upload of it get strict+ URL-credential redaction, not the log policy."""+ from hermes_cli.debug import _capture_dump, collect_debug_report, collect_share_bundle++ secret = "urlCredOpaque0123456789abcdef"+ (hermes_home_with_secret / "config.yaml").write_text(+ "fallback_providers:\n"+ " - provider: custom\n"+ " model: backup-model\n"+ f" base_url: '{base_url.format(s=secret)}'\n", encoding="utf-8")++ texts = [_capture_dump(redact=False), # `hermes dump` stdout, as printed+ *collect_share_bundle(log_lines=20).values(),+ collect_debug_report(log_lines=20, dump_text=_capture_dump())]++ assert all("backup-model" in text and "backup.example" in text for text in texts[:2])+ assert not [text for text in texts if secret in text]+def test_default_share_includes_redaction_banner(self, hermes_home_with_secret, capsys):diff --git a/website/docs/reference/cli-commands.md b/website/docs/reference/cli-commands.mdindex 709ede8160a..b4a6b0d132a 100644--- a/website/docs/reference/cli-commands.md+++ b/website/docs/reference/cli-commands.md@@ -1014,7 +1014,7 @@ Outputs a compact, plain-text summary of your entire Hermes setup. Designed to b| **Features** | Enabled toolsets, MCP server count, memory provider || **Services** | Gateway status, configured messaging platforms || **Workload** | Cron job counts, installed skill count |-| **Config overrides** | Any config values that differ from defaults |+| **Config overrides** | Any config values that differ from defaults. Credentials in them are redacted: a `fallback_providers` entry's `api_key`, and credentials in its `base_url` (userinfo, `key`/token query parameters, signed-URL signatures). |### Example output@@ -1081,7 +1081,7 @@ Upload a debug report (system info + recent logs) to a paste service and get a s| `--local` | Print the report locally instead of uploading. || `--no-redact` | Disable upload-time secret redaction. By default, uploads are redacted. |-The report includes system info (OS, Python version, Hermes version), recent agent, gateway, GUI/dashboard, and desktop logs (512 KB limit per file), and redacted API key status. By default, uploads are redacted so secrets are not included; this covers the system dump (including config values such as `fallback_providers` entries) as well as the logs, and the gateway `/debug` report too.+The report includes system info (OS, Python version, Hermes version), recent agent, gateway, GUI/dashboard, and desktop logs (512 KB limit per file), and redacted API key status. By default, uploads are redacted so secrets are not included; this covers the system dump (including config values such as `fallback_providers` entries and credentials in their URLs) as well as the logs, and the gateway `/debug` report too.Default uploads use public paste services tried in order: paste.rs, dpaste.com. `--nous` uploads the same debug bundle to private Nous diagnostics storage instead; the returned viewer link is for the Nous team and auto-deletes after 14 days.diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/cli-commands.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/cli-commands.mdindex 522d81ca47c..0d72fefe453 100644--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/cli-commands.md+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/cli-commands.md@@ -519,7 +519,7 @@ hermes dump [--show-keys]| **Features** | 已启用的 toolset、MCP 服务器数量、memory provider || **Services** | Gateway 状态、已配置的消息平台 || **Workload** | Cron 任务数量、已安装 skill 数量 |-| **Config overrides** | 与默认值不同的所有 config 值 |+| **Config overrides** | 与默认值不同的所有 config 值。其中的凭据会被脱敏:`fallback_providers` 条目的 `api_key`,以及其 `base_url` 中的凭据(userinfo、`key`/token 查询参数、签名 URL 的签名)。 |### 示例输出@@ -584,7 +584,7 @@ hermes debug share [options]| `--expire <days>` | 粘贴过期天数(默认:7)。 || `--local` | 在本地打印报告而非上传。 |-报告包含系统信息(操作系统、Python 版本、Hermes 版本)、近期 agent 和 gateway 日志(每文件 512 KB 限制)以及脱敏的 API 密钥状态。密钥始终脱敏——不会上传任何密钥。+报告包含系统信息(操作系统、Python 版本、Hermes 版本)、近期 agent 和 gateway 日志(每文件 512 KB 限制)以及脱敏的 API 密钥状态。密钥始终脱敏——不会上传任何密钥;这也涵盖系统 dump(包括 `fallback_providers` 条目及其 URL 中的凭据)和 gateway 的 `/debug` 报告。依次尝试的粘贴服务:paste.rs、dpaste.com。