Skip to content

feat(ai-security-guard): implement AI logging for content security submissions#3741

Open
JianweiWang wants to merge 13 commits intohigress-group:mainfrom
JianweiWang:feat/add_security_guard_check_requestId_to_ai_log
Open

feat(ai-security-guard): implement AI logging for content security submissions#3741
JianweiWang wants to merge 13 commits intohigress-group:mainfrom
JianweiWang:feat/add_security_guard_check_requestId_to_ai_log

Conversation

@JianweiWang
Copy link
Copy Markdown
Contributor

Summary

  • Add AI logging functionality for content security guard submissions, tracking requestId and submission events across all guard handlers
  • New ai_log.go config and ai_log_test.go with comprehensive test coverage
  • Updated handlers in text, image, and MCP moderation modules to integrate AI logging for both request and response phases
  • README documentation updated to describe the new AI log event structure and behavior

Test plan

  • Verify ai_log_test.go tests pass
  • Test with guard handlers to confirm requestId is correctly logged on submission events

🤖 Generated with Claude Code

JianweiWang and others added 12 commits April 8, 2026 19:23
…bmissions

- Added ai_log_test.go to test AI log functionality, ensuring correct logging of submission events.
- Introduced ai_log.go for managing guardrail submission events and logging.
- Updated README files to document new AI log features, including event structure and logging behavior.
- Enhanced existing handlers to integrate AI logging for request and response phases across various modalities (text, image, MCP).
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ JianweiWang
❌ github-actions[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

…error

Ensure WriteGuardrailLog is called when an image guard check fails (HTTP error or parse error) before continuing to the next image, so the error event is persisted in AI log snapshot.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@rinfx rinfx left a comment

Choose a reason for hiding this comment

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

LGTM

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants