Skip to content

fix: fill community PR gaps — bare excepts, print→logging, py.typed, LICENSE#344

Merged
imran-siddique merged 12 commits intomicrosoft:mainfrom
imran-siddique:fix/community-followup-gaps
Mar 22, 2026
Merged

fix: fill community PR gaps — bare excepts, print→logging, py.typed, LICENSE#344
imran-siddique merged 12 commits intomicrosoft:mainfrom
imran-siddique:fix/community-followup-gaps

Conversation

@imran-siddique
Copy link
Member

Follow-up to address remaining items from community PRs that partially covered issues #330, #331, #332, #334.

Changes

33 files changed — mostly LICENSE copies, 3 surgical code fixes.

Closes #330, closes #331, partially closes #332, partially closes #334.

imran-siddique and others added 12 commits March 20, 2026 10:56
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add EU AI Act, Colorado AI Act, and GPAI obligations timeline with
AGT coverage mapping. Reference Microsoft Purview DSPM for AI as
complementary data governance layer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Scorecard API rejects workflows with write permissions at the
workflow level. id-token: write and security-events: write must be
scoped to the job level only. Restores permissions: read-all at
workflow level while keeping job-level write permissions intact.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ft#324)

Add Google-style docstrings with Args, Returns, Raises, Attributes,
and Example sections to MCPMessageType, MCPAdapter, and MCPServer
classes. Also enhances docstrings for key methods including
handle_message, _handle_tools_call, _handle_resources_read, and
_map_tool_to_action.

