Skip to content

Autonomous OODA-loop pentesting agent. Hermes brain, Kali + Playwright tools over MCP, ATT&CK as the Orient language.

feat: make OpenRouter model configurable via OPENROUTER_MODEL env (fallback) — v1.0.1

irraz673984d7093d
diff --git a/.env.example b/.env.example
index da45513..135bd7c 100644
--- a/.env.example
+++ b/.env.example
@@ -9,7 +9,12 @@
# Hermes reads it directly from this variable (not from HERMES_LLM_API_KEY).
OPENROUTER_API_KEY=
-# OPTIONAL. Default OpenRouter model (if omitted, uses the one from the profile).
+# OPTIONAL. Overrides the OpenRouter model Hermes reasons with. Empty = use the profile
+# default (mistralai/mistral-large-4-0, see agent-ooda/profile/config.yaml).
+# WARNING: the project deliberately uses Mistral Large because models like Claude (anthropic/*)
+# refuse the authorized-offensive pentest framing (the OpenRouter/Anthropic safety filter returns
+# "violative cyber content" and does not respond). Overriding with such a model may make the
+# agent refuse to work.
OPENROUTER_MODEL=
# --- Hermes API server --------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 5263b23..71f33b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,10 @@ __pycache__/
.ruff_cache/
.venv/
venv/
+
+# --- Notas de trabajo locales (no versionar) ---
+# Backlog interno de features y planificación; vive en el repo pero fuera de git.
+backlog.md
+# Artefactos internos de agentes/workflows (informes, notas de verificación): no son producto.
+.agents/
+.worktrees/
diff --git a/README.md b/README.md
index 1da6736..a6cd934 100644
--- a/README.md
+++ b/README.md
@@ -59,6 +59,7 @@ variables empty in the `.env`:
| `AWS_SECRET_ACCESS_KEY` | No | Secret for that same credential. In the `.env`. |
| `AWS_SESSION_TOKEN` | No | Only for temporary credentials (STS). In the `.env`. |
| `AWS_REGION` | No | Default region (e.g. `us-east-1`). In the `.env`. |
+| `OPENROUTER_MODEL` | No | Overrides the OpenRouter model Hermes reasons with. Empty = the profile default (`mistralai/mistral-large-4-0`). **Caveat:** the project uses Mistral Large on purpose because models like Claude (`anthropic/*`) refuse the authorized-offensive pentest framing (OpenRouter/Anthropic returns "violative cyber content"); overriding with such a model may make the agent refuse to work. |
The rest of the `.env.example` variables (host ports, artifacts token, Prowler
scoping) are optional and come with defaults; leave them empty unless you need to
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..7dea76e
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+1.0.1
diff --git a/agent-ooda/profile/config.yaml b/agent-ooda/profile/config.yaml
index 074b496..b55c964 100644
--- a/agent-ooda/profile/config.yaml
+++ b/agent-ooda/profile/config.yaml
@@ -23,6 +23,10 @@ model:
# (anthropic/claude-sonnet-*) rechaza el encuadre ofensivo (el safety filter de OpenRouter/
# Anthropic devuelve "violative cyber content" y no responde). Mistral large no rehusa el pentest
# autorizado, por eso es el modelo del conductor OODA.
+ # NOTA: este valor es el DEFAULT de fallback. Se puede sobreescribir en tiempo de arranque con la
+ # variable de entorno OPENROUTER_MODEL (ver docker-compose.yml / .env.example): si OPENROUTER_MODEL
+ # esta definida y no vacia, el arranque hace `hermes config set model.default <valor>`; si esta
+ # vacia o sin definir, se usa este valor tal cual.
default: "mistralai/mistral-large-4-0"
# --- Primer servidor MCP: la Kali (contenedor `kali`) -----------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index f857149..e82e353 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -89,6 +89,12 @@ services:
cp -r /opt/profile-src/skills/. "$$DEF/skills/" 2>/dev/null || true
# (b) inject the API server KEY (secret, not versioned) BEFORE starting.
hermes config set platforms.api_server.key "$$HERMES_API_SERVER_KEY" >/dev/null
+ # (b2) OPTIONAL model override: if OPENROUTER_MODEL is set and non-empty, override
+ # model.default at runtime. If empty/unset, do nothing so the profile's model.default
+ # (mistralai/mistral-large-4-0) is used as-is (fallback).
+ if [ -n "$$OPENROUTER_MODEL" ]; then
+ hermes config set model.default "$$OPENROUTER_MODEL" >/dev/null
+ fi
# (c) start the default profile gateway: foreground (live container) + API server.
exec hermes gateway run
environment:
@@ -101,6 +107,10 @@ services:
# (OPENROUTER_API_KEY), which is why HERMES_LLM_API_KEY is NOT declared. Required
# fail-closed: without it the agent cannot reason.
OPENROUTER_API_KEY: "${OPENROUTER_API_KEY:?Falta OPENROUTER_API_KEY - define la API key de OpenRouter en .env}"
+ # OPTIONAL OpenRouter model override (NOT fail-closed): empty default. When set and
+ # non-empty, the startup command runs 'hermes config set model.default' to override the
+ # profile's model.default; when empty/unset, the profile default is used (fallback).
+ OPENROUTER_MODEL: "${OPENROUTER_MODEL:-}"
volumes:
# NAMED VOLUME REQUIRED (never a bind-mount): Hermes' state.db SQLite in WAL mode
# GETS CORRUPTED on bind-mounts that cross the macOS VM (virtiofs).