const body = JSON.stringify(req);
await llm(`Debug this error:\n${body}`);const safe = redact(JSON.stringify(req), [
/Bearer\s+[\w.-]+/g,
/[\w.+-]+@[\w-]+\.[\w.]+/g,
]);
await llm(`Debug this error:\n${safe}`);Redacting tokens and emails before the request leaves the app keeps secrets and personal data out of prompts and provider logs.
Many store prompts for some time for abuse monitoring, and some may use them for training depending on the plan and settings. Check the data policy.
Add deny rules for '.env' and credential folders in the agent's permissions, and keep real secrets out of the project folder where possible.
Yes, for example by hardcoding a key it saw in context or logging sensitive values. Scan generated code with a secret scanner before committing.