Skip to content

The agent that grows with you

fix(profiles): every store in a profile home, and Hermes' copies of them, stay out of both boundaries

John Paul Soliva64a073ad8821
diff --git a/hermes_cli/profiles.py b/hermes_cli/profiles.py
index 63775105063..a7dbdcdc1d9 100644
--- a/hermes_cli/profiles.py
+++ b/hermes_cli/profiles.py
@@ -148,9 +148,9 @@ def _clone_all_copytree_ignore(source_dir: Path):
return _ignore
-# Credential stores Hermes reads from a profile home, as paths relative to it. Never shipped in a
-# profile export, and user-owned (never overwritten) on a distribution install. Add a store here
-# when a loader starts reading one.
+# Credential stores in a profile home, as paths relative to it, plus the directories where Hermes
+# keeps recovery copies of them. Never shipped in a profile export, and user-owned (never
+# overwritten) on a distribution install. Add a store here when a writer or loader starts using one.
PROFILE_CREDENTIAL_PATHS = frozenset({
"auth.json", ".env", "auth/google_oauth.json",
".op.env", # 1Password service-account token (env_loader)
@@ -169,14 +169,32 @@ PROFILE_CREDENTIAL_PATHS = frozenset({
"whatsapp/session", "platforms/whatsapp/session", "matrix/store", "platforms/matrix/store",
"cache/bws_cache.json", "cache/bws_cache.enc.json",
"workspace/meetings/node_token.json", # google_meet node RPC secret
+ "weixin/accounts", # WeChat bot tokens + per-peer context tokens
+ ".copilot_jwt.json", # exchanged Copilot API token
+ "runtime/photon-sidecar.json", # Photon sidecar auth token
+ "proxy", # iron-proxy CA key + proxy tokens
+ "chrome-debug", # /browser connect Chrome profile (cookies, logins)
+ "home", # subprocess HOME: gh, git, ssh, npm and skill-CLI credentials
+ "backups", "state-snapshots", # pre-update zips, config copies, update snapshots of the stores
})
_CREDENTIAL_PATH_PARTS = tuple(tuple(p.casefold().split("/")) for p in PROFILE_CREDENTIAL_PATHS)
+# Copies Hermes' writers leave beside a store at the profile root, matched case-folded. Any
+# ``auth.json.*`` / ``.env.bak*`` is a credential store whoever named it; for config.yaml only the
+# writers' formats match (post_update ``.bak-<stamp>[.N]``, config_backups' legacy siblings), because a
+# hand-named ``config.yaml.bak-my-note`` is the user's and ships through the export scrub instead.
+_STORE_COPY_RE = re.compile(
+ r"auth\.json\..+|\.env\.bak.*"
+ r"|config\.yaml\.(?:bak-\d{8}t\d{6}z(?:\.\d+)?|bak\.\d+|corrupt\..*|bak-pre-migrate-.*)"
+)
+
def profile_path_is_private(parts: Tuple[str, ...]) -> bool:
- """True for a PROFILE_CREDENTIAL_PATHS store or anything below one. Case-folded: on a
- case-insensitive filesystem ``Platforms/Pairing`` IS the pairing store."""
+ """True for a PROFILE_CREDENTIAL_PATHS store, anything below one, or a root copy of one.
+ Case-folded: on a case-insensitive filesystem ``Platforms/Pairing`` IS the pairing store."""
folded = tuple(str(part).casefold() for part in parts)
+ if len(folded) == 1 and _STORE_COPY_RE.fullmatch(folded[0]):
+ return True
return any(folded[:len(store)] == store for store in _CREDENTIAL_PATH_PARTS)
@@ -2217,21 +2235,13 @@ def _default_export_ignore(root_dir: Path):
# its persistent Chromium profile (Cookies, Login Data — the bot's live web sessions), Xauthority, sockets.
_EXPORT_CREDENTIAL_FILES = frozenset({"auth.json", ".env", "bot-desktop"})
-# Recovery copies Hermes writes of those stores at a profile's root, dropped from a named-profile
-# export (the default export's root allow-list already omits them). ``backups/`` holds pre-update
-# zips of the whole home and config.yaml copies; ``state-snapshots/`` holds per-profile update
-# snapshots (pairing stores, state.db). The sibling copies (``auth.json.corrupt``, the config
-# migration's ``.env.bak-<stamp>`` / ``config.yaml.bak-<stamp>``, legacy ``config.yaml.bak.<n>``
-# and ``config.yaml.corrupt.*``) end in suffixes the text scrub never edits.
-_EXPORT_RECOVERY_ROOT_DIRS = frozenset({"backups", "state-snapshots"})
-_EXPORT_STORE_COPY_PREFIXES = ("auth.json.", ".env.bak", "config.yaml.bak", "config.yaml.corrupt")
-
# Text/config suffixes secret-scrubbed on export; binary DBs, images etc. are left alone.
_EXPORT_REDACT_SUFFIXES = frozenset({
".md", ".txt", ".yaml", ".yml", ".json", ".jsonl", ".toml", ".ini", ".cfg", ".conf", ".py", ".sh",
".bash", ".zsh", ".js", ".ts", ".tsx", ".jsx", ".css", ".html", ".xml", ".csv",
})
-# ``Path(".cursorrules").suffix`` is "" — name-match; ``*.env.example`` uses endswith.
+# ``Path(".cursorrules").suffix`` is "" — name-match; ``*.env.example`` uses endswith; a hand-named
+# config copy (``config.yaml.bak-my-note``) holds config.yaml's secrets under a suffix of its own.
_EXPORT_REDACT_NAMES = frozenset({".cursorrules"})
@@ -2240,6 +2250,7 @@ def _should_redact_export_file(path: Path) -> bool:
return (
name in _EXPORT_REDACT_NAMES
or name.lower().endswith(".env.example")
+ or name.lower().startswith("config.yaml.")
or path.suffix.lower() in _EXPORT_REDACT_SUFFIXES
)
@@ -2287,8 +2298,7 @@ def export_profile(name: str, output_path: str, extra_files: Optional[Dict[str,
rel = Path(directory).relative_to(profile_dir).parts
ignored.update(e for e in contents if profile_path_is_private((*rel, e)))
if Path(directory) == profile_dir:
- ignored |= (PM_RUNTIME_ROOT_DIRS | _EXPORT_RECOVERY_ROOT_DIRS) & set(contents)
- ignored.update(e for e in contents if e.startswith(_EXPORT_STORE_COPY_PREFIXES))
+ ignored |= PM_RUNTIME_ROOT_DIRS & set(contents)
return ignored
ignore = _default_export_ignore(profile_dir) if canon == "default" else _ignore_credentials
diff --git a/tests/hermes_cli/test_profile_export_credentials.py b/tests/hermes_cli/test_profile_export_credentials.py
index eb90cd64ace..cd6092abc25 100644
--- a/tests/hermes_cli/test_profile_export_credentials.py
+++ b/tests/hermes_cli/test_profile_export_credentials.py
@@ -25,6 +25,31 @@ def _patch_named_profile(monkeypatch, profiles_root, profile_dir):
monkeypatch.setattr("hermes_cli.profiles.validate_profile_name", lambda n: None)
+# Stores named here as well as in PROFILE_CREDENTIAL_PATHS, so dropping one from the list fails a test:
+# the loaders' and writers' own file names (.op.env and npmrc have no suffix the scrub edits).
+_EXTRA_STORES = {
+ ".op.env", "npmrc", "honcho.json", "google_chat_user_token.json", "google_chat_user_oauth_pending",
+ "workspace/meetings/node_token.json", "weixin/accounts", ".copilot_jwt.json", "proxy", "chrome-debug",
+ "home/.git-credentials", "home/.config/gh/hosts.yml", "backups", "state-snapshots",
+}
+
+
+def _seed_stores(root):
+ """Lay every credential store into a profile-shaped tree at *root*; returns their paths."""
+ from hermes_cli.profiles import PROFILE_CREDENTIAL_PATHS
+
+ stores = _EXTRA_STORES | PROFILE_CREDENTIAL_PATHS
+ (root / "platforms").mkdir(parents=True)
+ (root / "config.yaml").write_text("model: gpt-4\n")
+ (root / "platforms" / "keep.json").write_text("{}")
+ for rel in stores:
+ is_dir = "." not in rel.rsplit("/", 1)[-1] and rel != "npmrc" # token dirs vs single files
+ target = root / rel / "store" if is_dir else root / rel
+ target.parent.mkdir(parents=True, exist_ok=True)
+ target.write_text("fake-credential")
+ return stores
+
+
class TestCredentialExclusion:
def test_named_profile_export_excludes_auth(self, tmp_path, monkeypatch):
@@ -55,62 +80,56 @@ class TestCredentialExclusion:
assert not any("auth.json" in n for n in names), "auth.json must NOT be in export"
assert not any(".env" in n for n in names), ".env must NOT be in export"
- def test_export_ships_no_credential_store_a_loader_reads(self, tmp_path, monkeypatch):
- """Every credential store Hermes loads from a profile home stays out of a named-profile
- export and stays user-owned on a distribution install: a distribution can neither ship
- one (nested ones included) nor opt one back in through ``distribution_owned``. .op.env
- (env_loader) and npmrc (source_build) have no suffix the text scrub pass edits, so
- exclusion is their only guard; the legacy Google Chat token file ships its client_secret."""
- import shutil
- from pathlib import Path
-
- from hermes_cli.profile_distribution import DistributionManifest, install_distribution, write_manifest
+ def test_named_export_ships_no_credential_store_or_copy_of_one(self, tmp_path, monkeypatch):
+ """No credential store (any case spelling) and no copy Hermes' own writers leave of one
+ (pre-update zip, update snapshot, config backup, migration .bak, corrupt auth.json) reaches a
+ named-profile export. .op.env, npmrc, home/ CLI stores and the .bak copies have no suffix the
+ scrub edits, so exclusion is their only guard; a hand-named config copy is the user's and
+ ships scrubbed."""
+ from hermes_cli.auth import _load_auth_store
+ from hermes_cli.backup import create_pre_update_backup, create_quick_snapshot
+ from hermes_cli.config_backups import backup_config
+ from hermes_cli.post_update import _backup_existing
from hermes_cli.profiles import PROFILE_CREDENTIAL_PATHS
profiles_root = tmp_path / "profiles"
profile_dir = profiles_root / "testprofile"
- (profile_dir / "platforms").mkdir(parents=True)
- (profile_dir / "config.yaml").write_text("model: gpt-4\n")
- (profile_dir / "platforms" / "keep.json").write_text("{}")
- stores = {".op.env", "npmrc", "google_chat_user_token.json", "google_chat_user_oauth_pending",
- "workspace/meetings/node_token.json", "honcho.json", *PROFILE_CREDENTIAL_PATHS}
- for rel in stores:
- is_dir = "." not in rel.rsplit("/", 1)[-1] and rel != "npmrc" # token dirs vs single files
- target = profile_dir / rel / "store" if is_dir else profile_dir / rel
- target.parent.mkdir(parents=True, exist_ok=True)
- target.write_text("fake-credential")
-
- monkeypatch.setattr(Path, "home", lambda: tmp_path)
- (tmp_path / ".hermes").mkdir()
- monkeypatch.setenv("HERMES_HOME", str(tmp_path / ".hermes"))
- tops = sorted({r.split("/")[0] for r in stores})
- for owned in ([], sorted(stores) + tops): # legacy whole-payload, then explicit opt-in
- staged = tmp_path / f"dist{len(owned)}"
- shutil.copytree(profile_dir, staged)
- write_manifest(staged, DistributionManifest(name=staged.name, version="0.1.0", distribution_owned=owned))
- installed = install_distribution(str(staged), name=staged.name).target_dir
- assert (installed / "platforms" / "keep.json").exists()
- planted = sorted(r for r in stores if any(
- f.is_file() and f.read_text() == "fake-credential"
- for f in ((installed / r), *((installed / r).rglob("*") if (installed / r).is_dir() else ()))))
- assert not planted, (staged.name, planted)
-
+ _seed_stores(profile_dir)
+ (profile_dir / "config.yaml").write_text(f"model:\n api_key: {_LEAKED_KEY}\n")
+ (profile_dir / "config.yaml.bak-my-note").write_text(f"model:\n api_key: {_LEAKED_KEY}\n")
+ (profile_dir / "GOOGLE_CHAT_USER_TOKENS").mkdir(exist_ok=True)
+ (profile_dir / "GOOGLE_CHAT_USER_TOKENS" / "upper.json").write_text("fake-credential")
+ monkeypatch.setenv("HERMES_HOME", str(profile_dir))
+ copies = [
+ create_pre_update_backup(hermes_home=profile_dir),
+ profile_dir / "state-snapshots" / create_quick_snapshot(hermes_home=profile_dir),
+ backup_config(profile_dir / "config.yaml", "setup"),
+ *_backup_existing((profile_dir / ".env", profile_dir / "config.yaml")).values(),
+ ]
+ _load_auth_store(profile_dir / "auth.json") # "fake-credential" is not JSON: quarantined
+ copies.append(profile_dir / "auth.json.corrupt")
+ assert all(c and c.exists() for c in copies), copies
_patch_named_profile(monkeypatch, profiles_root, profile_dir)
with tarfile.open(export_profile("testprofile", str(tmp_path / "export.tar.gz")), "r:gz") as tf:
- names = set(tf.getnames())
-
- assert {"testprofile/config.yaml", "testprofile/platforms/keep.json"} <= names
- leaked = sorted(r for r in stores if any(n == f"testprofile/{r}" or n.startswith(f"testprofile/{r}/") for n in names))
+ members = {m.name: m for m in tf.getmembers()}
+ note = tf.extractfile("testprofile/config.yaml.bak-my-note").read().decode()
+
+ assert {"testprofile/config.yaml", "testprofile/platforms/keep.json"} <= set(members)
+ assert _LEAKED_KEY not in note
+ rels = {*_EXTRA_STORES, *PROFILE_CREDENTIAL_PATHS, "google_chat_user_tokens/upper.json",
+ *(c.relative_to(profile_dir).as_posix() for c in copies)}
+ folded = {n.casefold() for n in members}
+ leaked = sorted(r for r in rels if any(
+ n == f"testprofile/{r}".casefold() or n.startswith(f"testprofile/{r}/".casefold()) for n in folded))
assert not leaked, leaked
- @pytest.mark.parametrize("shipped_file", ["platforms", "platforms/whatsapp"])
@pytest.mark.parametrize("declare_owned", [False, True])
- def test_update_shipping_a_file_over_a_store_directory_changes_nothing(
- self, tmp_path, monkeypatch, shipped_file, declare_owned):
- """An update whose payload ships a FILE where the profile has a directory holding
- credential stores is refused before anything is written: the installer's stores
- survive and no other payload file has been replaced."""
+ def test_distribution_can_neither_plant_nor_replace_a_store(self, tmp_path, monkeypatch, declare_owned):
+ """A distribution never installs a credential store or a recovery copy of one, nested ones
+ included, whether it ships the whole payload or names each store in ``distribution_owned``,
+ while a sibling such as ``platforms/keep.json`` still installs. An update that ships a FILE
+ where the profile has a directory holding stores is refused before anything is written."""
from pathlib import Path
from hermes_cli.profile_distribution import (
@@ -120,71 +139,40 @@ class TestCredentialExclusion:
monkeypatch.setattr(Path, "home", lambda: tmp_path)
(tmp_path / ".hermes").mkdir()
monkeypatch.setenv("HERMES_HOME", str(tmp_path / ".hermes"))
- owned = ["SOUL.md", "platforms"] if declare_owned else []
+ stores = _seed_stores(tmp_path / "v1") | {"auth.json.corrupt", ".env.bak-20260928T084018Z",
+ "config.yaml.bak-20260928T084018Z"}
+ for copy in ("auth.json.corrupt", ".env.bak-20260928T084018Z", "config.yaml.bak-20260928T084018Z"):
+ (tmp_path / "v1" / copy).write_text("fake-credential")
+ # PLATFORMS/PAIRING: on a case-insensitive filesystem that spelling IS the pairing store.
+ owned = sorted(stores | {r.split("/")[0] for r in stores} | {"SOUL.md", "PLATFORMS/PAIRING"}) if declare_owned else []
def stage(label, soul):
staged = tmp_path / label
- staged.mkdir()
+ staged.mkdir(exist_ok=True)
(staged / "SOUL.md").write_text(soul)
write_manifest(staged, DistributionManifest(name="dist", version="0.1.0", distribution_owned=owned))
return staged
- first = stage("v1", "v1")
- (first / "platforms").mkdir()
- (first / "platforms" / "keep.json").write_text("{}")
- installed = install_distribution(str(first), name="dist").target_dir
- stores = [installed / "platforms" / "pairing" / "approved.json",
- installed / "platforms" / "whatsapp" / "session" / "creds.json"]
- for store in stores:
+ installed = install_distribution(str(stage("v1", "v1")), name="dist").target_dir
+ assert (installed / "platforms" / "keep.json").exists()
+ planted = sorted(r for r in stores if any(
+ f.is_file() and f.read_text() == "fake-credential"
+ for f in ((installed / r), *((installed / r).rglob("*") if (installed / r).is_dir() else ()))))
+ assert not planted, planted
+
+ live = [installed / "platforms" / "pairing" / "approved.json",
+ installed / "platforms" / "whatsapp" / "session" / "creds.json"]
+ for store in live:
store.parent.mkdir(parents=True)
store.write_text("installer-credential")
-
- second = stage("v2", "v2")
- target = second / shipped_file
- target.parent.mkdir(parents=True, exist_ok=True)
- target.write_text("not a directory")
- with pytest.raises(DistributionError):
- install_distribution(str(second), name="dist", force=True)
-
- assert [s.read_text() for s in stores] == ["installer-credential"] * 2
- assert (installed / "SOUL.md").read_text() == "v1"
-
- def test_export_ships_no_recovery_copy_hermes_writes_of_a_store(self, tmp_path, monkeypatch):
- """Every copy Hermes' own writers leave in a profile home (pre-update zip, update snapshot,
- config-migration .bak, config backup, corrupt auth.json) stays out of a named-profile
- export: each carries the same credentials, and none ends in a suffix the scrub edits."""
- from hermes_cli.auth import _load_auth_store
- from hermes_cli.backup import create_pre_update_backup, create_quick_snapshot
- from hermes_cli.config_backups import backup_config
- from hermes_cli.post_update import _backup_existing
-
- profiles_root = tmp_path / "profiles"
- profile_dir = profiles_root / "testprofile"
- (profile_dir / "pairing").mkdir(parents=True)
- (profile_dir / "config.yaml").write_text(f"model:\n api_key: {_LEAKED_KEY}\n")
- (profile_dir / ".env").write_text(f"OPENROUTER_API_KEY={_LEAKED_KEY}\n")
- (profile_dir / "pairing" / "telegram-approved.json").write_text('{"123": {}}')
- (profile_dir / "auth.json").write_text('{"providers": {"x": {"api_key": "' + _LEAKED_KEY + '"')
- monkeypatch.setenv("HERMES_HOME", str(profile_dir))
-
- copies = [
- create_pre_update_backup(hermes_home=profile_dir),
- profile_dir / "state-snapshots" / create_quick_snapshot(hermes_home=profile_dir),
- backup_config(profile_dir / "config.yaml", "setup"),
- *_backup_existing((profile_dir / ".env", profile_dir / "config.yaml")).values(),
- ]
- _load_auth_store(profile_dir / "auth.json")
- copies.append(profile_dir / "auth.json.corrupt")
- assert all(c and c.exists() for c in copies), copies
- _patch_named_profile(monkeypatch, profiles_root, profile_dir)
-
- with tarfile.open(export_profile("testprofile", str(tmp_path / "export.tar.gz")), "r:gz") as tf:
- names = set(tf.getnames())
-
- assert "testprofile/config.yaml" in names
- rels = [c.relative_to(profile_dir).as_posix() for c in copies]
- shipped = sorted(r for r in rels if any(n == f"testprofile/{r}" or n.startswith(f"testprofile/{r}/") for n in names))
- assert not shipped, shipped
+ for shipped_file in ("platforms", "platforms/whatsapp"):
+ update = stage(f"v2-{shipped_file.count('/')}", "v2")
+ (update / shipped_file).parent.mkdir(parents=True, exist_ok=True)
+ (update / shipped_file).write_text("not a directory")
+ with pytest.raises(DistributionError):
+ install_distribution(str(update), name="dist", force=True)
+ assert [s.read_text() for s in live] == ["installer-credential"] * 2
+ assert (installed / "SOUL.md").read_text() == "v1"
class TestExportSecretScrub:
diff --git a/tests/hermes_cli/test_profile_export_special_files.py b/tests/hermes_cli/test_profile_export_special_files.py
index 182785811af..7962de4e04d 100644
--- a/tests/hermes_cli/test_profile_export_special_files.py
+++ b/tests/hermes_cli/test_profile_export_special_files.py
@@ -42,7 +42,8 @@ def test_named_profile_export_survives_unix_socket(tmp_path, monkeypatch):
"""Sockets and FIFOs in a named profile are skipped, not fatal."""
profiles_root = tmp_path / "profiles"
profile_dir = profiles_root / "sockety"
- browser_dir = profile_dir / "home" / ".agent-browser"
+ # Not home/.agent-browser: a named export never walks home/ (the subprocess HOME's CLI credentials).
+ browser_dir = profile_dir / "workspace" / ".agent-browser"
browser_dir.mkdir(parents=True)
(profile_dir / "config.yaml").write_text("model: gpt-4\n")
diff --git a/website/docs/reference/profile-commands.md b/website/docs/reference/profile-commands.md
index 5f7ce5b5774..9f4f840f67d 100644
--- a/website/docs/reference/profile-commands.md
+++ b/website/docs/reference/profile-commands.md
@@ -325,7 +325,7 @@ hermes profile purge-identity mybot
hermes profile export <name> [options]
```
-Exports a profile as a compressed tar.gz archive — a portable snapshot you can back up, move to another machine, or hand to someone else. `auth.json` and `.env` are always excluded.
+Exports a profile as a compressed tar.gz archive — a portable snapshot you can back up, move to another machine, or hand to someone else. `auth.json`, `.env` and the other credential stores are always excluded; see [what an export file contains](../user-guide/profile-distributions.md#what-an-export-file-contains).
Also available in chat as [`/export`](./slash-commands.md), and in the desktop app via **⌘K → Export profile…** or a profile square's right-click menu. A desktop export additionally stages `desktop.json` (skin, light/dark mode, custom themes, rail color, window layout) into the archive.
diff --git a/website/docs/user-guide/profile-distributions.md b/website/docs/user-guide/profile-distributions.md
index f2aa7111af6..0bc023ce473 100644
--- a/website/docs/user-guide/profile-distributions.md
+++ b/website/docs/user-guide/profile-distributions.md
@@ -87,7 +87,7 @@ Not a fit:
- **You want to hand someone your setup once, right now.** A distribution needs a repo, a manifest, and a `.gitignore`. `/export` needs none of that — see [Export and import a profile file](#export-and-import-a-profile-file). Same for backing up or moving a profile to a new machine.
- **You want to share your desktop theme and layout.** A distribution carries the agent — SOUL, config, skills, cron, MCP, plugins. An export made from the desktop app also carries the look: skin, light/dark mode, custom themes, rail color, and window layout.
-- **You want to share API keys alongside the agent.** `auth.json`, `.env` and the other credential stores Hermes reads from a profile (`.op.env`, `npmrc`, OAuth token files, `honcho.json`, `mcp-tokens/`, `vault/`, browser profiles, platform sessions) are deliberately excluded from distributions. Each installer brings their own credentials. (Export files strip them too.)
+- **You want to share API keys alongside the agent.** `auth.json`, `.env` and the other credential stores Hermes reads from a profile (`.op.env`, `npmrc`, OAuth and bot token files, `honcho.json`, `mcp-tokens/`, `vault/`, `proxy/`, browser profiles, platform sessions) are deliberately excluded from distributions. Each installer brings their own credentials. (Export files strip them too.)
- **You want to share memories / sessions / conversation history.** Those are user data, not distribution content. Never shipped. (Export files are different here — read [what an export contains](#what-an-export-file-contains) before sending one.)
:::caution
@@ -274,7 +274,7 @@ When an installer updates to a new version, some things get replaced (author's d
|---|---|---|
| **Distribution-owned** | `SOUL.md`, `config.yaml`, `mcp.json`, `skills/`, `cron/jobs.json`, `distribution.yaml` | Files are replaced from the new clone. Skill directories are merged per entry. `cron/jobs.json` is merged by job id: shipped definitions update in place, your local jobs and each job's paused/enabled state survive, and newly shipped jobs arrive paused. Other `cron/` files and root-level hidden `skills/` metadata are runtime state and stay local. |
| **Config override** | `config.yaml` | Actually preserved by default — the installer may have tuned model or provider. Pass `--force-config` on update to reset. |
-| **User-owned** | `memories/`, `sessions/`, `state.db*`, `auth.json`, `.env` and the other credential stores (including those below a distribution-owned directory, such as `platforms/pairing/` and `platforms/whatsapp/session/`), `logs/`, `workspace/`, `plans/`, `home/`, `*_cache/`, `local/` | Never touched, and `distribution_owned` cannot claim a credential store. An update that ships a file where your profile has a directory holding one (a file named `platforms`) is refused before anything is written |
+| **User-owned** | `memories/`, `sessions/`, `state.db*`, `auth.json`, `.env` and the other credential stores (including those below a distribution-owned directory, such as `platforms/pairing/` and `platforms/whatsapp/session/`) and the recovery copies Hermes keeps of them (`state-snapshots/`, `auth.json.corrupt`, `.env.bak-*`), `logs/`, `workspace/`, `plans/`, `home/`, `*_cache/`, `local/` | Never touched, and `distribution_owned` cannot claim a credential store. An update that ships a file where your profile has a directory holding one (a file named `platforms`) is refused before anything is written |
You can override the distribution-owned list in the manifest:
@@ -686,13 +686,13 @@ You cannot import as `default` — that name is the built-in root profile (`~/.h
### What an export file contains
-Always excluded, both profile types: `auth.json`, `.env` and the other credential stores Hermes reads from a profile (OAuth token files, `honcho.json`, `mcp-tokens/`, `vault/`, browser profiles, platform sessions and pairing stores). Your API keys never leave the machine. `honcho.json` holds the Honcho API key and OAuth grant next to its settings, so after an import run `hermes honcho setup` again.
+Always excluded, both profile types: `auth.json`, `.env` and the other credential stores Hermes reads from a profile (OAuth and bot token files such as WeChat's `weixin/accounts/`, `honcho.json`, `mcp-tokens/`, `vault/`, the iron-proxy keys in `proxy/`, browser profiles including the `/browser connect` one in `chrome-debug/`, platform sessions and pairing stores). Your API keys never leave the machine. `honcho.json` holds the Honcho API key and OAuth grant next to its settings, so after an import run `hermes honcho setup` again.
**The default profile** (`~/.hermes`) is exported through an allow-list — only known Hermes artifacts, so an unrelated file sitting in your home directory can't get swept in:
`config.yaml`, `SOUL.md`, `MEMORY.md`, `USER.md`, `todo.json`, `system_prompt.md`, `AGENTS.md`, `CLAUDE.md`, `.cursorrules`, `skills/`, `plugins/`, `cron/`, `scripts/`, `sessions/`, `memories/`, `knowledge/`, `preferences/`, and `desktop.json` when the desktop staged one.
-**A named profile** (`~/.hermes/profiles/<name>`) copies the whole directory minus those credential stores and the recovery copies Hermes keeps of them (`backups/`, `state-snapshots/`, `auth.json.corrupt`, `.env.bak-*`, `config.yaml.bak-*`). That's broader — if the profile has `state.db`, logs, or caches, they go in the archive too, and the file gets big.
+**A named profile** (`~/.hermes/profiles/<name>`) copies the whole directory minus those credential stores, `home/` (the `HOME` of Hermes' tool subprocesses, where `git`, `ssh`, `gh`, `npm` and skill CLIs keep their credentials), and the recovery copies Hermes keeps of them (`backups/`, `state-snapshots/`, any `auth.json.*` or `.env.bak*`, and the `config.yaml.bak-<timestamp>` copies `hermes update` writes). A copy you name yourself, such as `config.yaml.bak-my-note`, is exported, with its secrets redacted like `config.yaml`'s. That's broader — if the profile has `state.db`, logs, or caches, they go in the archive too, and the file gets big.
:::caution Read your archive before you send it
An export is a snapshot of your profile, not a curated release. Unlike a distribution, it **can** include `memories/`, `sessions/`, and `USER.md` — and nothing scans skills, memories, or your persona for anything personal you wrote into them. Credentials are filtered by filename; content is not.
diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/profile-distributions.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/profile-distributions.md
index 3f81e375e55..1841bfa0073 100644
--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/profile-distributions.md
+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/profile-distributions.md
@@ -66,7 +66,7 @@ hermes profile install github.com/you/my-research-agent --alias
不适合的场景:
- **你只想在自己的机器上备份一个 profile。** 使用 [`hermes profile export` / `import`](../reference/profile-commands.md#hermes-profile-export)——那正是这两个命令的用途。
-- **你想随 agent 一起共享 API 密钥。** `auth.json`、`.env` 以及 Hermes 从 profile 读取的其他凭据存储(`.op.env`、`npmrc`、OAuth token 文件、`honcho.json`、`mcp-tokens/`、`vault/`、浏览器 profile、平台会话)被刻意排除在分发之外。每个安装者使用自己的凭据。(导出文件同样会去除它们。)
+- **你想随 agent 一起共享 API 密钥。** `auth.json`、`.env` 以及 Hermes 从 profile 读取的其他凭据存储(`.op.env`、`npmrc`、OAuth 与机器人 token 文件、`honcho.json`、`mcp-tokens/`、`vault/`、`proxy/`、浏览器 profile、平台会话)被刻意排除在分发之外。每个安装者使用自己的凭据。(导出文件同样会去除它们。)
- **你想共享记忆 / 会话 / 对话历史。** 这些是用户数据,不是分发内容,永远不会被发送。
## 生命周期:从作者到安装者再到更新
@@ -175,7 +175,7 @@ research-bot/
|---|---|---|
| **分发所有** | `SOUL.md`、`config.yaml`、`mcp.json`、`skills/`、`cron/`、`distribution.yaml` | 从新克隆中替换 |
| **配置覆盖** | `config.yaml` | 默认实际保留——安装者可能已调整模型或 provider。更新时传入 `--force-config` 可重置。 |
-| **用户所有** | `memories/`、`sessions/`、`state.db*`、`auth.json`、`.env` 及其他凭据存储(包括位于分发所有目录之下的存储,例如 `platforms/pairing/` 和 `platforms/whatsapp/session/`)、`logs/`、`workspace/`、`plans/`、`home/`、`*_cache/`、`local/` | 永不触碰,且 `distribution_owned` 不能声明凭据存储。如果更新在你的 profile 中存放凭据存储的目录位置上发送了一个文件(例如名为 `platforms` 的文件),则会在写入任何内容之前被拒绝 |
+| **用户所有** | `memories/`、`sessions/`、`state.db*`、`auth.json`、`.env` 及其他凭据存储(包括位于分发所有目录之下的存储,例如 `platforms/pairing/` 和 `platforms/whatsapp/session/`)及 Hermes 为它们保留的恢复副本(`state-snapshots/`、`auth.json.corrupt`、`.env.bak-*`)、`logs/`、`workspace/`、`plans/`、`home/`、`*_cache/`、`local/` | 永不触碰,且 `distribution_owned` 不能声明凭据存储。如果更新在你的 profile 中存放凭据存储的目录位置上发送了一个文件(例如名为 `platforms` 的文件),则会在写入任何内容之前被拒绝 |
你可以在 manifest 中覆盖分发所有列表: