Skip to content

feature: tool approvals #77

@iwasrobbed

Description

@iwasrobbed

Request

  • Explicit tool approvals for agential runs

Use Case

  1. LLM wants to execute a tool, but one the developer or user considers dangerous
  2. SDK needs to prevent execution / runloop continuation until there's some explicit tool approval

AI SDK Equivalent

https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling#tool-execution-approval

import { tool } from 'ai';
import { z } from 'zod';

const runCommand = tool({
  description: 'Run a shell command',
  inputSchema: z.object({
    command: z.string().describe('The shell command to execute'),
  }),
  needsApproval: true,
  execute: async ({ command }) => {
    // your command execution logic here
  },
});

Finally

This lib looks great by the way. Coming from TypeScript/aiSDK, it's a good parallel to what I'm used to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions