r/madeinpython • • 5h ago

[Python] nomosguard: a security decision core where the model supplies evidence and the rules decide

Repo: https://github.com/Furox-Art/nomosguard - 0.7.11, Apache-2.0, pure Python with no runtime dependencies, Python 3.11+.

The design constraint was to keep a model away from the decision. So the model reads logs, configs and CVE records and writes structured claims, each citing the exact fragment behind it - a log line hash, a config path, a CVE id. A claim without a reproducible citation raises UnevidencedClaimError at append time. What survives goes into an append-only SHA-256 hash-chained ledger, a rule engine derives attack and access paths from that ledger by plain logical inference, and a policy gate answers ALLOW / ALERT / BLOCK with deny as the default. If nothing is derived, the gate returns BLOCK with the reason saying so, rather than an empty allow.

You can watch all of that fail closed in one command: python -m nomosguard.demo_e2e runs a reproducible scenario list, and tests/test_demo_e2e.py pins that table to the scenario registry in both directions.

Install:

pip install nomosguard

One honest limit: it is early development (alpha), and it is a reasoning core rather than a scanner - it does not discover hosts or reach into your infrastructure, it reasons over the events you feed it. Coverage is a Linux gate where CI fails on any skipped test; the Windows job measures 99.64% because the fcntl lock branches and the directory-fsync path cannot execute there.

There is also an MCP client entry point if you want an agent to read events and write claims without ever holding the verdict.

1 Upvotes

0 comments sorted by