Skip to content

v0.4.12: guardrails, mistral models, privacy policy updates - #1608

Merged
waleedlatif1 merged 8 commits into
mainfrom
staging
Oct 12, 2025
Merged

v0.4.12: guardrails, mistral models, privacy policy updates#1608
waleedlatif1 merged 8 commits into
mainfrom
staging

Conversation

@waleedlatif1

@waleedlatif1waleedlatif1 commented Oct 12, 2025

Copy link
Copy Markdown
Collaborator

waleedlatif1and others added 6 commits October 11, 2025 20:37
* updated privacy policy for google
* update terms, privacy, and emails to incl address and update verbiage
* Adding guardrails block
* ack PR comments
* cleanup checkbox in dark mode
* cleanup
* fix supabase tools
… API, add drag-and-drop functionality to deployed chat (#1606)
* fix(inference): fix inference billing when stream is true via API
* add drag-and-drop to deployed chat
* feat(mistal): added mistral as a provider, updated model prices
* remove the ability for a block to reference its own outluts
* fixed order of responses for guardrails block
@vercel

vercelBot commented Oct 12, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentPreviewCommentsUpdated (UTC)
docsReadyReadyPreviewCommentOct 12, 2025 5:17am

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Summary

This release bundles 6 separate PRs into v0.4.12, introducing guardrails for content validation, Mistral AI provider support, performance improvements, and UX enhancements.

Major Changes:

  • Guardrails Feature (#1605): Added comprehensive content validation system with JSON validation, regex pattern matching, RAG-based hallucination detection using knowledge bases, and PII detection/masking using Microsoft Presidio
  • Mistral AI Provider (#1607): Integrated Mistral AI as a new LLM provider with streaming support, tool calling, and updated pricing for all models across providers
  • Inference Billing Fix (#1606): Resolved critical billing bug where streaming API executions weren't properly tracked; now defers logging completion until after token counting
  • Drag-and-Drop Files (#1606): Enhanced deployed chat interface with drag-and-drop file upload capability
  • Performance Optimization (#1603): Removed unused database indexes on workflow_edges (source/target blocks) and added index on state_snapshot_id for faster execution log queries
  • Blog Path Redirect (#1604): Added permanent redirect from /building/* to /blog/* for backward compatibility
  • Privacy Policy Update (#1602): Updated privacy policy for additional Google OAuth scopes

Key Implementation Details:

  • Guardrails block uses Python subprocess for PII detection via Presidio, with proper error handling and JSON parsing
  • Hallucination detection queries knowledge bases via internal API and uses LLM to score confidence (0-10 scale)
  • Mistral provider uses OpenAI SDK with custom base URL for API compatibility
  • Streaming billing fix adds skipLoggingComplete flag and _streamingMetadata to defer cost calculation

Confidence Score: 5/5

  • This PR is safe to merge with high confidence
  • All changes are well-implemented with no critical issues found. The PR bundles multiple tested PRs (#1603-1607) that were already reviewed individually. Code follows established patterns, includes proper error handling, and the billing fix addresses a real production issue. Database migrations are minimal and safe (index changes only).
  • No files require special attention

Important Files Changed

File Analysis

FilenameScoreOverview
packages/db/migrations/0098_thick_prima.sql5/5Removed unused source/target block indexes and added index on state_snapshot_id for performance optimization
apps/sim/blocks/blocks/guardrails.ts5/5Added comprehensive guardrails block with JSON, regex, hallucination, and PII validation types
apps/sim/lib/guardrails/validate_pii.py5/5Implemented PII detection using Presidio library with block/mask modes and multi-language support
apps/sim/lib/guardrails/validate_hallucination.ts5/5Implemented RAG-based hallucination detection with knowledge base retrieval and LLM confidence scoring
apps/sim/providers/mistral/index.ts5/5Added Mistral AI provider with OpenAI-compatible API client, streaming support, and tool calling
apps/sim/lib/workflows/streaming.ts5/5Fixed streaming workflow billing by deferring logging completion until after token counting
apps/sim/app/api/workflows/[id]/execute/route.ts5/5Added skipLoggingComplete option to support deferred billing in streaming workflows

Sequence Diagram

sequenceDiagram
participant Client
participant API
participant Executor
participant Guardrails
participant KB as Knowledge Base
participant LLM
participant Presidio as PII Detection
participant Billing
Client->>API: POST /api/workflows/[id]/execute
API->>Executor: executeWorkflow(stream: true)
alt Guardrails Block
Executor->>Guardrails: Validate content
alt Hallucination Check
Guardrails->>KB: Query knowledge base (RAG)
KB-->>Guardrails: Return chunks
Guardrails->>LLM: Score confidence (0-10)
LLM-->>Guardrails: Score + reasoning
else PII Detection
Guardrails->>Presidio: Analyze text
Presidio-->>Guardrails: Detected entities
alt Block Mode
Guardrails-->>Executor: Validation failed
else Mask Mode
Guardrails-->>Executor: Masked text
end
end
end
Executor->>LLM: Execute workflow (stream)
LLM-->>Executor: Stream response
Executor-->>API: Stream chunks
Note over Executor,Billing: Streaming Fix: Defer logging completion
Executor->>Executor: Build trace spans with costs
Executor->>Billing: Complete logging session
API-->>Client: Return response
Loading

59 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Comment threadapps/sim/lib/guardrails/validate_regex.ts Dismissed
…1611)
* fix(vulns): fix SSRF vulnerabilities
* cleanup
* cleanup
* regen docs
* remove unused deps
* fix failing tests
* cleanup
* update deps
* regen bun lock
Comment threadapps/sim/lib/copilot/tools/server/other/make-api-request.ts Dismissed
Comment threadapps/sim/lib/copilot/tools/server/other/make-api-request.ts Dismissed
Comment threadapps/sim/lib/copilot/tools/server/other/make-api-request.ts Dismissed
Comment threadapps/sim/tools/confluence/utils.ts Dismissed
Comment threadapps/sim/tools/sharepoint/utils.ts Dismissed
@waleedlatif1
waleedlatif1 merged commit 219a065 into mainOct 12, 2025
22 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@waleedlatif1@github-advanced-security@aadamgough