T09 · Insecure Skill Coding Practices
- Location
src/analyzers/__init__.py:54- Finding
Potentially Sensitive Log Data Is Transmitted to External AI Providers Without Accurate Disclosure
- Content
View full analysis
str: """Build the AI prompt.""" prompt = f"""You are a senior software engineer helping debug an application error. Analyze this error and provide a clear, actionable response: ERROR MESSAGE: {error_message} """ if stack_trace: prompt += f""" STACK TRACE: {stack_trace[:2000]} # Limit stack trace length """ prompt += """ Please provide your analysis in this exact JSON format: { "error_type": "Brief error type (e.g., Database Connection Error)", "severity": "CRITICAL|HIGH|MEDIUM|LOW", "explanation": "Plain English explanation of what happened (2-3 sentences)", "root_cause": "The underlying cause (1-2 sentences)", "suggestions": [ "Step 1 to fix", "Step 2 to fix", "Step 3 to fix" ], "code_examples": [ "// Optional code example" ] } Guidelines: - Be specific and actionable - Use simple language (avoid jargon when possible) - Provide numbered steps - Include commands/code when relevant - Be helpful and encouraging """ return prompt ``` ```python def _call_claude(self, prompt: str) -> str: """Call Claude API.""" try: import anthropic client = anthropic.Anthropic(api_key=self.api_key) message = client.messages.create( model="claude-3-5-sonnet-20241022", max_tokens=1024, messages=[{"role": "user", "content": prompt}] ) return message.content[0].text except ImportError: raise ImportError("Please insta ...[truncated 2582 chars]- Remediation
View remediation
