Repository navigation
OutboundHostValidator Configuration binding and addition of allow_http_for_loopback option - #655
Open
Rodrigo Brandão (rodrigobr-msft) wants to merge 9 commits into
Open
Rodrigo Brandão (rodrigobr-msft) wants to merge 9 commits into
Rodrigo Brandão (rodrigobr-msft) wants to merge 9 commits into
Conversation
Rodrigo Brandão (rodrigobr-msft)
requested a review
from a team
as a code owner
November 17, 2026 19:33
OutboundHostValidatorConfig definition and addition of allow_http_for_loopback optionOutboundHostValidator Configuration binding and addition of allow_http_for_loopback option
…into users/robrandao/allow-loopback-option
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Configuration binding disables outbound host enforcement when Enabled is omitted despite supplied hosts, allowing every URL instead of enforcing the allowlist.
2 open issues
What changed in this PR
This PR adds configuration binding and controlled HTTP loopback access to the SDK’s outbound host validator, while tightening service URL matching.
Changes:
- Adds configuration loading and an
allow_http_for_loopbackoption. - Requires matching schemes and ports between claim and activity service URLs.
- Updates address-validation tests to allow loopback addresses when private-network access is enabled.
| File | Description |
|---|---|
| tests/hosting_core/test_outbound_host_validator.py | Updates loopback expectations for private-network access. |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/security/outbound_host_validator.py | Adds configuration binding and conditional HTTP loopback support. |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/_http_adapter_base.py | Adds scheme and port checks to service URL validation. |
Review effort: Balanced
…b.com/microsoft/Agents-for-python into users/robrandao/allow-loopback-option
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.


This pull request introduces enhancements to the outbound host validation logic, focusing on improved security and configurability for handling HTTP and loopback addresses. The main changes add support for selectively allowing HTTP connections to loopback addresses, improve the validation of service URLs, and expand configuration options for outbound host validation.
Security and validation improvements:
_http_adapter_base.pyto ensure both the scheme (e.g., HTTP/HTTPS) and port match between claim and activity URLs, reducing the risk of mismatches or protocol downgrade attacks._allow_addrfunction and its usage to allow HTTP for loopback addresses only if explicitly configured, tightening network address rules. [1] [2] [3] [4]_is_allowedmethod to permit HTTP URLs only when the target is a loopback address and the new configuration flag is enabled, further restricting insecure connections.Configurability and extensibility:
allow_http_for_loopbackparameter and configuration option toOutboundHostValidator, enabling fine-grained control over HTTP access to loopback addresses via code or configuration. [1] [2] [3] [4] [5]_from_scoped_configuration,_from_root_configuration) intoOutboundHostValidatorto support reading settings from a configuration object, making the validator more extensible and easier to manage. [1] [2]Dependency and import updates:
outbound_host_validator.pyto support the new features and maintain code clarity.