[SC-17911] Send logged Markdown without script tags - #554
Open
even-steven wants to merge 6 commits into
Open
Conversation
|
|
cachafla
reviewed
Aug 21, 2026
cachafla
left a comment
Contributor
There was a problem hiding this comment.
@even-steven could you ask your agent to produce a test Jupyter notebook that we can execute and use a regression test? I'm interested in running through some example test cases for different cases of Markdown and HTML input to ensure we're not breaking any compatibility.
cachafla
approved these changes
Aug 21, 2026
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.
Pull Request Description
What and why?
Fixes SC-17911 / ZD-737.
ValidMind Library text logging converted Markdown and TeX to HTML before sending it. TeX became a literal
<script type="math/tex">element in the/tracking/log_metadatarequest body, which Experian's Imperva WAF rejects as XSS.When the connected backend advertises
feature_flags.log_metadata_markdown, this change keeps Markdown and TeX in their original form on the wire and sendstext_format: "markdown", allowing the backend to convert it after the request passes through the WAF.Capability negotiation is centralized in
alog_metadata(). If the backend does not advertise support, the library converts Markdown locally and omitstext_format, preserving legacy behavior and preventing older customer-managed backends from silently storing raw Markdown. Explicit caller-supplied HTML and directalog_metadata()calls without a format retain their existing behavior.The WAF-safe transport covers every result path that logs descriptions through
/log_metadata:log_text()callsrun_text_generation(...).log()resultsrun_test(...).log()descriptionsResult objects retain rendered HTML for local notebook display and carry the corresponding raw Markdown separately for transport. If a caller later replaces the rendered description, the saved Markdown is ignored so the caller's edited content remains authoritative.
How to test
Regression tests use the exact ZD-737 equation and verify both capability states:
text_format: "markdown", and contain no<script>tag.text_format, so raw Markdown is not silently persisted.What needs special review?
Please review the capability default of
False, the centralized fallback inalog_metadata(), and the split between rendered descriptions used for local display and Markdown source used for transport.Dependencies, breaking changes, and deployment notes
Release notes
Fixed ValidMind Library text and test-result requests containing TeX equations being blocked by Web Application Firewalls that reject MathJax
<script>tags.Checklist