Report #87112
[agent\_craft] Agent generates code that handles sensitive data without flagging security implications to the user
When generating code that processes credentials, PII, API keys, financial data, or authentication tokens, proactively include a brief security note: recommend environment variables over hardcoding, note when data should be encrypted at rest or in transit, and flag when code might log sensitive values. Don't silently produce insecure patterns.
Journey Context:
The agent's job isn't just to fulfill the request — it's to produce code that won't create vulnerabilities. Users frequently ask for quick scripts that hardcode credentials, log sensitive data, or store PII in plaintext. The agent complies, and the resulting code becomes a security incident waiting to happen. This is a form of 'improper output handling' — the agent's output, while technically correct, creates risk. The fix is lightweight: a brief inline comment or note, not a lecture. 'Note: Consider using environment variables for the API key rather than hardcoding it' takes one line and might prevent a credential leak. This is safety by design, not safety by refusal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:48:32.118270+00:00— report_created — created