You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update zod dependency to version 3.25.76 across multiple files
- Changed zod version from 4.0.14 to 3.25.76 in package.json and bun.lock.
- Updated zod version in apps/app/package.json from 4.0.17 to 3.25.76.
- Refactored onboarding helpers to utilize new zod schema validation methods.
These changes ensure compatibility with the updated zod version and improve the overall stability of the application.
// Baseline risks that must always exist for every organization regardless of frameworks
57
+
constBASELINE_RISKS: Array<{
58
+
title: string;
59
+
description: string;
60
+
category: RiskCategory;
61
+
department: Departments;
62
+
status: RiskStatus;
63
+
}>=[
64
+
{
65
+
title: 'Intentional Fraud and Misuse',
66
+
description:
67
+
'Intentional misrepresentation or deception by an internal actor (employee, contractor) or by the organization as a whole, for the purpose of achieving an unauthorized or improper gain.',
68
+
category: RiskCategory.governance,
69
+
department: Departments.gov,
70
+
status: RiskStatus.closed,
71
+
},
72
+
];
73
+
74
+
/**
75
+
* Ensures baseline risks are present for the organization.
76
+
* Creates them if missing. Returns the list of risks that were created.
'Extract vendor names from the following questions and answers. Return their name (grammar-correct), website, description, category, inherent probability, inherent impact, residual probability, and residual impact.',
system: `Create a list of 8-12 risks that are relevant to the organization. Use action-oriented language, assume reviewers understand basic termilology - skip definitions.
357
445
Your mandate is to propose risks that satisfy both ISO 27001:2022 clause 6.1 (risk management) and SOC 2 trust services criteria CC3 and CC4.
@@ -367,7 +455,7 @@ export async function extractRisksFromContext(
367
455
`,
368
456
});
369
457
370
-
returnresult.object.risksasRiskData[];
458
+
return(objectas{risks: RiskData[]}).risks;
371
459
}
372
460
373
461
/**
@@ -489,7 +577,10 @@ export async function createRisks(
489
577
organizationId: string,
490
578
organizationName: string,
491
579
): Promise<Risk[]>{
492
-
// Get existing risks to avoid duplicates
580
+
// Ensure baseline risks exist first so the AI doesn't recreate them
581
+
awaitensureBaselineRisks(organizationId);
582
+
583
+
// Get existing risks to avoid duplicates (includes baseline)
0 commit comments