Skip to content

Commit 35af511

Browse files
authored
docs: replaced remaining Guard.with_tiny() references with Guard(mode… (UnplugAI#130)
* docs: replaced remaining Guard.with_tiny() references with Guard(model='tiny') Closes UnplugAI#118 Note: the issue cited README.md:60, but the root README had three total with_tiny references (quickstart, 'What ships today' table, and the benchmark paragraph). Updated all three for consistency within the file. MIGRATION.md and the deprecation test left untouched as instructed. * fix: fail loudly on ML load failure * dropped require_ml as per review * fix: removed leftover conflict marker and duplicate paragraph * chore: re-trigger Greptile on current clean head
1 parent 2a63265 commit 35af511

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ print(result.findings) # evidence with span offsets
5858
One line upgrades detection to the ML span model (downloads [unplug-tiny-v1](https://huggingface.co/Unplug-AI/unplug-tiny-v1) once, cached):
5959

6060
```python
61-
guard = Guard.with_tiny()
61+
guard = Guard(model="tiny", auto_download_model=True)
6262
```
6363

6464
Try it without installing anything: [live demo](https://huggingface.co/spaces/Unplug-AI/unplug-tiny-demo).
@@ -71,17 +71,19 @@ Try it without installing anything: [live demo](https://huggingface.co/spaces/Un
7171
| TaintedText provenance + session taint | **Included** |
7272
| Tool-call enforcement (destructive block, tainted review) | **Included** |
7373
| Span-level redaction | **Included** |
74-
| ML span model `Guard.with_tiny()` | **Preview** ([unplug-tiny-v1](https://huggingface.co/Unplug-AI/unplug-tiny-v1)) |
74+
| ML span model `Guard(model="tiny")` | **Preview** ([unplug-tiny-v1](https://huggingface.co/Unplug-AI/unplug-tiny-v1)) |
7575
| Sliding-window long documents + streaming scan | **Included** |
7676

77-
On the neuralchemy prompt-injection set, regex-only detection reaches **F1 0.58 / recall 0.41** — a fast first line, not sufficient alone. Adding the ML span model (`Guard.with_tiny()`) takes that to **F1 0.99 / recall 0.98**, and lifts recall on *indirect* injection from **0.05 → 0.91**. False-positive rate stays under 1% on the injection set (2.1% on a separate hard-benign corpus). Full tables, methodology, and honest caveats: [`sdk/docs/BENCHMARKS.md`](sdk/docs/BENCHMARKS.md). Per-axis model metrics (including failure modes) are on the [model card](https://huggingface.co/Unplug-AI/unplug-tiny-v1).
77+
78+
On the neuralchemy prompt-injection set, regex-only detection reaches **F1 0.58 / recall 0.41** — a fast first line, not sufficient alone. Adding the ML span model (`Guard(model="tiny")`) takes that to **F1 0.99 / recall 0.98**, and lifts recall on *indirect* injection from **0.05 → 0.91**. False-positive rate stays under 1% on the injection set (2.1% on a separate hard-benign corpus). Full tables, methodology, and honest caveats: [`sdk/docs/BENCHMARKS.md`](sdk/docs/BENCHMARKS.md). Per-axis model metrics (including failure modes) are on the [model card](https://huggingface.co/Unplug-AI/unplug-tiny-v1).
7879

7980
**Language support.** Regex + normalization detection is tuned for English today.
8081
Ordinary non-English input (Cyrillic, CJK, etc.) is *not* treated as an evasion
8182
signal — only genuine zero-width/bidi control characters and mixed-script
8283
homoglyph smuggling are flagged. Robust multi-language injection detection is
8384
tracked as a separate work item.
8485

86+
8587
## Agent host checklist
8688

8789
1. Scan user input: `guard.scan(text, source="user")`

‎sdk/benchmarks/run.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def main() -> None:
3131
parser.add_argument(
3232
"--ml",
3333
action="store_true",
34-
help="Use Guard.with_tiny() (ML second-pass) instead of regex-only",
34+
help="Use Guard(model='tiny') (ML second-pass) instead of regex-only",
3535
)
3636
parser.add_argument(
3737
"--isolated",

‎sdk/scripts/smoke_ml_hooks.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""Offline smoke: synthetic ML checkpoint + Guard + one hooks adapter.
33
44
No Hugging Face download and no agent-framework install required. Builds a tiny
5-
random BIOES checkpoint, wires Guard.with_tiny against it, then exercises the
5+
random BIOES checkpoint, wires Guard(model="tiny") against it, then exercises the
66
LangGraph-style AgentHooks adapters (same surface as examples/langgraph_hooks_demo.py).
77
"""
88

0 commit comments

Comments
 (0)