Layer-by-Layer Results
Detailed breakdown of the three authority tiers (Origin, Semantic, Consequence),
adversarial tests, simulation scenarios, threat coverage, and implementation metrics.
All results reflect Phase I at v0.1.0-research-draft.
Summary
Tier 1 — Origin
Establishes who authorized the action. Fields: identity, credential, attestation, timestamp, nonce.
| Test | What it checks | Status |
|---|---|---|
| test_origin_valid | Valid origin passes | PASS |
| test_origin_missing_identity | Empty identity fails | PASS |
| test_origin_missing_credential | Empty credential fails | PASS |
| test_origin_evidence | Evidence dict populated | PASS |
| test_origin_timestamp_default | UTC timestamp by default | PASS |
| test_origin_timestamp_custom | Custom timestamp preserved | PASS |
| test_origin_nonce | Optional nonce supported | PASS |
| test_origin_attestation | Optional attestation supported | PASS |
Tier 2 — Semantic
Establishes what the action means in context. Fields: intent, scope, constraints, preconditions.
| Test | What it checks | Status |
|---|---|---|
| test_semantic_valid | In-scope action passes | PASS |
| test_semantic_missing_intent | Empty intent fails | PASS |
| test_semantic_missing_scope | Empty scope fails | PASS |
| test_semantic_target_out_of_scope | Out-of-scope target fails | PASS |
| test_semantic_wildcard_scope | Wildcard "*" accepts all | PASS |
| test_semantic_evidence | Evidence dict populated | PASS |
| test_semantic_constraints | Constraints dict preserved | PASS |
| test_semantic_preconditions | Preconditions list preserved | PASS |
Tier 3 — Consequence
Establishes what the action produces in the world. Fields: effects, side_effects, reversibility, audit_footprint.
| Test | What it checks | Status |
|---|---|---|
| test_consequence_valid | Declared effects pass | PASS |
| test_consequence_missing_effects | Empty effects fail | PASS |
| test_consequence_reversible | Reversible classification | PASS |
| test_consequence_irreversible | Irreversible classification | PASS |
| test_consequence_invalid_reversibility | Invalid reversibility fails | PASS |
| test_consequence_side_effects | Side effects preserved | PASS |
| test_consequence_audit_footprint | Audit footprint preserved | PASS |
Decision Engine
Aggregates the three tier verdicts into a single decision (AUTHORIZED / DENIED / ESCALATED).
| Test | What it checks | Status |
|---|---|---|
| test_decision_enum_values | Decision enum values | PASS |
| test_tier_verdict_dataclass | TierVerdict fields | PASS |
| test_authorization_authorized_flag | authorized property | PASS |
| test_authorization_denied_flag | authorized is False | PASS |
| test_decision_engine_all_pass | All pass → AUTHORIZED | PASS |
| test_decision_engine_one_fail | One fail → DENIED | PASS |
| test_decision_engine_escalated | Escalate reason → ESCALATED | PASS |
| test_decision_engine_multiple_fails | Multiple fails → DENIED | PASS |
Governance
Policy, delegation, escalation, audit.
| Test | What it checks | Status |
|---|---|---|
| test_escalation_dataclass | Escalation fields | PASS |
| test_escalation_immutability | Frozen dataclass | PASS |
| test_escalation_equality | Value equality | PASS |
| test_escalation_repr | Readable repr | PASS |
| test_escalation_empty_reason | Empty reason allowed | PASS |
Execution Gateway & Binding
Atomic execution only when authorized; cryptographic binding of action to authorization.
| Test | What it checks | Status |
|---|---|---|
| test_gateway_executes_when_authorized | Executes if AUTHORIZED | PASS |
| test_gateway_refuses_when_denied | Refuses if DENIED | PASS |
| test_gateway_captures_executor_exception | Captures executor errors | PASS |
| test_execution_result_dataclass | ExecutionResult fields | PASS |
| test_action_binding_create | Binding created correctly | PASS |
| test_action_binding_verify_ok | Valid binding verifies | PASS |
| test_action_binding_verify_tampered_action | Tampered action fails | PASS |
Adversarial Tests
Hostile conditions: compromised tiers, drift, escalation, non-override, atomicity, replay, tampering.
| Test | Threat addressed | Status |
|---|---|---|
| test_compromised_origin_missing_credential | T1 — Identity spoofing | PASS |
| test_semantic_drift_scope_escalation | T2 — Scope escalation | PASS |
| test_consequence_escalation_missing_effects | T3 — Consequence concealment | PASS |
| test_non_override_all_tiers_required | T4 — Tier collusion | PASS |
| test_atomicity_gateway_does_not_run_when_denied | Atomicity invariant | PASS |
| test_replay_protection_rejects_second_use | T5 — Replay | PASS |
| test_action_binding_detects_tampered_authorization | T6 — Authorization tampering | PASS |
| test_full_pipeline_happy_path | End-to-end baseline | PASS |
Simulation Scenarios
End-to-end scenarios executed by python3 -m simulation. All pass.
| Scenario | Expected | Status |
|---|---|---|
| happy_path | Action authorized and executed | PASS |
| scope_escalation | Out-of-scope denied, executor not run | PASS |
| tier_collusion | Two-tier collusion blocked | PASS |
| replay_attack | Replay rejected | PASS |
| tamper_attack | Tampering detected | PASS |
Architectural Invariants
Each invariant is enforced structurally and tested.
Decision Policy
Threat Coverage
8 threats catalogued in DOCS/threat_model.md; 6 covered by tests, 2 deferred to governance/deployment.
| ID | Threat | Coverage |
|---|---|---|
| T1 | Identity spoofing | Tested |
| T2 | Scope escalation | Tested |
| T3 | Consequence concealment | Tested |
| T4 | Tier collusion | Tested |
| T5 | Replay | Tested |
| T6 | Authorization tampering | Tested |
| T7 | Escalation abuse | Policy |
| T8 | Audit log tampering | Deployment |
Limitations
Explicit scope of Phase I.
| Concern | Mitigation |
|---|---|
| Declared effects vs. actual effects | Runtime monitoring is future work |
| At most two tiers compromised | Stated assumption |
| No formal verification | Structural invariants + adversarial tests |
| No real deployment | Simulation only; production is future work |
| Python-only | Cross-language generalization deferred |