护栏与审查
基于 OpenRouter,使用确定性策略和 TypeSafe Jev 实现 AI agent 工具调用的运行时授权和安全控制。
Runtime authorization and guardrails for AI-agent tool calls with deterministic policy and TypeSafe Jev via OpenRouter.
JEV_MODEL: z.string().default("typesafe/jev-1.13"),链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
取自 packages/decision-provider/test/openrouter.live.test.ts:12
wants_refund是/否Does the user explicitly request a refund?
intent选项What is the requested outcome?
refund — Refund a chargeexplain — Explain a chargeimport { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
wants_refund: { type: 'boolean', instructions: 'Does the user explicitly request a refund?' },
intent: { type: 'choice', instructions: 'What is the requested outcome?',
criteria: { refund: 'Refund a charge', explain: 'Explain a charge' } },
},
});