Skip to content

Conversation

@Dedulus
Copy link

@Dedulus Dedulus commented Jan 6, 2026

Change Description

This PR adds an optional, privacy first feedback extension to llm guard that allows users to record false positives and false negatives from scanner results.

The implementation is fully additive and opt-in, and does not modify any existing scanning logic or APIs.

Key characteristics

  • Privacy first feedback data models (no raw text stored by default)
  • Feedback collector with minimal pluggable storage backends:
    • In-memory (default)
    • Local JSON file
  • Thin, explicit wrapper functions for opt-in integration with:
    • scan_prompt
    • scan_output
  • Zero behavior change when the feature is unused
  • No network calls, background processing, or side effects in core scanning

The feature is implemented as an isolated extension under llm_guard.feedback.


Issue reference

This PR does not directly fix an existing issue.
It introduces an optional extension intended to help users provide structured feedback on scanner decisions.

(If helpful, I’m happy to link this to a new issue or discussion.)


Checklist

  • I have reviewed the contribution guidelines
  • My code includes unit tests
  • All unit tests and lint checks pass locally
  • My PR contains documentation updates / additions if required

Documentation and examples were intentionally deferred to keep this PR focused on code and tests.
I’m happy to add user facing docs or examples in a follow up PR if this approach seems acceptable.

@Dedulus
Copy link
Author

Dedulus commented Jan 6, 2026

Just to note for reviewers: the final cleanup commit
(fix: finalize feedback feature with strict typing and clean CI)
was made proactively before review, after running the full pre commit
and CI checks locally.

No functional behavior changed . This was limited to typing strictness,
test cleanup, and CI hygiene. The implementation itself remains unchanged.

Happy to adjust anything further if needed.

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.

1 participant