Python: Minor changes to inpsect_variable, quarantined_llm and tool approval exception#5352
Open
shrutitople wants to merge 1 commit intomicrosoft:feature/python-fidesfrom
Open
Python: Minor changes to inpsect_variable, quarantined_llm and tool approval exception#5352shrutitople wants to merge 1 commit intomicrosoft:feature/python-fidesfrom
shrutitople wants to merge 1 commit intomicrosoft:feature/python-fidesfrom
Conversation
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.
Motivation and Context
Minor changes to the tool approval exception in _tools.py, and security tools --- inspect_variable and quarantined_llm.
Few other changes to documentation based on copilot review.
Description
[_security.py]— Simplify quarantined_llm by removing tool-internal auto-hide logic (auto_hide_result parameter). The tool now declares source_integrity="untrusted" and relies on the middleware's standard auto-hide path. Also changed inspect_variable from approval_mode="always_require" to "never_require" — security is enforced by context tainting instead.
[_tools.py] — Fix _auto_invoke_function to preserve function_approval_request type through MiddlewareTermination, so the approval flow in _handle_function_call_results activates correctly for security policy violations.
[test_security.py] — Update tests to match the simplified quarantined_llm API (no auto_hide_result), add test for source_integrity declaration, add test verifying function_approval_request is preserved through _auto_invoke_function, and update inspect_variable approval mode assertion.
[FIDES_DEVELOPER_GUIDE.md] — Update documentation to reflect the simplified auto-hide mechanism and inspect_variable approval changes.
[README.md]— Fix broken file paths in examples and "More Information" section.
FIDES_IMPLEMENTATION_SUMMARY.md — Fix ADR reference (0011 → 0024).