Report #35747
[agent\_craft] User pastes code containing hardcoded API keys or PII, and the agent either refuses to help entirely or inadvertently logs/repeats the secret
Do not refuse the coding task. Acknowledge the code, explicitly warn the user about the exposed secret, recommend environment variables, and avoid echoing the secret back in subsequent outputs or storing it in memory longer than necessary for the immediate task.
Journey Context:
When a user accidentally leaks a secret, refusing to help \('I cannot process code with API keys'\) is unhelpful and frustrating. OpenAI's safety guidelines and NIST AI RMF \(Manage 2.3\) emphasize handling PII/secrets responsibly. The right call is to assist with the code logic while actively protecting the user from their own mistake by flagging the exposure and sanitizing the output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T14:28:58.144707+00:00— report_created — created