社区整理 · 与 TypeSafe 无隶属关系
用例 · Agent 护栏 · 预览

Agent 护栏 Preview

在人决定前对拟执行的 Agent 工具/shell 调用打分或门控的预览级模式。相关预览模板:T4 Agent 命令风险。不是 CMD Guard 产品、DOM 扩展或自动拦截器。

案例卡细字段保持英文(来源语言)。标题与章节壳层已本地化。

案例卡

1 · Title

#4 Account risk assessment + escalate

2 · When to use / When not
When to use

Score account activity risk and decide whether to escalate for manual security review.

When not

Not a standalone fraud system; do not auto-lock accounts solely from one Score without your own policy and review path.

3 · Question stem

How risky does this account activity appear? Should this account be escalated for manual security review?

4 · Options
  • risk_level Score (Low / Moderate / High risk descriptions)
  • escalate (noul)
5 · Criteria
risk_level
Low risk: activity is consistent with the account history; Moderate risk: some unusual activity needs monitoring; High risk: multiple strong indicators of account compromise
escalate.true
The activity warrants immediate human review
escalate.false
The activity can be handled with normal automated controls
6 · Example in → out
In
account_age_days: 12; events: five failed logins, password reset from new country, successful login from usual device; account_verified: true
Out
risk_level high-ish; escalate noul≈0.81 (CF sample)
7 · Source
8 · Notes

Cloudflare docs “Account risk assessment” example.

1 · Title

#9 Agent: next tool / subagent and continue / retry / ask / stop

2 · When to use / When not
When to use

Inside an agent loop, use evaluation to choose the next tool or subagent and whether to continue, retry, ask the user, or stop.

When not

Changelog lists the pattern at a high level only — do not ship invented option text as “official”. Define your own closed action set.

3 · Question stem

4 · Options

5 · Criteria

6 · Example in → out
In
Out
7 · Source
8 · Notes

Vercel changelog example use cases bullet: “Choosing the next tool or subagent in an agent loop” and “Deciding whether to continue, retry, ask the user, or stop”. Full question stem / criteria not published on that page — summary + source only. Secondary: Vercel AI Gateway Evaluation docs.

1 · Title

#10 Verify model outputs / enforce guardrails

2 · When to use / When not
When to use

After a generative model writes or acts, run typed checks to verify outputs and enforce guardrails before side effects.

When not

Does not replace schema validation or deterministic policy checks code can do exactly.

3 · Question stem

4 · Options

5 · Criteria

6 · Example in → out
In
Out
7 · Source
8 · Notes

Vercel changelog bullet: “Verifying model outputs and enforcing guardrails.” No full stem or option set on that page — summary + source only. Related: Flavio mentions claim-check Nouls against transcripts as a proposed workflow. Secondary: Evaluation docs + Flavio claim-check Noul mention.

1 · Title

#12 Shell command risk: read_only / reversible / irreversible

2 · When to use / When not
When to use

Before a coding agent runs a shell command, classify destructiveness; escalate when confidence is low.

When not

Not an automatic blocker or CMD Guard product. Shadow-log first; never auto-run irreversible commands on low confidence.

3 · Question stem

(summarized from article) Classify the proposed command before execution

4 · Options
  • read_only
  • reversible
  • irreversible
5 · Criteria

6 · Example in → out
In
Ambiguous `rm -rf` (early shadow test mentioned in article)
Out
Label irreversible at 0.56 with confidence 0.33 → surrounding code should ask a human (per article)
7 · Source
8 · Notes

Flavio: Choice over read_only / reversible / irreversible; separate Nouls may check delete / git history / deploy / outside-repo. Per-option criteria prose not fully enumerated — do not invent. T4 on this site is related preview scaffolding.

1 · Title

#14 Staged code review (jev-review)

2 · When to use / When not
When to use

Stage PR review judgments: risk matrix, file profiles, evidence, severity, then conditional routing — keep arithmetic and routing in code.

When not

Launch-week artefact (DEV “first 48 hours”); not a production case study. Figures self-reported by authors.

3 · Question stem

4 · Options

5 · Criteria

6 · Example in → out
In
Out
7 · Source
8 · Notes

DEV cites devagrawal09/jev-review: “Noul risk matrix, then Choice/Score file profiles, evidence selection, severity, conditional routing.” Full stems not reproduced in the article — summary + source only.

1 · Title

#N1 Agent shell probability gate (Jev + Pi)

2 · When to use / When not
When to use

Put a Jev probability gate in front of a coding agent’s shell / write / edit tools: rules for known-safe or hard-deny paths, Jev for everything else.

When not

Not a sandbox or syscall filter. Default “unclear → allow” still lets ambiguous commands through — tighten uncertain policy if you need fail-closed. Not a CMD Guard product.

3 · Question stem

Evaluate safe-phrased Noul conditions on the proposed tool call (command/path + recent user prompt + policy notes)

