Changelog
Every release of @stackone/defender and stackone-defender, generated from the package's GitHub releases and checked against both registries, so it cannot drift from what shipped. The two track each other by version number; a release shows the registries it reached.
v0.8.2
latestTSPYIncludes 0.8.0 and 0.8.1, which were tagged but never published.
Two changes to know about before you upgrade. Sanitization is sentence level now: Defender drops the highest-scoring sentences inside high-risk fields and leaves a marker, and cleaning is best effort, so keep gating on `allowed` rather than assuming the returned content is safe. And `riskLevel` is diagnostic, starting at low and only escalating, so read `allowed` as the verdict. Also here: `detectedFieldCount` as the threat count, per stage timings, and `requireTier2` to fail closed.
New
- detect-and-gate + review hardening (v0.8.0) #85
Previous releases
v0.7.4TSPYFixedlength-bucket Tier 2 batches to cut padding cost #82
Tier 2 scores every string in a tool result, and on list-shaped responses (many short fields with the occasional long one) most of that work was spent on padding rather than content. Strings are now grouped into fixed-width length buckets before batching, which is faster on exactly those responses. It also makes a string's score depend only on the string itself rather than on whichever other strings happened to share its batch, so verdicts near a threshold no longer shift between payloads.
v0.7.3TSPYFixedlet Tier 3 decide on score, not the model's word #74
Tier 3's verdict text is the model's own top pick, which is an implicit even split that nobody chose. Setting the new tier3.blockThreshold makes the defender decide on the score instead, so you can put the operating point where your risk tolerance actually is. It is opt-in: left unset, behaviour is identical to before, because a score's direction is not guaranteed across providers and blind thresholding could otherwise invert a decision.
v0.7.2TSPYFixedtier3: add optional usage field to Tier3Verdict #71
Tier 3 providers can now report token counts on the verdict, so callers can attribute spend per request instead of digging through a raw response. The field is optional and additive, so providers that ignore it keep working unchanged.
v0.7.1TSPYFixedadd Tier 3 provider interface + cascade orchestration #67
Adds the optional Tier 3 review layer. The package ships the provider interface and the orchestration only, so the model endpoint stays in your code rather than being baked in. Two modes: cascade, which escalates to Tier 3 only when Tier 2 lands in an uncertain band, and a Tier 3 only mode. Both default off, and a provider error records a reason on the result rather than failing the call.
v0.7.0TSPYNewmulti-head ONNX + temperature scaling + API contract fixes (v0.7) #63Fixedadd obfuscation normalisation chain to Tier 1 detection #39
The bundled Tier 2 classifier gains a second head and ships its own calibration alongside it, so you get well-behaved probabilities without tuning thresholds yourself. Also fixes a reporting inconsistency: tier2Score now reports the score that actually drove the decision, with the unadjusted value kept on tier2RawScore for debugging. The result is that tier2Score, riskLevel and allowed always tell one coherent story.
v0.6.0TSNewsentence density adjustment to reduce email notification FPs #50Fixedprevent prototype pollution during object traversal #47
Two fixes worth calling out. A single alarming sentence inside otherwise ordinary text, the kind of line a legitimate security-alert email contains, no longer dominates the score for the whole result. And Tier 2 now scans every string in a tool result rather than only the fields Tier 1 flagged, which closes a gap: fields outside Tier 1's rules were still visible to the model, so skipping them left a path through. Object traversal also refuses prototype-polluting keys and records any it drops.
Earlier releases
- v0.6.3TSPYmake boundary annotation opt-in (annotateBoundary flag)
- v0.6.2TSPYstrip boundary markers from input before classification
- v0.6.1TSv4 ONNX model + cumulative risk fixes + opt-in SFE preprocessor
- v0.5.8TSchunk batch classification to bound ONNX memory usage
- v0.5.7TSremove per-tool sanitization rules
- v0.5.6TSprevent unhandled rejection cascade on ONNX load failure
- v0.5.5TSfix field filter and batch sentence classification
- v0.5.4TScache ONNX session at module level to eliminate per-request
- v0.5.3TSupdate inline docs to match implementation, scope Tier 2 to Tier 1 risky fields by default
- v0.5.2TSuse absolute URLs for README images to fix npm display
- v0.5.1TSupgrade ML classifier to jbv2 (AgentShield 73.7 → 79.8)
- v0.5.0TSupgrade ML classifier to jbv5 (AgentShield 73.7 → 81.1); remove legacy MLP inference mode
- v0.4.5TSdowngrade nanoid to 3.3.11 to fix CJS compatibility
- v0.4.4TSexport ToolSanitizationRule and add tier2Fields option
- v0.4.3TSsync toolRules passthrough fix and test updates from connect
- v0.4.2TSdocument useDefaultToolRules and add ATS/CRM tool rules; document useDefaultToolRules and add ATS/CRM tool rules
- v0.4.1TSfix tsconfig extending missing monorepo base and add biome linter config; fix tsconfig extending missing monorepo base and add biome linter config
- v0.4.0TSadd biome configuration file and fix code formatting; initial release of @stackone/injection-guard v0.1.0; v0.2.0, ONNX-based Tier 2 classifier, API improvements