Agent: Sicherheitskern gehärtet (Adressfilter, Protokoll, Modellzugang)

This commit is contained in:
Rsclub2_2 committed 2026-11-15 01:26:35 +01:00
1 parent 181eab40fb
commit 7e50983d85
6 files changed
+201 -30

No files matched your search

+6
View File
@@ -49,3 +49,9 @@ def test_error_text_never_contains_the_key():
with pytest.raises(LLMUnavailable) as e:
llm.ask("s", "u")
assert "sk-secret" not in str(e.value)
@pytest.mark.parametrize("base_url", ["https://ai.example:abc", "https://ai.ex\x00ample", "http://", "ai.example"])
def test_invalid_endpoint_url_means_unavailable(base_url):
with pytest.raises(LLMUnavailable):
LLM(base_url, "m", "k", client=client(lambda r: httpx.Response(200, json={}))).ask("s", "u")