secrets — .env, api keys, and what not to commit7 / 9
.env, os.getenv, and the leak recovery you'll do at least once
Cursor read MODEL from the env without a default, so it's None
when the variable isn't set. The next line tries to call .startswith
on None and crashes with AttributeError. Fix line 5 so it falls
back to "claude-sonnet-4-6" when the env var is missing.
Expected output:
ok
The break is on line 6 — but read the whole snippet first.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _