Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Security Policy

For a more in-depth look at our security policy, please check out our [Coordinated Vulnerability Disclosure Policy](https://openai.com/security/disclosure/#:~:text=Disclosure%20Policy,-Security%20is%20essential&text=OpenAI%27s%20coordinated%20vulnerability%20disclosure%20policy,expect%20from%20us%20in%20return.).

Our PGP key can located [at this address.](https://cdn.openai.com/security.txt)
5 changes: 3 additions & 2 deletions src/agents/mcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1297,8 +1297,9 @@ def create_streams(
}
if "auth" in self.params:
kwargs["auth"] = self.params["auth"]
if "httpx_client_factory" in self.params:
kwargs["httpx_client_factory"] = self.params["httpx_client_factory"]
kwargs["httpx_client_factory"] = (
self.params.get("httpx_client_factory") or _create_default_streamable_http_client
)
return sse_client(**kwargs)

@property
Expand Down
6 changes: 4 additions & 2 deletions tests/mcp/test_mcp_auth_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TestMCPServerSseAuthAndFactory:

@pytest.mark.asyncio
async def test_sse_default_no_auth_no_factory(self):
"""SSE create_streams passes only the four base params when no extras are set."""
"""SSE create_streams falls back to the hardened default httpx_client_factory."""
with patch("agents.mcp.server.sse_client") as mock_client:
mock_client.return_value = MagicMock()
server = MCPServerSse(params={"url": "http://localhost:8000/sse"})
Expand All @@ -26,11 +26,12 @@ async def test_sse_default_no_auth_no_factory(self):
headers=None,
timeout=5,
sse_read_timeout=300,
httpx_client_factory=_create_default_streamable_http_client,
)

@pytest.mark.asyncio
async def test_sse_with_auth(self):
"""SSE create_streams forwards the auth parameter when provided."""
"""SSE create_streams forwards auth and still applies the hardened default factory."""
auth = httpx.BasicAuth(username="user", password="pass")
with patch("agents.mcp.server.sse_client") as mock_client:
mock_client.return_value = MagicMock()
Expand All @@ -42,6 +43,7 @@ async def test_sse_with_auth(self):
timeout=5,
sse_read_timeout=300,
auth=auth,
httpx_client_factory=_create_default_streamable_http_client,
)

@pytest.mark.asyncio
Expand Down
Loading