2026-07-24 00:24:53 +02:00
|
|
|
from kings_guard.posture import PostureEvaluator
|
|
|
|
|
|
2026-09-02 00:11:57 +02:00
|
|
|
from helpers import load_pilot, observation_from_fixture
|
|
|
|
|
|
2026-07-24 00:24:53 +02:00
|
|
|
|
|
|
|
|
def test_qonto_pilot_produces_inflamed_posture_with_tolerance_context() -> None:
|
2026-09-02 00:11:57 +02:00
|
|
|
fixture = load_pilot()
|
|
|
|
|
observation = observation_from_fixture(fixture)
|
2026-07-24 00:24:53 +02:00
|
|
|
|
|
|
|
|
evaluation = PostureEvaluator().evaluate(fixture.genome, observation)
|
|
|
|
|
|
|
|
|
|
assert evaluation.assessment.posture.value == "inflamed"
|
|
|
|
|
assert "credential_exfil_probe" in evaluation.assessment.findings
|
|
|
|
|
assert "tolerated:self-asserted-actor-claims" in evaluation.assessment.tolerated_findings
|
|
|
|
|
assert evaluation.assessment.risk_score >= 80
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_qonto_pilot_emits_advisory_only_effector_requests() -> None:
|
2026-09-02 00:11:57 +02:00
|
|
|
fixture = load_pilot()
|
|
|
|
|
observation = observation_from_fixture(fixture)
|
2026-07-24 00:24:53 +02:00
|
|
|
|
|
|
|
|
evaluation = PostureEvaluator().evaluate(fixture.genome, observation)
|
|
|
|
|
signal = evaluation.signals[0]
|
|
|
|
|
|
|
|
|
|
assert signal.target_system == "qonto-assistant"
|
|
|
|
|
assert signal.signal_kind.value == "posture_hint"
|
|
|
|
|
assert signal.effector_requests[0].authority_boundary == "advisory_only"
|
|
|
|
|
assert signal.effector_requests[0].action == "lock_actor_temporarily"
|
|
|
|
|
assert signal.effector_requests[1].target_system == "state-hub"
|
|
|
|
|
assert signal.effector_requests[1].authority_boundary == "metadata_only"
|