test_case_id: web_request_redirect_to_unsafe
description: "Test that web_request tool handles a redirect to an unsafe URL."
tags: ["all","agent","tools","web_tools"]
skip_intermediate_events: true

gateway_input:
  target_agent_name: "TestAgent"
  user_identity: "test_user@example.com"
  gateway_request_id: "request-126"
  external_context:
    a2a_session_id: "session-459"
  prompt:
    parts:
      - text: "Please fetch the content from http://safe.com/redirect"

llm_interactions:
  - static_response:
      choices:
        - message:
            role: "assistant"
            tool_calls:
              - id: "call_126"
                type: "function"
                function:
                  name: "web_request"
                  arguments: '{"url": "http://safe.com/redirect"}'
    expected_request:
      messages:
        - role: "user"
          content: "Please fetch the content from http://safe.com/redirect"
      tools_present:
        - "web_request"
  - static_response:
      choices:
        - message:
            role: "assistant"
            content: "I am sorry, but I cannot fulfill that request as it is unsafe."
    expected_request:
      messages:
        - role: "user"
          content: "Please fetch the content from http://safe.com/redirect"
        - role: "tool"
          content: '{"status": "error", "message": "URL is not safe to request."}'
          tool_call_id: "call_126"

expected_gateway_output:
  - type: final_response
    task_state: "completed"
    content_parts:
      - type: text
        text_contains: "I am sorry, but I cannot fulfill that request as it is unsafe."

expected_artifacts: []
