-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Plan: Minimal Integration MVP for WFGY semantic firewall
thanks for the green light. i’ll push a tiny MVP so we can validate the idea in your stack first, then decide how deep we go.
0) goal in one line
add a lightweight pre-gen semantic firewall that checks role drift and context fit before the agent/tool runs. pass if ΔS ≤ 0.45 and coverage ≥ 0.70. if not, auto-reset or compress.
1) insertion point for MVP
Path A: prompt-wrapper proxy (no infra change)
- intercept request right before model call
- compute ΔS with anchors
- if drift: rewrite or re-init, else pass through
we can add Path B (embedding gate) later if you want, but path A gets us a fast win.
2) deliverables
wfgy_guard.pya single file CLIspec.yamlanchors + weights + thresholdsexamples/3 tiny tasks for reproreport.jsonper call telemetry3) CLI
# init a sample spec python wfgy_guard.py init --out spec.yaml # run guard once python wfgy_guard.py guard \ --input input.txt \ --goal goal.txt \ --spec spec.yaml \ --out report.json # pipe mode for easy proxy cat prompt.txt | python wfgy_guard.py guard --goal goal.txt --spec spec.yaml4) spec.yaml (minimal)
anchors: entities: ["invoice", "due date", "customer id"] relations: ["invoice->due date", "customer id->lookup"] constraints: ["net-30", "usd only"] weights: w_e: 0.5 w_r: 0.3 w_c: 0.2 thresholds: delta_s_max: 0.45 coverage_min: 0.70 actions: on_drift: ["reset_role", "compress_context"] on_low_cov: ["add_missing_anchors"]5) telemetry (always printed)
triage=No.1|No.5 delta_s=0.38 coverage=0.74 lambda=convergent decision=pass
triagemaps to failure patterns we observe during guarddecisionispass|rewrite|reset6) acceptance targets
- ΔS ≤ 0.45 on 3 consecutive runs for the same task
- coverage ≥ 0.70 with anchors present
- no role drift across retry 1→3
7) quick dataset to reproduce
ex1_tool_pick.txttests wrong tool loopex2_role_swap.txttests role driftex3_cold_boot.txttests first call garbage8) scope and time
- day 1 ship CLI + spec + examples
- day 2 wire into your pipeline as a thin proxy function
- day 3 tune anchors with your real tasks, confirm targets
- day 4 optional: add
--cimode to fail builds on drift9) extension options after MVP
- Path B: embedding gate before retrieval, normalize vectors, add trace IDs
- Path C: multi-agent lock ordering and token passing to prevent deadlock
- Path D: recovery bridges for stalled steps
if this looks good, i’ll open a PR with the single-file CLI and the sample spec, then we tune it together on your tasks. happy to adjust the insertion point if you prefer embedding gate first. waiting on your preference and any constraints i should match.
Originally posted by @onestardao in #8