skills/tanstack/ai/ai-core/middleware/Gen Agent Trust Hub

ai-core/middleware

Pass

Audited by Gen Agent Trust Hub on Sep 27, 2026

Risk Level: SAFE
Full Analysis
  • [SAFE]: The skill documents the middleware architecture for @tanstack/ai. It provides educational examples for analytics, logging, and tool caching that follow library best practices.
  • [INDIRECT_PROMPT_INJECTION]: The middleware hooks process data from external providers (LLMs) and tools, creating a surface for indirect prompt injection.
  • Ingestion points: onChunk (processes provider stream chunks), onBeforeToolCall (processes provider-generated tool arguments), and onStructuredOutputConfig (processes JSON schemas).
  • Boundary markers: The skill emphasizes type narrowing for hookCtx.args and utilizes specific lifecycle phases (ctx.phase) to delimit processing logic.
  • Capability inventory: The skill demonstrates fetch calls for analytics, toolDefinition.server for tool execution, and file-system diffing via git in sandbox environments.
  • Sanitization: The skill explicitly includes a security pattern for data sanitization, demonstrating how to redact sensitive information from stream chunks using chunk.delta.replace(/secret/g, '[REDACTED]').
Audit Metadata
Risk Level
SAFE
Analyzed
Sep 27, 2026, 04:07 PM