Skip to content

[Feat]: Agent card validation hook #975

@ishymko

Description

@ishymko

Is your feature request related to a problem? Please describe.

#895 mentions lack of agent card validation on the client which may be used to trigger calls to private URLs when agent card is coming from an untrusted source.

Currently no hooks are provided for such validation, which is especially important for functions like create_client and create_from_url which support URL fetch.

Describe the solution you'd like

The SDK should not define the rules of validation and private URLs should not be forbidden as it can be a perfectly valid use case.

Instead it should

  1. Provide something like below in respective client_factory.py functions:
 card_validators: list[Callable[[AgentCard], None]] | None = None
  1. Provide built-in validators for private URLs (reject_private_urls) and non-HTTPS URLs (reject_non_https_urls) which are not enabled by default.

Describe alternatives you've considered

The PR referenced implements such validation unconditionally, however using A2A for internal addresses is a valid scenario.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions