Credentials in AI chat
You're debugging why a script can't connect to your company's Postgres database, and you want to ask an AI assistant for help. The error and the connection code both include the full connection string: `postgres://app:Sup3rSecret!@prod-db.internal:5432/orders`. You're about to paste the whole thing into the chat to get faster help. What's the problem, and what do you paste instead?
Implement
redact_connection_string(raw: str) → strExamples
in
["postgres://app:Sup3rSecret!@prod-db.internal:5432/orders"]out"postgres://app:<REDACTED>@<db-host>:5432/orders"in
["postgres://prod-db.internal:5432/orders"]out"postgres://<db-host>:5432/orders"What a strong answer looks like
Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
0:00 of about 8 min
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.