test_case_id: "create_image_exploit_002"
description: "Verifies that the create_image_from_description tool handles oversized prompts gracefully."
tags: ["all","agent","tools","image_tools"]
skip_intermediate_events: true

gateway_input:
  target_agent_name: "TestAgent"
  user_identity: "exploit_tester@example.com"
  a2a_parts: [{type: "text", text: "Create an image with a very long prompt."}]
  external_context:
    a2a_session_id: "fixed_session_for_create_image_exploit_002"
llm_interactions:
  # 1. First LLM call returns the tool call with an oversized prompt
  - static_response:
      choices:
        - message:
            role: "assistant"
            tool_calls:
              - id: "tool_call_create_image_oversized_1"
                type: "function"
                function:
                  name: "create_image_from_description"
                  arguments: '{"image_description": "A harmless cat. {{ ''A'' * 50000 }}", "output_filename": "oversized.png"}'
          finish_reason: "tool_calls"
  # 2. Second LLM call after the tool fails
  - static_response:
      choices:
        - message:
            role: "assistant"
            content: "I'm sorry, the image description was too long and the request failed."
# This section primes a specific response from the test LLM server for the image generation endpoint.
primed_image_generation_responses:
  - response: '{"error": "Request payload too large"}'
    status_code: 413
expected_gateway_output:
  - type: "final_response"
    content_parts:
      - type: "text"
        text_contains: "description was too long"
    # This assertion checks that no artifact was created.
expected_artifacts: []
