#21043·ai

Feature: AffixIO host-side toolApproval example (TS)

Author: AffixIOCreated Sep 17, 2026Updated Sep 17, 2026
Labelstask-identify-issue-type-donefactory-activefactory-automatictask-identify-harness-labels-done

Description

Request for a small TypeScript example (or docs note) showing AffixIO as a host-side toolApproval helper next to patterns like @ai-sdk/policy-opa.

AffixIO proves a host-side ACTION completed (signed yes/no). PII stays on the host. Not person/age/KYC.

Sit: before an AI SDK agent/tool loop runs a sensitive tool (spend, DB admin, destructive API), AffixIO can gate/prove the action on the host and map to approved / denied / user-approval.

You already have toolApproval on generateText / streamText / ToolLoopAgent, and @ai-sdk/policy-opa for Rego. AffixIO is the complementary host-proof gate for the same callback surface.

Sketch:

typescript
import { generateText } from 'ai';
// import AffixIO client / MCP bridge as needed

const toolApproval = async ({ toolName, input }) => {
  // For sensitive tools: require AffixIO host proof
  // return 'approved' | 'denied' | 'user-approval'
};

await generateText({ model, tools, toolApproval, prompt });

Not asking for a full first-party middleware package. A light example under examples/ or a docs snippet is the ask.

Install

bash
npm i affixio
npm i @affixio/[email protected]

MCP is local stdio.

AI SDK Version

N/A (proposal / example request)

Links

Happy to PR a minimal example if maintainers want that shape.

I agree to follow this project's Code of Conduct.

Kris / AffixIO