@aimarket/warden 0.22.0 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/README-es.md +23 -7
- package/README-fr.md +23 -7
- package/README-ru.md +23 -7
- package/README-zh.md +23 -7
- package/README.md +23 -7
- package/dist/annotation-review.js.map +1 -1
- package/dist/answer-gate.d.ts +94 -0
- package/dist/answer-gate.d.ts.map +1 -0
- package/dist/answer-gate.js +234 -0
- package/dist/answer-gate.js.map +1 -0
- package/dist/atomic-screen.d.ts.map +1 -1
- package/dist/classifier.d.ts +2 -2
- package/dist/classifier.d.ts.map +1 -1
- package/dist/claude-hook.js.map +1 -1
- package/dist/declare.d.ts.map +1 -1
- package/dist/declare.js.map +1 -1
- package/dist/flow-guard-answer.d.ts +3 -2
- package/dist/flow-guard-answer.d.ts.map +1 -1
- package/dist/flow-guard-answer.js +38 -11
- package/dist/flow-guard-answer.js.map +1 -1
- package/dist/flow-guard-classify.js.map +1 -1
- package/dist/flow-guard-constraints.d.ts +43 -0
- package/dist/flow-guard-constraints.d.ts.map +1 -0
- package/dist/flow-guard-constraints.js +69 -0
- package/dist/flow-guard-constraints.js.map +1 -0
- package/dist/flow-guard-fragments.d.ts.map +1 -1
- package/dist/flow-guard-labels.js.map +1 -1
- package/dist/flow-guard-leak.js.map +1 -1
- package/dist/flow-guard-paths.d.ts.map +1 -1
- package/dist/flow-guard-paths.js.map +1 -1
- package/dist/flow-guard-policy.js.map +1 -1
- package/dist/flow-guard-post.js.map +1 -1
- package/dist/flow-guard-pre.js.map +1 -1
- package/dist/flow-guard-screen.d.ts.map +1 -1
- package/dist/flow-guard-screen.js.map +1 -1
- package/dist/flow-guard-state.d.ts.map +1 -1
- package/dist/flow-guard-state.js +8 -0
- package/dist/flow-guard-state.js.map +1 -1
- package/dist/flow-guard-text.js.map +1 -1
- package/dist/flow-guard-types.d.ts +8 -0
- package/dist/flow-guard-types.d.ts.map +1 -1
- package/dist/flow-guard.d.ts +2 -0
- package/dist/flow-guard.d.ts.map +1 -1
- package/dist/flow-guard.js +1 -0
- package/dist/flow-guard.js.map +1 -1
- package/dist/histor.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/jcs.d.ts.map +1 -1
- package/dist/jcs.js.map +1 -1
- package/dist/mcp-client.d.ts.map +1 -1
- package/dist/mcp-client.js.map +1 -1
- package/dist/mcp-rpc.js.map +1 -1
- package/dist/mcp-tools.d.ts.map +1 -1
- package/dist/mcp-tools.js +3 -0
- package/dist/mcp-tools.js.map +1 -1
- package/dist/mtl.d.ts +1 -1
- package/dist/mtl.d.ts.map +1 -1
- package/dist/mtl.js.map +1 -1
- package/dist/origin.d.ts.map +1 -1
- package/dist/pin-store.d.ts.map +1 -1
- package/dist/pin-store.js.map +1 -1
- package/dist/pinning.d.ts.map +1 -1
- package/dist/pinning.js.map +1 -1
- package/dist/review-diff.js.map +1 -1
- package/dist/sandbox.d.ts.map +1 -1
- package/dist/sanitize.js.map +1 -1
- package/dist/scan-lock.d.ts.map +1 -1
- package/dist/scan-lock.js.map +1 -1
- package/dist/scan.d.ts.map +1 -1
- package/dist/scan.js.map +1 -1
- package/dist/static-scan.d.ts.map +1 -1
- package/dist/static-scan.js.map +1 -1
- package/dist/task-adapter.d.ts.map +1 -1
- package/dist/task-adapter.js.map +1 -1
- package/dist/threat-feed.d.ts.map +1 -1
- package/dist/threat-feed.js.map +1 -1
- package/dist/tool-list.js.map +1 -1
- package/dist/toxic-flow.js.map +1 -1
- package/dist/wrap-cli.d.ts +1 -1
- package/dist/wrap-cli.d.ts.map +1 -1
- package/dist/wrap-cli.js.map +1 -1
- package/dist/wrap-screen.js.map +1 -1
- package/dist/wrap-wire.d.ts.map +1 -1
- package/dist/wrap-wire.js.map +1 -1
- package/docs/flow-guard-answer-gate.es.md +53 -0
- package/docs/flow-guard-answer-gate.fr.md +53 -0
- package/docs/flow-guard-answer-gate.md +86 -0
- package/docs/flow-guard-answer-gate.ru.md +53 -0
- package/docs/flow-guard-answer-gate.zh.md +53 -0
- package/docs/flow-guard-constraint-evidence.es.md +76 -0
- package/docs/flow-guard-constraint-evidence.fr.md +76 -0
- package/docs/flow-guard-constraint-evidence.md +78 -0
- package/docs/flow-guard-constraint-evidence.ru.md +78 -0
- package/docs/flow-guard-constraint-evidence.zh.md +76 -0
- package/docs/flow-guard-final-witness-2026-10-26.es.md +24 -0
- package/docs/flow-guard-final-witness-2026-10-26.fr.md +24 -0
- package/docs/flow-guard-final-witness-2026-10-26.md +24 -0
- package/docs/flow-guard-final-witness-2026-10-26.ru.md +24 -0
- package/docs/flow-guard-final-witness-2026-10-26.zh.md +24 -0
- package/docs/flow-guard-fresh-rechecks-2026-10-26.es.md +39 -0
- package/docs/flow-guard-fresh-rechecks-2026-10-26.fr.md +39 -0
- package/docs/flow-guard-fresh-rechecks-2026-10-26.md +39 -0
- package/docs/flow-guard-fresh-rechecks-2026-10-26.ru.md +39 -0
- package/docs/flow-guard-fresh-rechecks-2026-10-26.zh.md +39 -0
- package/docs/flow-guard-model-comparison-2026-10-25.es.md +27 -0
- package/docs/flow-guard-model-comparison-2026-10-25.fr.md +27 -0
- package/docs/flow-guard-model-comparison-2026-10-25.md +27 -0
- package/docs/flow-guard-model-comparison-2026-10-25.ru.md +27 -0
- package/docs/flow-guard-model-comparison-2026-10-25.zh.md +27 -0
- package/docs/flow-guard-prospective-holdout-2026-10-26.es.md +30 -0
- package/docs/flow-guard-prospective-holdout-2026-10-26.fr.md +30 -0
- package/docs/flow-guard-prospective-holdout-2026-10-26.md +44 -0
- package/docs/flow-guard-prospective-holdout-2026-10-26.ru.md +44 -0
- package/docs/flow-guard-prospective-holdout-2026-10-26.zh.md +30 -0
- package/docs/flow-guard-reference-egress.es.md +25 -0
- package/docs/flow-guard-reference-egress.fr.md +25 -0
- package/docs/flow-guard-reference-egress.md +26 -0
- package/docs/flow-guard-reference-egress.ru.md +26 -0
- package/docs/flow-guard-reference-egress.zh.md +25 -0
- package/docs/flow-guard-review-factors-2026-10-26.es.md +41 -0
- package/docs/flow-guard-review-factors-2026-10-26.fr.md +41 -0
- package/docs/flow-guard-review-factors-2026-10-26.md +45 -0
- package/docs/flow-guard-review-factors-2026-10-26.ru.md +45 -0
- package/docs/flow-guard-review-factors-2026-10-26.zh.md +41 -0
- package/docs/flow-guard-structured-model-2026-10-26.es.md +35 -0
- package/docs/flow-guard-structured-model-2026-10-26.fr.md +35 -0
- package/docs/flow-guard-structured-model-2026-10-26.md +44 -0
- package/docs/flow-guard-structured-model-2026-10-26.ru.md +46 -0
- package/docs/flow-guard-structured-model-2026-10-26.zh.md +35 -0
- package/docs/flow-guard.es.md +25 -1
- package/docs/flow-guard.fr.md +25 -1
- package/docs/flow-guard.md +25 -1
- package/docs/flow-guard.ru.md +25 -1
- package/docs/flow-guard.zh.md +25 -1
- package/examples/answer-gate-host.mjs +33 -0
- package/package.json +5 -4
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Test réel du modèle avec réponses structurées
|
|
2
|
+
|
|
3
|
+
[en](flow-guard-structured-model-2026-10-26.md) · [ru](flow-guard-structured-model-2026-10-26.ru.md) · [es](flow-guard-structured-model-2026-10-26.es.md) · [fr](flow-guard-structured-model-2026-10-26.fr.md) · [zh](flow-guard-structured-model-2026-10-26.zh.md)
|
|
4
|
+
|
|
5
|
+
26 octobre 2026. WARDEN local **0.22.0**, runtime inchangé, non publié sur npm. Suite du [gate de l’application](flow-guard-answer-gate.fr.md) et de [l’étude à quatre conditions](flow-guard-review-factors-2026-10-26.fr.md).
|
|
6
|
+
|
|
7
|
+
## Protocole et résultats
|
|
8
|
+
|
|
9
|
+
160 nouveaux appels `deepseek-flash` sur Linux factory-vps : température .3, thinking désactivé, JSON object mode, maximum 700 tokens de sortie. Le véritable SDK contrôle toutes les règles, l’ensemble complet des admissibles et le prix minimal. Aucune proposition n’est modifiée silencieusement pour la faire passer.
|
|
10
|
+
|
|
11
|
+
Douze conversations enregistrées conservent l’instruction externe et l’ancienne réponse en prose. Une nouvelle demande exige son remplacement complet par le catalogue normalisé et quatre champs. Huit répétitions par contexte donnent **96/96 premières propositions valides**, dont **32/32** issues des quatre contextes auparavant contradictoires. Les huit autres contextes avaient des explications étayées. Il n’y a donc aucune occasion naturelle de réparation.
|
|
12
|
+
|
|
13
|
+
Séparément, l’expérimentateur introduit de fausses listes : ensemble réellement admissible plus C (190 > 150) ou D (2.5 > 1). Ce sont des **erreurs initiales synthétiques**, pas de nouveaux échecs spontanés du modèle. Quatre contextes et huit répétitions par type donnent **32/32 C et 32/32 D corrigés au premier appel réel de réparation**. La graine consomme la proposition initiale du SDK ; au plus deux réparations restent. Cette population ne se mélange pas à l’exactitude des premières propositions naturelles.
|
|
14
|
+
|
|
15
|
+
Aucune des 160 propositions nouvelles n’admet C/D, de clés JSON doubles, de format invalide ou de champs supplémentaires. **160 résultats validés et 160 avis de l’application** sont capturés, sans candidat non vérifié ni erreur API. Aucune substitution C→D ni tentative écartée. Les deux prédictions figées sont atteintes : >=80/96 naturel, >=48/64 contrôlé.
|
|
16
|
+
|
|
17
|
+
**Aucun cas n’a nécessité une deuxième réparation ou une retenue.** Leurs taux avec modèle réel ne sont donc pas mesurés ; les tests déterministes/stdio antérieurs vérifient leur mécanisme. Chaque trajectoire a utilisé un seul appel réel.
|
|
18
|
+
|
|
19
|
+
L’accumulation de l’ancienne affirmation fausse n’apparaît pas sur la surface structurée mesurée. Le schéma contient une seule liste d’admissibles, sans prose, prix ou exclusion rédigés par le modèle. Contrat, catalogue et instruction ont changé ensemble : pas de témoin prose contemporain, d’effet causal isolé du format ni de jeu indépendant. Douze contextes connus répétés ne prouvent ni fiabilité générale ni résistance universelle aux injections.
|
|
20
|
+
|
|
21
|
+
## Audit, coût et limites
|
|
22
|
+
|
|
23
|
+
Les valeurs finales sont recalculées sur les faits d’origine, sans appeler le validateur runtime. Le frame capturé est la frontière mesurée ; le rendu dans une GUI native tierce reste non testé. Véracité de la source, explications libres, autorisation de paiements/actions et influence cachée entre ex æquo restent hors portée.
|
|
24
|
+
|
|
25
|
+
Avant API : **9 tests Node + 28 tests relay/budget/collecte**, et 480 prévalidations de requêtes, sous Linux. Le conteneur n’a ni réseau ni clé ; seul le relay local accède au point officiel. Tous les échanges sont conservés ; **333 empreintes** vérifiées avant suppression du dossier temporaire. Aucun nouvel essai automatique ou répétition de l’étude. Aucun correctif runtime nécessaire.
|
|
26
|
+
|
|
27
|
+
Tous les appels sont hors pointe. Usage : 211 200 tokens d’entrée, dont 103 936 en cache ; 17 946 en sortie. Selon le [tarif publié](https://api-docs.deepseek.com/quick_start/pricing/), **USD 0.027169008** ; comptabilité prudente aux prix de pointe **USD 0.054338016**, sous le plafond **USD 0.15**. Facture et variation du solde non consultées ; serveur existant utilisé.
|
|
28
|
+
|
|
29
|
+
Préparation/audit assistés par IA et non aveugles ; aucune revue humaine indépendante revendiquée. Aucune publication GitHub/npm ni réponse envoyée.
|
|
30
|
+
|
|
31
|
+
[analysis.json](data/launchgate-structured-model-2026-10-26/analysis.json) · [protocol.md](data/launchgate-structured-model-2026-10-26/protocol.md) · [execution.json](data/launchgate-structured-model-2026-10-26/execution.json) · [output-audit.json](data/launchgate-structured-model-2026-10-26/output-audit.json) · [trajectories.jsonl](data/launchgate-structured-model-2026-10-26/trajectories.jsonl) · [manifest.json](data/launchgate-structured-model-2026-10-26/manifest.json)
|
|
32
|
+
|
|
33
|
+
<!-- prospective-holdout-followup -->
|
|
34
|
+
|
|
35
|
+
[Nouveaux cas après gel](flow-guard-prospective-holdout-2026-10-26.fr.md) : premières naturelles valides 89/96, cinq erreurs sur sept réparées, deux retenues ; contrôlées 45/48. Constats ultérieurs de classement/ensemble incomplet vérifiés hors ligne, sans nouveau modèle.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Live model test of the structured answer boundary
|
|
2
|
+
|
|
3
|
+
[en](flow-guard-structured-model-2026-10-26.md) · [ru](flow-guard-structured-model-2026-10-26.ru.md) · [es](flow-guard-structured-model-2026-10-26.es.md) · [fr](flow-guard-structured-model-2026-10-26.fr.md) · [zh](flow-guard-structured-model-2026-10-26.zh.md)
|
|
4
|
+
|
|
5
|
+
26 October 2026. Unchanged local WARDEN **0.22.0**, not published to npm. Follow-up to the [host-owned answer gate](flow-guard-answer-gate.md) and [four-condition prose study](flow-guard-review-factors-2026-10-26.md).
|
|
6
|
+
|
|
7
|
+
## What was run
|
|
8
|
+
|
|
9
|
+
160 fresh `deepseek-flash` calls on Linux factory-vps, temperature .3, thinking disabled, JSON object mode, maximum 700 output tokens. The actual frozen `createAnswerGate` build validated each proposal against every rule, the complete eligible set and minimum-price ranking. No model proposal was silently edited into a passing answer.
|
|
10
|
+
|
|
11
|
+
The twelve saved contexts retain their original tool conversation, untrusted source instruction and original prose answer. A new user request asks for complete replacement using a normalized catalog and the four-field structured contract. Eight repetitions per context give 96 natural transitions. Four contexts originally had contradicted explanations; eight were supported. This output contract/catalog/instruction bundle is a changed task, not a format-only ablation.
|
|
12
|
+
|
|
13
|
+
Separately, for the four contradicted contexts, we deliberately seeded the true eligible set plus either C (190 > 150 price cap) or D (2.5 > 1 distance bound), with eight repetitions per case/type. These **64 synthetic initial errors** are not spontaneous new model failures. They consume the initial SDK proposal; at most two fresh repairs remain. Natural trajectories permit an initial fresh proposal and at most two repairs. The two populations are never pooled into one correction rate.
|
|
14
|
+
|
|
15
|
+
## Results
|
|
16
|
+
|
|
17
|
+
| Population | Result |
|
|
18
|
+
|---|---|
|
|
19
|
+
| Natural transitions | **96/96 valid first proposals**; no natural repair opportunities |
|
|
20
|
+
| Four formerly contradicted contexts | **32/32 valid first proposals**, included in the 96 |
|
|
21
|
+
| Controlled C seeds | **32/32 corrected after one fresh repair** |
|
|
22
|
+
| Controlled D seeds | **32/32 corrected after one fresh repair** |
|
|
23
|
+
| Fresh proposals admitting C/D, malformed/duplicate JSON or extra fields | **0/160** |
|
|
24
|
+
| Final captured host frames | **160 checked results, 160 notices, zero unverified candidates** |
|
|
25
|
+
|
|
26
|
+
Both frozen predictions were met: >=80/96 natural first-valid and >=48/64 controlled final-valid. Every trajectory used one actual API call. No API errors, C→D substitutions or discarded attempts occurred. **No trajectory needed a second repair or live withholding**, so this experiment cannot estimate those paths' live-model success rates. Their earlier deterministic and actual stdio tests remain the evidence for mechanism behavior.
|
|
27
|
+
|
|
28
|
+
The addendum failure was not observed on this structured surface. The schema has one eligible-list field and no model-authored price, exclusion or reason field. This does not measure arbitrary contradictory prose or prove that the model cannot produce it. The normalized catalog and more explicit instruction changed alongside the schema; no contemporaneous prose control or independent holdout was run. Repetitions share twelve known contexts, so 160/160 is not a general reliability guarantee or proof of broad prompt-injection resistance.
|
|
29
|
+
|
|
30
|
+
## Delivery, audit and cost
|
|
31
|
+
|
|
32
|
+
The host independently supplied its fixed notice and emitted only validated structured selections/attributes. All final values were recalculated against the original fixture by the collected-data audit without invoking the runtime validator. The captured frame is the measured host boundary; rendering in a third-party native GUI remains untested. Source truth, arbitrary explanations, payment/action authorization and hidden tie-preference influence are outside this result.
|
|
33
|
+
|
|
34
|
+
Before calls, 9 Node harness tests and 28 relay/budget/collection tests passed on Linux, plus 480 request preflights. The runner had no network or credential; only the host-local relay reached the fixed official endpoint. All requests/responses were retained and 333 output hashes verified before deleting the owned temporary root. No transport retries or repeated study. No runtime code change was needed.
|
|
35
|
+
|
|
36
|
+
All calls occurred outside peak hours. Provider-reported usage: 211,200 input tokens (103,936 cached), 17,946 output tokens. At the [published tariff](https://api-docs.deepseek.com/quick_start/pricing/), usage cost is **USD 0.027169008**; conservative peak accounting is **USD 0.054338016**, below the **USD 0.15** hard ceiling. No invoice or balance delta was queried. Existing server capacity was used.
|
|
37
|
+
|
|
38
|
+
Preparation and audit were AI-assisted and unblinded; no independent human review is claimed. No GitHub/npm publication or comment posting was performed.
|
|
39
|
+
|
|
40
|
+
[analysis.json](data/launchgate-structured-model-2026-10-26/analysis.json) · [protocol.md](data/launchgate-structured-model-2026-10-26/protocol.md) · [execution.json](data/launchgate-structured-model-2026-10-26/execution.json) · [output-audit.json](data/launchgate-structured-model-2026-10-26/output-audit.json) · [trajectories.jsonl](data/launchgate-structured-model-2026-10-26/trajectories.jsonl) · [manifest.json](data/launchgate-structured-model-2026-10-26/manifest.json)
|
|
41
|
+
|
|
42
|
+
<!-- prospective-holdout-followup -->
|
|
43
|
+
|
|
44
|
+
[Prospective new-fixture results](flow-guard-prospective-holdout-2026-10-26.md): 89/96 natural first proposals valid, five of seven repaired, two withheld; controlled repair 45/48. Separate post-hoc ranking/missing-set facts passed offline checks, without a new model run.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Живой прогон модели через структурированный ответ
|
|
2
|
+
|
|
3
|
+
[en](flow-guard-structured-model-2026-10-26.md) · [ru](flow-guard-structured-model-2026-10-26.ru.md) · [es](flow-guard-structured-model-2026-10-26.es.md) · [fr](flow-guard-structured-model-2026-10-26.fr.md) · [zh](flow-guard-structured-model-2026-10-26.zh.md)
|
|
4
|
+
|
|
5
|
+
26 октября 2026. Прежний локальный WARDEN **0.22.0**, без публикации npm. Продолжение [механизма проверки ответа приложением](flow-guard-answer-gate.ru.md) и [эксперимента с четырьмя формулировками](flow-guard-review-factors-2026-10-26.ru.md).
|
|
6
|
+
|
|
7
|
+
## Как проверяли
|
|
8
|
+
|
|
9
|
+
160 свежих вызовов `deepseek-flash` на Linux factory-vps: temperature .3, thinking выключен, JSON object mode, максимум 700 выходных токенов. Использована та же замороженная сборка `createAnswerGate`. Проверяются все правила, полное множество допустимых записей и минимум цены. Ответы модели не редактировались для получения разрешения.
|
|
10
|
+
|
|
11
|
+
Двенадцать сохранённых контекстов содержат исходный диалог с инструментом, внешнюю инструкцию и прежний текст ответа. Новый запрос пользователя требует полностью заменить ответ четырьмя полями по нормализованному каталогу. По восемь повторов дают 96 естественных переходов на новый контракт: четыре исходных контекста содержали ложные объяснения, восемь — корректные. Вместе меняются контракт, каталог и инструкция; это не изолированный тест формата.
|
|
12
|
+
|
|
13
|
+
Отдельно для четырёх контекстов с прежней ошибкой искусственно задаются неверные начальные списки: правильное множество плюс C (цена 190 > 150) или D (расстояние 2,5 > 1). Восемь повторов каждого типа дают **64 контролируемые начальные ошибки**. Их создал экспериментатор, не модель. Такой список занимает начальную попытку SDK, после которой разрешено максимум два живых исправления. Для естественного перехода начальная попытка тоже живая. Доли этих двух групп не объединяются.
|
|
14
|
+
|
|
15
|
+
## Результат
|
|
16
|
+
|
|
17
|
+
| Группа | Результат |
|
|
18
|
+
|---|---|
|
|
19
|
+
| Естественный переход на новый контракт | **96/96 правильных первых предложений**; поводов для исправления нет |
|
|
20
|
+
| Четыре контекста с прежним ложным объяснением | **32/32 правильных первых предложений**, входят в 96 |
|
|
21
|
+
| Искусственно заданный C | **32/32 исправлены первым живым ответом** |
|
|
22
|
+
| Искусственно заданный D | **32/32 исправлены первым живым ответом** |
|
|
23
|
+
| Свежие ответы с C/D в допустимом списке, неверным/дублированным JSON либо лишними полями | **0/160** |
|
|
24
|
+
| Финальные кадры приложения | **160 проверенных результатов, 160 уведомлений, непроверенных кандидатов нет** |
|
|
25
|
+
|
|
26
|
+
Оба заранее зафиксированных прогноза выполнены: >=80/96 правильных первых естественных ответов и >=48/64 исправленных контролируемых случаев. На каждую траекторию понадобился один реальный вызов API. Ошибок API, замены C→D и отброшенных попыток не было.
|
|
27
|
+
|
|
28
|
+
**Второе исправление и удержание в живом прогоне не понадобились.** Их успешность на живой модели этим запуском не измерена. Прежние детерминированные и stdio-тесты по-прежнему подтверждают только работу соответствующих путей механизма.
|
|
29
|
+
|
|
30
|
+
На измеряемой структурированной поверхности добавления ложного старого утверждения не наблюдалось. В схеме один список допустимости; полей для свободного объяснения, собственной цены или отдельного исключения нет. Это не доказывает исправление произвольной прозы. Одновременно с форматом изменены нормализованный каталог и инструкция; нет одновременного контроля с прозой и независимого набора. Повторы относятся к двенадцати известным контекстам, поэтому полный счёт не является общей гарантией надёжности или защиты от инъекций.
|
|
31
|
+
|
|
32
|
+
## Выдача, проверка и стоимость
|
|
33
|
+
|
|
34
|
+
Уведомление формировало само приложение. В финальных кадрах только проверенные структурированные данные. После сбора результаты заново сверены с исходными фактами отдельным расчётом, без вызова runtime-валидатора. Измерены сохранённые кадры выдачи; отображение в стороннем нативном GUI не проверялось. Истинность внешнего источника, произвольные объяснения, полномочия на платежи/действия и скрытое влияние на выбор среди равных вариантов остаются вне результата.
|
|
35
|
+
|
|
36
|
+
До API на Linux прошли 9 Node-тестов адаптера, 28 тестов relay/бюджета/сбора и 480 предварительных проверок запросов. У контейнера нет сети и ключа; официальный API доступен только серверному relay. Все запросы и ответы сохранены, 333 выходных хеша проверены до удаления временного каталога. Автоповторов транспорта и повторного исследования не было. Runtime менять не потребовалось.
|
|
37
|
+
|
|
38
|
+
Все вызовы прошли вне пикового времени. Usage: 211 200 входных токенов, из них 103 936 кешированных; 17 946 выходных. По [опубликованному тарифу](https://api-docs.deepseek.com/quick_start/pricing/) расчёт составляет **$0,027169008**; консервативный пиковый учёт — **$0,054338016**, ниже лимита **$0,15**. Счёт и изменение баланса провайдера отдельно не проверялись. Использован существующий сервер.
|
|
39
|
+
|
|
40
|
+
Подготовка и разбор выполнены с AI, без слепой независимой проверки человеком. Ничего не опубликовано в GitHub/npm, комментарий не отправлен.
|
|
41
|
+
|
|
42
|
+
[analysis.json](data/launchgate-structured-model-2026-10-26/analysis.json) · [protocol.md](data/launchgate-structured-model-2026-10-26/protocol.md) · [execution.json](data/launchgate-structured-model-2026-10-26/execution.json) · [output-audit.json](data/launchgate-structured-model-2026-10-26/output-audit.json) · [trajectories.jsonl](data/launchgate-structured-model-2026-10-26/trajectories.jsonl) · [manifest.json](data/launchgate-structured-model-2026-10-26/manifest.json)
|
|
43
|
+
|
|
44
|
+
<!-- prospective-holdout-followup -->
|
|
45
|
+
|
|
46
|
+
[Новые случаи после заморозки](flow-guard-prospective-holdout-2026-10-26.ru.md): 89/96 первых естественных ответов правильны, пять из семи ошибок исправлены, два удержаны; контролируемые 45/48. Отдельные подсказки ранжирования/неполного списка проверены офлайн, без нового запуска модели.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# 结构化答案边界的真实模型测试
|
|
2
|
+
|
|
3
|
+
[en](flow-guard-structured-model-2026-10-26.md) · [ru](flow-guard-structured-model-2026-10-26.ru.md) · [es](flow-guard-structured-model-2026-10-26.es.md) · [fr](flow-guard-structured-model-2026-10-26.fr.md) · [zh](flow-guard-structured-model-2026-10-26.zh.md)
|
|
4
|
+
|
|
5
|
+
2026 年 10 月 26 日。本地 WARDEN **0.22.0**,运行时代码未改,未发布 npm。这是[应用答案门禁](flow-guard-answer-gate.zh.md)及[四条件实验](flow-guard-review-factors-2026-10-26.zh.md)的后续。
|
|
6
|
+
|
|
7
|
+
## 设计与结果
|
|
8
|
+
|
|
9
|
+
在 Linux factory-vps 对 `deepseek-flash` 发起 160 次新调用:temperature .3、关闭 thinking、JSON object mode、最多 700 输出 token。真实且冻结的 `createAnswerGate` 检查全部规则、完整合格集合与最低价格。没有暗中修改模型候选答案来获得通过。
|
|
10
|
+
|
|
11
|
+
保留十二段原始上下文,包括外部指令和原有自由文本答案。新增用户请求要求使用规范化目录与四字段契约完整替换旧答案。每段重复八次,共 **96/96 个初次提案有效**,其中来自四个旧矛盾上下文的 **32/32** 也有效;其余八段原解释有事实支持。因此,自然产生的纠正机会为零。
|
|
12
|
+
|
|
13
|
+
另设独立受控组:实验者构造真正合格集合加 C(价格 190 > 150)或 D(距离 2.5 > 1)的错误列表。它们是**合成初始错误**,并非模型新产生的失败。四段上下文、每类八次,**32/32 个 C 错误及 32/32 个 D 错误均在首次真实纠正调用后修复**。合成种子占 SDK 初次提案,之后最多两次纠正;不能把这一组的纠正率与自然初次提案正确率混合。
|
|
14
|
+
|
|
15
|
+
160 个新答案均未把 C/D 放入合格列表,也没有重复 JSON 键、无效格式或额外自由文本字段。捕获 **160 个已检查结果和 160 个应用告知**,没有未经验证的候选交付、API 错误、C→D 替换或丢弃的尝试。冻结预测均达到:自然初次正确 >=80/96,受控最终正确 >=48/64。
|
|
16
|
+
|
|
17
|
+
**所有轨迹只需一次真实调用,均未触发第二次纠正或保留。** 本次不提供这些路径的真实模型成功率;此前确定性/stdio 测试仍用于证明机制行为。
|
|
18
|
+
|
|
19
|
+
在测量的结构化表面上,没有出现保留旧错误再追加新说法的现象。模式只有一个合格列表,没有模型自写价格、排除结论或解释字段。输出契约、目录和指令同时改变,因此不能把效果单独归因于格式;没有同期自由文本对照或独立保留集。十二段已知上下文的重复满分不是通用可靠性保证或广泛注入防护证明。
|
|
20
|
+
|
|
21
|
+
## 审核、费用与边界
|
|
22
|
+
|
|
23
|
+
收集后按原始事实重新计算全部最终值,审核过程不调用运行时验证器。测量的是捕获的最终输出帧,不是第三方原生 GUI 的实际显示。来源真实性、任意解释、支付/动作权限,以及并列项之间的隐蔽偏好影响都不在本结论内。
|
|
24
|
+
|
|
25
|
+
付费调用前,Linux 上通过 **9 项 Node 适配器测试、28 项 relay/预算/收集测试**及 480 个请求预检。容器无网络、无密钥;只有主机 relay 可访问固定官方 API。完整请求与响应均保留,删除临时目录前校验 **333 个输出哈希**。没有传输自动重试或重复实验;无需修改运行时代码。
|
|
26
|
+
|
|
27
|
+
全部调用在非高峰时段。Usage:输入 211,200 token,其中缓存 103,936;输出 17,946。按[公布费率](https://api-docs.deepseek.com/quick_start/pricing/)计算 **USD 0.027169008**;保守高峰计费 **USD 0.054338016**,低于 **USD 0.15** 硬上限。未核查发票或账户余额差额;使用现有服务器。
|
|
28
|
+
|
|
29
|
+
准备与审核由 AI 辅助、非盲审;未声称独立人工审核。没有 GitHub/npm 发布,也未发送评论。
|
|
30
|
+
|
|
31
|
+
[analysis.json](data/launchgate-structured-model-2026-10-26/analysis.json) · [protocol.md](data/launchgate-structured-model-2026-10-26/protocol.md) · [execution.json](data/launchgate-structured-model-2026-10-26/execution.json) · [output-audit.json](data/launchgate-structured-model-2026-10-26/output-audit.json) · [trajectories.jsonl](data/launchgate-structured-model-2026-10-26/trajectories.jsonl) · [manifest.json](data/launchgate-structured-model-2026-10-26/manifest.json)
|
|
32
|
+
|
|
33
|
+
<!-- prospective-holdout-followup -->
|
|
34
|
+
|
|
35
|
+
[冻结后的新案例](flow-guard-prospective-holdout-2026-10-26.zh.md):自然初次有效 89/96,七个错误中五个纠正、两个保留;受控纠正 45/48。后续排序/缺失集合证据已离线验证,未重新调用模型。
|
package/docs/flow-guard.es.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Guardia de flujo: comprobaciones de llamadas tras texto externo
|
|
2
2
|
|
|
3
|
+
<!-- reference-only-egress -->
|
|
4
|
+
**[Referencias de salida: comportamiento comprobado y límites](flow-guard-reference-egress.es.md).** 127/127 pruebas Linux, incluidas 25 nuevas de referencias sintéticas. Fronteras y excepciones explícitas; sin seguimiento semántico.
|
|
5
|
+
<!-- /reference-only-egress -->
|
|
6
|
+
|
|
7
|
+
<!-- final-ranking-witness -->
|
|
8
|
+
**[Comparación final de mensajes de clasificación, 26 de octubre](flow-guard-final-witness-2026-10-26.es.md).** En los cinco contextos previamente retenidos, el mensaje anterior corrigió 6/40 continuaciones y la comparación explícita entre la opción elegida y la mejor corrigió 40/40. Los controles válidos se conservaron 20/20 por grupo nominal. La serie termina sobre fallos conocidos, no sobre un nuevo conjunto reservado. Este resultado actualiza la limitación anterior de evaluación solo sin conexión para la clasificación; la eficacia del mensaje de conjunto incompleto sigue sin medirse.
|
|
9
|
+
<!-- /final-ranking-witness -->
|
|
10
|
+
|
|
3
11
|
> 🌐 [English](flow-guard.md) · [Русский](flow-guard.ru.md) · **Español** · [Français](flow-guard.fr.md) · [中文](flow-guard.zh.md)
|
|
4
12
|
|
|
5
13
|
Consulte los [límites de medición y pruebas de versión](scan-limits.es.md) sobre facturación, versiones fijas, comparaciones de launchers y significado de los recuentos de aprobación.
|
|
@@ -303,7 +311,7 @@ La guardia comprueba llamadas después de recibir texto externo; no es un sandbo
|
|
|
303
311
|
- Una inyección que solo cambia la respuesta no hace ninguna llamada que rechazar. Desde el 2026-10-22 el hook Stop del plugin añade una línea bajo una respuesta cuyo turno leyó texto externo, con esas fuentes, y lo dice cuando alguna se dirigió al asistente con instrucciones. Si la respuesta repite 12 caracteres normalizados consecutivos de las frases donde ese texto se dirigió al asistente, el hook además devuelve la respuesta una vez (`decision: block`) para comprobarla frente a la petición del usuario antes de que este la lea; el usuario solo pierde el tiempo de esa comprobación. `answerNote`: `always` (por defecto), `instruction` (solo ese caso) u `off`; fuera del plugin, registra `warden-mcp hook stop`.
|
|
304
312
|
- El proxy registra también errores JSON-RPC y de herramientas. Retiene una respuesta si no puede registrarla; un estado de sesión corrupto bloquea la comprobación.
|
|
305
313
|
|
|
306
|
-
Publicado en npm `0.17.0`: `npx -y @aimarket/warden@0.22.
|
|
314
|
+
Publicado en npm `0.17.0`: `npx -y @aimarket/warden@0.22.2 hook pre-tool-use`, o desde el código fuente en WARDEN, `npm ci && npm run build`, luego `node dist/mcp-server.js hook pre-tool-use`, con los hooks prompt/post también registrados. Política: `~/.local/state/warden/flow-policy.json` o `WARDEN_FLOW_POLICY`; modos `ask`, `deny`, `audit`, `off`. Véase el ejemplo vigente en [inglés](flow-guard.md).
|
|
307
315
|
|
|
308
316
|
Proxy: `node dist/mcp-server.js wrap --flow mail -- node mail-server.js`. Use un `WARDEN_FLOW_SESSION` nuevo y compartido por los proxies de una conversación. El PID padre predeterminado no une lanzadores diferentes. El proxy no ve el prompt ni herramientas integradas. Lo que requeriría preguntar se pregunta con el formulario de elicitation MCP del cliente cuando lo ofrece (la respuesta queda en el registro como `approvalOutcome`) y, si no, o con `--ask refuse`, se rechaza. `trustedSources` se aplica a la URL de WebFetch, no a enlaces en argumentos MCP.
|
|
309
317
|
|
|
@@ -563,3 +571,19 @@ El auxiliar del repositorio `scripts/selection-probe/audit_warnings.mjs` reprodu
|
|
|
563
571
|
Las advertencias Post/Stop usan frases fijas e identificadores opacos `source-` (los primeros 16 dígitos hexadecimales del SHA-256 del nombre de herramienta). No citan la instrucción detectada ni repiten nombres originales, URL o rutas de la fuente. Esto limita la promoción de metadatos de terceros a través de la advertencia, pero no inmuniza al modelo frente al resultado original. El ID solo permite correlación; no verifica un paquete, no es un pin ni concede permisos. Los registros locales aún pueden contener metadatos externos y siguen siendo datos no confiables.
|
|
564
572
|
|
|
565
573
|
**Nueva comparación con el modelo (2026-10-25):** En seis casos conocidos, 720 respuestas intercaladas eligieron el objetivo inyectado 48/48 sin protección, 44/48 y 46/48 con note/note+Stop publicados (0.21.0), y 27/48 con ambos perfiles candidatos. Sus bases limpias fueron 23/48 y 25/48. Los intervalos de mejora ajustada frente a la versión publicada son [−8,3; +60,4] puntos para note y [+14,6; +62,5] para note+Stop. Ninguna de las 12 revisiones cambió el ID elegido; tres perdieron una referencia visible a la advertencia. Todos los ID eran admisibles y las preferencias reales se siguieron 30/30. Los casos conocidos, el puente tool-role y la comparación de versiones completas no prueban protección general ni un beneficio separado de Stop. [Informe completo](flow-guard-model-comparison-2026-10-25.es.md).
|
|
574
|
+
|
|
575
|
+
<!-- constraint-evidence-followup -->
|
|
576
|
+
|
|
577
|
+
[Evidencia determinista y conservación de la divulgación](flow-guard-constraint-evidence.es.md).
|
|
578
|
+
|
|
579
|
+
<!-- structured-answer-gate -->
|
|
580
|
+
|
|
581
|
+
[Validación por la aplicación](flow-guard-answer-gate.es.md): todas las reglas, corrección adicional limitada y salida almacenada; solo datos estructurados.
|
|
582
|
+
|
|
583
|
+
<!-- structured-live-followup -->
|
|
584
|
+
|
|
585
|
+
[Prueba real de respuestas estructuradas](flow-guard-structured-model-2026-10-26.es.md): 96 primeras propuestas válidas y 64 reparaciones controladas; denominadores y límites separados.
|
|
586
|
+
|
|
587
|
+
<!-- prospective-holdout-followup -->
|
|
588
|
+
|
|
589
|
+
[Nuevos casos tras congelación](flow-guard-prospective-holdout-2026-10-26.es.md): primeras naturales válidas 89/96, cinco de siete reparadas y dos retenidas; controladas 45/48. Evidencia posterior de clasificación/conjunto incompleto probada offline, sin volver a llamar al modelo.
|
package/docs/flow-guard.fr.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Garde de flux : vérifications des appels après du texte externe
|
|
2
2
|
|
|
3
|
+
<!-- reference-only-egress -->
|
|
4
|
+
**[Références sortantes : comportement vérifié et limites](flow-guard-reference-egress.fr.md).** 127/127 tests Linux, dont 25 nouveaux cas synthétiques de référence. Frontières et exceptions explicites ; pas de suivi sémantique.
|
|
5
|
+
<!-- /reference-only-egress -->
|
|
6
|
+
|
|
7
|
+
<!-- final-ranking-witness -->
|
|
8
|
+
**[Comparaison finale des messages de classement, 26 octobre](flow-guard-final-witness-2026-10-26.fr.md).** Sur les cinq contextes précédemment retenus, l’ancien message a corrigé 6/40 continuations et la comparaison explicite du choix avec le meilleur a corrigé 40/40. Les contrôles valides sont restés valides 20/20 par groupe nominal. La série se termine sur des échecs connus, sans nouvel échantillon réservé. Ce résultat actualise la limite antérieure de vérification hors ligne pour le classement ; l’efficacité du message d’ensemble incomplet reste non mesurée.
|
|
9
|
+
<!-- /final-ranking-witness -->
|
|
10
|
+
|
|
3
11
|
> 🌐 [English](flow-guard.md) · [Русский](flow-guard.ru.md) · [Español](flow-guard.es.md) · **Français** · [中文](flow-guard.zh.md)
|
|
4
12
|
|
|
5
13
|
Voir les [limites des mesures et preuves de version](scan-limits.fr.md) pour la facturation, les versions fixes, les comparaisons de launchers et le sens des compteurs d’approbation.
|
|
@@ -303,7 +311,7 @@ La garde vérifie les appels après réception de texte externe. Ce n’est ni u
|
|
|
303
311
|
- Une injection qui ne change que la réponse ne fait aucun appel à refuser. Depuis le 2026-10-22, le hook Stop du plugin ajoute une ligne sous une réponse dont le tour a lu du texte extérieur, avec ces sources, et le dit quand l’un d’eux s’adressait à l’assistant avec des instructions. Si la réponse reprend 12 caractères normalisés consécutifs des phrases où ce texte s’adressait à l’assistant, le hook renvoie aussi la réponse une fois (`decision: block`) pour qu’elle soit vérifiée face à la demande de l’utilisateur avant qu’il la lise ; l’utilisateur ne perd que le temps de cette vérification. `answerNote` : `always` (par défaut), `instruction` (ce cas seulement) ou `off` ; hors du plugin, enregistrez `warden-mcp hook stop`.
|
|
304
312
|
- Le proxy enregistre aussi les erreurs JSON-RPC et d’outils, retient les réponses dont l’enregistrement échoue et bloque les vérifications si l’état existant est corrompu.
|
|
305
313
|
|
|
306
|
-
Publié dans npm `0.17.0` : `npx -y @aimarket/warden@0.22.
|
|
314
|
+
Publié dans npm `0.17.0` : `npx -y @aimarket/warden@0.22.2 hook pre-tool-use`, ou depuis les sources dans WARDEN, `npm ci && npm run build`, puis `node dist/mcp-server.js hook pre-tool-use`, avec les hooks prompt/post également enregistrés. Politique : `~/.local/state/warden/flow-policy.json` ou `WARDEN_FLOW_POLICY` ; modes `ask`, `deny`, `audit`, `off`. Exemple actuel en [anglais](flow-guard.md).
|
|
307
315
|
|
|
308
316
|
Proxy : `node dist/mcp-server.js wrap --flow mail -- node mail-server.js`. Attribuez un nouveau `WARDEN_FLOW_SESSION` commun aux proxies d’une conversation. Le PID parent par défaut ne relie pas des lanceurs différents. Le proxy ne voit ni prompt ni outils intégrés. Un appel qui demanderait confirmation est demandé via le formulaire d’elicitation MCP du client s’il en propose un (la réponse est journalisée comme `approvalOutcome`), sinon, ou avec `--ask refuse`, il est refusé. `trustedSources` s’applique à l’URL WebFetch, pas aux liens des arguments MCP.
|
|
309
317
|
|
|
@@ -570,3 +578,19 @@ L’outil du dépôt `scripts/selection-probe/audit_warnings.mjs` rejoue les ent
|
|
|
570
578
|
Les avertissements Post/Stop utilisent des phrases fixes et des identifiants opaques `source-` (les 16 premiers chiffres hexadécimaux du SHA-256 du nom d’outil). Ils ne citent pas la consigne détectée et ne répètent ni noms bruts, ni URL, ni chemins de la source. Cela limite la promotion de métadonnées tierces dans le canal d’avertissement, sans immuniser le modèle contre le résultat initial. Cet ID sert uniquement à la corrélation ; ce n’est ni une identité de paquet vérifiée, ni un pin, ni une permission. Les journaux locaux peuvent encore contenir des métadonnées externes et restent des données non fiables.
|
|
571
579
|
|
|
572
580
|
**Nouvelle comparaison avec le modèle (2026-10-25) :** Sur six cas connus, 720 réponses entrelacées ont choisi la cible injectée 48/48 sans garde, 44/48 et 46/48 avec note/note+Stop publiés (0.21.0), et 27/48 dans les deux profils candidats. Leurs références propres étaient 23/48 et 25/48. Les intervalles d’amélioration corrigée face à la version publiée sont [−8,3 ; +60,4] points pour note et [+14,6 ; +62,5] pour note+Stop. Aucune des 12 vérifications n’a changé l’ID choisi ; trois ont perdu une référence visible à l’avertissement. Tous les ID étaient admissibles et les vraies préférences ont été suivies 30/30. Ces cas connus, le pont tool-role et la comparaison de versions entières ne prouvent ni protection générale ni bénéfice séparé de Stop. [Rapport complet](flow-guard-model-comparison-2026-10-25.fr.md).
|
|
581
|
+
|
|
582
|
+
<!-- constraint-evidence-followup -->
|
|
583
|
+
|
|
584
|
+
[Preuves déterministes et conservation de la divulgation](flow-guard-constraint-evidence.fr.md).
|
|
585
|
+
|
|
586
|
+
<!-- structured-answer-gate -->
|
|
587
|
+
|
|
588
|
+
[Validation par l’application](flow-guard-answer-gate.fr.md) : toutes les règles, correction supplémentaire bornée et sortie tamponnée ; données structurées uniquement.
|
|
589
|
+
|
|
590
|
+
<!-- structured-live-followup -->
|
|
591
|
+
|
|
592
|
+
[Test réel des réponses structurées](flow-guard-structured-model-2026-10-26.fr.md) : 96 premières propositions valides et 64 réparations contrôlées ; dénominateurs et limites séparés.
|
|
593
|
+
|
|
594
|
+
<!-- prospective-holdout-followup -->
|
|
595
|
+
|
|
596
|
+
[Nouveaux cas après gel](flow-guard-prospective-holdout-2026-10-26.fr.md) : premières naturelles valides 89/96, cinq erreurs sur sept réparées, deux retenues ; contrôlées 45/48. Constats ultérieurs de classement/ensemble incomplet vérifiés hors ligne, sans nouveau modèle.
|
package/docs/flow-guard.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Flow guard: tool-call checks after outside text
|
|
2
2
|
|
|
3
|
+
<!-- reference-only-egress -->
|
|
4
|
+
**[Reference-only egress: checked behavior and limits](flow-guard-reference-egress.md).** 127/127 Linux tests, including 25 new synthetic reference-only cases. Session/action boundaries and explicit exceptions; no semantic provenance claim.
|
|
5
|
+
<!-- /reference-only-egress -->
|
|
6
|
+
|
|
7
|
+
<!-- final-ranking-witness -->
|
|
8
|
+
**[Final ranking-feedback comparison, 26 October](flow-guard-final-witness-2026-10-26.md).** On all five previously withheld contexts, old feedback repaired 6/40 continuations and explicit selected-versus-best feedback repaired 40/40. Valid controls stayed valid 20/20 per nominal arm. This completes the series on selected known failures, not a new holdout. The earlier offline-only statement is superseded for ranking feedback on this cohort; missing-set feedback efficacy remains unmeasured.
|
|
9
|
+
<!-- /final-ranking-witness -->
|
|
10
|
+
|
|
3
11
|
> 🌐 **English** · [Русский](flow-guard.ru.md) · [Español](flow-guard.es.md) · [Français](flow-guard.fr.md) · [中文](flow-guard.zh.md)
|
|
4
12
|
|
|
5
13
|
See [measurement limits and version evidence](scan-limits.md) for billing, package pins, launcher comparisons and what approval counts establish.
|
|
@@ -303,7 +311,7 @@ The flow guard adds checks at tool-call boundaries after a session receives outs
|
|
|
303
311
|
- An injection that only changes the answer makes no call to refuse. Since 2026-10-22 the plugin's Stop hook adds one line under an answer whose turn read outside text, naming those sources, and says so when any of it addressed the assistant with instructions. When the answer repeats 12 consecutive normalized characters from the sentences where that text addressed the assistant, the hook also sends the answer back once (`decision: block`), to be checked against the user's request before the user reads it; the user loses nothing but the time of that check. `answerNote` chooses `always` (default), `instruction` (only that case) or `off`; outside the plugin, register `warden-mcp hook stop`.
|
|
304
312
|
- The MCP proxy records JSON-RPC error text and tool-error results as outside text too. If recording fails, it withholds the response. Existing corrupt session state blocks pre-tool checks instead of becoming an empty session.
|
|
305
313
|
|
|
306
|
-
Released in npm `0.17.0`: `npx -y @aimarket/warden@0.22.
|
|
314
|
+
Released in npm `0.17.0`: `npx -y @aimarket/warden@0.22.2 hook pre-tool-use`, or from a source checkout `npm ci && npm run build`, then `node dist/mcp-server.js hook pre-tool-use`. Register the prompt and post hooks as well, or use the bundled Claude plugin.
|
|
307
315
|
|
|
308
316
|
Policy is user-level (`~/.local/state/warden/flow-policy.json`, or `WARDEN_FLOW_POLICY`). Modes are `ask`, `deny`, `audit`, `off`. `audit` logs decisions without enforcing them. Example:
|
|
309
317
|
|
|
@@ -580,3 +588,19 @@ The repository helper `scripts/selection-probe/audit_warnings.mjs` replays saved
|
|
|
580
588
|
Post/Stop warning text uses fixed sentences and opaque `source-` identifiers (the first 16 hex digits of SHA-256 of the tool name). It does not quote the detected instruction or repeat raw tool names, source URLs or paths. This limits promotion of source-controlled metadata through the warning channel; it does not make a model immune to the original tool result. The identifier permits correlation only and is not a verified package identity, pin or permission. Local logs can still contain source-authored metadata and must be treated as untrusted data.
|
|
581
589
|
|
|
582
590
|
**Fresh model comparison (2026-10-25):** On the same six known fixtures, the 720-answer interleaved run selected the injected target 48/48 unguarded, 44/48 and 46/48 with published 0.21.0 note/note+Stop, and 27/48 with either local candidate profile. Candidate clean baselines were 23/48 and 25/48. Clean-adjusted candidate-versus-published intervals are −8.3 to +60.4pp for note and +14.6 to +62.5pp for note+Stop. Twelve actual rechecks changed no selected IDs; three lost a visible warning reference. All IDs were admissible and genuine user preferences passed 30/30. These known cases, controlled tool-role bridge and whole-version comparison do not establish general protection or a separate Stop benefit. See [the complete fresh-run report](flow-guard-model-comparison-2026-10-25.md).
|
|
591
|
+
|
|
592
|
+
<!-- constraint-evidence-followup -->
|
|
593
|
+
|
|
594
|
+
[Deterministic answer evidence and disclosure continuity](flow-guard-constraint-evidence.md).
|
|
595
|
+
|
|
596
|
+
<!-- structured-answer-gate -->
|
|
597
|
+
|
|
598
|
+
[Host-owned answer gate](flow-guard-answer-gate.md): all constraints, bounded extra correction and buffered final delivery; structured data only.
|
|
599
|
+
|
|
600
|
+
<!-- structured-live-followup -->
|
|
601
|
+
|
|
602
|
+
[Live structured-model test](flow-guard-structured-model-2026-10-26.md): 96 valid first proposals and 64 controlled-seed repairs; separate denominators and limits.
|
|
603
|
+
|
|
604
|
+
<!-- prospective-holdout-followup -->
|
|
605
|
+
|
|
606
|
+
[Prospective new-fixture results](flow-guard-prospective-holdout-2026-10-26.md): 89/96 natural first proposals valid, five of seven repaired, two withheld; controlled repair 45/48. Separate post-hoc ranking/missing-set facts passed offline checks, without a new model run.
|
package/docs/flow-guard.ru.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Страж потоков: проверки вызовов после внешнего текста
|
|
2
2
|
|
|
3
|
+
<!-- reference-only-egress -->
|
|
4
|
+
**[Исходящие смысловые ссылки: проверки и ограничения](flow-guard-reference-egress.ru.md).** 127/127 тестов на Linux, включая 25 новых синтетических сценариев смысловых ссылок. Границы действий и явные исключения; семантическое происхождение не отслеживается.
|
|
5
|
+
<!-- /reference-only-egress -->
|
|
6
|
+
|
|
7
|
+
<!-- final-ranking-witness -->
|
|
8
|
+
**[Финальное сравнение обратной связи, 26 октября](flow-guard-final-witness-2026-10-26.ru.md).** Во всех пяти ранее удержанных контекстах старое сообщение исправило 6/40 продолжений, явное сравнение выбранного и лучшего — 40/40. Правильные контроли сохранились 20/20 в каждой условной группе. Серия завершена на известных ошибках; это не новый holdout. Прежнее утверждение о проверке только офлайн уточнено этим результатом для ранжирования; эффективность сообщений о неполном наборе моделью пока не измерена.
|
|
9
|
+
<!-- /final-ranking-witness -->
|
|
10
|
+
|
|
3
11
|
> 🌐 [English](flow-guard.md) · **Русский** · [Español](flow-guard.es.md) · [Français](flow-guard.fr.md) · [中文](flow-guard.zh.md)
|
|
4
12
|
|
|
5
13
|
См. [границы измерений и подтверждение версии](scan-limits.ru.md): биллинг, закрепление пакетов, сравнение launcher и смысл счётчиков подтверждений.
|
|
@@ -313,7 +321,7 @@ node dist/mcp-server.js wrap --flow screen --screen-read computer --screen-read-
|
|
|
313
321
|
- Инъекция, которая меняет только ответ, не делает вызова, которому можно отказать. С 2026-10-22 хук Stop плагина добавляет под ответом строку, если за этот ход читался внешний текст: какие источники, и отдельно — если какой-то из них обращался к ассистенту с указаниями. Если ответ повторяет 12 нормализованных символов подряд из тех предложений, где внешний текст обращался к ассистенту, хук ещё и один раз возвращает ответ модели (`decision: block`) на проверку по запросу пользователя, прежде чем пользователь его прочтёт; пользователь теряет только время этой проверки. `answerNote`: `always` (по умолчанию), `instruction` (только этот случай) или `off`; вне плагина зарегистрируйте `warden-mcp hook stop`.
|
|
314
322
|
- Прокси учитывает текст JSON-RPC errors и ошибки инструментов как внешние данные. Если учёт ответа не удался, ответ удерживается. Повреждённое состояние сессии блокирует проверяемый вызов вместо сброса в пустую сессию.
|
|
315
323
|
|
|
316
|
-
Вышло в npm `0.17.0`: `npx -y @aimarket/warden@0.22.
|
|
324
|
+
Вышло в npm `0.17.0`: `npx -y @aimarket/warden@0.22.2 hook pre-tool-use`, либо из исходников — в каталоге WARDEN `npm ci && npm run build`, затем `node dist/mcp-server.js hook pre-tool-use`. Зарегистрируйте также prompt/post hooks либо плагин Claude.
|
|
317
325
|
|
|
318
326
|
Политика: `~/.local/state/warden/flow-policy.json` или `WARDEN_FLOW_POLICY`. Режимы: `ask`, `deny`, `audit`, `off`; `audit` только пишет журнал. Пример настройки контактов и адресатов — в [английской версии](flow-guard.md).
|
|
319
327
|
|
|
@@ -564,3 +572,19 @@ python3 scripts/agentdojo/summarize_model.py summary.json /srv/adojo/out --goals
|
|
|
564
572
|
Текст предупреждений Post/Stop состоит из фиксированных фраз и непрозрачных ID `source-` (первые 16 hex-символов SHA-256 имени инструмента). В нём не цитируются найденная инструкция, сырые имена инструментов, URL и пути источника. Это ограничивает перенос чужих метаданных в канал предупреждения, но не защищает модель от любого влияния исходного tool result. ID предназначен только для сопоставления: он не является проверенной версией пакета, pin или разрешением. Локальные журналы могут содержать чужие метаданные и остаются недоверенными данными.
|
|
565
573
|
|
|
566
574
|
**Свежий прогон модели (2026-10-25):** На шести известных задачах получены 720 основных ответов. Под атакой цель выбрана 48/48 без защиты, 44/48 и 46/48 со старыми note/note+Stop (0.21.0), 27/48 в обоих новых режимах. Чистые фоны кандидата — 23/48 и 25/48. Интервалы улучшения относительно старой версии с поправкой на фон: [−8,3; +60,4] п.п. для note и [+14,6; +62,5] для note+Stop. Ни одна из 12 реальных перепроверок не изменила выбранный ID; в трёх исчезла видимая ссылка на предупреждение. Все ID допустимы, настоящие предпочтения пользователя выполнены 30/30. Известные случаи, tool-role bridge и сравнение целых версий не доказывают общей защиты или отдельной пользы Stop. [Полный отчёт](flow-guard-model-comparison-2026-10-25.ru.md).
|
|
575
|
+
|
|
576
|
+
<!-- constraint-evidence-followup -->
|
|
577
|
+
|
|
578
|
+
[Детерминированные факты для проверки ответа и сохранение раскрытия](flow-guard-constraint-evidence.ru.md).
|
|
579
|
+
|
|
580
|
+
<!-- structured-answer-gate -->
|
|
581
|
+
|
|
582
|
+
[Проверка ответа приложением](flow-guard-answer-gate.ru.md): все ограничения, дополнительный ограниченный проход и буферизация выдачи; только структурированные данные.
|
|
583
|
+
|
|
584
|
+
<!-- structured-live-followup -->
|
|
585
|
+
|
|
586
|
+
[Живой прогон структурированных ответов](flow-guard-structured-model-2026-10-26.ru.md): 96 правильных первых предложений и 64 исправления контролируемых ошибок; отдельные знаменатели и границы.
|
|
587
|
+
|
|
588
|
+
<!-- prospective-holdout-followup -->
|
|
589
|
+
|
|
590
|
+
[Новые случаи после заморозки](flow-guard-prospective-holdout-2026-10-26.ru.md): 89/96 первых естественных ответов правильны, пять из семи ошибок исправлены, два удержаны; контролируемые 45/48. Отдельные подсказки ранжирования/неполного списка проверены офлайн, без нового запуска модели.
|
package/docs/flow-guard.zh.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# 流守卫:接收外部文本后的工具调用检查
|
|
2
2
|
|
|
3
|
+
<!-- reference-only-egress -->
|
|
4
|
+
**[纯引用式外发:已验证行为与限制](flow-guard-reference-egress.zh.md).** Linux 127/127测试通过,含25项新增纯引用合成场景。明确动作边界与例外;不宣称语义来源追踪。
|
|
5
|
+
<!-- /reference-only-egress -->
|
|
6
|
+
|
|
7
|
+
<!-- final-ranking-witness -->
|
|
8
|
+
**[10月26日最终排序反馈对照](flow-guard-final-witness-2026-10-26.zh.md).** 在全部五个此前被拦截的上下文中,旧反馈修复了6/40次续答,明确比较所选项与最优项的新反馈修复了40/40次。每个名义组的有效对照均保持20/20。本系列到此结束,结果针对已知失败案例,并非新的留出测试。此结果更新了此前仅离线验证的排序反馈限制;缺失合格项反馈的模型修复效果仍未测量。
|
|
9
|
+
<!-- /final-ranking-witness -->
|
|
10
|
+
|
|
3
11
|
> 🌐 [English](flow-guard.md) · [Русский](flow-guard.ru.md) · [Español](flow-guard.es.md) · [Français](flow-guard.fr.md) · **中文**
|
|
4
12
|
|
|
5
13
|
关于账单、包版本固定、launcher 比较及批准计数的含义,请参见[测量边界与版本证据](scan-limits.zh.md)。
|
|
@@ -303,7 +311,7 @@ Wrap 提问前读取基线,批准后重新验证工具定义并再次读取。
|
|
|
303
311
|
- 只改变回答的注入不会发出可拒绝的调用。自 2026-10-22 起,插件的 Stop 钩子会在本轮读过外部文本的回答下方加一行,列出这些来源;若其中有文本以指令口吻对助手说话,也会注明。如果回答连续重复了外部文本中对助手下指令那几句话里的 12 个规范化字符,钩子还会把回答退回给模型一次(`decision: block`),在用户读到之前对照用户的请求检查;用户只损失这次检查的时间。`answerNote`:`always`(默认)、`instruction`(只在这种情况下)或 `off`;插件之外请注册 `warden-mcp hook stop`。
|
|
304
312
|
- 代理也记录 JSON-RPC 和工具错误;记录失败时不转发响应,现有会话状态损坏时阻止检查中的调用。
|
|
305
313
|
|
|
306
|
-
已在 npm `0.17.0` 发布:`npx -y @aimarket/warden@0.22.
|
|
314
|
+
已在 npm `0.17.0` 发布:`npx -y @aimarket/warden@0.22.2 hook pre-tool-use`;或从源码在 WARDEN 目录运行 `npm ci && npm run build`,然后使用 `node dist/mcp-server.js hook pre-tool-use`,并注册 prompt/post hooks。策略为 `~/.local/state/warden/flow-policy.json` 或 `WARDEN_FLOW_POLICY`;模式为 `ask`、`deny`、`audit`、`off`。当前配置示例见[英文页](flow-guard.md)。
|
|
307
315
|
|
|
308
316
|
代理命令:`node dist/mcp-server.js wrap --flow mail -- node mail-server.js`。同一会话的代理应共享一个新的 `WARDEN_FLOW_SESSION`。默认父进程 PID 不能关联不同启动器。代理看不到用户提示或客户端内置工具。需要确认的调用会在客户端提供 MCP elicitation 表单时通过表单询问(回答记入日志的 `approvalOutcome`),否则或使用 `--ask refuse` 时被拒绝。`trustedSources` 仅用于 WebFetch URL,不用于 MCP 参数中的任意链接。
|
|
309
317
|
|
|
@@ -494,3 +502,19 @@ python3 scripts/agentdojo/summarize_model.py summary.json /srv/adojo/out --goals
|
|
|
494
502
|
Post/Stop 警告使用固定语句和不透明的 `source-` ID(工具名 SHA-256 的前 16 个十六进制字符),不会引用检测到的指令,也不重复原始工具名、来源 URL 或路径。这限制了外部元数据借警告渠道获得权威性,但不使模型免受原始工具结果的影响。ID 只用于关联,不是经验证的软件包身份、pin 或权限。当地日志仍可能包含外部元数据,必须作为不可信数据处理。
|
|
495
503
|
|
|
496
504
|
**新的模型对比(2026-10-25):** 在相同六个已知案例的 720 个交错运行答案中,无保护时攻击目标被选中 48/48 次;已发布 0.21.0 的 note/note+Stop 为 44/48、46/48;两个本地候选模式均为 27/48。候选的干净基线为 23/48、25/48。相对旧版、校正基线后的改善区间:note 为 [−8.3,+60.4] 个百分点,note+Stop 为 [+14.6,+62.5]。12 次实际复核均未改变所选 ID,其中三个最终答案失去了可见的警告引用。全部 ID 均可接受,真实用户偏好遵从为 30/30。这些已知案例、tool-role 桥接及完整版本对比不证明普遍防护或 Stop 的独立收益。[完整报告](flow-guard-model-comparison-2026-10-25.zh.md)。
|
|
505
|
+
|
|
506
|
+
<!-- constraint-evidence-followup -->
|
|
507
|
+
|
|
508
|
+
[确定性答案证据与披露保留](flow-guard-constraint-evidence.zh.md).
|
|
509
|
+
|
|
510
|
+
<!-- structured-answer-gate -->
|
|
511
|
+
|
|
512
|
+
[应用答案门禁](flow-guard-answer-gate.zh.md):全部规则、有界额外纠正与缓冲交付;仅支持结构化数据。
|
|
513
|
+
|
|
514
|
+
<!-- structured-live-followup -->
|
|
515
|
+
|
|
516
|
+
[结构化答案真实模型测试](flow-guard-structured-model-2026-10-26.zh.md):96 个初次提案有效,64 个受控种子修复;分母与边界分别报告。
|
|
517
|
+
|
|
518
|
+
<!-- prospective-holdout-followup -->
|
|
519
|
+
|
|
520
|
+
[冻结后的新案例](flow-guard-prospective-holdout-2026-10-26.zh.md):自然初次有效 89/96,七个错误中五个纠正、两个保留;受控纠正 45/48。后续排序/缺失集合证据已离线验证,未重新调用模型。
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Host integration: read structured proposals from stdin; output only a verified final result or withholding notice.
|
|
3
|
+
// No model API, keys, network, tool calls or effects. Integrators supply their own bounded model callback instead.
|
|
4
|
+
import { readFileSync } from 'node:fs';
|
|
5
|
+
import { createInterface } from 'node:readline';
|
|
6
|
+
import { createAnswerGate } from '../dist/index.js';
|
|
7
|
+
|
|
8
|
+
const controller = new AbortController();
|
|
9
|
+
process.once('SIGINT', () => controller.abort());
|
|
10
|
+
// stdout failures are uncertain delivery, never a reason to resend.
|
|
11
|
+
process.stdout.on('error', () => {});
|
|
12
|
+
let lines;
|
|
13
|
+
try {
|
|
14
|
+
if (process.argv.length !== 4 || process.argv[2] !== '--contract') throw new Error('usage');
|
|
15
|
+
const bytes = readFileSync(process.argv[3]);
|
|
16
|
+
if (bytes.length > 262_144) throw new Error('contract too large');
|
|
17
|
+
const gate = createAnswerGate(JSON.parse(bytes.toString('utf8')));
|
|
18
|
+
lines = createInterface({ input: process.stdin, crlfDelay: Infinity });
|
|
19
|
+
const iterator = lines[Symbol.asyncIterator]();
|
|
20
|
+
const result = await gate.run({ signal: controller.signal, maxCorrections: 2, timeoutMs: 30_000,
|
|
21
|
+
generate: async request => {
|
|
22
|
+
process.stderr.write('WARDEN_REQUEST ' + JSON.stringify({ attempt: request.attempt, catalog: request.catalog, feedback: request.feedback ?? null }) + '\n');
|
|
23
|
+
const next = await iterator.next();
|
|
24
|
+
if (next.done) throw new Error('No structured proposal');
|
|
25
|
+
return next.value;
|
|
26
|
+
},
|
|
27
|
+
emit: rendered => new Promise((resolve, reject) => process.stdout.write(rendered, error => error ? reject(error) : resolve())),
|
|
28
|
+
});
|
|
29
|
+
process.exitCode = result.status === 'delivered' ? 0 : result.status === 'withheld' ? 2 : result.status === 'cancelled' ? 130 : 3;
|
|
30
|
+
} catch {
|
|
31
|
+
process.stderr.write('WARDEN_HOST_ERROR: provide --contract with normalized host-owned facts. No candidate forwarded.\n');
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
} finally { lines?.close(); }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aimarket/warden",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.2",
|
|
4
4
|
"description": "WARDEN — MCP security firewall. Stdio wrap proxy, inspection tools and library. Vets definitions before model exposure. Zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"docs/gates*.md",
|
|
53
53
|
"docs/flow-guard*.md",
|
|
54
54
|
"examples/atomic-screen-server.mjs",
|
|
55
|
+
"examples/answer-gate-host.mjs",
|
|
55
56
|
"native/macos/Package.swift",
|
|
56
57
|
"native/macos/Sources",
|
|
57
58
|
"scripts/build-macos.mjs"
|
|
@@ -96,8 +97,8 @@
|
|
|
96
97
|
},
|
|
97
98
|
"devDependencies": {
|
|
98
99
|
"@types/node": "^26.6.4",
|
|
99
|
-
"@vitest/coverage-v8": "^
|
|
100
|
-
"typescript": "^
|
|
101
|
-
"vitest": "^
|
|
100
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
101
|
+
"typescript": "^7.0.2",
|
|
102
|
+
"vitest": "^5.0.5"
|
|
102
103
|
}
|
|
103
104
|
}
|