Does each invisible automation loop carry a reflex-interrupt pathway with delegation underwriting and anomaly attestation?
LoopShield evaluates whether each invisible automation loop has adequate reflex-interrupt, delegation underwriting, and anomaly attestation evidence, emitting a deterministic 4-way verdict with a hash-chained audit ledger.
LoopShield does not execute, schedule, or repair loops. It evaluates whether reflex-interrupt pathways exist and attests to their presence.
| Source | Mechanism reused |
|---|---|
| LoopKit | observability + repair triggers for invisible loops |
| DelegationUnderwriter | trust envelope + liability pre-screening |
| AfferentCore | reflex-interrupt pathway verification |
It differs from AfferentInterrupt (which detects abnormal loops in real time) by evaluating the design-time adequacy of reflex pathways rather than runtime behavior. It differs from LoopKit by adding delegation underwriting and attestation as first-class predicates.
# Install
pip install -e .
# Write sample loop definitions
loopshield sample -o loops.json
# Evaluate loops
loopshield evaluate loops.json -o result.json --report report.md
# Render report from existing result
loopshield report result.json -o report.md| Command | Purpose |
|---|---|
sample |
Write sample loop definitions to JSON |
evaluate |
Evaluate loop specs → JSON result + optional MD report |
report |
Render Markdown report from JSON result |
| Predicate | Source project | Evidence keys |
|---|---|---|
| authority | DelegationUnderwriter | responsible_entity, escalation_path, liability_limit, trust_envelope |
| interrupt | AfferentCore | interrupt_signal, reflex_pathway, max_duration, timeout_handler |
| observability | LoopKit | telemetry, state_exposure, log_stream, repair_trigger |
| attestation | AfferentCore | anomaly_attestation, verification_method, evidence_chain, timestamp_proof |
| repair | LoopKit | rollback_procedure, repair_procedure, recovery_state, compensation_action |
A predicate passes if any of its evidence keys is truthy.
| Verdict | Condition |
|---|---|
cleared |
coverage high (≥ 0.8), no critical gaps |
flagged |
coverage medium (≥ 0.6), non-critical gaps only |
attenuated |
coverage medium with one critical gap |
blocked |
coverage low (< 0.6), or ≥ 2 critical gaps |
Critical predicates: authority, interrupt, attestation.
Every evaluation entry is appended to a SHA-256 chained ledger. Each entry
records prev_hash, hash, seq, and timestamp_utc. The ledger is
sealed with a final hash over all entries.
- stdlib-only — Python 3.10+, zero external packages
- cli_triplet — sample / evaluate / report
- k-way verdict — 4-way deterministic (cleared/flagged/attenuated/blocked)
- hash-chained audit log — SHA-256 chain with seal
- single_question — "Does this loop carry a reflex-interrupt pathway…?"
- boundary_clause — "What LoopShield is not" explicitly stated
- dual_output — JSON (machine) + Markdown (human)
python -m unittest discover -s tests -q44 tests covering engine predicates, verdict rules, hash-chain integrity, ledger sealing, report rendering, and all CLI subcommands.
LoopShield/
├── loopshield/
│ ├── __init__.py # Public API re-exports
│ ├── engine.py # Deterministic 5-predicate scoring + verdict + ledger
│ ├── cli.py # argparse: sample/evaluate/report
│ ├── report.py # Markdown report renderer
│ └── __main__.py # python -m loopshield entry
├── tests/
│ └── test_engine.py # 44 unit tests
├── pyproject.toml
├── README.md
├── LICENSE # MIT
└── .gitignore
