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), andonStructuredOutputConfig(processes JSON schemas). - Boundary markers: The skill emphasizes type narrowing for
hookCtx.argsand utilizes specific lifecycle phases (ctx.phase) to delimit processing logic. - Capability inventory: The skill demonstrates
fetchcalls for analytics,toolDefinition.serverfor tool execution, and file-system diffing viagitin 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