Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

feat(eve): add automatic tool approval (#3481)

Casey Gowrie7ef42fd9b6ce
diff --git a/.changeset/auto-tool-approval.md b/.changeset/auto-tool-approval.md
new file mode 100644
index 000000000..631b059f5
--- /dev/null
+++ b/.changeset/auto-tool-approval.md
@@ -0,0 +1,5 @@
+---
+"eve": patch
+---
+
+Add `auto({ model?, instructions?, criteria? })` for evaluation-model tool approvals, defaulting to TypeSafe Jev and failing closed to user approval. Approval policies now receive the active turn's cancellation signal.
diff --git a/apps/templates/eve-chat-template/package.json b/apps/templates/eve-chat-template/package.json
index 2ec63fcdb..0a8f99ab7 100644
--- a/apps/templates/eve-chat-template/package.json
+++ b/apps/templates/eve-chat-template/package.json
@@ -34,7 +34,7 @@
"@vercel/analytics": "2.0.1",
"@vercel/connect": "0.8.0",
"@vercel/speed-insights": "2.0.0",
- "ai": "7.0.84",
+ "ai": "7.0.105",
"better-auth": "1.7.1",
"class-variance-authority": "0.7.1",
"clsx": "2.1.1",
diff --git a/apps/templates/eve-chat-template/pnpm-lock.yaml b/apps/templates/eve-chat-template/pnpm-lock.yaml
index aee939203..d1c7b3b27 100644
--- a/apps/templates/eve-chat-template/pnpm-lock.yaml
+++ b/apps/templates/eve-chat-template/pnpm-lock.yaml
@@ -43,13 +43,13 @@ importers:
'@vercel/connect':
specifier: 0.8.0
'@vercel/speed-insights':
specifier: 2.0.0
ai:
- specifier: 7.0.84
- version: 7.0.84([email protected])
+ specifier: 7.0.105
+ version: 7.0.105([email protected])
better-auth:
specifier: 1.7.1
@@ -67,7 +67,7 @@ importers:
version: 0.45.2(@neondatabase/[email protected])(@types/[email protected])(@upstash/[email protected])([email protected])
eve:
specifier: ^0.54.2
lucide-react:
specifier: 1.33.0
version: 1.33.0([email protected])
@@ -126,20 +126,20 @@ importers:
packages:
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-XKvZv6HFoMOWK64zXMaQatk4SxBzBDkGg7enXPWsCkxqPP4zDhFewOoBKasf3FPnZP9ceE+Yj3BgW925blAWtw==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-c8ztST/CslupqO3p7izsAuG3TlKg9mhE6mGJ42iUADsSMJIV5IOKd9AsLG33QCAY7SWs6NDO2giM/rq7bUTNlQ==}
engines: {node: '>=22'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-TfjJqJmRsQyxAlb+3hGmP1o1xLUIT79yhOgtJuTF4hqsB37IC3CufGsuFhU04EeTOg7R9iptQ6Bzm0MW0n/c3g==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-gw/bcNseOGSs59TMtV4H1KwqXXe24NHgx+uBYr98pa4Fg6Uvp8hPPxjuckVnfFFyIxHCDew8so0ujpvcSuyMZA==}
engines: {node: '>=22'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-aWO7iwhFUGf347tCwNGggggfmZigaSu7TF739IZSrWWABUp7zkb4Cr3fMqvBe5EIS7ABJJu3Cadn0g/zs1G0QQ==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-VYMBxIQdcHqbIf1j+YZlI9Ati6LZ4wJe0GGd4z4a5H/KxTggjeOiyaVYTnfF7LHZK5jMQ+rofmzz4QPqf++NUw==}
engines: {node: '>=22'}
@@ -2542,8 +2542,8 @@ packages:
'@workflow/[email protected]':
resolution: {integrity: sha512-pav4F2BoirECWR7Nf1TKt+2eETcBj7jj4cBefQ8VXQCA6NPkaKeLfj/zMgi+3zYV5ZIBT4GuUiphsj0/b9hPQQ==}
- resolution: {integrity: sha512-znHNBWADOy79k8EK7636kDm5LmnjF4tMzegC2TfmlLDobDZbs0z0OXD2sxtH3eDTp5Re+pJQESvjinWJ6+kadQ==}
+ resolution: {integrity: sha512-gkV3W+tTtWwQ41KNV/KjV8wabBrk+bnbnZ3f0AWp/T9LLyljose8uhFViKleVy7tIdEiR2PiS4BpbNdcExf7rQ==}
engines: {node: '>=22'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
@@ -4096,23 +4096,23 @@ packages:
snapshots:
dependencies:
- '@ai-sdk/provider': 4.0.8
- '@ai-sdk/provider-utils': 5.0.33([email protected])
+ '@ai-sdk/provider': 4.0.17
+ '@ai-sdk/provider-utils': 5.0.43([email protected])
'@vercel/oidc': 3.2.0
zod: 4.4.3
dependencies:
- '@ai-sdk/provider': 4.0.8
+ '@ai-sdk/provider': 4.0.17
'@standard-schema/spec': 1.1.0
'@workflow/serde': 4.1.0
eventsource-parser: 3.1.1
undici: 7.29.1
zod: 4.4.3
- '@ai-sdk/[email protected]':
+ '@ai-sdk/[email protected]':
dependencies:
json-schema: 0.4.0
@@ -6039,13 +6039,13 @@ snapshots:
dependencies:
execa: 5.1.1
dependencies:
'@vercel/oidc': 3.8.4
optionalDependencies:
- ai: 7.0.84([email protected])
+ ai: 7.0.105([email protected])
'@vercel/[email protected]': {}
@@ -6062,11 +6062,11 @@ snapshots:
'@workflow/[email protected]': {}
dependencies:
- '@ai-sdk/gateway': 4.0.68([email protected])
- '@ai-sdk/provider': 4.0.8
- '@ai-sdk/provider-utils': 5.0.33([email protected])
+ '@ai-sdk/gateway': 4.0.85([email protected])
+ '@ai-sdk/provider': 4.0.17
+ '@ai-sdk/provider-utils': 5.0.43([email protected])
zod: 4.4.3
@@ -6514,9 +6514,9 @@ snapshots:
dependencies:
- ai: 7.0.84([email protected])
+ ai: 7.0.105([email protected])
nitro: 3.0.260903-beta
undici: 8.9.0
optionalDependencies:
diff --git a/apps/templates/eve-chat-template/pnpm-workspace.yaml b/apps/templates/eve-chat-template/pnpm-workspace.yaml
index b5ec16db1..8ad3f8339 100644
--- a/apps/templates/eve-chat-template/pnpm-workspace.yaml
+++ b/apps/templates/eve-chat-template/pnpm-workspace.yaml
@@ -2,8 +2,10 @@ packages:
- "."
minimumReleaseAgeExclude:
- - eve
+ - "@ai-sdk/*"
- "@vercel/connect"
+ - ai
+ - eve
allowBuilds:
esbuild: true
diff --git a/apps/templates/eve-llm-council-template/package.json b/apps/templates/eve-llm-council-template/package.json
index e710ab4d4..a85d2285f 100644
--- a/apps/templates/eve-llm-council-template/package.json
+++ b/apps/templates/eve-llm-council-template/package.json
@@ -14,7 +14,7 @@
},
"dependencies": {
"@comark/react": "0.6.2",
- "ai": "^7.0.70",
+ "ai": "^7.0.105",
"eve": "^0.54.2",
"geist": "1.7.2",
"next": "16.3.4",
diff --git a/apps/templates/eve-llm-council-template/pnpm-lock.yaml b/apps/templates/eve-llm-council-template/pnpm-lock.yaml
index e1ef93666..83b96aa41 100644
--- a/apps/templates/eve-llm-council-template/pnpm-lock.yaml
+++ b/apps/templates/eve-llm-council-template/pnpm-lock.yaml
@@ -12,11 +12,11 @@ importers:
specifier: 0.6.2
version: 0.6.2([email protected])
ai:
- specifier: ^7.0.70
- version: 7.0.70([email protected])
+ specifier: ^7.0.105
+ version: 7.0.105([email protected])
eve:
specifier: ^0.54.2
geist:
specifier: 1.7.2
@@ -48,20 +48,20 @@ importers:
packages:
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-fc7tq+v7WrzCV+aXegbq/EOs68tFDJYLEwnCOnVYcB/Y5ZTjUIHzyJlrqdoJUlMTkc/qmKsXb1ovVvdUYPmxIA==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-c8ztST/CslupqO3p7izsAuG3TlKg9mhE6mGJ42iUADsSMJIV5IOKd9AsLG33QCAY7SWs6NDO2giM/rq7bUTNlQ==}
engines: {node: '>=22'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-TnHUyd/rCYQqHg5RuiOaz/hUql6U+kbUaBW0Rp+0N5UhnAInA9CzzV0HXvuAAPwppDsK6fAx9Rd+tRawpJ/3pg==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-gw/bcNseOGSs59TMtV4H1KwqXXe24NHgx+uBYr98pa4Fg6Uvp8hPPxjuckVnfFFyIxHCDew8so0ujpvcSuyMZA==}
engines: {node: '>=22'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-6or44XprPzKbr8zkmzosowSE0pxkvJcoojBL+mCZvPUt3kvXp3XSNqeVun9golb1acEfSo6yaEBRT18h2VU+1Q==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-VYMBxIQdcHqbIf1j+YZlI9Ati6LZ4wJe0GGd4z4a5H/KxTggjeOiyaVYTnfF7LHZK5jMQ+rofmzz4QPqf++NUw==}
engines: {node: '>=22'}
'@comark/[email protected]':
@@ -551,8 +551,8 @@ packages:
'@workflow/[email protected]':
resolution: {integrity: sha512-pav4F2BoirECWR7Nf1TKt+2eETcBj7jj4cBefQ8VXQCA6NPkaKeLfj/zMgi+3zYV5ZIBT4GuUiphsj0/b9hPQQ==}
- resolution: {integrity: sha512-r7Y0alVQqairf0WvT3puyjz5wPMjRV5zYSHiGz87K3uoqkCeK1EaN6O8lLqduSszLcfqC6XVJAIdy3/RkPwPHg==}
+ resolution: {integrity: sha512-gkV3W+tTtWwQ41KNV/KjV8wabBrk+bnbnZ3f0AWp/T9LLyljose8uhFViKleVy7tIdEiR2PiS4BpbNdcExf7rQ==}
engines: {node: '>=22'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
@@ -852,23 +852,23 @@ packages:
snapshots:
dependencies:
- '@ai-sdk/provider': 4.0.7
- '@ai-sdk/provider-utils': 5.0.28([email protected])
+ '@ai-sdk/provider': 4.0.17
+ '@ai-sdk/provider-utils': 5.0.43([email protected])
'@vercel/oidc': 3.2.0
zod: 4.4.3
dependencies:
- '@ai-sdk/provider': 4.0.7
+ '@ai-sdk/provider': 4.0.17
'@standard-schema/spec': 1.1.0
'@workflow/serde': 4.1.0
eventsource-parser: 3.1.1
undici: 7.29.0
zod: 4.4.3
- '@ai-sdk/[email protected]':
+ '@ai-sdk/[email protected]':
dependencies:
json-schema: 0.4.0
@@ -1152,11 +1152,11 @@ snapshots:
'@workflow/[email protected]': {}
dependencies:
- '@ai-sdk/gateway': 4.0.56([email protected])
- '@ai-sdk/provider': 4.0.7
- '@ai-sdk/provider-utils': 5.0.28([email protected])
+ '@ai-sdk/gateway': 4.0.85([email protected])
+ '@ai-sdk/provider': 4.0.17
+ '@ai-sdk/provider-utils': 5.0.43([email protected])
zod: 4.4.3
@@ -1216,9 +1216,9 @@ snapshots:
httpxy: 0.5.5
srvx: 1.0.4
dependencies:
- ai: 7.0.70([email protected])
+ ai: 7.0.105([email protected])
nitro: 3.0.260903-beta
undici: 8.9.0
diff --git a/apps/templates/eve-slack-agent-template/package.json b/apps/templates/eve-slack-agent-template/package.json
index ee2728459..bc1c13ed0 100644
--- a/apps/templates/eve-slack-agent-template/package.json
+++ b/apps/templates/eve-slack-agent-template/package.json
@@ -14,7 +14,7 @@
},
"dependencies": {
"@vercel/connect": "0.8.0",
- "ai": "7.0.70",
+ "ai": "7.0.105",
"eve": "^0.54.2",
"zod": "4.4.3"
},
diff --git a/apps/templates/eve-slack-agent-template/pnpm-lock.yaml b/apps/templates/eve-slack-agent-template/pnpm-lock.yaml
index 3a505e67f..c726d6325 100644
--- a/apps/templates/eve-slack-agent-template/pnpm-lock.yaml
+++ b/apps/templates/eve-slack-agent-template/pnpm-lock.yaml
@@ -10,13 +10,13 @@ importers:
dependencies:
'@vercel/connect':
specifier: 0.8.0
ai:
- specifier: 7.0.70
- version: 7.0.70([email protected])
+ specifier: 7.0.105
+ version: 7.0.105([email protected])
eve:
specifier: ^0.54.2
zod:
specifier: 4.4.3
version: 4.4.3
@@ -30,20 +30,20 @@ importers:
packages:
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-fc7tq+v7WrzCV+aXegbq/EOs68tFDJYLEwnCOnVYcB/Y5ZTjUIHzyJlrqdoJUlMTkc/qmKsXb1ovVvdUYPmxIA==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-c8ztST/CslupqO3p7izsAuG3TlKg9mhE6mGJ42iUADsSMJIV5IOKd9AsLG33QCAY7SWs6NDO2giM/rq7bUTNlQ==}
engines: {node: '>=22'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-TnHUyd/rCYQqHg5RuiOaz/hUql6U+kbUaBW0Rp+0N5UhnAInA9CzzV0HXvuAAPwppDsK6fAx9Rd+tRawpJ/3pg==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-gw/bcNseOGSs59TMtV4H1KwqXXe24NHgx+uBYr98pa4Fg6Uvp8hPPxjuckVnfFFyIxHCDew8so0ujpvcSuyMZA==}
engines: {node: '>=22'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-6or44XprPzKbr8zkmzosowSE0pxkvJcoojBL+mCZvPUt3kvXp3XSNqeVun9golb1acEfSo6yaEBRT18h2VU+1Q==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-VYMBxIQdcHqbIf1j+YZlI9Ati6LZ4wJe0GGd4z4a5H/KxTggjeOiyaVYTnfF7LHZK5jMQ+rofmzz4QPqf++NUw==}
engines: {node: '>=22'}
'@oxc-project/[email protected]':
@@ -315,8 +315,8 @@ packages:
'@workflow/[email protected]':
resolution: {integrity: sha512-pav4F2BoirECWR7Nf1TKt+2eETcBj7jj4cBefQ8VXQCA6NPkaKeLfj/zMgi+3zYV5ZIBT4GuUiphsj0/b9hPQQ==}
- resolution: {integrity: sha512-r7Y0alVQqairf0WvT3puyjz5wPMjRV5zYSHiGz87K3uoqkCeK1EaN6O8lLqduSszLcfqC6XVJAIdy3/RkPwPHg==}
+ resolution: {integrity: sha512-gkV3W+tTtWwQ41KNV/KjV8wabBrk+bnbnZ3f0AWp/T9LLyljose8uhFViKleVy7tIdEiR2PiS4BpbNdcExf7rQ==}
engines: {node: '>=22'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
@@ -526,23 +526,23 @@ packages:
snapshots:
dependencies:
- '@ai-sdk/provider': 4.0.7
- '@ai-sdk/provider-utils': 5.0.28([email protected])
+ '@ai-sdk/provider': 4.0.17
+ '@ai-sdk/provider-utils': 5.0.43([email protected])
'@vercel/oidc': 3.2.0
zod: 4.4.3
dependencies:
- '@ai-sdk/provider': 4.0.7
+ '@ai-sdk/provider': 4.0.17
'@standard-schema/spec': 1.1.0
'@workflow/serde': 4.1.0
eventsource-parser: 3.1.1
undici: 7.29.0
zod: 4.4.3
- '@ai-sdk/[email protected]':
+ '@ai-sdk/[email protected]':
dependencies:
json-schema: 0.4.0
@@ -670,12 +670,12 @@ snapshots:
dependencies:
execa: 5.1.1
dependencies:
'@vercel/oidc': 3.8.4
optionalDependencies:
- ai: 7.0.70([email protected])
+ ai: 7.0.105([email protected])
'@vercel/[email protected]': {}
@@ -687,11 +687,11 @@ snapshots:
'@workflow/[email protected]': {}
dependencies:
- '@ai-sdk/gateway': 4.0.56([email protected])
- '@ai-sdk/provider': 4.0.7
- '@ai-sdk/provider-utils': 5.0.28([email protected])
+ '@ai-sdk/gateway': 4.0.85([email protected])
+ '@ai-sdk/provider': 4.0.17
+ '@ai-sdk/provider-utils': 5.0.43([email protected])
zod: 4.4.3
@@ -715,9 +715,9 @@ snapshots:
httpxy: 0.5.5
srvx: 1.0.4
dependencies:
- ai: 7.0.70([email protected])
+ ai: 7.0.105([email protected])
nitro: 3.0.260903-beta
undici: 8.9.0
diff --git a/apps/templates/personal-agent-template/package.json b/apps/templates/personal-agent-template/package.json
index b1f22916a..906105589 100644
--- a/apps/templates/personal-agent-template/package.json
+++ b/apps/templates/personal-agent-template/package.json
@@ -32,7 +32,7 @@
"@shikijs/langs": "^4.4.3",
"@vercel/analytics": "^2.0.1",
"@vercel/connect": "0.8.0",
- "ai": "^7.0.70",
+ "ai": "^7.0.105",
"better-auth": "^1.7.1",
"chat": "^4.38.1",
"chat-adapter-sendblue": "^0.2.0",
diff --git a/apps/templates/personal-agent-template/pnpm-lock.yaml b/apps/templates/personal-agent-template/pnpm-lock.yaml
index 9628d311b..185227ae7 100644
--- a/apps/templates/personal-agent-template/pnpm-lock.yaml
+++ b/apps/templates/personal-agent-template/pnpm-lock.yaml
@@ -13,13 +13,13 @@ importers:
'@github-tools/sdk':
specifier: ^1.11.1
'@libsql/client':
specifier: ^0.17.4
version: 0.17.4
'@nuxt/ui':
specifier: ^4.11.1
- version: 4.11.1(b1a3df63fb042e42b75eaddf3ef85b31)
+ version: 4.11.1(bb980e1ad3ed1800d848c88676a3cc2c)
'@nuxthub/core':
specifier: ^0.10.8
@@ -31,19 +31,19 @@ importers:
version: 2.0.1([email protected](99e75a557cede4926b71c8c93d703d06))([email protected])([email protected]([email protected]))
'@vercel/connect':
specifier: 0.8.0
ai:
- specifier: ^7.0.70
- version: 7.0.70([email protected])
+ specifier: ^7.0.105
+ version: 7.0.105([email protected])
better-auth:
specifier: ^1.7.1
chat:
specifier: ^4.38.1
chat-adapter-sendblue:
specifier: ^0.2.0
drizzle-kit:
specifier: ^0.31.10
version: 0.31.10
@@ -52,7 +52,7 @@ importers:
eve:
specifier: ^0.54.2
maska:
specifier: ^3.2.0
version: 3.2.0
@@ -96,20 +96,20 @@ importers:
packages:
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-fc7tq+v7WrzCV+aXegbq/EOs68tFDJYLEwnCOnVYcB/Y5ZTjUIHzyJlrqdoJUlMTkc/qmKsXb1ovVvdUYPmxIA==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-c8ztST/CslupqO3p7izsAuG3TlKg9mhE6mGJ42iUADsSMJIV5IOKd9AsLG33QCAY7SWs6NDO2giM/rq7bUTNlQ==}
engines: {node: '>=22'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-TnHUyd/rCYQqHg5RuiOaz/hUql6U+kbUaBW0Rp+0N5UhnAInA9CzzV0HXvuAAPwppDsK6fAx9Rd+tRawpJ/3pg==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-gw/bcNseOGSs59TMtV4H1KwqXXe24NHgx+uBYr98pa4Fg6Uvp8hPPxjuckVnfFFyIxHCDew8so0ujpvcSuyMZA==}
engines: {node: '>=22'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-6or44XprPzKbr8zkmzosowSE0pxkvJcoojBL+mCZvPUt3kvXp3XSNqeVun9golb1acEfSo6yaEBRT18h2VU+1Q==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-VYMBxIQdcHqbIf1j+YZlI9Ati6LZ4wJe0GGd4z4a5H/KxTggjeOiyaVYTnfF7LHZK5jMQ+rofmzz4QPqf++NUw==}
engines: {node: '>=22'}
@@ -3050,8 +3050,8 @@ packages:
resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==}
engines: {node: '>= 14'}
- resolution: {integrity: sha512-r7Y0alVQqairf0WvT3puyjz5wPMjRV5zYSHiGz87K3uoqkCeK1EaN6O8lLqduSszLcfqC6XVJAIdy3/RkPwPHg==}
+ resolution: {integrity: sha512-gkV3W+tTtWwQ41KNV/KjV8wabBrk+bnbnZ3f0AWp/T9LLyljose8uhFViKleVy7tIdEiR2PiS4BpbNdcExf7rQ==}
engines: {node: '>=22'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
@@ -6526,23 +6526,23 @@ packages:
snapshots:
dependencies:
- '@ai-sdk/provider': 4.0.7
- '@ai-sdk/provider-utils': 5.0.28([email protected])
+ '@ai-sdk/provider': 4.0.17
+ '@ai-sdk/provider-utils': 5.0.43([email protected])
'@vercel/oidc': 3.2.0
zod: 4.4.3
dependencies:
- '@ai-sdk/provider': 4.0.7
+ '@ai-sdk/provider': 4.0.17
'@standard-schema/spec': 1.1.0
'@workflow/serde': 4.1.0
eventsource-parser: 3.1.1
undici: 7.29.0
zod: 4.4.3
- '@ai-sdk/[email protected]':
+ '@ai-sdk/[email protected]':
dependencies:
json-schema: 0.4.0
@@ -7229,14 +7229,14 @@ snapshots:
- '@vue/composition-api'
- vue
dependencies:
- ai: 7.0.70([email protected])
+ ai: 7.0.105([email protected])
octokit: 5.0.5
zod: 4.4.3
optionalDependencies:
'@iconify-json/[email protected]':
dependencies:
@@ -7288,7 +7288,7 @@ snapshots:
'@jridgewell/[email protected]':
dependencies:
- '@jridgewell/sourcemap-codec': 1.5.5
+ '@jridgewell/sourcemap-codec': 1.6.0
'@jridgewell/trace-mapping': 0.3.31
'@jridgewell/[email protected]':
@@ -7811,7 +7811,7 @@ snapshots:
rc9: 3.0.1
std-env: 4.2.0
- '@nuxt/[email protected](b1a3df63fb042e42b75eaddf3ef85b31)':
+ '@nuxt/[email protected](bb980e1ad3ed1800d848c88676a3cc2c)':
dependencies:
'@floating-ui/dom': 1.8.0
'@iconify/vue': 5.0.1([email protected]([email protected]))
@@ -7880,7 +7880,7 @@ snapshots:
optionalDependencies:
'@internationalized/date': 3.12.3
'@internationalized/number': 3.6.7
- ai: 7.0.70([email protected])
+ ai: 7.0.105([email protected])
zod: 4.4.3
transitivePeerDependencies:
- '@azure/app-configuration'
@@ -9255,13 +9255,13 @@ snapshots:
dependencies:
execa: 5.1.1
dependencies:
'@vercel/oidc': 3.8.4
optionalDependencies:
- ai: 7.0.70([email protected])
+ ai: 7.0.105([email protected])
dependencies:
@@ -9502,11 +9502,11 @@ snapshots:
dependencies:
- '@ai-sdk/gateway': 4.0.56([email protected])
- '@ai-sdk/provider': 4.0.7
- '@ai-sdk/provider-utils': 5.0.28([email protected])
+ '@ai-sdk/gateway': 4.0.85([email protected])
+ '@ai-sdk/provider': 4.0.17
+ '@ai-sdk/provider-utils': 5.0.43([email protected])
zod: 4.4.3
@@ -9764,12 +9764,12 @@ snapshots:
dependencies:
sendblue: 3.11.0
dependencies:
'@workflow/serde': 4.1.0-beta.2
mdast-util-to-string: 4.0.0
@@ -9779,7 +9779,7 @@ snapshots:
remend: 1.3.0
unified: 11.0.5
optionalDependencies:
- ai: 7.0.70([email protected])
+ ai: 7.0.105([email protected])
zod: 4.4.3
transitivePeerDependencies:
- supports-color
@@ -10290,9 +10290,9 @@ snapshots:
dependencies:
- ai: 7.0.70([email protected])
+ ai: 7.0.105([email protected])
nitro: 3.0.260903-beta
undici: 8.9.0
optionalDependencies:
@@ -10972,7 +10972,7 @@ snapshots:
dependencies:
- '@jridgewell/sourcemap-codec': 1.5.5
+ '@jridgewell/sourcemap-codec': 1.6.0
dependencies:
diff --git a/apps/templates/personal-agent-template/pnpm-workspace.yaml b/apps/templates/personal-agent-template/pnpm-workspace.yaml
index 66edcf498..630dcced0 100644
--- a/apps/templates/personal-agent-template/pnpm-workspace.yaml
+++ b/apps/templates/personal-agent-template/pnpm-workspace.yaml
@@ -2,8 +2,10 @@ packages:
- "."
minimumReleaseAgeExclude:
- - eve
+ - "@ai-sdk/*"
- "@vercel/connect"
+ - ai
+ - eve
allowBuilds:
"@parcel/watcher": false
diff --git a/docs/connections/mcp.mdx b/docs/connections/mcp.mdx
index fa93063f6..25d00d22c 100644
--- a/docs/connections/mcp.mdx
+++ b/docs/connections/mcp.mdx
@@ -100,11 +100,11 @@ Prefer `allow` for the smallest safe surface, especially when the server exposes
## Approval gates
-Use the shared `approval` option to gate every tool served by an MCP connection. The [connections overview](../connections#per-connection-approval) defines the `never()`, `once()`, and `always()` helpers; [Human-in-the-loop](../human-in-the-loop#approvals) defines the pause-and-resume contract.
+Use the shared `approval` option to gate every tool served by an MCP connection. The [connections overview](../connections#per-connection-approval) defines the `never()`, `once()`, `always()`, and `auto()` helpers; [Human-in-the-loop](../human-in-the-loop#approvals) defines the pause-and-resume contract.
### Gate specific tools by name or input
-A remote MCP server usually mixes read tools with destructive or publishing ones, so a blanket `always()` would prompt on every harmless call. Pass a custom policy instead — the same [`Approval`](/docs/human-in-the-loop#approvals) shape authored tools use — to gate only the calls that matter. The policy receives `{ session, toolName, toolInput, approvedTools }` and returns an approval status, synchronously or as a promise.
+A remote MCP server usually mixes read tools with destructive or publishing ones, so a blanket `always()` would prompt on every harmless call. Pass a custom policy instead — the same [`Approval`](/docs/human-in-the-loop#approvals) shape authored tools use — to gate only the calls that matter. The policy receives `{ session, toolName, toolInput, approvedTools, callId, abortSignal }` and returns an approval status, synchronously or as a promise.
This connection always gates deletes, gates a publish only when the call actually schedules a post, and lets everything else through:
diff --git a/docs/connections/overview.mdx b/docs/connections/overview.mdx
index c7cf46bbb..9dad0e774 100644
--- a/docs/connections/overview.mdx
+++ b/docs/connections/overview.mdx
@@ -172,7 +172,7 @@ export default defineMcpClientConnection({
});
```
-`never()` lets every call through, `once()` asks for approval the first time in a session, and `always()` asks every time. The pause and resume is the same human-in-the-loop flow covered in [Tools](/docs/tools).
+`never()` lets every call through, `once()` asks for approval the first time in a session, `always()` asks every time, and `auto()` uses an evaluation model to allow routine calls and ask about dangerous or unclear effects. The pause and resume is the same human-in-the-loop flow covered in [Tools](/docs/tools).
For connection tools that can create, modify, delete, transmit, purchase, message, or access sensitive data, use approval, allow-lists, or other safeguards appropriate to the action.
diff --git a/docs/guides/evaluate.md b/docs/guides/evaluate.md
index ecb5bf1c9..d7600bf77 100644
--- a/docs/guides/evaluate.md
+++ b/docs/guides/evaluate.md
@@ -152,6 +152,31 @@ You can also call `evaluate` outside a tool; it does not require an active eve
session. Each call performs its own evaluation. `autoModel` uses this function
and adds the per-turn routing behavior described below.
+## Evaluate tool approvals
+
+Use `auto({ model? })` when an evaluation model should decide whether a
+tool call can run automatically or needs human approval. It accepts the same
+AI SDK evaluation model strings and provider instances described above and
+defaults to `typesafe-ai/jev`:
+
+```ts title="agent/tools/deploy.ts"
+import { defineTool } from "eve/tools";
+import { auto } from "eve/tools/approval";
+import { z } from "zod";
+
+export default defineTool({
+ description: "Deploy an application.",
+ inputSchema: z.object({ environment: z.string() }),
+ approval: auto({ model: "typesafe-ai/jev" }), // Uses AI SDK string-model resolution
+ execute: ({ environment }) => deploy(environment),
+});
+```
+
+The evaluation model reviews the tool name and input for dangerous effects. A
+caution, failed review, or incomplete input requires human approval. See
+[Human-in-the-loop approvals](/docs/human-in-the-loop#approvals) for classifier
+options and data handling.
+
## Runtime behavior
`autoModel` evaluates at the first `step.started` event, after the incoming prompt
diff --git a/docs/reference/typescript-api.md b/docs/reference/typescript-api.md
index 7695f4827..45c02011a 100644
--- a/docs/reference/typescript-api.md
+++ b/docs/reference/typescript-api.md
@@ -115,7 +115,7 @@ import template from "../../prompts/template.txt?raw";
| `eve` | `defineAgent`, `defineRemoteAgent`, `defineDynamic`, agent config types |
| `eve/tools` | `defineTool`, `defineWorkflowTool`, `defineDurableCallback`, `defineDurableSchema`, `defineDynamic`, `disableTool`, tool types |
| `eve/tools/{bash,read_file,write_file,todo,web_fetch,load_skill,glob,grep}` | Individual reusable tool definitions |
-| `eve/tools/approval` | Approval types and `always`, `once`, `never` |
+| `eve/tools/approval` | Approval types and `auto`, `always`, `once`, `never` |
| `eve/tools/web_search` | Provider-managed `webSearch` configuration |
| `eve/tools/workflow` | Runtime-generated `workflow` tool factory |
| `eve/tools/sleep` | Opt-in durable `sleep` tool |
diff --git a/docs/tools/human-in-the-loop.md b/docs/tools/human-in-the-loop.md
index ad4dd0792..a08ef2ac5 100644
--- a/docs/tools/human-in-the-loop.md
+++ b/docs/tools/human-in-the-loop.md
@@ -6,24 +6,24 @@ url: /human-in-the-loop
Human-in-the-loop (HITL) is any point where the agent durably pauses and waits for a person. Two things trigger it, and both ride the same pause-and-resume protocol:
-- **Approvals** — a tool requires a person to sign off before (or instead of) running. The agent decides to call the tool; a human decides whether it does.
+- **Approvals** — a tool policy allows, denies, or pauses a call for a person to review. The agent decides to call the tool; the policy decides whether it runs automatically or needs a human decision.
- **Questions** — the agent itself asks the user a clarifying question or a choice mid-turn, and parks until they answer.
Either way the run parks at `session.waiting`, durably, for as long as it takes — seconds or days — and picks back up exactly where it left off once the answer arrives. Channels render the request for you.
## Approvals
-Approval is a property of a [tool](/docs/tools) that pauses for a person before it runs. Gate a tool with `approval` and the helpers from `eve/tools/approval`:
+Approval is a property of a [tool](/docs/tools) that gates it before it runs. The policy can decide automatically or pause for a person. Set `approval` with the helpers from `eve/tools/approval`:
```ts title="agent/tools/refund_charge.ts"
import { defineTool } from "eve/tools";
-import { always } from "eve/tools/approval";
+import { auto } from "eve/tools/approval";
import { z } from "zod";
export default defineTool({
description: "Refund a charge.",
inputSchema: z.object({ tenantId: z.string(), chargeId: z.string(), amount: z.number() }),
- approval: always(), // or once() / never() / a policy
+ approval: auto(), // or always() / once() / never() / a policy
async execute(input) {
return refund(input);
},
@@ -35,12 +35,34 @@ export default defineTool({
| `never()` | Never require approval (the default when omitted). |
| `once()` | Require approval only the first time the tool runs in a session; auto-allow after. |
| `always()` | Require approval before every call. |
+| `auto()` | Ask an evaluation model whether to run the exact call or require user approval. |
By default, omitted `approval` behaves like `never()`, so tool calls may execute without human approval. Require human approval or other safeguards for sensitive, irreversible, regulated, financial, healthcare, employment, housing, legal, safety-impacting, user-impacting, or external side-effecting actions.
+`auto()` uses an [AI SDK evaluation model](/docs/guides/evaluate) to classify each call as `clear` or `caution`. It defaults to `typesafe-ai/jev`. Like `evaluate`, a model string uses Vercel AI Gateway unless the application configures a global AI SDK default provider:
+
+```ts
+approval: auto({ model: "typesafe-ai/jev" });
+```
+
+The evaluation model reviews the tool name and input for dangerous effects. A caution, failed review, or incomplete input requires user approval. The tool input is sent to the evaluation model's provider.
+
+Override the classifier text for application-specific policy:
+
+```ts
+approval: auto({
+ model: "typesafe-ai/jev",
+ instructions: "Review whether this refund needs finance approval.",
+ criteria: {
+ clear: "The refund can proceed automatically.",
+ caution: "A person must review the refund.",
+ },
+});
+```
+
A reusable approval grant applies only after every matching request that is already pending has been resolved. If several calls to a `once()`-gated tool have each produced an approval prompt, approving one does not authorize the others; each visible prompt remains an independent decision. After those pending requests are resolved, later calls in the session are allowed automatically.
-When the decision depends on the input, pass your own policy instead of a helper. It receives the same session context as tool execution, plus `{ toolName, toolInput, approvedTools, callId }`, and returns an AI SDK 7 approval status synchronously or as a promise. Use `ctx.session.auth.current` to guard by the caller of the current turn and `ctx.session.auth.initiator` to guard by the caller that created the session. Return `"user-approval"` to pause for a person or `"not-applicable"` to continue without a prompt. `toolInput` can be undefined, so guard the access. This policy denies cross-tenant calls, then requires approval only when an amount crosses a threshold:
+When the decision depends on the input, pass your own policy instead of a helper. It receives the same session context as tool execution, plus `{ toolName, toolInput, approvedTools, callId, abortSignal }`, and returns an AI SDK 7 approval status synchronously or as a promise. Use `abortSignal` for asynchronous policy work so cancellation stops it with the turn. Use `ctx.session.auth.current` to guard by the caller of the current turn and `ctx.session.auth.initiator` to guard by the caller that created the session. Return `"user-approval"` to pause for a person or `"not-applicable"` to continue without a prompt. `toolInput` can be undefined, so guard the access. This policy denies cross-tenant calls, then requires approval only when an amount crosses a threshold:
```ts
approval: ({ session, toolInput }) => {
diff --git a/docs/tools/overview.mdx b/docs/tools/overview.mdx
index 09b439d26..dee48836a 100644
--- a/docs/tools/overview.mdx
+++ b/docs/tools/overview.mdx
@@ -212,14 +212,14 @@ import { z } from "zod";
export default defineTool({
description: "Refund a charge.",
inputSchema: z.object({ chargeId: z.string(), amount: z.number() }),
- approval: always(), // or once() / never() / a policy
+ approval: always(), // or auto() / once() / never() / a policy
async execute(input) {
return refund(input);
},
});
```
-Approval is one half of eve's [human-in-the-loop](./human-in-the-loop) model — the page covers the `always/once/never` helpers, input-dependent policies, and how a gated call pauses and resumes durably.
+Approval is one half of eve's [human-in-the-loop](./human-in-the-loop) model — the page covers the `auto`/`always`/`once`/`never` helpers, input-dependent policies, and how a gated call pauses and resumes durably.
## Shape what the model sees with `toModelOutput`
diff --git a/e2e/fixtures/agent-evaluate/agent/agent.ts b/e2e/fixtures/agent-evaluate/agent/agent.ts
index 55ac687b1..2e6c354ec 100644
--- a/e2e/fixtures/agent-evaluate/agent/agent.ts
+++ b/e2e/fixtures/agent-evaluate/agent/agent.ts
@@ -8,6 +8,23 @@ const { experimental } = e2eAgentConfig();
export default defineAgent({
experimental,
model: fixtureModel(async (request) => {
+ if (request.userMessages.some((text) => text.includes("automatic-review"))) {
+ const result = request.toolResults.find((entry) => entry.name === "automatic-review");
+ if (result) return JSON.stringify({ isError: result.isError, output: result.output });
+ return {
+ toolCalls: [
+ {
+ id: "automatic-review-1",
+ name: "automatic-review",
+ input: {
+ effect: request.userMessages.some((text) => text.includes("malicious"))
+ ? "malicious"
+ : "safe",
+ },
+ },
+ ],
+ };
+ }
if (request.userMessages.some((text) => text.includes("evaluate-request"))) {
const result = request.toolResults.find((result) => result.name === "evaluate-request");
if (result) return JSON.stringify({ isError: result.isError, output: result.output });
diff --git a/e2e/fixtures/agent-evaluate/agent/testing.ts b/e2e/fixtures/agent-evaluate/agent/testing.ts
index 8387e273d..0850c51ce 100644
--- a/e2e/fixtures/agent-evaluate/agent/testing.ts
+++ b/e2e/fixtures/agent-evaluate/agent/testing.ts
@@ -10,6 +10,21 @@ export const routing = defineState("evaluate-fixture.routing", () => ({
reasoning: "unselected",
}));
+export const permissionEvaluationModel: Exclude<Experimental_EvaluationModel, string> = {
+ specificationVersion: "v4",
+ provider: "fixture",
+ modelId: "fixture-permission-evaluator",
+ supportedQuestionTypes: ["choice"],
+ async doEvaluate({ state }) {
+ const choice = JSON.stringify(state).includes('"effect":"malicious"') ? "caution" : "clear";
+ return {
+ answers: { permission: { type: "choice", choice } },
+ usage: { inputTokens: 20, outputTokens: 1 },
+ warnings: [],
+ };
+ },
+};
+
export const evaluationModel: Exclude<Experimental_EvaluationModel, string> = {
specificationVersion: "v4",
provider: "fixture",
diff --git a/e2e/fixtures/agent-evaluate/agent/tools/automatic-review.ts b/e2e/fixtures/agent-evaluate/agent/tools/automatic-review.ts
new file mode 100644
index 000000000..16be5b3a0
--- /dev/null
+++ b/e2e/fixtures/agent-evaluate/agent/tools/automatic-review.ts
@@ -0,0 +1,18 @@
+import { defineTool } from "eve/tools";
+import { auto } from "eve/tools/approval";
+
+import { permissionEvaluationModel } from "../testing";
+
+export default defineTool({
+ description: "Exercise evaluation-model approval.",
+ inputSchema: {
+ type: "object",
+ properties: { effect: { type: "string", enum: ["safe", "malicious"] } },
+ required: ["effect"],
+ additionalProperties: false,
+ },
+ approval: auto({ model: permissionEvaluationModel }),
+ execute({ effect }) {
+ return { effect, executed: true };
+ },
+});
diff --git a/e2e/fixtures/agent-evaluate/evals/automatic-approval.eval.ts b/e2e/fixtures/agent-evaluate/evals/automatic-approval.eval.ts
new file mode 100644
index 000000000..0abe4dbc0
--- /dev/null
+++ b/e2e/fixtures/agent-evaluate/evals/automatic-approval.eval.ts
@@ -0,0 +1,33 @@
+import { defineEval } from "eve/evals";
+
+export default defineEval({
+ description: "Automatic approval allows safe calls and asks about malicious calls.",
+ async test(t) {
+ const safe = await t.send("Call automatic-review for a safe effect.");
+ safe.expectOk();
+ safe.calledTool("automatic-review", {
+ count: 1,
+ output: { effect: "safe", executed: true },
+ status: "completed",
+ });
+
+ const malicious = await t.send("Call automatic-review for a malicious effect.");
+ malicious.expectOk();
+ malicious.calledTool("automatic-review", { count: 1, status: "pending" });
+ const request = malicious.session.requireInputRequest({
+ display: "confirmation",
+ toolName: "automatic-review",
+ });
+
+ const approved = await malicious.session.respond([
+ { optionId: "approve", requestId: request.requestId },
+ ]);
+ approved.expectOk();
+ approved.session.calledTool("automatic-review", {
+ count: 1,
+ output: { effect: "malicious", executed: true },
+ status: "completed",
+ });
+ approved.session.succeeded();
+ },
+});
diff --git a/packages/eve/extension-contracts/compatibility/connection/v21.ts b/packages/eve/extension-contracts/compatibility/connection/v21.ts
new file mode 100644
index 000000000..c3b0e35fa
--- /dev/null
+++ b/packages/eve/extension-contracts/compatibility/connection/v21.ts
@@ -0,0 +1,9 @@
+import { defineMcpClientConnection } from "#public/connections/index.js";
+
+export default defineMcpClientConnection({
+ description: "Read the support queue after approval.",
+ url: "https://support.example.com/mcp",
+ approval({ toolInput, toolName }) {
+ return toolName && toolInput !== undefined ? "user-approval" : "denied";
+ },
+});
diff --git a/packages/eve/extension-contracts/compatibility/dynamicTool/v46.ts b/packages/eve/extension-contracts/compatibility/dynamicTool/v46.ts
new file mode 100644
index 000000000..13a0ffc25
--- /dev/null
+++ b/packages/eve/extension-contracts/compatibility/dynamicTool/v46.ts
@@ -0,0 +1,26 @@
+import { defineDurableCallback, defineDynamic, defineTool } from "#public/tools/index.js";
+
+export default defineDynamic({
+ events: {
+ "session.started": (_event, context) => ({
+ guarded: defineTool({
+ description: "Return a captured value after approval.",
+ inputSchema: {
+ type: "object",
+ properties: { value: { type: "string" } },
+ required: ["value"],
+ additionalProperties: false,
+ },
+ approval: defineDurableCallback({
+ closure: { sessionId: context.session.id },
+ callback: ({ sessionId }, { toolInput }) =>
+ sessionId && toolInput?.value ? "user-approval" : "denied",
+ }),
+ execute: defineDurableCallback({
+ closure: { sessionId: context.session.id },
+ callback: ({ sessionId }, { value }) => ({ sessionId, value }),
+ }),
+ }),
+ }),
+ },
+});
diff --git a/packages/eve/extension-contracts/compatibility/tool/v48.ts b/packages/eve/extension-contracts/compatibility/tool/v48.ts
new file mode 100644
index 000000000..79e42d299
--- /dev/null
+++ b/packages/eve/extension-contracts/compatibility/tool/v48.ts
@@ -0,0 +1,17 @@
+import { defineTool } from "#public/tools/index.js";
+
+export default defineTool({
+ description: "Report a guarded value.",
+ inputSchema: {
+ type: "object",
+ properties: { value: { type: "string" } },
+ required: ["value"],
+ additionalProperties: false,
+ },
+ approval({ callId, toolInput, toolName }) {
+ return callId && toolName && toolInput?.value ? "user-approval" : "denied";
+ },
+ execute({ value }) {
+ return value;
+ },
+});
diff --git a/packages/eve/extension-contracts/reports/connection/v22.json b/packages/eve/extension-contracts/reports/connection/v22.json
new file mode 100644
index 000000000..9f04abec9
--- /dev/null
+++ b/packages/eve/extension-contracts/reports/connection/v22.json
@@ -0,0 +1,16 @@
+{
+ "kind": "eve-extension-capability-contract",
+ "capability": "connection",
+ "epoch": 22,
+ "sha256": "af05c37388961466957cb89d9c748aad73e8dd0fbd9277fa9821de8d802e2dac",
+ "exports": [
+ "ConnectionAuthorizationFailedError",
+ "ConnectionAuthorizationRequiredError",
+ "defineDynamic",
+ "defineInteractiveAuthorization",
+ "defineMcpClientConnection",
+ "defineOpenAPIConnection",
+ "isConnectionAuthorizationFailedError",
+ "isConnectionAuthorizationRequiredError"
+ ]
+}
diff --git a/packages/eve/extension-contracts/reports/dynamicTool/v47.json b/packages/eve/extension-contracts/reports/dynamicTool/v47.json
new file mode 100644
index 000000000..42ef91f8a
--- /dev/null
+++ b/packages/eve/extension-contracts/reports/dynamicTool/v47.json
@@ -0,0 +1,16 @@
+{
+ "kind": "eve-extension-capability-contract",
+ "capability": "dynamicTool",
+ "epoch": 47,
+ "sha256": "287831252b8ea473cf6f1937e5d5da15bbf3b7ac09028be0a34a0d8ddabfce76",
+ "exports": [
+ "DynamicToolEntry",
+ "DynamicToolEvents",
+ "DynamicToolResult",
+ "DynamicToolSet",
+ "autoModel",
+ "defineDurableCallback",
+ "defineDurableSchema",
+ "defineDynamic"
+ ]
+}
diff --git a/packages/eve/extension-contracts/reports/tool/v49.json b/packages/eve/extension-contracts/reports/tool/v49.json
new file mode 100644
index 000000000..6b59df8ab
--- /dev/null
+++ b/packages/eve/extension-contracts/reports/tool/v49.json
@@ -0,0 +1,23 @@
+{
+ "kind": "eve-extension-capability-contract",
+ "capability": "tool",
+ "epoch": 49,
+ "sha256": "ce1aba64de58c372c4a23d631123e2ce231fcb2315e99e39d0aeb9c4acf2993b",
+ "exports": [
+ "WorkflowTool",
+ "WorkflowToolInput",
+ "WorkflowToolOptions",
+ "defaultWebSearch",
+ "defineTool",
+ "defineWorkflowTool",
+ "disableTool",
+ "evaluate",
+ "isDisabledToolSentinel",
+ "isWebSearchToolDefinition",
+ "toolOutput",
+ "toolOutputPart",
+ "toolResultFrom",
+ "webSearch",
+ "workflow"
+ ]
+}
diff --git a/packages/eve/src/approval/definition.ts b/packages/eve/src/approval/definition.ts
index ad551bfb1..8357ac079 100644
--- a/packages/eve/src/approval/definition.ts
+++ b/packages/eve/src/approval/definition.ts
@@ -13,6 +13,8 @@ type ApprovalToolInput<TInput> = TInput extends object ? Readonly<TInput> : TInp
* the active session, current caller, and turn.
*/
export interface ApprovalContext<TInput = Record<string, unknown>> extends SessionContext {
+ /** Cancels policy work when the active model generation is cancelled. */
+ readonly abortSignal: AbortSignal;
readonly approvedTools: ReadonlySet<string>;
readonly callId: string;
readonly toolInput?: ApprovalToolInput<TInput>;
diff --git a/packages/eve/src/compiler/extension-compatibility.ts b/packages/eve/src/compiler/extension-compatibility.ts
index 6687d03d4..14d26b42e 100644
--- a/packages/eve/src/compiler/extension-compatibility.ts
+++ b/packages/eve/src/compiler/extension-compatibility.ts
@@ -22,9 +22,9 @@ interface ExtensionCapabilityContract {
const EXTENSION_CAPABILITY_CONTRACTS = {
extension: { current: 1, supported: [1], dropped: {} },
tool: {
- current: 48,
+ current: 49,
supported: [
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 28, 29, 30, 31, 32, 34, 35, 44, 45, 46, 47, 48,
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 28, 29, 30, 31, 32, 34, 35, 44, 45, 46, 47, 48, 49,
],
dropped: {
14: "TaskExec.delegated was removed; migrate to workflow-backed background tools",
@@ -53,10 +53,10 @@ const EXTENSION_CAPABILITY_CONTRACTS = {
},
},
dynamicTool: {
- current: 46,
+ current: 47,
supported: [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 28, 29, 30, 31, 32,
- 33, 41, 42, 43, 44, 45, 46,
+ 33, 41, 42, 43, 44, 45, 46, 47,
],
dropped: {
21: "Message and reasoning append events now expose deltas instead of cumulative snapshots.",
@@ -102,8 +102,8 @@ const EXTENSION_CAPABILITY_CONTRACTS = {
},
},
connection: {
- current: 21,
- supported: [1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21],
+ current: 22,
+ supported: [1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22],
dropped: {
9: "Dynamic connection resolvers no longer receive conversation or channel continuation data",
10: "Message and reasoning append events now expose deltas instead of cumulative snapshots.",
diff --git a/packages/eve/src/context/dynamic-tool-lifecycle.test.ts b/packages/eve/src/context/dynamic-tool-lifecycle.test.ts
index 4a38a0425..fe4831b1d 100644
--- a/packages/eve/src/context/dynamic-tool-lifecycle.test.ts
+++ b/packages/eve/src/context/dynamic-tool-lifecycle.test.ts
@@ -414,6 +414,7 @@ function createApprovalContext(input: {
readonly toolName: string;
}): ApprovalContext {
return {
+ abortSignal: new AbortController().signal,
approvedTools: new Set(),
callId: "call_1",
getSandbox: vi.fn(),
diff --git a/packages/eve/src/harness/tool-loop.test.ts b/packages/eve/src/harness/tool-loop.test.ts
index 55d835ebf..edc9a9ce3 100644
--- a/packages/eve/src/harness/tool-loop.test.ts
+++ b/packages/eve/src/harness/tool-loop.test.ts
@@ -10966,7 +10966,7 @@ describe("createToolLoopHarness", () => {
});
});
- it("anthropic-direct path: adds prepareStep and marks the last tool", async () => {
+ it("anthropic-direct path: marks the last tool without dropping approval", async () => {
setupStopResult();
const config: ToolLoopHarnessConfig = {
mode: "conversation",
@@ -10979,6 +10979,7 @@ describe("createToolLoopHarness", () => {
[
"add",
{
+ approval: () => "user-approval" as const,
description: "Adds numbers",
execute: vi.fn(),
inputSchema: jsonSchema({ type: "object" }),
@@ -11003,6 +11004,31 @@ describe("createToolLoopHarness", () => {
anthropic: { cacheControl: { type: "ephemeral" } },
bedrock: { cachePoint: { type: "default" } },
});
+
+ const approval = agentCall?.toolApproval;
+ if (typeof approval !== "function") throw new TypeError("Expected tool approval function.");
+ const context = new ContextContainer();
+ context.set(SessionKey, {
+ auth: { current: null, initiator: null },
+ sessionId: "session-1",
+ turn: { id: "turn-1", sequence: 0 },
+ });
+ await expect(
+ contextStorage.run(context, () =>
+ approval({
+ messages: [],
+ runtimeContext: {},
+ toolCall: {
+ input: {},
+ toolCallId: "call-1",
+ toolName: "add",
+ type: "tool-call",
+ },
+ tools: agentCall!.tools,
+ toolsContext: {},
+ }),
+ ),
+ ).resolves.toBe("user-approval");
});
it("anthropic-direct path: prepareStep marks last user and last assistant messages", async () => {
diff --git a/packages/eve/src/harness/tool-loop.ts b/packages/eve/src/harness/tool-loop.ts
index c7dca1b94..d4e7deb61 100644
--- a/packages/eve/src/harness/tool-loop.ts
+++ b/packages/eve/src/harness/tool-loop.ts
@@ -1443,13 +1443,13 @@ export function createToolLoopHarness(config: ToolLoopHarnessConfig): StepFn {
};
}
- return { effectiveTools, backgroundBatch, advertisedHarnessTools };
+ return { effectiveTools, backgroundBatch, advertisedHarnessTools, modelTools };
};
const runSingleModelCall = async (
opts: ModelCallOptions & { readonly attemptIndex: number },
): Promise<HarnessStepResult> => {
- let { effectiveTools, backgroundBatch, advertisedHarnessTools } =
+ let { effectiveTools, backgroundBatch, advertisedHarnessTools, modelTools } =
await prepareModelTools(opts);
currentMessages = createRequestMessages();
requestEnvelopeTokens = await estimateRequestEnvelope({
@@ -1507,7 +1507,7 @@ export function createToolLoopHarness(config: ToolLoopHarnessConfig): StepFn {
normalizeModelMessages(projectHistory(createModelMessages(messages), session.state)),
);
currentMessages = createRequestMessages();
- ({ effectiveTools, backgroundBatch, advertisedHarnessTools } =
+ ({ effectiveTools, backgroundBatch, advertisedHarnessTools, modelTools } =
await prepareModelTools(opts));
requestEnvelopeTokens = await estimateRequestEnvelope({
history: projectedMessages,
@@ -1604,7 +1604,7 @@ export function createToolLoopHarness(config: ToolLoopHarnessConfig): StepFn {
runtimeContext: telemetryRuntimeContext,
stopWhen: isStepCount(1),
telemetry: attempt?.telemetry,
- toolApproval: buildToolApproval(effectiveTools),
+ toolApproval: buildToolApproval(modelTools, generation.signal),
tools: effectiveTools,
};
const agent = new ToolLoopAgent(agentSettings);
diff --git a/packages/eve/src/harness/tools.test.ts b/packages/eve/src/harness/tools.test.ts
index 6894040e4..97f8c1389 100644
--- a/packages/eve/src/harness/tools.test.ts
+++ b/packages/eve/src/harness/tools.test.ts
@@ -37,16 +37,18 @@ async function resolveApproval(
tools: ReturnType<typeof buildToolSet>,
toolName: string,
input: unknown,
- session: Session = {
+ session?: Session,
+ options: { readonly abortSignal?: AbortSignal } = {},
+): Promise<unknown> {
+ const approval = buildToolApproval(tools, options.abortSignal);
+ const activeSession = session ?? {
auth: { current: null, initiator: null },
sessionId: "session-1",
turn: { id: "turn-1", sequence: 0 },
- },
-): Promise<unknown> {
- const approval = buildToolApproval(tools);
+ };
if (typeof approval !== "function") throw new TypeError("Expected generic approval function.");
const ctx = new ContextContainer();
- ctx.set(SessionKey, session);
+ ctx.set(SessionKey, activeSession);
return contextStorage.run(ctx, () =>
approval({
messages: [],
@@ -1061,6 +1063,31 @@ describe("buildToolSet", () => {
expect(capturedCallId).toBe("call_1");
});
+ it("passes cancellation into approval", async () => {
+ let capturedSignal: AbortSignal | undefined;
+ const tools: HarnessToolMap = new Map([
+ [
+ "deploy",
+ {
+ approval: (ctx: ApprovalContext) => {
+ capturedSignal = ctx.abortSignal;
+ return "user-approval";
+ },
+ description: "Deploy the application.",
+ execute: async () => "ok",
+ inputSchema: jsonSchema({}),
+ name: "deploy",
+ },
+ ],
+ ]);
+ const abortSignal = new AbortController().signal;
+
+ const result = buildToolSet({ tools });
+ await resolveApproval(result, "deploy", {}, undefined, { abortSignal });
+
+ expect(capturedSignal).toBe(abortSignal);
+ });
+
it("passes the active caller and session context into approval", async () => {
let capturedCtx: ApprovalContext | undefined;
const tools: HarnessToolMap = new Map<string, HarnessToolDefinition>([
diff --git a/packages/eve/src/harness/tools.ts b/packages/eve/src/harness/tools.ts
index c1bdaaa73..e601a5248 100644
--- a/packages/eve/src/harness/tools.ts
+++ b/packages/eve/src/harness/tools.ts
@@ -30,7 +30,7 @@ type NativeApprovalStatus = Exclude<ApprovalStatus, boolean>;
const toolApprovals = new WeakMap<
object,
- (toolInput: unknown, callId: string) => Promise<NativeApprovalStatus>
+ (toolInput: unknown, callId: string, abortSignal?: AbortSignal) => Promise<NativeApprovalStatus>
>();
/**
@@ -332,14 +332,19 @@ export async function buildToolSetWithProviderTools(input: {
function buildApprovalFn(
definition: HarnessToolDefinition,
input: { readonly approvedTools?: ReadonlySet<string> },
-): (toolInput: unknown, callId: string) => Promise<NativeApprovalStatus> {
- return async (toolInput: unknown, callId: string) => {
+): (
+ toolInput: unknown,
+ callId: string,
+ abortSignal?: AbortSignal,
+) => Promise<NativeApprovalStatus> {
+ return async (toolInput: unknown, callId: string, abortSignal?: AbortSignal) => {
if (definition.approval === undefined) return undefined;
const toolInputRecord = isObject(toolInput) ? toolInput : undefined;
const status = await resolveApprovalPolicy(definition.approval)({
...buildCallbackContext(),
+ abortSignal: abortSignal ?? new AbortController().signal,
approvedTools: input.approvedTools ?? new Set(),
callId,
toolInput: toolInputRecord,
@@ -352,12 +357,17 @@ function buildApprovalFn(
/** Builds the AI SDK 7 call-level approval policy for an assembled tool set. */
export function buildToolApproval(
tools: ToolSet,
+ abortSignal?: AbortSignal,
): ToolApprovalConfiguration<ToolSet, Record<string, unknown>> {
return async ({ toolCall }) => {
const toolDefinition = tools[toolCall.toolName];
if (toolDefinition === undefined) return undefined;
const approval = toolApprovals.get(toolDefinition);
- return (await approval?.(toolCall.input, toolCall.toolCallId)) as ToolApprovalStatus;
+ return (await approval?.(
+ toolCall.input,
+ toolCall.toolCallId,
+ abortSignal,
+ )) as ToolApprovalStatus;
};
}
diff --git a/packages/eve/src/public/definitions/connections/mcp.ts b/packages/eve/src/public/definitions/connections/mcp.ts
index a6f615612..746a6aaa6 100644
--- a/packages/eve/src/public/definitions/connections/mcp.ts
+++ b/packages/eve/src/public/definitions/connections/mcp.ts
@@ -73,6 +73,7 @@ export interface McpClientConnectionDefinition {
* - `never()`: allow all tool calls without approval
* - `once()`: require approval only the first time per session
* - `always()`: require approval for every tool call
+ * - `auto()`: use an evaluation model to ask about dangerous or unclear effects
*
* When omitted, tool calls execute without approval, consistent
* with authored tools.
diff --git a/packages/eve/src/public/definitions/connections/openapi.ts b/packages/eve/src/public/definitions/connections/openapi.ts
index 62c707030..a3e3ec4bd 100644
--- a/packages/eve/src/public/definitions/connections/openapi.ts
+++ b/packages/eve/src/public/definitions/connections/openapi.ts
@@ -90,6 +90,7 @@ export interface OpenAPIConnectionDefinition {
* - `never()`: allow all tool calls without approval
* - `once()`: require approval only the first time per session
* - `always()`: require approval for every tool call
+ * - `auto()`: use an evaluation model to ask about dangerous or unclear effects
*/
approval?: Approval;
/**
diff --git a/packages/eve/src/public/tools/approval/index.ts b/packages/eve/src/public/tools/approval/index.ts
index 3f2af7e29..5fe6a0963 100644
--- a/packages/eve/src/public/tools/approval/index.ts
+++ b/packages/eve/src/public/tools/approval/index.ts
@@ -16,4 +16,5 @@ export type {
ApprovalResponseSession,
ApprovalStatus,
} from "#public/definitions/approval.js";
-export { always, never, once } from "#tools/approval/policies.js";
+export type { AutoApprovalOptions } from "#tools/approval/policies.js";
+export { always, auto, never, once } from "#tools/approval/policies.js";
diff --git a/packages/eve/src/self-modification/registry-add.test.ts b/packages/eve/src/self-modification/registry-add.test.ts
index 9b3bf3566..d0c79ef8f 100644
--- a/packages/eve/src/self-modification/registry-add.test.ts
+++ b/packages/eve/src/self-modification/registry-add.test.ts
@@ -10,7 +10,10 @@ const { findPackageJSON, readFile } = vi.hoisted(() => ({
readFile: vi.fn(),
}));
-vi.mock("node:module", () => ({ findPackageJSON }));
+vi.mock("node:module", async (importOriginal) => ({
+ ...(await importOriginal<typeof import("node:module")>()),
+ findPackageJSON,
+}));
vi.mock("node:fs/promises", () => ({ readFile }));
import { readTerminalHeadlessEvent, runEveAdd } from "./extension/eve-add.js";
diff --git a/packages/eve/src/tools/approval/policies.test.ts b/packages/eve/src/tools/approval/policies.test.ts
index a2356cec1..3802600ab 100644
--- a/packages/eve/src/tools/approval/policies.test.ts
+++ b/packages/eve/src/tools/approval/policies.test.ts
@@ -1,9 +1,33 @@
-import { describe, expect, it } from "vitest";
+import { beforeEach, describe, expect, it, vi } from "vitest";
-import { always, never, once } from "#tools/approval/policies.js";
+const evaluate = vi.hoisted(() => vi.fn());
+vi.mock("#experimental/evaluate/evaluate.js", () => ({ evaluate }));
+
+import type { ApprovalContext } from "#approval/definition.js";
+import { always, auto, never, once } from "#tools/approval/policies.js";
import { readDurableDynamicCallback } from "#tools/durable-callbacks.js";
+function approvalContext(overrides: Partial<ApprovalContext> = {}): ApprovalContext {
+ return {
+ abortSignal: new AbortController().signal,
+ approvedTools: new Set(),
+ callId: "call-1",
+ getSandbox: vi.fn(),
+ getSkill: vi.fn(),
+ session: {
+ auth: { current: null, initiator: null },
+ id: "session-1",
+ turn: { id: "turn-1", sequence: 0 },
+ },
+ toolInput: { environment: "production" },
+ toolName: "deploy",
+ ...overrides,
+ };
+}
+
describe("dynamic tool approval helpers", () => {
+ beforeEach(() => evaluate.mockReset());
+
it.each([
["always", always(), "user-approval"],
["never", never(), "not-applicable"],
@@ -15,6 +39,93 @@ describe("dynamic tool approval helpers", () => {
expect(await reference!.callback(reference!.closure, {} as never)).toBe(expected);
});
+ it.each([
+ ["clear", "approved"],
+ ["caution", "user-approval"],
+ ] as const)("maps the automatic review's %s decision to %s", async (choice, expected) => {
+ evaluate.mockResolvedValueOnce({ answers: { permission: { choice } } });
+ const context = approvalContext();
+
+ await expect(auto()(context)).resolves.toBe(expected);
+ expect(evaluate).toHaveBeenCalledWith(
+ expect.objectContaining({
+ abortSignal: expect.any(AbortSignal),
+ maxRetries: 0,
+ model: "typesafe-ai/jev",
+ state: { action: { input: context.toolInput, tool: "deploy" } },
+ }),
+ );
+ });
+
+ it("allows classifier instructions and outcome descriptions to be overridden", async () => {
+ evaluate.mockResolvedValueOnce({ answers: { permission: { choice: "clear" } } });
+ const context = approvalContext();
+
+ await auto({
+ model: "custom-evaluator",
+ instructions: "Classify this action for my application.",
+ criteria: {
+ clear: "The action is within policy.",
+ caution: "The action needs review.",
+ },
+ })(context);
+
+ expect(evaluate).toHaveBeenCalledWith(
+ expect.objectContaining({
+ model: "custom-evaluator",
+ questions: {
+ permission: {
+ type: "choice",
+ instructions: "Classify this action for my application.",
+ criteria: {
+ clear: "The action is within policy.",
+ caution: "The action needs review.",
+ },
+ },
+ },
+ }),
+ );
+ });
+
+ it("accepts another evaluation model", async () => {
+ evaluate.mockResolvedValueOnce({ answers: { permission: { choice: "clear" } } });
+ const model = { modelId: "custom", provider: "test", specificationVersion: "v4" } as never;
+ const context = approvalContext();
+
+ await expect(auto({ model })(context)).resolves.toBe("approved");
+ expect(evaluate).toHaveBeenCalledWith(expect.objectContaining({ model }));
+ });
+
+ it.each([new Date(), new Map([["kind", "delete"]]), new Set(["delete"]), Number.NaN])(
+ "requires approval without evaluating lossy input %#",
+ async (toolInput) => {
+ await expect(auto()(approvalContext({ toolInput: { value: toolInput } }))).resolves.toBe(
+ "user-approval",
+ );
+ expect(evaluate).not.toHaveBeenCalled();
+ },
+ );
+
+ it("requires approval without evaluating oversized input", async () => {
+ const context = approvalContext({ toolInput: { value: "x".repeat(64 * 1024) } });
+
+ await expect(auto()(context)).resolves.toBe("user-approval");
+ expect(evaluate).not.toHaveBeenCalled();
+ });
+
+ it("fails closed when the automatic review is unavailable", async () => {
+ evaluate.mockRejectedValueOnce(new Error("unavailable"));
+ await expect(auto()(approvalContext())).resolves.toBe("user-approval");
+ });
+
+ it("propagates cancellation instead of requesting approval", async () => {
+ const reason = new Error("cancelled");
+ evaluate.mockRejectedValueOnce(reason);
+ const context = approvalContext({ abortSignal: AbortSignal.abort(reason) });
+
+ await expect(auto()(context)).rejects.toBe(reason);
+ });
+
it("replays once against the current approval context", async () => {
const reference = readDurableDynamicCallback(once())!;
diff --git a/packages/eve/src/tools/approval/policies.ts b/packages/eve/src/tools/approval/policies.ts
index 7ef1abe06..a38852268 100644
--- a/packages/eve/src/tools/approval/policies.ts
+++ b/packages/eve/src/tools/approval/policies.ts
@@ -1,7 +1,68 @@
+import type { Experimental_EvaluationModel as EvaluationModel } from "ai";
+
import type { ApprovalContext, ApprovalPolicy } from "#approval/definition.js";
-import type { JsonObject } from "#shared/json.js";
+import { evaluate } from "#experimental/evaluate/evaluate.js";
+import { parseJsonValue, type JsonObject } from "#shared/json.js";
import { stampDurableDynamicCallback } from "#tools/durable-callbacks.js";
+const MAX_ACTION_BYTES = 64 * 1024;
+
+const DEFAULT_INSTRUCTIONS = `Review the exact tool action for dangerous effects. Return caution when it could cause meaningful harm, including destructive data loss, credential exposure, financial transactions, deployments or public changes, external communication, privilege or system changes, or concealed execution. Return clear for routine, low-impact actions. Judge the action's actual effects from its name and input. If important effects are unclear, return caution.`;
+const DEFAULT_CLEAR_DESCRIPTION = "The action is routine and low impact.";
+const DEFAULT_CAUTION_DESCRIPTION = "The action is dangerous or its important effects are unclear.";
+
+export interface AutoApprovalOptions {
+ /** Evaluation model instance or ID. Defaults to TypeSafe Jev. */
+ readonly model?: EvaluationModel;
+ /** Instructions used to classify the exact tool call. */
+ readonly instructions?: string;
+ /** Descriptions of the fixed approval outcomes. */
+ readonly criteria?: {
+ readonly clear?: string;
+ readonly caution?: string;
+ };
+}
+
+async function autoApproval(
+ evaluationModel: EvaluationModel,
+ options: AutoApprovalOptions,
+ context: ApprovalContext,
+): Promise<"approved" | "user-approval"> {
+ try {
+ const input = parseJsonValue(context.toolInput ?? null);
+ const serializedInput = JSON.stringify(input);
+ if (new TextEncoder().encode(serializedInput).byteLength > MAX_ACTION_BYTES) {
+ return "user-approval";
+ }
+ const abortSignal = AbortSignal.any([context.abortSignal, AbortSignal.timeout(30_000)]);
+ const result = await evaluate({
+ model: evaluationModel,
+ state: {
+ action: {
+ input,
+ tool: context.toolName,
+ },
+ },
+ questions: {
+ permission: {
+ type: "choice",
+ instructions: options.instructions ?? DEFAULT_INSTRUCTIONS,
+ criteria: {
+ clear: options.criteria?.clear ?? DEFAULT_CLEAR_DESCRIPTION,
+ caution: options.criteria?.caution ?? DEFAULT_CAUTION_DESCRIPTION,
+ },
+ },
+ },
+ abortSignal,
+ maxRetries: 0,
+ });
+ return result.answers.permission.choice === "clear" ? "approved" : "user-approval";
+ } catch {
+ context.abortSignal.throwIfAborted();
+ return "user-approval";
+ }
+}
+
function alwaysApproval(_closure: JsonObject): "user-approval" {
return "user-approval";
}
@@ -17,6 +78,21 @@ function onceApproval(
return context.approvedTools.has(context.toolName) ? "not-applicable" : "user-approval";
}
+/**
+ * Returns an `approval` callback that asks an AI SDK evaluation model whether
+ * the exact tool call presents concrete security danger. Defaults to TypeSafe Jev.
+ * Unavailable or invalid evaluations require user approval.
+ */
+export function auto<TInput = unknown>(options: AutoApprovalOptions = {}): ApprovalPolicy<TInput> {
+ const evaluationModel = options.model ?? "typesafe-ai/jev";
+ const callback = (_closure: JsonObject, context: ApprovalContext) =>
+ autoApproval(evaluationModel, options, context);
+ return stampDurableDynamicCallback(
+ (context) => autoApproval(evaluationModel, options, context as ApprovalContext),
+ { callback, closure: {} },
+ ) as ApprovalPolicy<TInput>;
+}
+
/**
* Returns an `approval` callback that always requires user approval before
* the tool executes.
diff --git a/research/automatic-tool-approval.md b/research/automatic-tool-approval.md
new file mode 100644
index 000000000..4926cc8e8
--- /dev/null
+++ b/research/automatic-tool-approval.md
@@ -0,0 +1,33 @@
+---
+issue: "TBD (maintainer-requested implementation; no matching issue found)"
+status: implemented
+last_updated: "2026-09-17"
+---
+
+# Automatic tool approval
+
+## Authoring API
+
+Add `auto({ model?, instructions?, criteria? })` to `eve/tools/approval`. `model` accepts any AI SDK `Experimental_EvaluationModel`, including a string resolved through the configured default provider, and defaults to `typesafe-ai/jev`. `instructions` and `criteria.clear` / `criteria.caution` override the classifier text.
+
+```ts
+import { defineTool } from "eve/tools";
+import { auto } from "eve/tools/approval";
+
+export default defineTool({
+ // ...
+ approval: auto(),
+});
+```
+
+The helper asks one constrained choice question with `clear` and `caution` outcomes. `clear` returns `"approved"`; `caution` returns `"user-approval"`. Provider errors, invalid answers, timeouts, oversized input, and non-serializable tool input fail closed to user approval. Cancelling the active turn cancels evaluation instead of producing a prompt.
+
+## Evidence and cancellation
+
+The evaluation state contains the exact tool name and input. Assistant prose and conversation history are excluded. `ApprovalContext` adds `abortSignal` so the helper and custom asynchronous approval policies stop with the active turn.
+
+## Policy
+
+The default classifier returns caution for dangerous or unclear effects, including destructive data loss, credential exposure, financial transactions, deployments, public changes, external communication, privilege or system changes, and concealed execution.
+
+`auto()` is not authorization. Applications must still enforce identity, tenancy, service permissions, allowlists, and other deterministic requirements. Tool input is sent to the selected evaluation provider, so authors must not use it for inputs the provider is not permitted to receive.