Repository navigation
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
CI Results
All checks passed. 🎉 |
|
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 #191
ADR 0011 says no observability tool may see conversation content. Three things got in the way of that.
LangChain's tracing client is installed, and setting
LANGSMITH_TRACING=truewould send every prompt to LangSmith. The backend now refuses to start if any LangSmith/LangChain tracing flag is on, or if a tracing API key or endpoint is set. The error names the variable but never prints its value.Exception messages are where user text usually leaks: a provider error quoting the prompt, a validation error quoting the rejected value. A log record factory now rewrites every logged exception to its type and location (file, line, function, and the chain it was raised from) and drops the message. It works for every logger and handler, so it also covers dependencies. I also fixed the two explicit log calls that broke the rule: the guardrail line logged the model's reason, which can quote the message, and the Ollama connection warning logged the raw exception.
While writing the canary test I found a third leak: at DEBUG level,
sse_starlettelogs every chunk it streams (every model reply), and theopenaiandanthropicclients log full request bodies. Those three loggers are now held at INFO even when the app runs at DEBUG.There's no error-reporting integration yet, so there's nothing to scrub. When #38 adds one, it needs a
before_sendthat drops request and response bodies.The issue also asks for a test through admission and sign-in. Those don't exist yet, so the test covers the chat flow. It sends a canary string through a normal turn, a guardrailed turn and a failing turn, captures every logger at DEBUG, and checks the canary appears nowhere. It should be extended when #184 and #185 land.
328 tests pass; the two
test_prompt_loaderfailures already fail on main (Windows file locking). Ruff and mypy are clean.