T09 · Insecure Skill Coding Practices
- Location
core/distill_engine.py:118- Finding
Undisclosed transmission of Agent memory to external LLM endpoints
- Content
View full analysis
str: base_url = self.config.get("base_url") api_key = ( self.config.get("api_key") or os.getenv("ANIMA_LLM_API_KEY") or os.getenv("OPENAI_API_KEY") or os.getenv("DASHSCOPE_API_KEY") ) if not base_url or not api_key: return "" model = ( self.config.get("models", {}).get(task) or self.config.get("default_model", "") ) import urllib.request import json as _json url = f"{base_url.rstrip('/')}/chat/completions" payload = _json.dumps({ "model": model, "messages": [{"role": "user", "content": prompt}], "max_tokens": max_tokens, "temperature": 0.3 }).encode("utf-8") req = urllib.request.Request(url, data=payload, headers={ "Content-Type": "application/json", "Authorization": f"Bearer {api_key}" }) try: with urllib.request.urlopen(req, timeout=60) as resp: data = _json.loads(resp.read().decode("utf-8")) return data.get("choices", [{}])[0].get( "message", {} ).get("content", "").strip() except Exception as e: logger.warning(f"Direct API call failed: {e}") return "" ``` The fallback channel also submits the complete prompt to the OpenClaw Agent: ```python def _call_openclaw(self, prompt: str) -> str: try: cmd = ["openclaw", "agent", "--message", prompt] if self._agent_name: cmd.extend(["--agent", self._a ...[truncated 3605 chars]- Remediation
View remediation
