T09 · Insecure Skill Coding Practices
- Location
SKILL.md:20- Finding
Unrestricted Plaintext Logging of Sensitive LLM Requests and Responses
- Content
View full analysis
(); api.on("llm_input", (event: any) => { const runId = event.runId; inFlightRequests.set(runId, { timestamp: Date.now(), input: event }); }); api.on("llm_output", (event: any) => { const runId = event.runId; const request = inFlightRequests.get(runId); // Successfully paired, record the complete request-response inFlightRequests.delete(runId); }); ``` It then recommends serializing log entries directly into date-based plaintext JSONL files: ```typescript // JSONL format, split files by date const logPath = path.join(basePath, `${new Date().toISOString().split('T')[0]}.jsonl`); fs.appendFileSync(logPath, JSON.stringify(entry) + "\n"); ``` The referenced example is explicitly described as having the following behavior: ```text Features: - Log all LLM API requests and responses - JSONL formatted logs, split by date - Correlate requests and responses using runId - Record metrics such as durationMs and usage ``` ### Technical Analysis The documented pattern captures complete LLM input and output events and recommends writing serialized entries to plaintext JSONL files. The document states that input events may contain prompts, system prompts, and historical messages. These fields can include credentials, API tokens, personal information, proprietary content, hidden system instructions, and other confidential conversation data. The guidance does not include: - A field allowlist limiting collection to operational metadata. - Redaction of passwords, tokens, or personally identifiable information. - Explicit us ...[truncated 2211 chars]- Remediation
View remediation