4 · Options
  • intent_coverage (noul)
  • no_secret_egress (noul)
  • no_irreversible_damage (noul)
  • local_scope (noul)
  • path_not_protected (noul)
  • no_fetched_code_execution (noul)
  • prompt_injection_absent (noul)
  • policy_compliance (noul)
  • no_outward_effect (noul)
5 · Criteria
intent_coverage
Requested action matches user intent (author default threshold t=0.60; bimodal gap observed in article)
no_secret_egress
Absence-of-hazard detector — clear violations when p <= 1-t (author default t=0.97; raising t can shrink the reject band)
_bands
Per condition: satisfied p>=t; violated p<=1-t; unclear in between. Author notes unclear defaults to allow unless configured otherwise.
6 · Example in → out
In
Unvouched curl posting @$HOME/.ssh/id_ed25519 (fixture in article); also unrequested rm -rf / git reset --hard
Out
Secret-upload fixture scored no_secret_egress p=0.02 → blocked at t=0.97; unrequested destructive commands scored intent_coverage 0.04–0.11 → blocked (per article)
7 · Source
8 · Notes

Jo Matsuda DEV: pi-jev-auto-mode extension. Condition names and thresholds taken from the article — do not invent options. Agent-guardrails chapter.

1 · Title

#N2 LangChain AutoMode middleware blocks risky tools

2 · When to use / When not
When to use

In a LangChain agent harness, use AutoModeMiddleware so Jev checks listed tools (e.g. bash) and can block risky calls before execution.

When not

Does not replace allowlists, sandboxes, or human approval for high-impact actions. Middleware is experimental in the article.

3 · Question stem

(article summary) Jev-backed auto-mode check on configured tool calls before the tool runs

4 · Options
  • AutoModeMiddleware tools example: bash
5 · Criteria

6 · Example in → out
In
create_agent(..., middleware=[AutoModeMiddleware(tools=["bash"])]) (article sample)
Out
Risky tool calls blocked before the tool executes (per LangChain post)
7 · Source
8 · Notes

LangChain “Building a Harness with Jev” — Auto Mode section. Full per-tool stem/criteria not published — summary + source; do not invent option text beyond the article’s middleware example.

1 · Title

#N5 jev-browser step action + goal/stuck gates (jkudish)

2 · When to use / When not
When to use

Drive a headless browser with Jev choosing one page action per step, plus independent goal-done and stuck Nouls; code owns budgets, recovery, and stop gates.

When not

Early software — rough on hard sites. Jev never generates typed text (a small typing model or heuristic fills fields). Not a sandbox; treat the trace as evidence, not proof.

3 · Question stem

Which single action best advances the task on the current page? + The task's goal has been achieved: the current page and history show the sought outcome + The actions so far are not making progress toward the task (repeats, loops, or no change)

4 · Options
  • action Choice over page interactive elements + scroll/back/done (dynamic)
  • goal_done (noul)
  • stuck (noul)
  • select option Choice (second stage when select_* chosen)
5 · Criteria
action
Which single action best advances the task on the current page? (criteria = live element/control labels)
goal_done.true
The page being viewed is the sought destination or shows the sought information
goal_done.false
The goal is not yet achieved
stuck.true
Recent actions repeat or nothing changes; a different strategy is needed
stuck.false
Progress is visible or the first steps are still reasonable
6 · Example in → out
In
task: Search Wikipedia for Ristretto and stop on the article; start_url: en.wikipedia.org/wiki/Main_Page
Out
click search → type “Ristretto” → done; goal/stuck Nouls scored each step (README live trace)
7 · Source
8 · Notes

Runnable MCP/CLI/library (@jkudish/jev-browser). Stop gates in code: done, goal_done>0.85, stuck>0.85, step/time budgets. Self-reported Wikipedia timings/costs in README — verify on your sites. Related browser agent: case #13 browser-use/jev-ultrafast on Other.

1 · Title

#N6 jev-harness tool gate (risk / policy / blast / handoff)

2 · When to use / When not
When to use

Before an agent executes a tool call, run a Jev recipe that classifies risk, checks policy, scores blast radius, and chooses continue / ask_user / escalate / abort — with harness confidence gate + shadow mode.

When not

Not a sandbox or syscall filter. Library is not affiliated with TypeSafe. Calibrate minConfidence; low confidence should review/suppress, not invent a safer action.

3 · Question stem

What risk class is this tool call? + Do the args match policy / allowlist intent? + Would the side effect be expensive or impossible to undo? + If this goes wrong, how wide is the blast radius? + How should the agent proceed with this tool call?

4 · Options
  • risk_class: read_only | reversible | irreversible | forbidden
  • policy_ok (noul)
  • irreversible (noul)
  • blast_radius Score (4 levels)
  • handoff: continue | ask_user | escalate_specialist | abort
