Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ce6cad01f | ||
|
|
9cf6304e23 | ||
|
|
91ec7ea3d2 | ||
|
|
e59f59d776 | ||
|
|
889f4e4dd1 |
@@ -74,8 +74,9 @@ model:
|
||||
Run on any Hermes host to detect violations:
|
||||
|
||||
```bash
|
||||
grep -n 'api_key: sk-' /root/.hermes/config.yaml \
|
||||
| grep -v 'deepseek\|b7d9\|openai\|anthropic\|DEEPSEEK'
|
||||
grep -rn 'api_key: sk-' /root/.hermes/ \
|
||||
--include='config.yaml' \
|
||||
| grep -v 'deepseek\|openai\|anthropic\|DEEPSEEK'
|
||||
```
|
||||
|
||||
If any output — violation. Fix immediately.
|
||||
@@ -118,14 +119,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
|
||||
|
||||
@@ -135,9 +158,25 @@ litellm_settings:
|
||||
4. **Restart** — gateway must restart to pick up env var
|
||||
5. **Confirm** — test key against LiteLLM: `curl -H "Authorization: Bearer $KEY" .../v1/models` → 200
|
||||
6. **Update** — bump the verified table above
|
||||
7. **Use safe-mutate** — if the fix requires changing `/etc/environment` or restarting the gateway on a remote host, use `safe-mutate` to verify current state before mutating.
|
||||
|
||||
## Related Contracts
|
||||
|
||||
- `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`
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
# Posts review comments via Gitea API.
|
||||
set -euo pipefail
|
||||
|
||||
LITELLM_URL="${LITELLM_URL:-https://litellm.sysloggh.net}"
|
||||
LITELLM_KEY="${LITELLM_KEY:-sk-litellm-7f96080dd99b15c36bd4b333b58a6796}"
|
||||
LITELLM_URL="${LITELLM_URL:-}"
|
||||
LITELLM_KEY="${LITELLM_KEY:-}"
|
||||
GITEA_TOKEN="${GITEA_TOKEN:-$(grep GITEA_TOKEN /root/.pi/agent/extensions/telegram/.env 2>/dev/null | cut -d= -f2 || echo '')}"
|
||||
GITEA_API="https://git.sysloggh.net/api/v1"
|
||||
|
||||
@@ -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" \
|
||||
|
||||
Reference in New Issue
Block a user