You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(personality): save/create fails in SLM admin - JWT mismatch + add new personalities #1145
Admin cannot create new personalities via the SLM admin interface
Root Cause
The SLM frontend calls /autobot-api/personality/* which nginx proxies to the main backend (172.16.168.20:8443/api/personality/*).
The mutating endpoints (PUT, POST, DELETE) require check_admin_permission which validates a main backend JWT. But the SLM frontend sends its own SLM JWT (signed with SLM_SECRET_KEY), which the main backend cannot verify — returning 401.
GET requests work because they have no auth requirement.
Solution
Add SLM backend personality proxy routes at /api/personality/* that:
Validate the SLM JWT and require admin for mutations
Forward all requests to the main backend using a shared X-Internal-API-Key header
Add X-Internal-API-Key check to main backend check_admin_permission
Change frontend API_BASE from /autobot-api/personality to /api/personality (SLM backend)
Subtasks
Add AUTOBOT_INTERNAL_API_KEY to main backend auth_middleware check_admin_permission
Add AUTOBOT_INTERNAL_API_KEY and AUTOBOT_BACKEND_URL to SLM backend config
The SLM admin frontend was sending SLM JWT tokens (signed with SLM_SECRET_KEY) directly to the main backend's personality API via the nginx /autobot-api/ proxy. The main backend validates JWTs with its own SECRET_KEY and uses different claim names (username/role vs sub/admin), so all mutating requests (PUT/POST/DELETE) were rejected with 401.
Changes
autobot-slm-backend/api/personality_proxy.py (new): Catch-all proxy router at /api/personality/*. Validates SLM JWT for all requests; requires admin: true claim for mutations. Forwards to main backend with X-Internal-API-Key header.
autobot-slm-backend/main.py: Register new personality_proxy_router at /api.
autobot-backend/auth_middleware.py: Added X-Internal-API-Key check — if header matches AUTOBOT_INTERNAL_API_KEY env var, grant admin access without requiring a main-backend JWT.
autobot-slm-frontend/src/composables/usePersonality.ts: Changed API_BASE from /autobot-api/personality to /api/personality to route through the SLM backend proxy.
Deployment
AUTOBOT_INTERNAL_API_KEY set on both .20 (main backend) and .19 (SLM backend via /etc/autobot/slm-secrets.env)
AUTOBOT_BACKEND_URL=https://172.16.168.20:8443 set on .19
Both services restarted and confirmed healthy
SLM frontend rebuilt and deployed to .19
Verification: Both GET (profile list) and POST/PUT/DELETE (save, create, activate) now go through the SLM backend proxy, which validates the SLM admin JWT before forwarding.
Activity
fix(personality): fix save/create in SLM admin via SLM backend proxy (#…
mrveiss commentedon Feb 23, 2026
✅ Implemented and deployed in commit 4e4ee87.
Root Cause
The SLM admin frontend was sending SLM JWT tokens (signed with
SLM_SECRET_KEY) directly to the main backend's personality API via the nginx/autobot-api/proxy. The main backend validates JWTs with its ownSECRET_KEYand uses different claim names (username/rolevssub/admin), so all mutating requests (PUT/POST/DELETE) were rejected with 401.Changes
autobot-slm-backend/api/personality_proxy.py(new): Catch-all proxy router at/api/personality/*. Validates SLM JWT for all requests; requiresadmin: trueclaim for mutations. Forwards to main backend withX-Internal-API-Keyheader.autobot-slm-backend/main.py: Register newpersonality_proxy_routerat/api.autobot-backend/auth_middleware.py: AddedX-Internal-API-Keycheck — if header matchesAUTOBOT_INTERNAL_API_KEYenv var, grant admin access without requiring a main-backend JWT.autobot-slm-frontend/src/composables/usePersonality.ts: ChangedAPI_BASEfrom/autobot-api/personalityto/api/personalityto route through the SLM backend proxy.Deployment
AUTOBOT_INTERNAL_API_KEYset on both .20 (main backend) and .19 (SLM backend via/etc/autobot/slm-secrets.env)AUTOBOT_BACKEND_URL=https://172.16.168.20:8443set on .19Verification: Both GET (profile list) and POST/PUT/DELETE (save, create, activate) now go through the SLM backend proxy, which validates the SLM admin JWT before forwarding.
fix(ansible): fix ownership of autobot-backend after unarchive (#1145)
fix(slm): restore agent control plane — internal-key gate on machine …
refactor(slm-frontend): migrate LLM/Personality/Settings domain onto …
security(settings): admin-gate the core /api/settings routes, and rec…
security(auth): admin-gate the open routers, settings, teams and user…