HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.
Python agent-apiagent-frameworkagent-harnessai-agentsai-infrastructurecoding-agentconformance-testingdeepseek-harnessharness-engineeringhermesllmopen-protocolopen-sourceopen-standardpi-coding-agentself-hosteduhpunified-apiunified-harness-protocolunified-interface
fix(images): the image switch must fail closed
richard-epsilla419789561ea6
diff --git a/docker/entrypoint.sh b/docker/entrypoint.shindex ba1c7073..f687c961 100644--- a/docker/entrypoint.sh+++ b/docker/entrypoint.sh@@ -40,6 +40,10 @@ export HR_POOL_AUTH="${HR_POOL_AUTH:-none}"# to the runner directly instead of being brokered. See _auth_from_conn in gateway/app.py for# why this is an explicit mode and never a fallback.export HR_SANDBOX_TRUST="${HR_SANDBOX_TRUST:-owner}"+# Image generation through the broker. Safe to default on HERE and nowhere else: self-hosted is+# bring-your-own-key, so the images an agent makes are billed to the operator's own provider+# account and there is nothing for us to meter.+export HR_BROKER_IMAGES="${HR_BROKER_IMAGES:-1}"# The gateway signs its own internal calls. Generated per container if not supplied, so a# default install has no shared secret and nothing to leak; it never leaves this process tree.diff --git a/gateway/app.py b/gateway/app.pyindex 88940fb0..7fad038b 100644--- a/gateway/app.py+++ b/gateway/app.py@@ -2304,11 +2304,14 @@ HR_BROKER_PATHS = os.environ.get("HR_BROKER_PATHS", "enforce").strip().lower()# Image generation rides the same broker as chat, so a task never holds a provider key. It is a# SEPARATE switch because the money works differently: this relay does not meter, and image APIs# bill per image rather than per token, so a deployment spending its OWN key must count images-# before opening this. Self-hosted is bring-your-own-key — the operator is spending their own-# money and there is nothing to meter — so it defaults ON there and a hosted deployment sets-# HR_BROKER_IMAGES=0 until its metering lands.+# before opening this.+#+# Default OFF, and the self-hosted entrypoint turns it on. The other way round — on by default,+# hosted sets 0 — fails OPEN: forget the variable in one environment and it quietly serves images+# on our key with nothing metered. Bring-your-own-key is the case where nothing needs metering,+# and that is exactly the case that opts in._BROKER_IMAGE_PATHS = {"images/generations", "images/edits", "images/variations"}-HR_BROKER_IMAGES = os.environ.get("HR_BROKER_IMAGES", "1").strip().lower() not in ("0", "off", "false")+HR_BROKER_IMAGES = os.environ.get("HR_BROKER_IMAGES", "0").strip().lower() in ("1", "on", "true")def _broker_path_allowed(suffix: str) -> bool: