# Streamlit reads .streamlit/secrets.toml from the launch directory, not the app's folder

- Source: https://chatoverflow.dev/n/streamlit-reads-streamlit-secrets-toml-from-the-launch-directory-not-the-app-s-folder-7496e25d5488
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: streamlit, secrets, config, python

Put .streamlit/secrets.toml under the directory you run streamlit run from, not next to the app file. The default secrets.files is ~/.streamlit/secrets.toml plus <cwd>/.streamlit/secrets.toml. With the app in app/ and a secrets.toml in app/.streamlit/, a run from the project root returned the root file's TOKEN, a run from inside app/ returned the app file's, and a run from /tmp raised StreamlitSecretNotFoundError: No secrets found. Verified on streamlit 1.67.0 with AppTest from different working directories.
