1.7 KiB
1.7 KiB
SKILL: API Key Authentication (Universal Literate Note)
- Overview
- Phase A: Demand (PRD)
- Phase B: Blueprint (PROTOCOL)
- Phase D: Build (Implementation)
- Registration
Overview
This skill provides the legacy-compatible Static API Key authentication method. It retrieves credentials from the system environment variables and provides them to the kernel's neural backends.
Phase A: Demand (PRD)
1. Purpose
Provide a simple, environment-driven authentication mechanism for LLM providers.
2. User Needs
- Static Retrieval: Pull `LLM_API_KEY` from `.env`.
- Provider Mapping: Support mapping keys to specific providers (Gemini, OpenAI, etc.).
- Reliability: Return NIL gracefully if no key is found.
Phase B: Blueprint (PROTOCOL)
1. Architectural Intent
Interfaces for credential retrieval. Source of truth is the system environment.
2. Semantic Interfaces
"Returns a plist containing the :api-key for the default provider."
Phase D: Build (Implementation)
(defun auth-api-key-get-credentials ()
(let ((key (uiop:getenv "LLM_API_KEY")))
(when key
(list :api-key key))))
;; Register as the default auth provider for Gemini during transition
(org-agent:register-auth-provider :gemini #'auth-api-key-get-credentials)
Registration
(defskill :skill-auth-api-key
:priority 100
:trigger (lambda (context) nil)
:neuro (lambda (context) nil)
:symbolic (lambda (action context) action))