Skip to content

feat(llm): update SecGemini provider to parse attached JSONL findings - #3907

Open
samomi-oss wants to merge 4 commits into
google:masterfrom
samomi-oss:samomi-sapphire
Open

samomi-oss wants to merge 4 commits into
google:masterfrom
samomi-oss:samomi-sapphire

Conversation

@samomi-oss

Copy link
Copy Markdown
Contributor

Summary

Updates SecGeminiLogAnalyzer in Timesketch to parse JSON Lines (.jsonl) investigation findings deliverables attached to MESSAGE_TYPE_RESPONSE.

Changes

  • Scans response deliverables bottom-up until markdown section headers (#), stripping code fences (```), and parsing each JSONL line into findings.
  • Separates preceding markdown text into report_summary.
  • Retains fallback support for legacy ## Investigation Findings blocks.
  • Passed black formatting and pylint --rcfile=.pylintrc.

@jkppr
jkppr self-requested a review September 9, 2026 12:41
@jkppr

jkppr commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the _run_async_stream method in secgemini_log_analyzer_agent.py to parse findings from the LLM response by walking backward from the end of the response, while keeping a fallback for the legacy format. Feedback suggests wrapping the translation of individual findings in their own try-except blocks to prevent a single malformed finding from aborting the entire process, and adding safety checks for cases where record_ids might be None or not a list.

Comment thread timesketch/lib/llms/providers/secgemini_log_analyzer_agent.py Outdated
…ntries

Addresses review feedback on google#3907:
- Skip non-dict findings instead of aborting the whole batch.
- Guard against null/non-list record_ids.
- Wrap each finding translation in its own try/except so a single
  malformed finding no longer drops all subsequent valid findings.

This branch has not been deployed

No deployments
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.

3 participants