Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 25, 2025

This PR fixes two documentation inconsistencies in the RedTeam.scan method that could confuse developers using the API:

Issues Fixed

1. Incorrect timeout default documentation

The docstring incorrectly stated the timeout default as 120 seconds, but the actual default value in the method signature is 3600 seconds:

# Method signature
async def scan(self, ..., timeout: int = 3600, ...):

# Docstring incorrectly said:
:param timeout: The timeout in seconds for API calls (default: 120)

2. Missing user_agent parameter documentation

The user_agent parameter is accepted via **kwargs and used internally, but was not documented:

# Code usage (line 787)
user_agent: Optional[str] = kwargs.get("user_agent", "(type=redteam; subtype=RedTeam)")

# But no documentation existed for this parameter

Changes Made

  • Updated timeout parameter documentation from (default: 120) to (default: 3600) to match the actual default value
  • Added complete documentation for the user_agent parameter:
    :param user_agent: Optional custom user agent string for API calls
    :type user_agent: Optional[str]
    

These changes ensure the API documentation accurately reflects the method's behavior, helping developers understand the correct default values and available parameters when calling the scan method.

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
    • Triggering command: /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/lib/python3.9/site-packages/pip/__pip-REDACTED__.py install --ignore-installed --no-user --prefix /tmp/pip-build-env-9hw9p1be/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i REDACTED -- setuptools>=40.8.0 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] when this code gets run: ``` result = await red_team.scan( target=target, scan_name=red_team_scan.display_name, attack_strategies= red_team_scan.attack_strategies, skip_upload... Fix RedTeam.scan method documentation: correct timeout default and add missing user_agent parameter Aug 25, 2025
Copilot finished work on behalf of slister1001 August 25, 2025 19:40
@Copilot Copilot AI requested a review from slister1001 August 25, 2025 19:40
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.

2 participants