Repository navigation
Python: feat(autogenstudio): add SensitiveDataRedactor to sanitize credentials from Agent Responses (#3255) - #8357
Open
SparkyPunk (sparkysolutions10-pixel) wants to merge 1 commit into
Conversation
…edentials from Agent Responses (microsoft#3255) Add SensitiveDataRedactor utility and integration into AutoGen Studio to prevent leakage of sensitive credentials, API keys, and environment variable secrets in agent responses and streaming logs. - Introduce SensitiveDataRedactor in autogenstudio.utils.redactor - Add RedactionConfig to SettingsConfig in datamodel/types.py and datamodel.ts - Integrate redactor in WebSocketManager (streaming, DB persistence, run updates) - Integrate redactor in TeamManager run and run_stream flows - Add comprehensive test coverage in tests/test_redactor.py Fixes microsoft#3255 Signed-off-by: sparkysolutions10-pixelmy <sparkysolutions10@gmail.com>
This branch has not been deployed
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.
Summary
This PR addresses issue #3255 by introducing a modular, dynamic, and generic credential & sensitive data redaction architecture (SensitiveDataRedactor) for AutoGen Studio.
Motivation & Problem Statement
In AutoGen Studio, agents execute tools and skills that interact with the local environment. When agents call tools, process environment variables (such as OpenAI/Anthropic/Azure/AWS keys), or generate reasoning outputs, there is a risk of inadvertently emitting raw credentials or secrets into streaming websocket events, SQLite database records, and the Studio UI.
Key Changes
SensitiveDataRedactor Engine (�utogenstudio.utils.redactor):
Studio Settings & Data Models (datamodel/types.py & datamodel.ts):
edact_env_vars,
edact_api_keys, custom_patterns, and
eplacement.
edaction into SettingsConfig with safe default factory (100% backward compatible with existing configurations).
WebSocket & Persistence Layer (web/managers/connection.py):
TeamManager Execution ( eammanager/teammanager.py):
edaction_config parameter to
un_stream() and
un() for automatic response sanitation.
Test Coverage ( ests/test_redactor.py):
Fixes #3255
Signed-off-by: sparkysolutions10-pixelmy sparkysolutions10@gmail.com