JevAutoModeMiddleware
public final class JevAutoModeMiddleware implements MiddlewareBase
io/agentscope/extensions/judge/jev/example/JevAutoModeMiddleware.java:72–343Jev Auto 模式中间件,在智能体执行流程中提供横切扩展。位于 io.agentscope.extensions.judge.jev.example 包,实现 MiddlewareBase。核心成员包括 builder、order、onActing、DEFAULT_DENY_MESSAGE。
Uses Jev to decide, before execution, whether a guarded tool call is safe enough to run automatically.
For every tool call whose name appears in guardedTools, this middleware asks Jev a
yes/no risk question built from the conversation history and the tool input. Calls whose
P(safe) is at least safetyThreshold pass through; the rest get a synthetic
DENIED tool result written to the conversation state and are never dispatched to the
toolkit. Tool calls that were already explicitly allowed by the user (state ALLOWED)
skip the check entirely, so this guardrail cannot override a human confirmation.
The check runs in #onActing, after any outer middleware that filters or rewrites
tool calls and immediately before the core permission/execution pipeline. This makes it
complementary to the deterministic PermissionEngine: a call that passes the Jev
assessment is still subject to permission deny rules inside the core acting pipeline, so this
middleware adds a model-driven pre-check for the specific tools it guards without replacing
the rule-based engine.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
Builder | 类class | 构建器,用于构建并配置目标实例。 A class in io.agentscope.extensions.judge.jev.example that evaluates agent behaviour and records tracing and telemetry data. |
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
DEFAULT_DENY_MESSAGEstaticfinal | String | 默认拒绝消息字段。 The DEFAULT DENY MESSAGE field. |
方法摘要Method Summary
字段详情Field Detail
DEFAULT_DENY_MESSAGE
public static final String DEFAULT_DENY_MESSAGE
默认拒绝消息字段。声明为 public static final String DEFAULT_DENY_MESSAGE。
The DEFAULT DENY MESSAGE field.
io/agentscope/extensions/judge/jev/example/JevAutoModeMiddleware.java:76–79方法详情Method Detail
builder
public static Builder builder(JevClient client)
返回构建器实例。
Performs the builder operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
client | JevClient | 客户端(类型 `JevClient`)。The client. |
Builderio/agentscope/extensions/judge/jev/example/JevAutoModeMiddleware.java:98–101order
public int order()
返回顺序。
Returns the order.
intio/agentscope/extensions/judge/jev/example/JevAutoModeMiddleware.java:107–110onActing
public Flux<AgentEvent> onActing(Agent agent, RuntimeContext ctx, ActingInput input, Function<ActingInput, Flux<AgentEvent>> next)
处理执行事件。
Performs the on acting operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agent | Agent | 智能体(类型 `Agent`)。The agent. |
ctx | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The ctx. |
input | ActingInput | 输入消息(类型 `ActingInput`)。The input. |
next | Function<ActingInput, Flux<AgentEvent>> | 下一个(类型 `Function >`)。The next. |
Flux<AgentEvent>io/agentscope/extensions/judge/jev/example/JevAutoModeMiddleware.java:112–146嵌套类详情Nested Class Detail
Builder
public static final class Builder构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.judge.jev.example 包。核心成员包括 guardedTool、guardedTools、safetyThreshold、denyMessage、failOpen、build。
A class in io.agentscope.extensions.judge.jev.example that evaluates agent behaviour and records tracing and telemetry data. Declared in io.agentscope.extensions.judge.jev.example.