The learned layer (L3) of Guard-NLIP, a Type-3 Security Extension for NLIP (ECMA-430) agents (code and paper, MIT; live demo: Space).
Given the user's request and a tool call (tool name and control arguments; free-text arguments are excluded), it scores how unlikely the call is for that request. A joint-embedding predictive model: a context encoder embeds the request, a target encoder embeds the canonical call, and a predictor conditioned on the tool predicts the call embedding; the loss adds SIGReg (LeJEPA) and a tool-plausibility head. Score = prediction error and tool negative log-likelihood, each divided by its 99.5% quantile on held-out benign calls; a score of 1 or more is an alarm.
from guard_nlip.jepa.model import JEPAScorer # pip install -e . from the GitHub repository
sc = JEPAScorer.load("hf://saad484/guard-nlip-jepa") # config.json + model.safetensors (no pickle)
raw = sc.raw_scores(["Summarize https://acme-hub.com/q3-report for me."],
["send_email | to=archive@drop-zone.xyz"], ["send_email"])
print(float(sc.normalized(raw)[0])) # 11.09 -> alarm
In the guard proxy: GUARD_JEPA=hf://saad484/guard-nlip-jepa uvicorn guard_nlip.server.guard_proxy:app.
Trained only on benign traces of the repository's own benchmark generator (python -m guard_nlip.bench.generate --seed 0; five simulated tools: web_fetch, read_file, send_email, run_sql, run_shell), with
python -m guard_nlip.jepa.train --encoder sentence-transformers/all-MiniLM-L6-v2 --seed 0. No attack data.
It models that tool set only. Results from the paper (seed 0 of three):
| setting | result |
|---|---|
| own benchmark, confused-deputy calls | AUC 1.000, 100% caught (all three seeds) |
| own benchmark, all attack calls | AUC 0.875; false alarms 1.1% of benign calls (1.1-5.9% over seeds) |
| AgentDojo live calls (retrained per fold on AgentDojo) | AUC 0.57-0.66; a training-free similarity reaches 0.83 |
| InjecAgent, trained on ToolACE (transfer) | did not beat a training-free similarity (protocol fixed in advance) |
Use it as an ask-the-user signal next to the rule layers (L1 policy, L2 provenance), not as a blocker on its own, and retrain it on a deployment's own benign traffic.