Repository navigation
0.0.9-alpha.1 - Tool Calling Middleware PII Masking
Pre-releaseThis release shifts genkit-guard from an input-only security utility into a fully bidirectional, stateful data compliance firewall for agentic workflows. By intercepting Genkit's native tool-calling lifecycle, it completely solves the paradox of wanting tools to execute with real customer data while keeping the upstream LLM completely zero-trust and PII-free.
🌟 Key Features & Improvements
Just-In-Time (JIT) Tool Payload Hydration:
The middleware isolates an ephemeral token ledger per execution turn. When the LLM decides to call a tool using masked placeholders (e.g., [private_email_0]), the middleware intercepts the payload right before execution and swaps the raw data back in so your database or CRM gets valid data natively.
Automated Egress Sanitization:
If an internal tool retrieves a database record or customer profile containing fresh, unmasked PII, the middleware intercepts the return object and scrubs it before appending it to the LLM's chat history context, preventing downstream token leakage.
Runtime Fixes (TypeError Resolved):
Fixed a critical runtime crash (TypeError: Cannot assign to read only property 'name') caused by JavaScript's native restriction on modifying function names when wrapping Genkit action middlewares.
Zero-Touch Developer Experience:
Retains 100% backward compatibility with your existing configurations (intent.semantic, pii.reversible). No manual tool-wrapping or refactoring is required—it hooks directly into your ai.generate plugin lifecycle automatically.