14 lines
616 B
Python
14 lines
616 B
Python
"""Integration: input con PII (NIF español + email) bloqueado por guardrails de entrada."""
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.mark.integration
|
|
def test_pii_es_nif_bloquea(integration_client) -> None: # type: ignore[no-untyped-def]
|
|
pii_input = "El cliente con NIF 12345678Z reporta caída de servicio. Email juan@example.com"
|
|
r = integration_client.post("/api/agents/incident_analyzer/invoke", json={"input": pii_input})
|
|
assert r.status_code == 200
|
|
body = r.json()
|
|
assert body["status"] == "blocked_by_guardrail"
|
|
assert any(v["validator"] == "DetectPII" and v["blocked"] for v in body["violations"])
|