← All integrations
VERCEL AI SDK 7 · NATIVE TELEMETRY · NPM v0.1.0

Signed decision evidence for Vercel AI SDK.

Attach LoopGrid through AI SDK 7's native Telemetry integration surface. AI SDK keeps running the model and tools; your application owns authority, policy, human approval and the real downstream outcome; LoopGrid preserves and independently verifies the evidence.

loopgrid-vercel-ai-sdk v0.1.0 · validated with ai 7.0.122 · Node.js 22 / 24 · LoopGrid Core 0.8.1-design-partner.

NATIVE EVIDENCE FLOW
01Application decision + authority
02Model evidence
03Explicit application policy
04Tool request + execution / result
05Explicit observed outcome
06Evidence complete + verify

Telemetry observes; it does not authorize. AI SDK's approval mechanism remains framework-owned, while reviewer identity and business outcome are recorded explicitly by the application.

01 · INSTALL

Install the native Vercel AI SDK integration.

npm install loopgrid-vercel-ai-sdk ai

Version 0.1.0 is public on npm. The integration depends on @cybertechsoft/loopgrid and targets AI SDK 7 on Node.js 22 or newer. npm Trusted Publishing is configured for future releases.

02 · CONNECT

Bind one consequential decision to one AI SDK call.

import { generateText } from 'ai';
import { LoopGridAISDK } from 'loopgrid-vercel-ai-sdk';

const loopgrid = new LoopGridAISDK({
  baseUrl: 'http://127.0.0.1:8000',
  workspaceId: 'default',
});

const { decisionId } = await loopgrid.startDecision({
  decisionType: 'customer_refund',
  agent: { id: 'refund-agent', version: '1.0.0' },
  authority: { acting_for: 'Support', scope: ['refund:create'] },
  model: { provider: 'configured-provider', name: 'configured-model' },
  context: { prompt_version: 'refund-v3' },
  proposedAction: { tool: 'refund', amount: 25, currency: 'USD' },
  policy: {
    policy_id: 'refund-policy',
    version: '3',
    decision: 'auto_allowed',
  },
});

const result = await generateText({
  model,
  prompt,
  tools,
  telemetry: loopgrid.telemetryOptions(decisionId, {
    functionId: 'refund-agent',
  }),
});

await loopgrid.flush(decisionId);
loopgrid.assertHealthy();

// Application-owned fact observed from the downstream system:
await loopgrid.recordOutcome(decisionId, {
  status: 'settled',
  external_id: 'refund_123',
});

The telemetry object is decision-scoped instead of relying on a global mutable “current decision” value, so concurrent AI SDK calls remain isolated.

03 · NATIVE LIFECYCLE

Use AI SDK Telemetry instead of wrapping generateText().

01Start decision

startDecision() records agent identity, delegated authority, model/context provenance and the proposed consequential action from explicit application input.

02Model completion

onLanguageModelCallEnd records model_completed with privacy-safe content commitments by default.

03Tool request

onToolExecutionStart records tool_requested before the tool execution evidence arrives.

04Tool completion

onToolExecutionEnd records tool_executed on success or tool_result for an error instead of inventing a successful outcome.

05Human review

recordHumanReview() records explicit reviewer identity and approval/rejection only when the application supplies it.

06Observed outcome

recordOutcome() appends outcome_observed after the application observes the authoritative downstream result.

04 · APPROVAL + ACTION BOUNDARY

AI SDK owns approval mechanics. LoopGrid preserves the evidence.

AI SDK requests approval
  → tool has not executed

application records explicit reviewer
  → loopgrid.recordHumanReview(...)
  → human_approved

AI SDK resumes approved tool
  → tool_requested
  → tool_executed

application observes downstream result
  → loopgrid.recordOutcome(...)
  → outcome_observed
  → evidence_complete
  → verify valid:true

LoopGrid does not infer delegated authority from tool availability, infer policy from AI SDK approval configuration, infer reviewer identity from an approval response, or treat a successful tool callback as proof of the final business outcome. Telemetry callbacks are observational rather than a policy-enforcement boundary.

05 · PRIVACY + FAILURE MODE

Commit to model/tool content without storing it by default.

captureContent = false by default. The integration stores SHA-256 commitments for model content, provider metadata, tool inputs, results and errors while omitting raw content unless explicitly enabled.

AI SDK telemetry inputs and outputs also default to disabled. A dedicated regression test against ai@7.0.122 verifies that context excluded by telemetry allowlists is not exposed on the diagnostics tracing channel. Transport failures are retained and surfaced through flush() and assertHealthy(); applications that require evidence before execution should enforce that requirement in their own control logic.

06 · RELEASE VALIDATION

Validated through the actual AI SDK runtime and a real LoopGrid Core E2E.

Automated tests20 / 20 passing, including the AI SDK diagnostics privacy regression
Framework runtimeDeterministic MockLanguageModelV4 tool-call flow on ai@7.0.122
Human approvalTool blocked before approval, explicit reviewer evidence recorded, approved tool executes exactly once
LoopGrid lifecycleevidence_complete
Applicable coverage100%
Verificationvalid: true with no failures
Public packageloopgrid-vercel-ai-sdk@0.1.0 clean-installed from npm and runtime-import validated
DistributionGitHub release v0.1.0; Trusted Publisher configured for future npm releases

The release E2Es used a deterministic AI SDK test model and sandbox action, so no model API key or real-money movement was required. Verification establishes the integrity/provenance of captured evidence; it does not prove that the underlying decision was correct, that every upstream statement was true, or that the system is legally compliant.

VERCEL AI SDK + LOOPGRID

Keep AI SDK native. Make the evidence portable.

Install the npm package, bind native decision-scoped telemetry, and preserve consequential agent evidence without replacing the Vercel AI SDK runtime.