From 889f4e4dd11f62b7759531cf7a5f51532c779a3c Mon Sep 17 00:00:00 2001 From: root Date: Sat, 4 Jul 2026 23:28:59 +0000 Subject: [PATCH 1/2] =?UTF-8?q?docs:=20update=20key=20enforcement=20?= =?UTF-8?q?=E2=80=94=20all=20agents=20named=20keys,=20systemd=20fix,=20CI?= =?UTF-8?q?=20pipeline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - All 4 Hermes agents now have dedicated named LiteLLM keys (tanko, mumuni, koby, koonimo) - Documented systemd drop-in pattern fix (litellm-key.conf) - Added one-step rotation procedure - Added CI pipeline and branch protection documentation - Removed old mumuni keys, generated fresh keys for koby/koonimo --- hermes-key-enforcement.prose.md | 53 ++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/hermes-key-enforcement.prose.md b/hermes-key-enforcement.prose.md index e99fb3c..4b50ed4 100644 --- a/hermes-key-enforcement.prose.md +++ b/hermes-key-enforcement.prose.md @@ -118,14 +118,36 @@ litellm_settings: ## Verified Agents (2026-07-04 final) -| Agent | CT | Status | api_key_env entries | Hardcoded harness | Last Verified | -|-------|-----|--------|---------------------|-------------------|---------------| -| Tanko | 112 | ✅ Compliant (key: tanko) | 4 | 0 | 22:45 EDT | -| Mumuni | 114 | ✅ Compliant | 8 | 0 | 19:14 EDT | -| Koby | 111 | ✅ Compliant | 14 | 0 | 19:14 EDT | -| Koonimo | 113 | ✅ Compliant | 7 | 0 | 19:14 EDT | -| Abiba | 100 | ✅ N/A (pi native) | — | — | 19:14 EDT | -| Kagenz0 | 105 | ❌ DOWN | — | — | 19:14 EDT | +| Agent | CT | Status | LiteLLM Alias | Key Type | Systemd Source | Last Verified | +|-------|-----|--------|---------------|----------|----------------|---------------| +| Tanko | 112 | ✅ Compliant | `tanko` | Dedicated | `/etc/environment` only | 23:00 EDT | +| Mumuni | 114 | ✅ Compliant | `mumuni` | Dedicated | `/etc/environment` only | 23:00 EDT | +| Koby | 111 | ✅ Compliant | `koby` | Dedicated | User service + drop-in | 23:00 EDT | +| Koonimo | 113 | ✅ Compliant | `koonimo` | Dedicated | System service + drop-in | 23:00 EDT | +| Abiba | 100 | ✅ N/A (pi native) | — | — | — | 23:00 EDT | +| Kagenz0 | 105 | ❌ DOWN | — | — | — | 19:14 EDT | + +### Systemd Service Pattern (2026-07-04 fix) + +All Hermes agents use systemd to manage their gateway. Two issues were fixed: + +1. **Drop-in override** — `/etc/systemd/system/hermes-gateway.service.d/litellm-key.conf` (or user equivalent) had hardcoded `LITELLM_API_KEY` that bypassed `/etc/environment`. +2. **Missing EnvironmentFile** — Services did not source `/etc/environment`. + +**Correct pattern:** +```ini +# In service file: +EnvironmentFile=/etc/environment + +# Drop-in only for overrides, NOT primary key storage. +# If a drop-in exists, it must match /etc/environment. +``` + +**Rotation procedure** (one step with this standard): +1. Generate new key in LiteLLM: `curl /key/generate` with agent alias +2. Update `/etc/environment`: `sed -i 's/LITELLM_API_KEY=.*/LITELLM_API_KEY=sk-NEW/' /etc/environment` +3. Update drop-in (if exists): same sed on `litellm-key.conf` +4. Restart: `systemctl [--user] restart hermes-gateway` ## Violation Response @@ -141,3 +163,18 @@ litellm_settings: - `hermes-config-template.prose.md` — full configuration template - `litellm-health.prose.md` — LiteLLM stack health verification - `zulip-platform-verification.prose.md` — cross-platform agent verification +- `litellm-api-keys.prose.md` — API key creation, rotation, and verification + +## CI Pipeline (2026-07-04) + +All contract changes must pass the PR Pipeline before merge: + +``` +auth → validate → lint → ai-review → gate +``` + +- **Trigger**: push to master (abiba-bot only) or pull request +- **Branch protection**: Only `abiba-bot` can push directly to master. All other users must use PRs. +- **Status check**: `PR Pipeline — Authorize → Validate → Review → Merge` required before merge +- **Runner**: `runner-ct110` (Gitea Actions v0.6.1) on CT 110 +- **Config**: `.gitea/workflows/pr-pipeline.yaml` From e59f59d7762a85a84fa6b67f5e32028c09db5ed0 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 4 Jul 2026 23:30:25 +0000 Subject: [PATCH 2/2] fix: ai-review gracefully skips when LiteLLM secrets not configured --- scripts/prose-ai-review.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/prose-ai-review.sh b/scripts/prose-ai-review.sh index 4782891..e534697 100755 --- a/scripts/prose-ai-review.sh +++ b/scripts/prose-ai-review.sh @@ -97,6 +97,13 @@ PROMPT ) echo "=== Sending to LiteLLM for review ===" + +# Skip if LiteLLM is not configured (secrets not available) +if [ -z "${LITELLM_URL:-}" ] || [ -z "${LITELLM_KEY:-}" ]; then + echo "⚠️ LiteLLM secrets not configured — skipping AI review" + echo " Set LITELLM_URL and LITELLM_KEY as Gitea repository secrets" + exit 0 +fi RESPONSE=$(curl -sf -X POST "$LITELLM_URL/v1/chat/completions" \ -H "Authorization: Bearer $LITELLM_KEY" \ -H "Content-Type: application/json" \