Skip to content

The agent that grows with you

test(install): the fresh-install fixture tree carries the stdlib-only safe-worker policy

Teknium998efbce44a6
diff --git a/agent/safe_worker_policy.py b/agent/safe_worker_policy.py
index 36f3c72bf37..72226c92b76 100644
--- a/agent/safe_worker_policy.py
+++ b/agent/safe_worker_policy.py
@@ -1,5 +1,8 @@
"""Private bootstrap policy for admission-owned troubleshooting workers.
+Stdlib-only: hermes_cli's config/env layer imports it, so it ships in the installer's
+hermes_cli + i18n-kernel tail and must never import beyond the standard library.
+
Bind once in a fresh exec, before config/agent/plugin imports. This is not a
sandbox or a public launch switch: only the managed worker bootstrap consumes
the owner's validated assignment. No environment flag grants this policy and
diff --git a/tests/scripts/test_fresh_source_install.py b/tests/scripts/test_fresh_source_install.py
index 59ca6f0004f..232b51cdbbd 100644
--- a/tests/scripts/test_fresh_source_install.py
+++ b/tests/scripts/test_fresh_source_install.py
@@ -69,10 +69,12 @@ def test_current_installer_publishes_real_dependencies_and_warm_path(tmp_path, s
shutil.copytree(ROOT / name, source / name, ignore=shutil.ignore_patterns("__pycache__"))
for name in ("utils.py", "hermes_constants.py", "hermes_yaml.py", "hermes_bootstrap.py", "setup-hermes.sh"):
shutil.copy2(ROOT / name, source / name)
- # The CLI's user-facing text resolves through the i18n kernel (agent.i18n + the English catalog);
- # the rest of agent/ stays out so the tail cannot grow a dependency on the agent runtime.
+ # The CLI's user-facing text resolves through the i18n kernel (agent.i18n + the English catalog),
+ # and its config/env layer consults the stdlib-only safe-worker policy; the rest of agent/ stays
+ # out so the tail cannot grow a dependency on the agent runtime.
(source / "agent").mkdir()
- for name in ("__init__.py", "jiter_preload.py", "i18n.py", "i18n_layers.py", "i18n_languages.py"):
+ for name in ("__init__.py", "jiter_preload.py", "i18n.py", "i18n_layers.py", "i18n_languages.py",
+ "safe_worker_policy.py"):
shutil.copy2(ROOT / "agent" / name, source / "agent" / name)
(source / "locales").mkdir()
shutil.copy2(ROOT / "locales/en.yaml", source / "locales/en.yaml")