-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Add early storage validation and improve error messaging for Red Team scans #44389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: slister1001 <[email protected]>
Co-authored-by: slister1001 <[email protected]>
Co-authored-by: slister1001 <[email protected]>
Co-authored-by: slister1001 <[email protected]>
Co-authored-by: slister1001 <[email protected]>
Co-authored-by: slister1001 <[email protected]>
Co-authored-by: slister1001 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds early storage validation for Red Team scans to detect misconfigured storage before running attacks (which can take hours), and improves error messages when storage upload fails. The implementation adds a test_storage_upload() method that validates connectivity using a minimal in-memory test upload, integrated into the Red Team scan workflow right after MLFlow run initialization with visual feedback.
Key Changes:
- Added early storage connectivity validation that fails fast before running attacks
- Enhanced error messages with storage account names and actionable troubleshooting steps
- Implemented test coverage for both OneDP and non-OneDP project scenarios
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
azure/ai/evaluation/_common/evaluation_onedp_client.py |
Adds test_storage_upload() method that validates storage connectivity using BytesIO for in-memory test data |
azure/ai/evaluation/red_team/_mlflow_integration.py |
Adds test_storage_upload() wrapper that delegates to OneDP client for validation or skips for non-OneDP projects |
azure/ai/evaluation/red_team/_red_team.py |
Integrates storage validation into scan workflow with visual feedback after MLFlow initialization |
azure/ai/evaluation/_common/utils.py |
Enhances error messages in upload() to include storage account name and troubleshooting guidance |
tests/unittests/test_redteam/test_storage_validation.py |
Adds comprehensive unit tests for storage validation success/failure scenarios |
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_common/evaluation_onedp_client.py
Show resolved
Hide resolved
sdk/evaluation/azure-ai-evaluation/tests/unittests/test_redteam/test_storage_validation.py
Outdated
Show resolved
Hide resolved
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_common/evaluation_onedp_client.py
Outdated
Show resolved
Hide resolved
sdk/evaluation/azure-ai-evaluation/tests/unittests/test_redteam/test_storage_validation.py
Outdated
Show resolved
Hide resolved
…/evaluation_onedp_client.py Co-authored-by: Copilot <[email protected]>
…/evaluation_onedp_client.py Co-authored-by: Copilot <[email protected]>
…m/test_storage_validation.py Co-authored-by: Copilot <[email protected]>
…m/test_storage_validation.py Co-authored-by: Copilot <[email protected]>
Description
Red Team scans upload results to storage at the end after all attacks complete (potentially hours). If storage is misconfigured, users waste significant time. This PR adds early storage validation and improves error messages.
Changes
Early Storage Validation
test_storage_upload()inEvaluationServiceOneDPClientthat validates storage connectivity before running attacksBytesIOfor efficient in-memory test data with UUID-based unique identifiersRedTeam.scan()workflow immediately after MLFlow run initializationEnhanced Error Messages
upload()inutils.pyto include storage account name and actionable troubleshooting steps:SYSTEM_ERROR(connectivity issues may be user config or system failures)Test Coverage
test_storage_validation.pywith unit tests covering success/failure scenarios for both OneDP and non-OneDP projectsImpact
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
pypi.org/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python python -m pip install --quiet pylint(dns block)/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python -m pip download --progress-bar off --disable-pip-version-check --only-binary=:all: --no-deps --python-version 3.9 -d /home/REDACTED/.local/share/virtualenv/wheel/house setuptools==77.0.3(dns block)/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python -m pip download --progress-bar off --disable-pip-version-check --only-binary=:all: --no-deps --python-version 3.9 -d /home/REDACTED/.local/share/virtualenv/wheel/house pip==24.0(dns block)pypi.python.org/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python -m pip download --progress-bar off --disable-pip-version-check --only-binary=:all: --no-deps --python-version 3.9 -d /home/REDACTED/.local/share/virtualenv/wheel/house setuptools==77.0.3(dns block)/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python -m pip download --progress-bar off --disable-pip-version-check --only-binary=:all: --no-deps --python-version 3.9 -d /home/REDACTED/.local/share/virtualenv/wheel/house pip==24.0(dns block)scanning-api.github.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.