Fixes microsoft#316
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
…s (dependency confusion) (microsoft#325)

- Replace !pip install agent-os with !pip install -e ../.. in all 6 notebooks;
  agent-os is not on PyPI and installing it from PyPI is a dependency confusion vector
- Replace zendesk-sdk/freshdesk-sdk with zenpy/freshdesk (the real published SDKs)
  in customer-service/requirements.txt
- Remove hashlib-compat from healthcare-hipaa/requirements.txt; hashlib is stdlib
  and hashlib-compat is not a real PyPI package
…stall agent-os with agent-os-kernel

Replace all remaining instances of `pip install agent-os` (unregistered
on PyPI) with `pip install agent-os-kernel` (the actual package) across
docs, examples, TypeScript extensions, CLI source, tests, and SVG assets.

Also fixes `pip install emk` references to point to `agent-os-kernel[full]`
since emk is a submodule, not a standalone PyPI package.

Completes the fix started in PR microsoft#325 which only covered notebooks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dify 65K→133K, AutoGen 42K→55K, CrewAI 28K→46K, Semantic Kernel
24K→27K, LangGraph 24K→27K, Haystack 22K→24K, Agent Framework
7.6K→8K. Added star counts for OpenAI Agents SDK (20K) and
Google ADK (18K). Sorted by stars descending.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…LICENSE files

Address remaining items from issues microsoft#330, microsoft#331, microsoft#332, microsoft#334 that
community PRs partially covered.

- Fix bare except blocks in time_travel_debugger.py, demo_client.py
- Replace print() with logging in integrity.py, promotion.py, verify.py
- Add py.typed markers for PEP 561 compliance
- Copy LICENSE to all subpackages

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions bot added agent-mesh agent-mesh package agent-hypervisor agent-hypervisor package agent-sre agent-sre package size/XL Extra large PR (500+ lines) labels Mar 22, 2026
@github-actions
Copy link

🤖 AI Agent: breaking-change-detector

🔍 API Compatibility Report

Summary

This pull request primarily addresses non-functional changes such as adding missing licenses, replacing bare exception handling, and switching from print statements to logging. These changes improve code quality and maintainability but do not introduce any breaking changes to the public API. Additionally, PEP 561 type hinting markers (py.typed) were added to two packages, which is an additive change and does not affect existing functionality.

Findings

Severity Package Change Impact
🔵 agent-compliance Added py.typed file ADDED: Enables type checking for downstream users.
🔵 agent-marketplace Added py.typed file ADDED: Enables type checking for downstream users.
🟡 agent-os Bare except replaced with specific exceptions (json.JSONDecodeError, ValueError) in time_travel_debugger.py POTENTIALLY BREAKING: Downstream users relying on catching generic exceptions may need to update their code.
🟡 agent-os Bare except replaced with ValueError in demo_client.py POTENTIALLY BREAKING: Downstream users relying on catching generic exceptions may need to update their code.
🔵 Multiple packages Added MIT LICENSE files ADDED: Improves compliance and documentation.
🔵 agent-compliance Added logging setup in verify.py ADDED: Improves maintainability and debugging.

Migration Guide

  1. Bare except changes in agent-os:

    • If your code relies on catching generic exceptions from time_travel_debugger.py or demo_client.py, update your exception handling to specifically catch json.JSONDecodeError or ValueError as appropriate.
  2. PEP 561 type hinting (py.typed):

    • Downstream users can now use type checking tools (e.g., mypy) with agent-compliance and agent-marketplace. No migration is required, but users may need to update their type-checking configurations.
  3. Logging changes in verify.py:

    • If you were relying on print statements for debugging, you may need to adjust your logging configuration to capture log output.

Conclusion

No breaking changes detected. The changes are primarily additive and improve code quality, maintainability, and compliance. However, the replacement of bare except blocks with specific exception types is flagged as potentially breaking for downstream users who may rely on catching generic exceptions.

@github-actions
Copy link

🤖 AI Agent: docs-sync-checker

📝 Documentation Sync Report

Issues Found

  1. make_request(url: str, method: str = "GET", data: Optional[dict] = None, headers: Optional[dict] = None) in packages/agent-os/modules/iatp/examples/demo_client.py — missing docstring.
  2. _convert_audit_entry_to_replay_event(audit_entry: dict) -> ReplayEvent in packages/agent-os/modules/control-plane/src/agent_control_plane/time_travel_debugger.py — missing docstring.
  3. ⚠️ packages/agent-compliance/README.md — no mention of the new logging setup in verify.py.
  4. ⚠️ CHANGELOG.md — no entry for the changes made in this PR.
  5. ⚠️ examples/ — example code in demo_client.py uses print for error handling, which has been replaced with logging in the main codebase.

Suggestions

  • 💡 Add a docstring for make_request(url: str, method: str = "GET", data: Optional[dict] = None, headers: Optional[dict] = None) in demo_client.py. Include details about its purpose, parameters, return value, and exceptions.
  • 💡 Add a docstring for _convert_audit_entry_to_replay_event(audit_entry: dict) -> ReplayEvent in time_travel_debugger.py. Include details about its purpose, parameters, return value, and exceptions.
  • 💡 Update packages/agent-compliance/README.md to include information about the new logging setup in verify.py.
  • 💡 Add an entry to CHANGELOG.md summarizing the fixes for bare excepts, the addition of logging, the inclusion of py.typed files, and the addition of LICENSE files.
  • 💡 Update the example code in demo_client.py to replace print statements with logging, aligning it with the updated logging approach in the main codebase.

Additional Notes

  • The addition of py.typed files and LICENSE files does not require documentation updates.
  • Ensure that all new or modified public APIs have complete type annotations, which appears to be the case for the functions in the diff.

Please address the issues and suggestions above to ensure documentation and code are fully synchronized. Let me know if you need further assistance!

@github-actions
Copy link

🤖 AI Agent: test-generator

🧪 Test Coverage Analysis

packages/agent-compliance/src/agent_compliance/verify.py

  • Existing coverage:

    • The file contains a new logging setup (logger = logging.getLogger(__name__)) which is a minor change. If there are existing tests that execute the code paths where logging is used, this change is indirectly covered.
    • If the logging statements are part of existing functions that are already tested, the logging setup will be executed during those tests.
  • Missing coverage:

    • There is no direct evidence in the provided information that the new logging setup is explicitly tested. While it is likely that existing tests exercise the code paths where logging is used, this cannot be confirmed without inspecting the test suite.
  • 💡 Suggested test cases:

    1. test_logging_initialization — Verify that the logger is properly initialized with the correct name (agent_compliance.verify) and that logging messages are correctly captured during the execution of the relevant functions.
    2. test_logging_output — Test that the logging messages are correctly generated and formatted when the logger is invoked in the modified code paths. This can be done by mocking the logger and asserting the expected log messages.
    3. test_logging_with_invalid_configuration — Simulate scenarios where the logging configuration is invalid or missing, and ensure the application handles it gracefully without crashing.
    4. test_logging_with_various_log_levels — Test the behavior of the logger when different log levels (e.g., DEBUG, INFO, WARNING, ERROR) are set, ensuring that the appropriate messages are logged at each level.

General Recommendations

  • Ensure that the test suite includes tests for all functions in verify.py that now use the logger object. This will help confirm that the logging setup does not introduce any unintended side effects.
  • If the repository has a centralized logging configuration, consider adding integration tests to verify that the logging behavior is consistent across all modules, including verify.py.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Agent: code-reviewer

Review Summary

This pull request addresses several issues related to code quality and compliance, including the replacement of bare excepts, the transition from print statements to logging, the addition of PEP 561 markers, and the inclusion of the MIT license in various packages. Overall, the changes are positive and contribute to better maintainability and compliance of the codebase.

Detailed Feedback

  1. Bare Excepts Replacement:

    • The changes to replace bare excepts with specific exception types in time_travel_debugger.py and demo_client.py are commendable. This enhances error handling and prevents unintended catches of exceptions that could mask underlying issues.
    • Action: Ensure that all similar patterns throughout the codebase are addressed to maintain consistency.
  2. Print to Logging Transition:

    • The transition from print statements to logging in verify.py is a significant improvement. Logging provides better control over output and can be configured for different environments (e.g., development vs. production).
    • Action: Consider reviewing other parts of the codebase for similar transitions to logging, ensuring that all output is handled consistently.
  3. PEP 561 Markers:

    • Adding py.typed files to agent-compliance and agent-marketplace is a good step towards improving type safety and compatibility with type checkers.
    • Action: Verify that all packages in the monorepo have appropriate type hints and markers to ensure type safety across the library.
  4. License Inclusion:

    • Including the MIT license in all subpackages is essential for legal compliance and clarity regarding the use of the code.
    • Action: Ensure that the license is also included in any future packages added to the repository.
  5. Thread Safety:

    • While the changes do not directly address thread safety, it is crucial to ensure that any logging or shared resources are managed in a thread-safe manner, especially in a concurrent execution environment.
    • Action: Review the logging setup and any shared resources to ensure they are thread-safe.
  6. OWASP Compliance:

    • The changes do not explicitly mention any OWASP compliance checks. It is essential to ensure that the code adheres to OWASP guidelines, especially concerning error handling and logging.
    • Action: Conduct a review of the codebase against the OWASP Agentic Top 10 to identify any potential vulnerabilities.
  7. Backward Compatibility:

    • The changes appear to maintain backward compatibility as they do not introduce breaking changes to the public API.
    • Action: Ensure that any future changes are carefully reviewed for potential breaking changes, especially in public-facing APIs.

Flags

  • 🟡 WARNING: Ensure that all instances of bare excepts are replaced throughout the codebase to maintain consistency and improve error handling.
  • 💡 SUGGESTION: Consider implementing a logging configuration that allows for different logging levels (DEBUG, INFO, WARNING, ERROR) to provide more flexibility in output.

Conclusion

This pull request makes significant strides in improving code quality and compliance. The changes are well-implemented and align with best practices. Continued attention to thread safety, OWASP compliance, and type safety will further enhance the robustness of the library.

@github-actions
Copy link

🤖 AI Agent: security-scanner

Security Review of Pull Request

This pull request addresses several issues, including replacing bare except blocks, transitioning from print to logging, adding PEP 561 markers, and ensuring all subpackages include the MIT license. Below is a detailed security review of the changes.


1. Bare Excepts Replaced with Specific Exception Types

Files Affected:

  • time_travel_debugger.py
  • demo_client.py

Analysis:

Bare except blocks were replaced with specific exception types:

  • except (json.JSONDecodeError, ValueError) in time_travel_debugger.py
  • except ValueError in demo_client.py

Security Impact:

  • 🔵 LOW: Bare except blocks can mask unexpected exceptions, potentially hiding critical errors or vulnerabilities. Replacing them with specific exception types improves error handling and reduces the risk of unintended behavior.
  • Attack Vector: Previously, an attacker could exploit the lack of specific exception handling to inject unexpected data that triggers unintended behavior or bypasses validation.
  • Fix: The changes are appropriate and mitigate the risk by handling only expected exceptions. However, logging sensitive data (e.g., tool_args or result) in time_travel_debugger.py could inadvertently expose sensitive information.

Recommendation:

  • Review the contents of tool_args and result to ensure no sensitive information is logged. If sensitive data might be present, sanitize the logs before outputting them.

2. Transition from print to logging

Files Affected:

  • verify.py

Analysis:

The print statements were replaced with a logging setup using Python's logging module.

Security Impact:

  • 🔵 LOW: Using logging instead of print is a best practice for production code, as it allows for better control over log levels and destinations. However, logging sensitive data can lead to credential exposure or other security risks.
  • Attack Vector: If sensitive information (e.g., API keys, tokens, or PII) is logged, an attacker with access to logs could exploit this data.
  • Fix: No sensitive data appears to be logged in the changes. However, ensure that all logging statements are reviewed for potential exposure of sensitive information.

Recommendation:

  • Implement a centralized logging policy to sanitize sensitive data before logging.
  • Use logging levels appropriately (e.g., avoid logging sensitive data at debug or info levels).

3. PEP 561 Markers Added

Files Affected:

  • agent-compliance/py.typed
  • agent-marketplace/py.typed

Analysis:

Adding py.typed files ensures that type hints in the code are available to type checkers like mypy.

Security Impact:

  • 🔵 LOW: This change has no direct security implications but improves type safety, which can help prevent certain classes of bugs.

Recommendation:

  • Ensure that type annotations are comprehensive and accurate throughout the codebase to maximize the benefits of type checking.

4. MIT License Added

Files Affected:

  • Multiple LICENSE files added to subpackages.

Analysis:

The addition of the MIT license to subpackages ensures proper licensing and compliance.

Security Impact:

  • No security impact: This is a legal compliance change and does not affect the security posture of the codebase.

5. Logging in time_travel_debugger.py

Files Affected:

  • time_travel_debugger.py

Analysis:

The self.logger.debug statements log errors when JSON parsing fails for tool_args and result.

Security Impact:

  • 🟡 MEDIUM: Logging unvalidated or sensitive data (e.g., tool_args or result) could lead to credential exposure or leakage of sensitive information if these fields contain secrets, tokens, or PII.
  • Attack Vector: An attacker could craft malicious input containing sensitive data, which would then be logged and potentially exposed to unauthorized parties.

Recommendation:

  • Before logging, sanitize tool_args and result to ensure no sensitive information is included. For example:
    try:
        tool_args = json.loads(tool_args)
    except (json.JSONDecodeError, ValueError) as e:
        self.logger.debug("Could not parse tool_args as JSON: %s", str(e))

6. General Observations

  • No issues were found related to prompt injection defense bypass, policy engine circumvention, trust chain weaknesses, sandbox escape, deserialization attacks, race conditions, or supply chain vulnerabilities in this PR.
  • The changes are primarily focused on improving code quality and compliance, with minimal impact on the core functionality of the library.

Summary of Findings

Finding Severity Description Recommendation
Bare excepts replaced 🔵 LOW Bare except blocks replaced with specific exception types. Improves error handling and reduces risk of unintended behavior. Ensure no sensitive data is logged in time_travel_debugger.py.
Transition from print to logging 🔵 LOW Transition to logging improves maintainability and control over log levels. Review logging statements for potential sensitive data exposure.
Logging in time_travel_debugger.py 🟡 MEDIUM Logging unvalidated data (tool_args and result) could expose sensitive information. Sanitize data before logging to ensure no sensitive information is logged.
PEP 561 markers added 🔵 LOW Improves type safety, reducing the likelihood of type-related bugs. Ensure type annotations are comprehensive and accurate.
MIT license added No impact Legal compliance change. No action needed.

Final Recommendation

  • Approve with changes: The PR improves code quality and addresses some security concerns. However, ensure that logging statements in time_travel_debugger.py are reviewed and sanitized to prevent potential sensitive data exposure.

@imran-siddique imran-siddique merged commit 55b9ca6 into microsoft:main Mar 22, 2026
54 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-hypervisor agent-hypervisor package agent-mesh agent-mesh package agent-sre agent-sre package size/XL Extra large PR (500+ lines)

Projects

None yet

5 participants