fix(guardrails): route PII validation through app runtime - #7227
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThe PR routes single-text PII guardrail validation through an authenticated app-runtime capability so foreground and scheduled execution use the same Presidio-reachable path.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/internal/guardrails/operations.ts | Routes PII validation through the HTTP capability and converts non-abort failures into PII-shaped fail-closed results before the wrapper restores verdict metadata. |
| apps/sim/lib/guardrails/validation-client.ts | Implements the authenticated cross-runtime request with input validation, cancellation propagation, bounded response reads, and response-schema validation. |
| apps/sim/app/api/guardrails/pii/validate/route.ts | Adds an auth-before-parse app boundary that invokes Presidio validation with request cancellation and validates the returned contract. |
| apps/sim/lib/guardrails/validate_pii.ts | Adds strict Presidio response validation and bounded materialization while preserving fail-closed behavior. |
| apps/sim/lib/api/contracts/hotspots.ts | Defines strict bounded request and response schemas for the single-text PII capability. |
Sequence Diagram
sequenceDiagram
participant Runtime as Workflow runtime
participant Client as PII validation client
participant App as Authenticated app endpoint
participant Presidio as Internal Presidio service
Runtime->>Client: Validate text with cancellation signal
Client->>App: POST /api/guardrails/pii/validate + internal JWT
App->>App: Authenticate and validate bounded input
App->>Presidio: Analyze and optionally anonymize
Presidio-->>App: Bounded validation result
App-->>Client: Schema-validated verdict
Client-->>Runtime: PII result
alt Non-abort capability failure
Runtime->>Runtime: Return fail-closed PII verdict with original metadata
end
Reviews (3): Last reviewed commit: "fix(guardrails): bound PII validation re..." | Re-trigger Greptile
Collaborator
Author
There was a problem hiding this comment.
All reported issues were addressed across 7 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type of Change
Testing
bun run lintChecklist