T09 · Insecure Skill Coding Practices
- Location
scripts/embed.py:303- Finding
Mandatory External Transmission of Potentially Sensitive Record Contents
- Content
View full analysis
list[float]: MAX_CHARS = 15000 if len(text) > MAX_CHARS: text = text[:MAX_CHARS] client = get_client() for attempt in range(1, 4): try: response = client.embeddings.create( model=CONFIG["model"], input=text ) return response.data[0].embedding except Exception: if attempt < 3: import time time.sleep(1 * attempt) else: raise ``` ```python for rf in record_files: rid = record_id(rf) fh = file_hash(rf) old_fh = db_status(conn, rid) if old_fh is None: status = "NEW" elif old_fh != fh: status = "UPDATED" else: status = "SKIPPED" if status == "SKIPPED": skipped_count += 1 continue try: plain_text = extract_record_content(rf) embedding = embed_text(plain_text) except Exception as e: continue ``` The Skill instructions require `embed.py init` to run immediately after every record creation or modification, including when the user did not explicitly request external indexing. Supported record categories include personnel ...[truncated 2631 chars]- Remediation
View remediation
