Skip to content

Disable automatic local context file injection in Streamlit app#75

Closed
DavidJBianco wants to merge 1 commit into
mainfrom
codex/propose-fix-for-local-context-leak
Closed

Disable automatic local context file injection in Streamlit app#75
DavidJBianco wants to merge 1 commit into
mainfrom
codex/propose-fix-for-local-context-leak

Conversation

@DavidJBianco

Copy link
Copy Markdown
Collaborator

Motivation

  • Prevent inadvertent disclosure of sensitive local data by stopping the app from automatically loading context.txt into st.session_state["local_context"] and forwarding it to external LLM providers.

Description

  • Replace the prior file-read logic with an explicit default of st.session_state["local_context"] = "" in peak_assistant/streamlit/app.py, and add a comment explaining the security rationale so callers must provide context explicitly.

Testing

  • python -m compileall peak_assistant/streamlit/app.py succeeded; pytest -q tests/integration/test_streamlit_workflow.py failed during collection due to a missing dependency (ModuleNotFoundError: No module named 'dotenv') in this environment.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fdbcc4dbbe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

local_context = file.read()

st.session_state["local_context"] = local_context
st.session_state["local_context"] = ""

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve explicit local context input path

Setting local_context to an empty string here removes the only Streamlit code path that ever populates this value, so every runner now receives empty context in normal app usage. In environments that rely on context.txt guidance (including launches using the --context compatibility option), this is a functional regression rather than just disabling automatic injection; the app should still support an explicit, user-controlled way to provide local context.

Useful? React with 👍 / 👎.

DavidJBianco added a commit that referenced this pull request Apr 23, 2026
Initializes local_context to empty string instead of reading from disk
to prevent sensitive server-side data reaching external LLM providers.

Supersedes PR #76, closes PR #75.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@DavidJBianco

Copy link
Copy Markdown
Collaborator Author

Duplicate of #76. Superseded by #86. Merged into dev via merge commit 39cb907.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant