TestMaskEval scores 38 made-up texts of the kinds agents send (prose, code, logs, tool results, JSON, CSV, Chinese) with 34 values to mask and 40 to keep. The cases start from what users reported masked wrongly (#3144, #3143, #3029, #3538, #3577,d3db461bb,611b9e173, #1977) and add the values masking is for. It logs, by kind, how many each way masked of those to mask and, wrongly, of those to keep: the rules alone, the local model as it said it, and both with the checks on what the model found, and lists every value one way got wrong. What the real model said is recorded in testdata/eval-model.json, so the test replays "both" with no model and no network, and fails when a value comes out wrong, or a Known one right. MAGPIE_EVAL_CACHE points it at a downloaded model to record again. Baseline (privacy-filter q8, M4 Pro): rules 16/34 masked, 0/40 wrongly model 32/34 masked, 8/40 wrongly both 30/34 masked, 0/40 wrongly The checks take all 8 of the model's wrong ones off. Of the 4 misses, 3 are phones the model found with the delimiter before them (`":"+86 …`, `,+81 …`), which the PHONE check turns down (#3591), and 1 is 刘洋, which the model doesn't find (#3592). Both are Known. Run: MAGPIE_EVAL_CACHE=$HOME/.cache go test -run TestMaskEval -v ./internal/redact against the installed model (recorded); go test ./internal/redact ./internal/pii ok; go vet for darwin, linux, windows; gofmt -l clean. internal/proc's TestNoCommandBypassesProc is red, on origin/main too: internal/tui/keep.go (#3567). Broken by hand: modelFits off: 4 keeps masked and the 3 #3591 phones reported right, red. A case's text changed: red, the recording is stale. Taking snakeWord, epochNumber or madeID's SECRET check off alone stays green: the model makes neither mistake on these texts, or a second check catches it. Not tried: the model on Linux or Windows, or on the CPU.
404 lines
5.6 KiB
JSON
404 lines
5.6 KiB
JSON
{
|
|
"asset-files": {
|
|
"text": "8b019ca5e2af716b",
|
|
"found": []
|
|
},
|
|
"assistant-names": {
|
|
"text": "6f312259162fb240",
|
|
"found": []
|
|
},
|
|
"bearer": {
|
|
"text": "708d72f298141a4c",
|
|
"found": [
|
|
{
|
|
"Start": 31,
|
|
"End": 148,
|
|
"Label": "secret"
|
|
},
|
|
{
|
|
"Start": 150,
|
|
"End": 180,
|
|
"Label": "private_url"
|
|
}
|
|
]
|
|
},
|
|
"card": {
|
|
"text": "7387f43ca5ce5824",
|
|
"found": []
|
|
},
|
|
"code-keys": {
|
|
"text": "d5f835bbf0a332b8",
|
|
"found": [
|
|
{
|
|
"Start": 12,
|
|
"End": 50,
|
|
"Label": "secret"
|
|
},
|
|
{
|
|
"Start": 67,
|
|
"End": 108,
|
|
"Label": "secret"
|
|
},
|
|
{
|
|
"Start": 135,
|
|
"End": 175,
|
|
"Label": "secret"
|
|
}
|
|
]
|
|
},
|
|
"code-locations": {
|
|
"text": "ebbde1d7b5199206",
|
|
"found": []
|
|
},
|
|
"colors-ports": {
|
|
"text": "252b9ce2e8df3e82",
|
|
"found": [
|
|
{
|
|
"Start": 14,
|
|
"End": 21,
|
|
"Label": "secret"
|
|
}
|
|
]
|
|
},
|
|
"digests": {
|
|
"text": "3b3e688a54f12e96",
|
|
"found": [
|
|
{
|
|
"Start": 8,
|
|
"End": 72,
|
|
"Label": "secret"
|
|
}
|
|
]
|
|
},
|
|
"env-file": {
|
|
"text": "c1f1a7ab84f78373",
|
|
"found": [
|
|
{
|
|
"Start": 15,
|
|
"End": 63,
|
|
"Label": "secret"
|
|
},
|
|
{
|
|
"Start": 76,
|
|
"End": 90,
|
|
"Label": "secret"
|
|
}
|
|
]
|
|
},
|
|
"example-mail": {
|
|
"text": "a1867625846dc315",
|
|
"found": [
|
|
{
|
|
"Start": 14,
|
|
"End": 30,
|
|
"Label": "private_email"
|
|
}
|
|
]
|
|
},
|
|
"git-author": {
|
|
"text": "94a966005e2adee1",
|
|
"found": [
|
|
{
|
|
"Start": 23,
|
|
"End": 33,
|
|
"Label": "private_person"
|
|
},
|
|
{
|
|
"Start": 35,
|
|
"End": 55,
|
|
"Label": "private_email"
|
|
}
|
|
]
|
|
},
|
|
"git-user-url": {
|
|
"text": "b92e10fa6b923a00",
|
|
"found": [
|
|
{
|
|
"Start": 10,
|
|
"End": 55,
|
|
"Label": "private_url"
|
|
}
|
|
]
|
|
},
|
|
"grep-pattern": {
|
|
"text": "0d38dbff0a086bdf",
|
|
"found": []
|
|
},
|
|
"home-path": {
|
|
"text": "4f79a2f3631db506",
|
|
"found": [
|
|
{
|
|
"Start": 4,
|
|
"End": 40,
|
|
"Label": "private_url"
|
|
}
|
|
]
|
|
},
|
|
"iban": {
|
|
"text": "cf32ccaec3a1dfc1",
|
|
"found": [
|
|
{
|
|
"Start": 24,
|
|
"End": 51,
|
|
"Label": "account_number"
|
|
}
|
|
]
|
|
},
|
|
"json-contact": {
|
|
"text": "8b8300472a287a74",
|
|
"found": [
|
|
{
|
|
"Start": 21,
|
|
"End": 30,
|
|
"Label": "private_person"
|
|
},
|
|
{
|
|
"Start": 41,
|
|
"End": 62,
|
|
"Label": "private_email"
|
|
},
|
|
{
|
|
"Start": 70,
|
|
"End": 90,
|
|
"Label": "private_phone"
|
|
}
|
|
]
|
|
},
|
|
"log-user": {
|
|
"text": "cda01fa1bd419b1d",
|
|
"found": [
|
|
{
|
|
"Start": 0,
|
|
"End": 19,
|
|
"Label": "private_date"
|
|
},
|
|
{
|
|
"Start": 35,
|
|
"End": 52,
|
|
"Label": "private_email"
|
|
},
|
|
{
|
|
"Start": 68,
|
|
"End": 76,
|
|
"Label": "private_url"
|
|
}
|
|
]
|
|
},
|
|
"noreply": {
|
|
"text": "271c7650b6474a19",
|
|
"found": []
|
|
},
|
|
"phone-intl": {
|
|
"text": "28bf596367da1b2b",
|
|
"found": [
|
|
{
|
|
"Start": 36,
|
|
"End": 39,
|
|
"Label": "private_person"
|
|
},
|
|
{
|
|
"Start": 43,
|
|
"End": 58,
|
|
"Label": "private_phone"
|
|
}
|
|
]
|
|
},
|
|
"prose-password": {
|
|
"text": "b45e2539ee55a672",
|
|
"found": [
|
|
{
|
|
"Start": 27,
|
|
"End": 38,
|
|
"Label": "secret"
|
|
}
|
|
]
|
|
},
|
|
"prose-person": {
|
|
"text": "7090b229a3288b42",
|
|
"found": [
|
|
{
|
|
"Start": 13,
|
|
"End": 27,
|
|
"Label": "private_person"
|
|
}
|
|
]
|
|
},
|
|
"retina-file": {
|
|
"text": "6210ece83f6b71ab",
|
|
"found": []
|
|
},
|
|
"session-uuid": {
|
|
"text": "45ff8afdbe77e369",
|
|
"found": [
|
|
{
|
|
"Start": 39,
|
|
"End": 81,
|
|
"Label": "secret"
|
|
}
|
|
]
|
|
},
|
|
"sizes-versions": {
|
|
"text": "e08a850f552a995b",
|
|
"found": []
|
|
},
|
|
"snake-arg": {
|
|
"text": "7ade5b7b89a61dd4",
|
|
"found": []
|
|
},
|
|
"snake-words": {
|
|
"text": "89fcc6da0d4cc9fb",
|
|
"found": []
|
|
},
|
|
"token-count": {
|
|
"text": "359c740b1ce9a3c5",
|
|
"found": [
|
|
{
|
|
"Start": 31,
|
|
"End": 39,
|
|
"Label": "account_number"
|
|
}
|
|
]
|
|
},
|
|
"tool-ids": {
|
|
"text": "50c8c97e610d704c",
|
|
"found": [
|
|
{
|
|
"Start": 37,
|
|
"End": 67,
|
|
"Label": "account_number"
|
|
},
|
|
{
|
|
"Start": 93,
|
|
"End": 121,
|
|
"Label": "account_number"
|
|
}
|
|
]
|
|
},
|
|
"tool-result-mixed": {
|
|
"text": "f5a49344e0e7f392",
|
|
"found": [
|
|
{
|
|
"Start": 36,
|
|
"End": 50,
|
|
"Label": "private_person"
|
|
},
|
|
{
|
|
"Start": 50,
|
|
"End": 70,
|
|
"Label": "private_email"
|
|
},
|
|
{
|
|
"Start": 70,
|
|
"End": 87,
|
|
"Label": "private_phone"
|
|
},
|
|
{
|
|
"Start": 88,
|
|
"End": 99,
|
|
"Label": "private_person"
|
|
},
|
|
{
|
|
"Start": 100,
|
|
"End": 121,
|
|
"Label": "private_email"
|
|
},
|
|
{
|
|
"Start": 121,
|
|
"End": 137,
|
|
"Label": "private_phone"
|
|
}
|
|
]
|
|
},
|
|
"tool-servers": {
|
|
"text": "6b9515c4bf396f51",
|
|
"found": []
|
|
},
|
|
"unix-time": {
|
|
"text": "3e3d22cf38729962",
|
|
"found": []
|
|
},
|
|
"unix-time-ms": {
|
|
"text": "7e29836c6aa4f105",
|
|
"found": []
|
|
},
|
|
"url-userinfo": {
|
|
"text": "a74a01c8225d54da",
|
|
"found": [
|
|
{
|
|
"Start": 27,
|
|
"End": 55,
|
|
"Label": "secret"
|
|
}
|
|
]
|
|
},
|
|
"us-address": {
|
|
"text": "d73e7386a905373e",
|
|
"found": [
|
|
{
|
|
"Start": 24,
|
|
"End": 68,
|
|
"Label": "private_address"
|
|
},
|
|
{
|
|
"Start": 78,
|
|
"End": 92,
|
|
"Label": "private_phone"
|
|
}
|
|
]
|
|
},
|
|
"zh-contact": {
|
|
"text": "5d654b2bbdd23aa1",
|
|
"found": [
|
|
{
|
|
"Start": 12,
|
|
"End": 18,
|
|
"Label": "private_person"
|
|
},
|
|
{
|
|
"Start": 28,
|
|
"End": 39,
|
|
"Label": "private_phone"
|
|
},
|
|
{
|
|
"Start": 51,
|
|
"End": 93,
|
|
"Label": "private_address"
|
|
}
|
|
]
|
|
},
|
|
"zh-id": {
|
|
"text": "f058f91bb1800cbe",
|
|
"found": [
|
|
{
|
|
"Start": 13,
|
|
"End": 31,
|
|
"Label": "account_number"
|
|
}
|
|
]
|
|
},
|
|
"zh-password": {
|
|
"text": "ca3835176b202e40",
|
|
"found": [
|
|
{
|
|
"Start": 19,
|
|
"End": 29,
|
|
"Label": "secret"
|
|
}
|
|
]
|
|
},
|
|
"zh-prose": {
|
|
"text": "c75e8925f3dddfc7",
|
|
"found": [
|
|
{
|
|
"Start": 0,
|
|
"End": 15,
|
|
"Label": "private_person"
|
|
}
|
|
]
|
|
},
|
|
"zh-words": {
|
|
"text": "dfccf70c683fe55b",
|
|
"found": []
|
|
}
|
|
}
|