Skip to content

The agent that grows with you

docs(plugins): pin plugins.isolation in the managed scope for shared deployments

teknium133eedf29c941
diff --git a/plugins/AGENTS.md b/plugins/AGENTS.md
index ba82474634b..2da52d73a59 100644
--- a/plugins/AGENTS.md
+++ b/plugins/AGENTS.md
@@ -109,6 +109,9 @@ Invariants:
- **A host never spawns a host** (`HERMES_PLUGIN_HOST_PROCESS=1` makes `isolation_mode()` in-process
there) and must not start while a module import holds its lock (model-provider discovery is the
known case).
+- **The isolated party cannot opt out when an operator pins it:** `isolation_mode()` / `host_launcher()`
+ read through the managed overlay (`load_config_readonly`), so `/etc/hermes/config.yaml` beats the
+ profile's own config. Never switch them to a raw user-config read.
- Plugins stay tenant-unaware: no new API, same `ctx`. Per-profile env comes from
`served_profile_child_env`, so a host sees only its own profile's secrets.
diff --git a/tests/hermes_cli/test_plugin_host.py b/tests/hermes_cli/test_plugin_host.py
index 988f03b5ec9..326379a87cb 100644
--- a/tests/hermes_cli/test_plugin_host.py
+++ b/tests/hermes_cli/test_plugin_host.py
@@ -124,6 +124,31 @@ def test_isolation_host_keeps_every_user_import_path_out_of_process(tmp_path, mo
assert blocked.verdict == "in_process" and "register_platform" in blocked.reasons[0]
+
+def test_managed_scope_pins_host_isolation_over_the_profiles_own_config(tmp_path, monkeypatch):
+ """The isolated party must not be able to opt out: an operator pin in the managed scope
+ (/etc/hermes/config.yaml) wins over a profile config that says in_process."""
+ from hermes_cli import managed_scope
+ from tools.registry import registry
+
+ _home_with_plugins(tmp_path, monkeypatch, {"hostprobe": PROBE_PLUGIN}, isolation="in_process")
+ managed = tmp_path / "managed"
+ managed.mkdir()
+ (managed / "config.yaml").write_text(yaml.safe_dump({"plugins": {"isolation": "host"}}), encoding="utf-8")
+ monkeypatch.setenv("HERMES_MANAGED_DIR", str(managed))
+ managed_scope.invalidate_managed_cache()
+ manager = PluginManager()
+ manager.discover_and_load()
+ try:
+ assert not any("hostprobe" in name for name in sys.modules)
+ result = json.loads(registry.dispatch("hostprobe_pid", {}, scope=manager.scope_key))
+ assert result["pid"] != os.getpid()
+ finally:
+ host = getattr(manager, "_plugin_host_instance", None)
+ if host is not None:
+ host.shutdown()
+ managed_scope.invalidate_managed_cache()
+
MODEL_PROVIDER_PLUGIN = '''
import os
from providers import register_provider
diff --git a/website/docs/user-guide/features/plugins.md b/website/docs/user-guide/features/plugins.md
index 1d6c1ced46c..6782dd9976a 100644
--- a/website/docs/user-guide/features/plugins.md
+++ b/website/docs/user-guide/features/plugins.md
@@ -819,6 +819,22 @@ What changes in `host` mode:
model-provider profiles that build their own SDK client (`create_client`), streaming dashboard
endpoints, and plugins that monkeypatch Hermes modules. Run those with `isolation: in_process`.
+**Locking it for a shared deployment.** `plugins.isolation` is ordinary profile config, so whoever can
+edit a profile's `config.yaml` can turn it off. When the profiles belong to people you are isolating from
+each other, pin it in the [managed scope](../managed-scope.md) instead; the managed value wins over every
+profile's own config and `hermes config set` refuses to change it:
+
+```yaml
+# /etc/hermes/config.yaml (root-owned, read by every profile on the machine)
+plugins:
+ isolation: host
+ host:
+ launcher: [...] # pin the sandbox runner too, if you use one
+```
+
+Run the agents' terminal on an isolated backend (Docker, SSH, ...) as well, so the agent itself cannot
+reach the operator's files.
+
`hermes plugins validate <dir>` and `hermes plugins show <name>` report whether a plugin runs in the host
and, if not, why. Across the plugin catalog at the time of writing, 299 of 348 entries run in the host
unchanged.