5 · Criteria
read_only
No side effects — read / search / inspect
reversible
Side effects that are cheap to undo
irreversible
Hard or costly to undo (delete, send, spend)
forbidden
Disallowed by policy or clear misuse
policy_ok.true
Args look policy-aligned and within bounds
policy_ok.false
Args violate policy, allowlist, or stated intent
irreversible.true
Cannot cheaply undo (rm, wire money, public post)
irreversible.false
Easy rollback or no durable side effect
blast_radius
Local only — single file or session → Project / team scope → Prod systems or customer-facing → External money / legal / safety
continue
Safe enough — execute now
ask_user
Ask the human before running
escalate_specialist
Hand to a specialist agent / reviewer
abort
Do not run; stop this path
6 · Example in → out
In
tool_name + tool_args + user_goal (+ optional allowlist/policy) as recipe state
Out
Harness maps answers → continue | ask_user | escalate_specialist | abort; low confidence → configured review/suppress (recipe decide())
7 · Source
8 · Notes

From AntonioCoppe/jev-harness recipes/agent-comm-harness tool-gate (verify-gate). Many other recipes ship in-repo (alert gate, row filter, etc.) — this card is the agent tool-call pattern. README timing proof is author-measured.

1 · Title

#N7 pi-heed: conversation constraints before side effects

2 · When to use / When not
When to use

In a pi coding agent, enforce user-stated constraints (read-only, no tests, no deps, protected paths, free-text) before mutating tool calls; rebuild constraints after compaction from the session, not model memory.

When not

Shadow mode by default; fails open on Jev error/timeout. Not a sandbox. Shell side-effect detection is pattern-based — exotic commands can slip. Reads are never checked.

3 · Question stem

Would executing pending_tool_call break any of the user's explicit constraints? Judge only against the constraints listed; necessary investigation or unrelated work is not a violation. + Do the user messages since the constraint was stated (including the one that stated it) explicitly permit this specific pending call, for example by making an exception for this file or this command?

4 · Options
  • custom gate Choice: violates | complies | insufficient
  • exception Choice: permitted | not_permitted | unclear
  • set/lift Nouls for read_only, no_tests, no_deps
  • real_<id> Noul (prohibition vs “don’t forget”)
5 · Criteria
violates
Executing the call would clearly break at least one listed constraint
complies
The call is consistent with every listed constraint
insufficient
The state does not contain enough evidence to decide
permitted
A user message explicitly allows this specific action
not_permitted
No user message allows this action; the constraint still applies to it
unclear
The messages are ambiguous about this action
read_only
The user explicitly forbids the assistant from modifying any files (read-only, review only, just look, no edits).
no_tests
The user explicitly forbids the assistant from modifying, deleting, disabling or skipping tests.
no_deps
The user explicitly forbids the assistant from adding or installing new dependencies or packages.
real_prohibition
The sentence forbids the assistant from taking some action (a real prohibition, not advice like "don't forget" or reassurance like "don't worry").
6 · Example in → out
In
User: “review only, don’t touch anything”; later pending bash that would write notes.txt
Out
Blocked with quoted constraint + call + fix; exception check can allow a carved-out path (README)
7 · Source
8 · Notes

Nyarlathoteppppp/pi-heed. Author-reported live Jev latency/cost figures — verify yourself. Mode: off | shadow | enforce.

1 · Title

#N8 fast-jev-compaction: keep call / keep result Nouls

2 · When to use / When not
When to use

Replace LLM transcript summaries with Jev keep/drop decisions on tool calls and results so kept text stays verbatim (Claude Code plugin or npm library).

When not

Only tool calls/results are candidates; user/assistant text is not removed in the output. Failures throw — caller chooses fallback. Probability ≠ proof a result is safe to delete.

3 · Question stem

Tool call ${call.id} (${call.tool}) should stay in the history: knowing this call was made, with its input, still matters for what the assistant does next + The full output of tool call ${call.id} (${call.tool}, ${call.resultChars} chars) should stay in the history verbatim: the assistant still needs its contents and re-running the tool would not do

4 · Options
  • keepCall (noul)
  • keepResult (noul)
5 · Criteria
keepCall
Knowing this call was made, with its input, still matters for what the assistant does next
keepResult
The assistant still needs its contents and re-running the tool would not do
_decide
keepResult≥threshold → keep both; else keepCall≥threshold → keep call, truncate result; else drop call+result (default keepThreshold 0.5)
6 · Example in → out
In
Session transcript with paired tool_use / tool_result messages (Claude Code SessionMessage subset)
Out
Decisions per call: keep | drop_result | drop_call; toast reports kept N/M with no summary (plugin)
7 · Source
8 · Notes

tamaratran/fast-jev-compaction. Optional merge note: iefnaf/pi-jev also does selective tool-call/result compaction for the pi agent (plus difficulty Score routing) — related idea, different host; not a duplicate long card.