-
Notifications
You must be signed in to change notification settings - Fork 4
FEATURE: PII Settings #240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Initial implementation
Implemented regex pattern functionality
fix namng issues in action.yml
fixing test input
guardrails input formatting fixed
…mposite multiline input
Code Review: PII Settings FeatureThank you for implementing the PII settings feature! This is a valuable addition that allows users to configure guardrails for personally identifiable information. Below is my detailed review. 🔴 Critical Issues (Must Fix)1. Example Workflows Using Local ReferencesFiles: All example YAML files in This breaks the examples for external users who copy these workflows. The Required Change: # Revert to:
uses: h2oai/h2ogpte-action@v0.2.2-beta
# Or update to the new version tag when released2. Unsafe YAML Parsing Without DocumentationFile: // This is commented out:
// const guardrailsSettingsPayload = JSON.parse(guardrailsSettings);
// But this is used instead:
const res = GuardRailsSchema.safeParse(yaml.load(guardrailsSettings));Concerns:
Required Changes:
🟡 Major Issues (Should Fix)1. Breaking API ChangeFile: This is a breaking change. While the internal caller has been updated, consider:
2. Poor Error MessagesFile: if (!res.success) {
throw new Error("Invalid guardrails settings");
}Required Change: if (!res.success) {
throw new Error(`Invalid guardrails settings: ${res.error.message}`);
}This provides users with actionable information about what's wrong with their configuration. 3. Missing Error Handling for Collection CleanupFile: If Suggested Fix: let collectionId: string | null = null;
try {
collectionId = await createCollection();
await createGuardRailsSettings(
collectionId,
process.env.GUARDRAILS_SETTINGS,
);
await uploadAttachmentsToH2oGPTe(
collectionId,
githubData.attachmentUrlMap,
);
} catch (error) {
if (collectionId) {
await deleteCollection(collectionId).catch(() => {
// Log but don't throw - original error is more important
});
}
throw error;
}🔵 Minor Issues (Nice to Fix)1. Unexplained Timeout ChangeFile: 2. Missing Null CheckFile: Suggested Fix: collectionId = await createCollection();
if (!collectionId) {
throw new Error("Failed to create collection");
}3. Debug Logging IssueFile: // Current (won't display object properly):
core.debug(`Guardrails settings payload: ${guardrailsSettingsPayload}`);
// Better:
core.debug(`Guardrails settings payload: ${JSON.stringify(guardrailsSettingsPayload)}`);4. Strict Schema May Cause Future IssuesFile: Using
5. Example Workflows Need DocumentationFiles: All example YAML files guardrails_settings: |
{
"presidio_labels_to_flag": ["CREDIT_CARD", "IBAN_CODE"], # Flag credit cards and bank codes
"pii_labels_to_flag": ["ACCOUNTNUMBER", "CREDITCARDNUMBER"], # Flag account numbers
"pii_detection_parse_action": "redact", # Redact PII during parsing
"pii_detection_llm_input_action": "redact", # Redact PII before sending to LLM
"pii_detection_llm_output_action": "redact" # Redact PII in LLM responses
}✅ Positive Aspects
SummaryOverall Assessment: This PR adds valuable PII protection functionality, but has several issues that need to be addressed before merging. Priority Actions:
Stats:
Please address the critical and major issues before merging. The minor issues can be addressed in follow-up PRs if needed. Great work on the comprehensive test coverage! 🎉 |
MillenniumForce
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Sankalpa!! I added some comments.
One final addition, would you be able to adjust the configuration docs and usage examples please?
Closes #220