Remove committed API key, require env at first use (#15)#24
Open
ojuschugh1 wants to merge 1 commit into
Open
Conversation
The Smithery fallback in agent_bridge.py was a real committed secret, not a placeholder. The "your key" Anthropic fallbacks masked missing env. Drop both. Lazy-init the Anthropic client so import still works without the env, but the first call raises a clear error. Adds .env.example and tightens .gitignore. Closes projnanda#15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #15.
The Smithery API key in agent_bridge.py was a real committed secret, not a placeholder. The "your key" Anthropic fallbacks in agent_bridge.py, mcp_utils.py, and nanda.py silently masked missing env vars and produced confusing 401s.
Dropped both. Anthropic client is now lazy-init so import still works without the env, but the first call raises with a clear pointer to .env.example. Also added .env.example and tightened .gitignore.
The Smithery key (bfcb8cec-...) has been public since it was first committed. You'll want to rotate it on the Smithery side too, since removing it from main doesn't invalidate the value in git history.
Tested locally: import without env works, first LLM call raises cleanly, with env set everything works as before.