crivo-sentinel-v1
The decision model that comes with Sentinels.
When a sentinel freezes a program on one of your machines, the Sentinel service asks this model what to do with it: stop, release or hold for an operator. For any case a sentinel reports, it also gives a second opinion: investigate, stop or release.
It is a 68 million parameter typed-decision encoder. The base is the Apache-2.0 encoder cross-encoder/ettin-reranker-68m-v1. The way a question is put to it and scored is the Crivo decision encoder code (Apache-2.0), which the model is named after. The answer token and the scorer were trained from scratch on 2,854 cases, written exactly the way the Sentinel service sends them.
It runs on a CPU. No account, no API key, and nothing leaves your machine. model.onnx is the same model exported
for ONNX Runtime: that is what the Sentinel service runs, in its own process, with nothing else installed.
Benchmarks
Measured on 548 held-out test cases, and on 734 "unseen" cases: 15% of the signal combinations were kept out of training altogether, so these say how the model does on a case shaped like nothing it was taught.
"Service rule" is what the Sentinel service actually does with an answer. It stops a frozen program only on a confident stop (probability 0.85 or more), releases only on a confident release when you allow that, and holds everything else for an operator.
| test | unseen | |
|---|---|---|
| decide: accuracy | 0.995 | 0.995 |
| decide: macro-F1 | 0.981 | 0.969 |
| cases that should be stopped, stopped under the service rule | 155 of 155 | 176 of 177 (one held) |
| cases that should be released, released | 34 of 34 | 38 of 39 (one held) |
| cases that should be held, held | 10 of 10 | 5 of 5 |
| wrongly stopped | 0 | 0 |
| second opinion: accuracy | 0.994 | 0.895 |
| calibration error (ECE), decide | 0.004 | 0.006 |
For comparison: before training, the same encoder with the Crivo-68M weights answered "stop" to every case at low confidence. Under the service rule that would have held 150 of the 155 attacks instead of stopping them.
Speed, one request at a time (a request is about 540 tokens), then batches of 16:
| one request, median | p95 | batched, questions a second | |
|---|---|---|---|
| one desktop GPU | 17.7 ms | 19.6 ms | 273 |
| CPU, 8 threads | 122 ms | 189 ms | 9 |
The weights are 274 MB. The raw numbers are in benchmarks/.
One thing to know. The model leans on the evidence sentences the sentinel writes for each signal. With those blanked out, decide accuracy drops to 0.88: 27 of the 155 stops become holds, and still nothing is wrongly stopped or released. The sentinel always sends them.
Run it
Inside the Sentinel service, nothing is needed: the installer carries the model and the service loads model.onnx
itself (server/src/decisions.mjs in the Sentinels repository renders the question exactly as model.py does).
On its own, with Python 3.10 or newer:
pip install -r requirements.txt
python serve.py --model . --port 8791 --cert service.crt --key service.key
The server answers GET /health and takes a POST with {"state": ..., "questions": {...}} on any path. It
replies with a probability for every allowed answer:
{"decision": {"type": "choice", "choice": "hold", "probabilities": {"stop": 0.000001, "release": 0.0, "hold": 0.999999}}}
example-request.json is one request as the service sends it (a remote PowerShell
session listing the domain, on Windows), and example-response.json is the answer.
--device cpu and --threads 8 pick the CPU and how much of it; without --cert and --key the server speaks
plain HTTP, which the service will not use but curl will. --model gary23w/crivo-sentinel-v1 fetches the
weights from here instead of a folder.
Use it with Sentinels
The one-file service installer carries this model
and sets it up by default: the service runs it in its own process. Pass --model off to the installer to skip
it. sudo garrett-service setup walks you through plugging in a model of your own instead.
By hand, these lines in the service's configuration do the same, with the four model files in that folder:
AI_PROVIDER=decision
AI_MODEL=crivo-sentinel-v1
MODEL_DIR=/usr/lib/garrett-service/model
To serve it over HTTPS instead, for a service elsewhere, run serve.py above and point AI_BASE_URL at it.
AI_HIGH_CONFIDENCE (0.85 unless set) is the bar an answer must clear. DECISION_RELEASE=high-confidence
lets a confident release let a frozen program go. The service gives the model 8 seconds; past that,
DECISION_FALLBACK decides: kill (the default) or hold.
Train it again
Everything that built this model is here. cases.mjs writes the training rows, train.py trains, measure.py
measures, export.py writes model.onnx and checks it answers like the PyTorch model, and parity.py writes
the rows the service's own runner is tested against. cases.mjs renders each case with the service's own code,
so it needs a Sentinels checkout: clone this repository as model/ inside one.
git clone https://github.com/gary23w/sentinels
cd sentinels
git clone https://huggingface.co/gary23w/crivo-sentinel-v1 model
cd model
node cases.mjs synth
python train.py --init . --train data/train.jsonl --dev data/dev.jsonl --out runs/next
python measure.py --rows data/test.jsonl --rows data/unseen.jsonl --model . --model runs/next
python export.py --model runs/next --out runs/next/model.onnx --rows data/test.jsonl # needs onnx, onnxscript, onnxruntime
The rows are labelled by the policy at the top of cases.mjs: the decide question's own criteria, the signals
the service never releases, the launch chains the sentinel acts on without waiting, and the rules the model is
given about remembered verdicts. That is a starting point, not anyone's verdict on a real case. The verdicts
that matter are your operators'. node cases.mjs service /etc/garrett-service/service.conf exports every
case they confirmed, stopped, trusted or released as rows with those verdicts; train on them beside the
synthetic rows, starting from these weights.
The model sees only what the service sends: platform, level and score, the program and what started it, each signal with the service's sentence for it and the sentinel's evidence sentence, the connections, whether the program is paused, where it would start again from, and what operators decided about similar cases before. Program names reach it as names; command lines never do.
Licence
MIT, for the weights and the code written for this model. The base encoder is Apache-2.0. model.py is from
the Crivo repository, Apache-2.0; its licence text is in LICENSE-APACHE. No Crivo weights are
in this model: those are CC BY-NC 4.0, and this one was trained from the Apache-2.0 base so you can use it for
anything.
- Downloads last month
- 162
Model tree for gary23w/crivo-sentinel-v1
Base model
jhu-clsp/ettin-encoder-68m