From 235b5c72ddfec0c22abb1f00c53849cfa2f4e803 Mon Sep 17 00:00:00 2001 From: Evan Mattson <35585003+moonbox3@users.noreply.github.com> Date: Wed, 19 Nov 2025 16:39:31 +0900 Subject: [PATCH 1/2] Potential fix for code scanning alert no. 18: Information exposure through an exception Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- python/packages/ag-ui/agent_framework_ag_ui/_endpoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/packages/ag-ui/agent_framework_ag_ui/_endpoint.py b/python/packages/ag-ui/agent_framework_ag_ui/_endpoint.py index ba6e9f5ddd..d1baad5561 100644 --- a/python/packages/ag-ui/agent_framework_ag_ui/_endpoint.py +++ b/python/packages/ag-ui/agent_framework_ag_ui/_endpoint.py @@ -91,4 +91,4 @@ async def event_generator(): ) except Exception as e: logger.error(f"Error in agent endpoint: {e}", exc_info=True) - return {"error": str(e)} + return {"error": "An internal error has occurred."} From e5beb9bf536fcee8ca98522f65eb68bf102161b5 Mon Sep 17 00:00:00 2001 From: Evan Mattson Date: Thu, 20 Nov 2025 08:14:43 +0900 Subject: [PATCH 2/2] Fix test --- python/packages/ag-ui/tests/test_endpoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/packages/ag-ui/tests/test_endpoint.py b/python/packages/ag-ui/tests/test_endpoint.py index b5846bbbf8..1ae364f818 100644 --- a/python/packages/ag-ui/tests/test_endpoint.py +++ b/python/packages/ag-ui/tests/test_endpoint.py @@ -154,7 +154,7 @@ async def test_endpoint_error_handling(): assert response.status_code == 200 content = json.loads(response.content) assert "error" in content - assert "Expecting value" in content["error"] + assert content["error"] == "An internal error has occurred." async def test_endpoint_multiple_paths():