test_case_id: edit_image_path_traversal_input
description: "Tests for path traversal vulnerability in the input filename."
tags: ["agent","tools","image_tools"]
skip_intermediate_events: true

gateway_input:
  user_identity: "test_user@example.com"
  target_agent_name: "TestAgent"
  prompt: "Edit the image ../../../../etc/passwd and add a hat."
  tool_names: ["edit_image_with_gemini"]
  external_context:
    a2a_session_id: "session_edit_image_path_traversal_input"

llm_interactions:
  - static_response:
      choices:
        - message:
            role: "assistant"
            tool_calls:
              - id: "call_pt1"
                type: "function"
                function:
                  name: "edit_image_with_gemini"
                  arguments: '{"image_filename": "../../../../etc/passwd", "edit_prompt": "add a hat"}'
  - expected_request:
      messages:
        - role: "tool"
          content_contains: "Image artifact '../../../../etc/passwd' not found"
          tool_call_id: "call_pt1"
    static_response:
      choices:
        - message:
            role: "assistant"
            content: "I could not find the image '../../../../etc/passwd'. Please ensure the file exists and is in the correct location."

expected_gateway_output:
  - type: "final_response"
    task_state: "completed"
    content_parts:
      - type: "text"
        text_contains: "I could not find the image '../../../../etc/passwd'. Please ensure the file exists and is in the correct location."
