A fast, lightweight threat classifier purpose-built for AI agent security scanning. Classifies SKILL.md files, MCP server configurations, SOUL.md governance docs, and agent tool descriptions into 10 security categories in under 1ms.
ONNX Runtime (cross-platform) or MLX (Apple Silicon)
The model processes text through: Embedding -> 8x MambaBlock (in_proj -> SiLU gate -> dt_proj -> out_proj + LayerNorm residual) -> Mean pooling -> LayerNorm -> Linear classifier -> Softmax.
Quick Start
Via HackMyAgent (recommended)
bash
1npminstall -g hackmyagent
23# Scan an AI agent project for threats4hackmyagent scan ./my-agent --deep
Via OpenA2A CLI
npx opena2a scan ./my-agent
Direct ONNX Inference (Python)
python
1import json
2import numpy as np
3import onnxruntime as ort
45# Load model6session = ort.InferenceSession("nanomind-tme.onnx")7vocab = json.load(open("tokenizer.json"))89# Tokenize10text ="your agent config text here"11tokens = text.lower().split()12ids =[vocab.get(t,1)for t in tokens[:128]]13ids +=[0]*(128-len(ids))# pad14input_ids = np.array([ids], dtype=np.int64)1516# Predict17logits = session.run(None,{"input_ids": input_ids})[0][0]18classes =["exfiltration","injection","privilege_escalation","persistence",19"credential_abuse","lateral_movement","social_engineering",20"policy_violation","benign","steganography"]21pred = classes[np.argmax(logits)]22conf = np.exp(logits)/ np.exp(logits).sum()23print(f"{pred} (confidence: {conf[np.argmax(logits)]:.3f})")
Strategy: Fine-tuned from v0.4.0 weights with lower learning rate (0.0005)
Schedule: Cosine decay with linear warmup (5 epochs)
Regularization: Dropout 0.1, early stopping (patience=60)
Corpus Evolution
Version
Samples
Classes
Key Change
sft-v4
1,028
9
Initial release
sft-v5
~1,100
9
Added OASB data
sft-v8
4,500
9
Multi-source, balanced
sft-v9
3,566
10
Added steganography class
sft-v10
3,566
10
FP-reduction: +106 targeted benign
Changelog
v0.5.0 (2026-04-09)
FP reduction: 7 false positives eliminated via targeted benign training data (base64, emoji, Cyrillic, Arabic, governance, error messages, security tools). Fine-tuned from v0.4.0.
v0.4.0 (2026-04-07)
Added steganography as 10th attack class. Trained on sft-v9 corpus with 370+ steganographic attack samples and 370+ benign Unicode samples.
v0.3.0 (2026-04-01)
Added ONNX export with external data format for efficient deployment.
v0.2.0 (2026-03-20)
Upgraded from MLP to Mamba TME architecture. 97.01% accuracy.
File Manifest
File
Size
Description
nanomind-tme.onnx
140 KB
ONNX model graph
nanomind-tme.onnx.data
8.0 MB
External weight data
tokenizer.json
165 KB
Word-level vocabulary (6,000 tokens)
nanomind-tme-classifier.npz
8.0 MB
Best checkpoint (MLX/NumPy weights)
Limitations
Small eval set: 194 samples. Per-class metrics may be noisy for classes with < 15 support.
Word-level tokenizer: Cannot detect character-level steganographic attacks (e.g., single Cyrillic homoglyphs embedded in Latin words). Relies on contextual patterns instead.
Base64 sensitivity: Long base64 strings can look like encoded/hidden content. v0.5.0 added targeted training but novel base64 patterns may still trigger false positives.
English-centric vocabulary: Vocabulary is trained primarily on English text. Non-English package descriptions rely on Unicode pattern recognition rather than semantic understanding.
No adversarial robustness testing: Not tested against adversarial examples designed to evade detection.
Responsible Use
This model is designed to assist security review, not replace it. All findings should be verified by a human before taking action. The model may produce false positives on legitimate content that uses security-related terminology in defensive contexts.
Do not use this model to:
Block packages or agents without human review
Make automated access control decisions
Replace security audits or penetration testing
License
Apache-2.0. Free for commercial and non-commercial use.
Citation
bibtex
1@software{nanomind,
2 title = {NanoMind Security Classifier},
3 author = {OpenA2A},
4 url = {https://github.com/opena2a-org/nanomind},
5 version = {0.5.0},
6 year = {2026}
7}
Links
NanoMind GitHub -- Model code, specifications, documentation