axor-sentinel
Cross-session behavioral analysis layer for axor-core. Detects slow-and-low staging attacks — coordinated data exfiltration spread across many sessions over days or weeks — that are invisible to per-session anomaly detection.
The problem it solves
Per-session anomaly detectors see each session in isolation. An attacker staging an exfiltration across dozens of short, individually normal sessions — touching sensitive resources a little each time, then exfiltrating later — never exceeds any single-session threshold.
axor-sentinel maintains a resource reputation graph across all sessions. Resources accumulate suspicion over time, and that suspicion is fed back to axor-core as observe-only telemetry: it never denies a request on its own. The only enforcement coupling is opt-in — when a resource's suspicion is high enough, core's DegradationEngine (configured with a detection_floor) can tighten the session's degradation level, narrowing the surface. Reputation is a signal that raises caution, not a gate.
How it works
sessions (axor-core)
│
▼
SentinelCycle ← background audit, runs every ~1h
├── evidence sets ← windowed typed facts per resource (30-day TTL, exact expiry)
├── predicates P1–P4 ← declared, decidable: export-denied / distinct-origin
│ export-adjacency / staging count / staged-then-export
├── fanout quota ← > N distinct containers in one tainted session
│ (N declared per actor class — no self-trained baseline)
├── adjacency labels ← sharing a container with a FLAGGED resource ⇒ WATCH
└── snapshot swap ← atomic write to disk (symlink rename / os.replace)
│
▼
ReputationSnapshot ← resource_id → LEVEL_SUSPICION[level], a FINITE
codomain (0.0 clean / 0.4 watch / 1.0 flagged) +
level names and the facts behind each verdict;
the old scalar scores ride along as telemetry
│
▼
SnapshotIntentEnricher ← converts suspicion → trust, populates
│ NormalizedIntent.target_resource_reputation (telemetry)
▼
IntentLoop (axor-core) ← observe-only: records the reputation signal; with an
opt-in detection_floor it can only TIGHTEN degradation,
never deny. (floor in (0.001, 0.6) ⇒ FLAGGED-only;
floor ≥ 0.6 ⇒ WATCH too — decidable end-to-end)
Polarity note. Sentinel scores suspicion (high = bad). Core's reputation field is trust (a positive reading
<=detection_floorcrosses and tightens;0.0= unknown).SnapshotIntentEnricherconverts at the boundary (reputation = 1 - suspicion), so core tightens on suspicious resources.
Score accumulation uses logarithmic diminishing returns — each signal contributes proportionally to remaining headroom, so scores are bounded to [0, 1] and saturate naturally:
new_score = current + new_weight × (1 − current)
Resource ids
Reputation accumulates per resource id, so one resource must map to exactly one id
whatever tool touched it. Ids are derived purely lexically (no disk access) by
graph.derive.derive_identity, which both the hot-path enricher and the audit-path
CoreSessionSink call:
| Source | Id |
|---|---|
local path (any tool: read_file, write_file, fs_read, Read, …) |
file:/data/secret.txt |
| http(s) URL — host kept, query sorted, fragment/credentials dropped | url:corp.example.com/a/b?id=1 |
| other-scheme URL | url:s3://bucket/key |
| non-URL path via a recognised provider tool | sharepoint:/sites/hr/x.xlsx |
| provider object id (no path; recognised provider only) | sharepoint:item:42 |
| filename fingerprint | heuristic:name|size|mtime |
call naming no resource (bash, send_email) |
no access recorded |
Containers are the parent of the normalised locator (file:/data, url:host/a).
Full rules: architecture.md §4b.
Migration. The id format changed after 0.4.2 (previously verb-prefixed ids such as
read:/data/x/fs:/data/x, lowercased paths, host-less URLs, bare provider ids,""for path-less calls). Reputation, evidence and graph nodes accumulated under old ids do not carry over; they stop being hit and decay/expire on their normal schedule (or purge them for a clean start).
Quick start
pip install -e ".[neo4j]"
from pathlib import Path
from axor_sentinel.sentinel.cycle import SentinelCycle
from axor_sentinel.integration.intent_enricher import SnapshotIntentEnricher
from axor_sentinel.sentinel.weight import FLAG_THRESHOLD
from axor_core.degradation.engine import DegradationEngine
snapshot_dir = Path("~/.axor/sentinel").expanduser()
# Background audit cycle (runs hourly, not on hot path)
cycle = SentinelCycle(neo4j_session, snapshot_dir=snapshot_dir)
snapshot = cycle.run_once(sessions)
# Hot-path enrichment — pure dict lookup, no Neo4j
enricher = SnapshotIntentEnricher.from_dir(snapshot_dir)
# Wire into axor-core IntentLoop. Enrichment alone only populates telemetry; to act
# on it, give the loop a DegradationEngine with a detection_floor so a suspicious
# resource TIGHTENS degradation (never denies). The floor pairs with the suspicion
# flag threshold: floor = 1 - FLAG_THRESHOLD.
degradation = DegradationEngine(detection_floor=1.0 - FLAG_THRESHOLD)
loop = IntentLoop(..., reputation_enricher=enricher, degradation_engine=degradation)
Bench suite
820-scenario synthetic dataset (paper baseline):
pip install -e ".[bench]"
from axor_sentinel.bench.dataset.composer import DatasetComposer
from axor_sentinel.bench.eval.metrics import evaluate
scenarios = DatasetComposer().compose() # 820 scenarios, seed=42
result = evaluate(scenarios, scores=my_scores)
print(result.tpr_at_fpr_budget) # TPR @ FPR ≤ 0.02
See docs/architecture.md for the full design: graph schema, weight model, invariants, attack patterns, and bench composition.
Metadata
Release files for axor-sentinel 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| axor_sentinel-0.4.2.tar.gz | 188.1 kB | With provenance | Details for axor_sentinel-0.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| axor_sentinel-0.4.2-py3-none-any.whl | Python 3 | none | any | Details for axor_sentinel-0.4.2-py3-none-any.whl |
Total release size: 288.7 kB
Release files / axor_sentinel-0.4.2.tar.gz
| Download URL | axor_sentinel-0.4.2.tar.gz |
|---|---|
| Size | 188.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0cb8a029010a80c299be8af4e44cea54f0e92ff5e23744d8b00c8fc3bd00745d
|
|
BLAKE2b-256 checksum How to use checksums |
0b0cdcc337dd27d880b96c08c0220b9d955c2fa607cd654928cf2e7096dd9703
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / axor_sentinel-0.4.2-py3-none-any.whl
| Download URL | axor_sentinel-0.4.2-py3-none-any.whl |
|---|---|
| Size | 100.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e745e9bb5c73806257824752eae956a08827599bf52a2bf477280ba27fa2a12
|
|
BLAKE2b-256 checksum How to use checksums |
47c93675e88b7b5a2e940d4bf408250380c21113778ee27fc5b8ef875939e215
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logSecurity for axor-sentinel 0.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for axor_sentinel-0.4.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.