promptfoo 0.81.5 → 0.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -4
- package/dist/package.json +8 -8
- package/dist/src/commands/{generate/redteam.d.ts → redteam/generate.d.ts} +3 -3
- package/dist/src/commands/redteam/generate.d.ts.map +1 -0
- package/dist/src/commands/{generate/redteam.js → redteam/generate.js} +5 -3
- package/dist/src/commands/redteam/generate.js.map +1 -0
- package/dist/src/commands/{redteam.d.ts → redteam/init.d.ts} +1 -2
- package/dist/src/commands/redteam/init.d.ts.map +1 -0
- package/dist/src/commands/{redteam.js → redteam/init.js} +148 -147
- package/dist/src/commands/redteam/init.js.map +1 -0
- package/dist/src/commands/redteam/plugins.d.ts +3 -0
- package/dist/src/commands/redteam/plugins.d.ts.map +1 -0
- package/dist/src/commands/redteam/plugins.js +31 -0
- package/dist/src/commands/redteam/plugins.js.map +1 -0
- package/dist/src/database/tables.d.ts +6 -6
- package/dist/src/envars.d.ts +3 -0
- package/dist/src/envars.d.ts.map +1 -1
- package/dist/src/envars.js.map +1 -1
- package/dist/src/index.d.ts +15 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +14 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/main.js +7 -6
- package/dist/src/main.js.map +1 -1
- package/dist/src/onboarding.js +2 -2
- package/dist/src/onboarding.js.map +1 -1
- package/dist/src/redteam/constants.d.ts +1 -0
- package/dist/src/redteam/constants.d.ts.map +1 -1
- package/dist/src/redteam/constants.js +3 -1
- package/dist/src/redteam/constants.js.map +1 -1
- package/dist/src/redteam/extraction/entities.d.ts.map +1 -1
- package/dist/src/redteam/extraction/entities.js +14 -3
- package/dist/src/redteam/extraction/entities.js.map +1 -1
- package/dist/src/redteam/extraction/purpose.d.ts.map +1 -1
- package/dist/src/redteam/extraction/purpose.js +15 -3
- package/dist/src/redteam/extraction/purpose.js.map +1 -1
- package/dist/src/redteam/extraction/util.d.ts +27 -0
- package/dist/src/redteam/extraction/util.d.ts.map +1 -1
- package/dist/src/redteam/extraction/util.js +46 -0
- package/dist/src/redteam/extraction/util.js.map +1 -1
- package/dist/src/redteam/index.d.ts +1 -1
- package/dist/src/redteam/index.d.ts.map +1 -1
- package/dist/src/redteam/index.js +38 -23
- package/dist/src/redteam/index.js.map +1 -1
- package/dist/src/redteam/plugins/base.d.ts +6 -5
- package/dist/src/redteam/plugins/base.d.ts.map +1 -1
- package/dist/src/redteam/plugins/base.js +21 -7
- package/dist/src/redteam/plugins/base.js.map +1 -1
- package/dist/src/redteam/plugins/bfla.d.ts +1 -1
- package/dist/src/redteam/plugins/bfla.d.ts.map +1 -1
- package/dist/src/redteam/plugins/bfla.js +11 -5
- package/dist/src/redteam/plugins/bfla.js.map +1 -1
- package/dist/src/redteam/plugins/bola.d.ts +1 -1
- package/dist/src/redteam/plugins/bola.d.ts.map +1 -1
- package/dist/src/redteam/plugins/bola.js +11 -7
- package/dist/src/redteam/plugins/bola.js.map +1 -1
- package/dist/src/redteam/plugins/custom.d.ts +1 -1
- package/dist/src/redteam/plugins/custom.d.ts.map +1 -1
- package/dist/src/redteam/plugins/custom.js +2 -2
- package/dist/src/redteam/plugins/custom.js.map +1 -1
- package/dist/src/redteam/plugins/harmful.d.ts +1 -1
- package/dist/src/redteam/plugins/harmful.d.ts.map +1 -1
- package/dist/src/redteam/plugins/harmful.js +45 -34
- package/dist/src/redteam/plugins/harmful.js.map +1 -1
- package/dist/src/redteam/plugins/index.d.ts +5 -4
- package/dist/src/redteam/plugins/index.d.ts.map +1 -1
- package/dist/src/redteam/plugins/index.js +78 -83
- package/dist/src/redteam/plugins/index.js.map +1 -1
- package/dist/src/redteam/plugins/indirectPromptInjection.d.ts +0 -2
- package/dist/src/redteam/plugins/indirectPromptInjection.d.ts.map +1 -1
- package/dist/src/redteam/plugins/indirectPromptInjection.js +0 -3
- package/dist/src/redteam/plugins/indirectPromptInjection.js.map +1 -1
- package/dist/src/redteam/plugins/policy.d.ts +1 -1
- package/dist/src/redteam/plugins/policy.d.ts.map +1 -1
- package/dist/src/redteam/plugins/policy.js +4 -2
- package/dist/src/redteam/plugins/policy.js.map +1 -1
- package/dist/src/redteam/plugins/promptExtraction.d.ts +1 -1
- package/dist/src/redteam/plugins/promptExtraction.d.ts.map +1 -1
- package/dist/src/redteam/plugins/promptExtraction.js +1 -1
- package/dist/src/redteam/plugins/promptExtraction.js.map +1 -1
- package/dist/src/redteam/plugins/ssrf.d.ts +1 -1
- package/dist/src/redteam/plugins/ssrf.d.ts.map +1 -1
- package/dist/src/redteam/plugins/ssrf.js +2 -2
- package/dist/src/redteam/plugins/ssrf.js.map +1 -1
- package/dist/src/redteam/providers/crescendo/index.d.ts +2 -2
- package/dist/src/redteam/providers/crescendo/index.d.ts.map +1 -1
- package/dist/src/redteam/providers/iterative.d.ts.map +1 -1
- package/dist/src/redteam/providers/iterativeImage.d.ts.map +1 -1
- package/dist/src/redteam/providers/shared.d.ts +2 -2
- package/dist/src/redteam/providers/shared.d.ts.map +1 -1
- package/dist/src/redteam/providers/shared.js +1 -1
- package/dist/src/redteam/providers/shared.js.map +1 -1
- package/dist/src/redteam/strategies/index.d.ts +2 -4
- package/dist/src/redteam/strategies/index.d.ts.map +1 -1
- package/dist/src/redteam/strategies/index.js.map +1 -1
- package/dist/src/redteam/strategies/multilingual.d.ts.map +1 -1
- package/dist/src/redteam/strategies/multilingual.js +20 -0
- package/dist/src/redteam/strategies/multilingual.js.map +1 -1
- package/dist/src/redteam/util.d.ts +1 -0
- package/dist/src/redteam/util.d.ts.map +1 -1
- package/dist/src/redteam/util.js +6 -0
- package/dist/src/redteam/util.js.map +1 -1
- package/dist/src/types/index.d.ts +40 -40
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/redteam.d.ts +29 -35
- package/dist/src/types/redteam.d.ts.map +1 -1
- package/dist/src/validators/redteam.d.ts +20 -13
- package/dist/src/validators/redteam.d.ts.map +1 -1
- package/dist/src/validators/redteam.js +13 -0
- package/dist/src/validators/redteam.js.map +1 -1
- package/dist/src/web/nextui/404/index.html +1 -1
- package/dist/src/web/nextui/404.html +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/{page-67165aedfd3a64fc.js → page-766e25cc9af8e519.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/{layout-e9b86858e84ebd38.js → layout-3fb162429b886376.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/page-b6714efe6c381b92.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/report/{page-0b89c8ba365b7195.js → page-a330d7b915e8a5b9.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/main-app-cf76b7c55faa5c9b.js +1 -0
- package/dist/src/web/nextui/auth/login/index.html +1 -1
- package/dist/src/web/nextui/auth/login/index.txt +2 -2
- package/dist/src/web/nextui/auth/signup/index.html +1 -1
- package/dist/src/web/nextui/auth/signup/index.txt +2 -2
- package/dist/src/web/nextui/datasets/index.html +1 -1
- package/dist/src/web/nextui/datasets/index.txt +2 -2
- package/dist/src/web/nextui/eval/index.html +1 -1
- package/dist/src/web/nextui/eval/index.txt +3 -3
- package/dist/src/web/nextui/index.html +1 -1
- package/dist/src/web/nextui/index.txt +2 -2
- package/dist/src/web/nextui/progress/index.html +1 -1
- package/dist/src/web/nextui/progress/index.txt +2 -2
- package/dist/src/web/nextui/prompts/index.html +1 -1
- package/dist/src/web/nextui/prompts/index.txt +2 -2
- package/dist/src/web/nextui/report/index.html +1 -1
- package/dist/src/web/nextui/report/index.txt +3 -3
- package/dist/src/web/nextui/setup/index.html +1 -1
- package/dist/src/web/nextui/setup/index.txt +2 -2
- package/dist/test/commands/redteam/generate.test.d.ts +2 -0
- package/dist/test/commands/redteam/generate.test.d.ts.map +1 -0
- package/dist/test/commands/{generate/redteam.test.js → redteam/generate.test.js} +12 -13
- package/dist/test/commands/redteam/generate.test.js.map +1 -0
- package/dist/test/redteam/extraction/entities.test.js +45 -2
- package/dist/test/redteam/extraction/entities.test.js.map +1 -1
- package/dist/test/redteam/extraction/purpose.test.js +45 -10
- package/dist/test/redteam/extraction/purpose.test.js.map +1 -1
- package/dist/test/redteam/extraction/util.test.js +93 -4
- package/dist/test/redteam/extraction/util.test.js.map +1 -1
- package/dist/test/redteam/index.test.js +0 -23
- package/dist/test/redteam/index.test.js.map +1 -1
- package/dist/test/redteam/plugins/base.test.js +16 -4
- package/dist/test/redteam/plugins/base.test.js.map +1 -1
- package/dist/test/redteam/providers/shared.test.js +0 -8
- package/dist/test/redteam/providers/shared.test.js.map +1 -1
- package/dist/test/redteam/validators.test.js +1 -1
- package/dist/test/redteam/validators.test.js.map +1 -1
- package/package.json +8 -8
- package/dist/src/commands/generate/redteam.d.ts.map +0 -1
- package/dist/src/commands/generate/redteam.js.map +0 -1
- package/dist/src/commands/redteam.d.ts.map +0 -1
- package/dist/src/commands/redteam.js.map +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/page-81e3b8fee37eaf67.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/main-app-0dc90092cd7acaaf.js +0 -1
- package/dist/test/commands/generate/redteam.test.d.ts +0 -2
- package/dist/test/commands/generate/redteam.test.d.ts.map +0 -1
- package/dist/test/commands/generate/redteam.test.js.map +0 -1
- /package/dist/src/web/nextui/_next/static/{B-Wbtl8GsdNHqd1Jebs7I → 8ykUqaOH4zii7_PoqqHv2}/_buildManifest.js +0 -0
- /package/dist/src/web/nextui/_next/static/{B-Wbtl8GsdNHqd1Jebs7I → 8ykUqaOH4zii7_PoqqHv2}/_ssgManifest.js +0 -0
- /package/dist/src/web/nextui/_next/static/chunks/{258-5f4892005dadd945.js → 258-6060e00d93b0f598.js} +0 -0
|
@@ -1,59 +1,53 @@
|
|
|
1
1
|
import type { ApiProvider, ProviderOptions } from '../types/providers';
|
|
2
|
-
export type
|
|
2
|
+
export type RedteamObjectConfig = Record<string, unknown>;
|
|
3
|
+
export type PluginConfig = RedteamObjectConfig;
|
|
4
|
+
export type StrategyConfig = RedteamObjectConfig;
|
|
5
|
+
type ConfigurableObject = {
|
|
3
6
|
id: string;
|
|
7
|
+
config?: RedteamObjectConfig;
|
|
8
|
+
};
|
|
9
|
+
type WithNumTests = {
|
|
4
10
|
numTests?: number;
|
|
5
|
-
config?: Record<string, unknown>;
|
|
6
11
|
};
|
|
12
|
+
export type RedteamPluginObject = ConfigurableObject & WithNumTests;
|
|
7
13
|
export type RedteamPlugin = string | RedteamPluginObject;
|
|
8
|
-
export type RedteamStrategyObject =
|
|
9
|
-
id: string;
|
|
10
|
-
};
|
|
14
|
+
export type RedteamStrategyObject = ConfigurableObject;
|
|
11
15
|
export type RedteamStrategy = string | RedteamStrategyObject;
|
|
12
|
-
|
|
16
|
+
type CommonOptions = {
|
|
17
|
+
injectVar?: string;
|
|
18
|
+
language?: string;
|
|
19
|
+
numTests?: number;
|
|
20
|
+
plugins?: RedteamPluginObject[];
|
|
21
|
+
provider?: string | ProviderOptions | ApiProvider;
|
|
22
|
+
purpose?: string;
|
|
23
|
+
strategies?: RedteamStrategy[];
|
|
24
|
+
delay?: number;
|
|
25
|
+
};
|
|
26
|
+
export interface RedteamCliGenerateOptions extends CommonOptions {
|
|
13
27
|
cache: boolean;
|
|
14
28
|
config?: string;
|
|
15
29
|
defaultConfig: Record<string, unknown>;
|
|
16
30
|
defaultConfigPath?: string;
|
|
17
31
|
envFile?: string;
|
|
18
|
-
injectVar?: string;
|
|
19
|
-
language?: string;
|
|
20
32
|
maxConcurrency?: number;
|
|
21
|
-
numTests?: number;
|
|
22
33
|
output?: string;
|
|
23
|
-
plugins?: RedteamPluginObject[];
|
|
24
|
-
provider?: string;
|
|
25
|
-
purpose?: string;
|
|
26
|
-
strategies?: RedteamStrategy[];
|
|
27
34
|
write: boolean;
|
|
28
|
-
}
|
|
29
|
-
export
|
|
35
|
+
}
|
|
36
|
+
export interface RedteamFileConfig extends CommonOptions {
|
|
30
37
|
entities?: string[];
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
language?: string;
|
|
34
|
-
plugins: RedteamPluginObject[];
|
|
35
|
-
provider?: string | ProviderOptions | ApiProvider;
|
|
36
|
-
purpose?: string;
|
|
37
|
-
strategies: RedteamStrategyObject[];
|
|
38
|
-
};
|
|
39
|
-
export type RedteamAssertionTypes = `promptfoo:redteam:${string}`;
|
|
40
|
-
export interface SynthesizeOptions {
|
|
38
|
+
}
|
|
39
|
+
export interface SynthesizeOptions extends CommonOptions {
|
|
41
40
|
entities?: string[];
|
|
42
|
-
injectVar?: string;
|
|
43
41
|
language: string;
|
|
44
42
|
maxConcurrency?: number;
|
|
45
43
|
numTests: number;
|
|
46
|
-
plugins: {
|
|
44
|
+
plugins: (RedteamPluginObject & {
|
|
47
45
|
id: string;
|
|
48
46
|
numTests: number;
|
|
49
|
-
|
|
50
|
-
}[];
|
|
47
|
+
})[];
|
|
51
48
|
prompts: [string, ...string[]];
|
|
52
|
-
|
|
53
|
-
purpose?: string;
|
|
54
|
-
strategies: {
|
|
55
|
-
id: string;
|
|
56
|
-
config?: Record<string, any>;
|
|
57
|
-
}[];
|
|
49
|
+
strategies: RedteamStrategyObject[];
|
|
58
50
|
}
|
|
51
|
+
export type RedteamAssertionTypes = `promptfoo:redteam:${string}`;
|
|
52
|
+
export {};
|
|
59
53
|
//# sourceMappingURL=redteam.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redteam.d.ts","sourceRoot":"","sources":["../../../src/types/redteam.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"redteam.d.ts","sourceRoot":"","sources":["../../../src/types/redteam.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGvE,MAAM,MAAM,mBAAmB,GAAG,MAA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,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,CAAC,mBAAmB,GAAG;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IACpE,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IAC/B,UAAU,EAAE,qBAAqB,EAAE,CAAC;CACrC;AAED,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,MAAM,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RedteamFileConfig } from '../types/redteam';
|
|
3
3
|
/**
|
|
4
4
|
* Schema for individual redteam plugins or their shorthand.
|
|
5
5
|
*/
|
|
@@ -71,19 +71,22 @@ export declare const RedteamGenerateOptionsSchema: z.ZodObject<{
|
|
|
71
71
|
config?: Record<string, unknown> | undefined;
|
|
72
72
|
}>]>, "many">>;
|
|
73
73
|
write: z.ZodBoolean;
|
|
74
|
+
delay: z.ZodOptional<z.ZodNumber>;
|
|
74
75
|
}, "strip", z.ZodTypeAny, {
|
|
75
|
-
write: boolean;
|
|
76
76
|
cache: boolean;
|
|
77
77
|
defaultConfig: Record<string, unknown>;
|
|
78
|
+
write: boolean;
|
|
78
79
|
provider?: string | undefined;
|
|
79
80
|
config?: string | undefined;
|
|
81
|
+
delay?: number | undefined;
|
|
80
82
|
output?: string | undefined;
|
|
81
|
-
|
|
83
|
+
defaultConfigPath?: string | undefined;
|
|
82
84
|
envFile?: string | undefined;
|
|
85
|
+
maxConcurrency?: number | undefined;
|
|
83
86
|
numTests?: number | undefined;
|
|
84
87
|
injectVar?: string | undefined;
|
|
85
|
-
purpose?: string | undefined;
|
|
86
88
|
language?: string | undefined;
|
|
89
|
+
purpose?: string | undefined;
|
|
87
90
|
plugins?: {
|
|
88
91
|
id: string;
|
|
89
92
|
numTests: number;
|
|
@@ -93,22 +96,23 @@ export declare const RedteamGenerateOptionsSchema: z.ZodObject<{
|
|
|
93
96
|
id: string;
|
|
94
97
|
config?: Record<string, unknown> | undefined;
|
|
95
98
|
})[] | undefined;
|
|
96
|
-
defaultConfigPath?: string | undefined;
|
|
97
99
|
addPlugins?: string[] | undefined;
|
|
98
100
|
addStrategies?: string[] | undefined;
|
|
99
101
|
}, {
|
|
100
|
-
write: boolean;
|
|
101
102
|
cache: boolean;
|
|
102
103
|
defaultConfig: Record<string, unknown>;
|
|
104
|
+
write: boolean;
|
|
103
105
|
provider?: string | undefined;
|
|
104
106
|
config?: string | undefined;
|
|
107
|
+
delay?: number | undefined;
|
|
105
108
|
output?: string | undefined;
|
|
106
|
-
|
|
109
|
+
defaultConfigPath?: string | undefined;
|
|
107
110
|
envFile?: string | undefined;
|
|
111
|
+
maxConcurrency?: number | undefined;
|
|
108
112
|
numTests?: number | undefined;
|
|
109
113
|
injectVar?: string | undefined;
|
|
110
|
-
purpose?: string | undefined;
|
|
111
114
|
language?: string | undefined;
|
|
115
|
+
purpose?: string | undefined;
|
|
112
116
|
plugins?: {
|
|
113
117
|
id: string;
|
|
114
118
|
config?: Record<string, unknown> | undefined;
|
|
@@ -118,7 +122,6 @@ export declare const RedteamGenerateOptionsSchema: z.ZodObject<{
|
|
|
118
122
|
id: string;
|
|
119
123
|
config?: Record<string, unknown> | undefined;
|
|
120
124
|
})[] | undefined;
|
|
121
|
-
defaultConfigPath?: string | undefined;
|
|
122
125
|
addPlugins?: string[] | undefined;
|
|
123
126
|
addStrategies?: string[] | undefined;
|
|
124
127
|
}>;
|
|
@@ -363,6 +366,7 @@ export declare const RedteamConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
363
366
|
config?: Record<string, unknown> | undefined;
|
|
364
367
|
}>]>, "many">>>;
|
|
365
368
|
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
369
|
+
delay: z.ZodOptional<z.ZodNumber>;
|
|
366
370
|
}, "strip", z.ZodTypeAny, {
|
|
367
371
|
plugins: (string | {
|
|
368
372
|
id: string;
|
|
@@ -422,11 +426,12 @@ export declare const RedteamConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
422
426
|
callEmbeddingApi?: ((args_0: string, ...args_1: unknown[]) => Promise<import("..").ProviderEmbeddingResponse>) | undefined;
|
|
423
427
|
callClassificationApi?: ((args_0: string, ...args_1: unknown[]) => Promise<import("..").ProviderClassificationResponse>) | undefined;
|
|
424
428
|
} | undefined;
|
|
429
|
+
delay?: number | undefined;
|
|
425
430
|
maxConcurrency?: number | undefined;
|
|
426
431
|
numTests?: number | undefined;
|
|
427
432
|
injectVar?: string | undefined;
|
|
428
|
-
purpose?: string | undefined;
|
|
429
433
|
language?: string | undefined;
|
|
434
|
+
purpose?: string | undefined;
|
|
430
435
|
}, {
|
|
431
436
|
provider?: string | {
|
|
432
437
|
id?: string | undefined;
|
|
@@ -477,11 +482,12 @@ export declare const RedteamConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
477
482
|
callEmbeddingApi?: ((args_0: string, ...args_1: unknown[]) => Promise<import("..").ProviderEmbeddingResponse>) | undefined;
|
|
478
483
|
callClassificationApi?: ((args_0: string, ...args_1: unknown[]) => Promise<import("..").ProviderClassificationResponse>) | undefined;
|
|
479
484
|
} | undefined;
|
|
485
|
+
delay?: number | undefined;
|
|
480
486
|
maxConcurrency?: number | undefined;
|
|
481
487
|
numTests?: number | undefined;
|
|
482
488
|
injectVar?: string | undefined;
|
|
483
|
-
purpose?: string | undefined;
|
|
484
489
|
language?: string | undefined;
|
|
490
|
+
purpose?: string | undefined;
|
|
485
491
|
plugins?: (string | {
|
|
486
492
|
id: string;
|
|
487
493
|
config?: Record<string, unknown> | undefined;
|
|
@@ -491,7 +497,7 @@ export declare const RedteamConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
491
497
|
id: string;
|
|
492
498
|
config?: Record<string, unknown> | undefined;
|
|
493
499
|
})[] | undefined;
|
|
494
|
-
}>,
|
|
500
|
+
}>, RedteamFileConfig, {
|
|
495
501
|
provider?: string | {
|
|
496
502
|
id?: string | undefined;
|
|
497
503
|
label?: string | undefined;
|
|
@@ -541,11 +547,12 @@ export declare const RedteamConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
541
547
|
callEmbeddingApi?: ((args_0: string, ...args_1: unknown[]) => Promise<import("..").ProviderEmbeddingResponse>) | undefined;
|
|
542
548
|
callClassificationApi?: ((args_0: string, ...args_1: unknown[]) => Promise<import("..").ProviderClassificationResponse>) | undefined;
|
|
543
549
|
} | undefined;
|
|
550
|
+
delay?: number | undefined;
|
|
544
551
|
maxConcurrency?: number | undefined;
|
|
545
552
|
numTests?: number | undefined;
|
|
546
553
|
injectVar?: string | undefined;
|
|
547
|
-
purpose?: string | undefined;
|
|
548
554
|
language?: string | undefined;
|
|
555
|
+
purpose?: string | undefined;
|
|
549
556
|
plugins?: (string | {
|
|
550
557
|
id: string;
|
|
551
558
|
config?: Record<string, unknown> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redteam.d.ts","sourceRoot":"","sources":["../../../src/validators/redteam.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"redteam.d.ts","sourceRoot":"","sources":["../../../src/validators/redteam.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,kBAAkB,CAAC;AAmB/E;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;IAU9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;IAMhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmCvC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmH5B,CAAC"}
|
|
@@ -79,6 +79,12 @@ exports.RedteamGenerateOptionsSchema = zod_1.z.object({
|
|
|
79
79
|
purpose: zod_1.z.string().optional().describe('Purpose of the redteam generation'),
|
|
80
80
|
strategies: zod_1.z.array(exports.RedteamStrategySchema).optional().describe('Strategies to use'),
|
|
81
81
|
write: zod_1.z.boolean().describe('Whether to write the output'),
|
|
82
|
+
delay: zod_1.z
|
|
83
|
+
.number()
|
|
84
|
+
.int()
|
|
85
|
+
.positive()
|
|
86
|
+
.optional()
|
|
87
|
+
.describe('Delay in milliseconds between plugin API calls'),
|
|
82
88
|
});
|
|
83
89
|
/**
|
|
84
90
|
* Schema for `redteam` section of promptfooconfig.yaml
|
|
@@ -118,6 +124,12 @@ exports.RedteamConfigSchema = zod_1.z
|
|
|
118
124
|
.positive()
|
|
119
125
|
.optional()
|
|
120
126
|
.describe('Maximum number of concurrent API calls'),
|
|
127
|
+
delay: zod_1.z
|
|
128
|
+
.number()
|
|
129
|
+
.int()
|
|
130
|
+
.positive()
|
|
131
|
+
.optional()
|
|
132
|
+
.describe('Delay in milliseconds between plugin API calls'),
|
|
121
133
|
})
|
|
122
134
|
.transform((data) => {
|
|
123
135
|
const pluginMap = new Map();
|
|
@@ -183,6 +195,7 @@ exports.RedteamConfigSchema = zod_1.z
|
|
|
183
195
|
...(data.language ? { language: data.language } : {}),
|
|
184
196
|
...(data.provider ? { provider: data.provider } : {}),
|
|
185
197
|
...(data.purpose ? { purpose: data.purpose } : {}),
|
|
198
|
+
...(data.delay ? { delay: data.delay } : {}),
|
|
186
199
|
};
|
|
187
200
|
});
|
|
188
201
|
// Ensure that schemas match their corresponding types
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redteam.js","sourceRoot":"","sources":["../../../src/validators/redteam.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,6BAAwB;AACxB,oDAY8B;AAE9B,uDAAyD;AAEzD;;GAEG;AACH,MAAM,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,EAAE,EAAE,OAAC;SACF,IAAI,CAAC,CAAC,GAAG,uBAAmB,EAAE,GAAG,2BAAe,CAA0B,CAAC;SAC3E,QAAQ,CAAC,oBAAoB,CAAC;IACjC,QAAQ,EAAE,OAAC;SACR,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,OAAO,CAAC,wCAA4B,CAAC;SACrC,QAAQ,CAAC,6CAA6C,CAAC;IAC1D,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ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CAAC,CAAC,EAAE,CAAC;QACrD,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC7C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,sDAAsD;AACtD,6DAA6D;AAC7D,SAAS,MAAM,KAAqB,CAAC;AAGrC,MAAM,EAA6E,CAAC;AACpF,2BAA2B;AAC3B,+FAA+F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2bde9ee952171572.js" defer=""></script><script src="/_next/static/chunks/framework-c3d480eb9ad30ba5.js" defer=""></script><script src="/_next/static/chunks/main-853e5508e37bbe4c.js" defer=""></script><script src="/_next/static/chunks/pages/_app-998b254a061422d4.js" defer=""></script><script src="/_next/static/chunks/pages/_error-94f0db477e27e000.js" defer=""></script><script src="/_next/static/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2bde9ee952171572.js" defer=""></script><script src="/_next/static/chunks/framework-c3d480eb9ad30ba5.js" defer=""></script><script src="/_next/static/chunks/main-853e5508e37bbe4c.js" defer=""></script><script src="/_next/static/chunks/pages/_app-998b254a061422d4.js" defer=""></script><script src="/_next/static/chunks/pages/_error-94f0db477e27e000.js" defer=""></script><script src="/_next/static/8ykUqaOH4zii7_PoqqHv2/_buildManifest.js" defer=""></script><script src="/_next/static/8ykUqaOH4zii7_PoqqHv2/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"8ykUqaOH4zii7_PoqqHv2","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2bde9ee952171572.js" defer=""></script><script src="/_next/static/chunks/framework-c3d480eb9ad30ba5.js" defer=""></script><script src="/_next/static/chunks/main-853e5508e37bbe4c.js" defer=""></script><script src="/_next/static/chunks/pages/_app-998b254a061422d4.js" defer=""></script><script src="/_next/static/chunks/pages/_error-94f0db477e27e000.js" defer=""></script><script src="/_next/static/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2bde9ee952171572.js" defer=""></script><script src="/_next/static/chunks/framework-c3d480eb9ad30ba5.js" defer=""></script><script src="/_next/static/chunks/main-853e5508e37bbe4c.js" defer=""></script><script src="/_next/static/chunks/pages/_app-998b254a061422d4.js" defer=""></script><script src="/_next/static/chunks/pages/_error-94f0db477e27e000.js" defer=""></script><script src="/_next/static/8ykUqaOH4zii7_PoqqHv2/_buildManifest.js" defer=""></script><script src="/_next/static/8ykUqaOH4zii7_PoqqHv2/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"8ykUqaOH4zii7_PoqqHv2","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[421],{
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[421],{10849:function(e,n,t){Promise.resolve().then(t.t.bind(t,27924,23)),Promise.resolve().then(t.t.bind(t,16662,23)),Promise.resolve().then(t.t.bind(t,30910,23)),Promise.resolve().then(t.t.bind(t,81885,23)),Promise.resolve().then(t.bind(t,55258)),Promise.resolve().then(t.t.bind(t,29820,23))},81885:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e,n){for(var t in n)Object.defineProperty(e,t,{enumerable:!0,get:n[t]})}(n,{suspense:function(){return o},NoSSR:function(){return i}}),t(69278),t(14978);let r=t(66995);function o(){let e=Error(r.NEXT_DYNAMIC_NO_SSR_CODE);throw e.digest=r.NEXT_DYNAMIC_NO_SSR_CODE,e}function i(e){let{children:n}=e;return n}},29820:function(){}},function(e){e.O(0,[583,148,640,193,391,654,65,975,276,132,874,235,264,459,631,734,19,258,470,730,744],function(){return e(e.s=10849)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{84173:function(e,t,r){Promise.resolve().then(r.bind(r,5071)),Promise.resolve().then(r.t.bind(r,5100,23)),Promise.resolve().then(r.t.bind(r,65246,23))},5071:function(e,t,r){"use strict";r.r(t),r.d(t,{PageShell:function(){return J}});var o=r(24004),n=r(14978),s=r(52428),i=r(14819),l=r(52653),a=r(13457),c=r(38640),u=r.n(c),d=r(28891),h=r(39864),f=r(47028);function p(e){let{darkMode:t,onToggleDarkMode:r}=e;return(0,o.jsx)("div",{className:"dark-mode-toggle",onClick:r,children:t?(0,o.jsx)(h.Z,{}):(0,o.jsx)(f.Z,{})})}r(32854);var x=r(58715),m=r(61443),g=r(14089),j=r(68452),b=r(91018),v=r(89394),k=r(91797),C=r(43226),Z=r(25210),S=r(26337),E=r(42834),O=r(49050);let _=[{icon:(0,o.jsx)(b.Z,{fontSize:"small"}),text:"Documentation",href:"https://www.promptfoo.dev/docs/intro"},{icon:(0,o.jsx)(j.Z,{fontSize:"small"}),text:"GitHub Repository",href:"https://github.com/promptfoo/promptfoo"},{icon:(0,o.jsx)(x.Z,{fontSize:"small"}),text:"File an Issue",href:"https://github.com/promptfoo/promptfoo/issues"},{icon:(0,o.jsx)(g.Z,{fontSize:"small"}),text:"Join Our Discord Community",href:"https://discord.gg/gHPS9jjfbs"},{icon:(0,o.jsx)(m.Z,{fontSize:"small"}),text:"Book a Meeting",href:"https://cal.com/team/promptfoo/intro"}];function P(e){let{open:t,onClose:r}=e;return(0,o.jsxs)(v.Z,{open:t,onClose:r,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"about-promptfoo-dialog-title",children:[(0,o.jsx)(k.Z,{id:"about-promptfoo-dialog-title",children:(0,o.jsxs)(a.Z,{children:[(0,o.jsx)(C.Z,{variant:"h6",children:"About Promptfoo"}),(0,o.jsx)(Z.Z,{href:"https://github.com/promptfoo/promptfoo/releases",underline:"none",sx:{color:"inherit"},target:"_blank",children:(0,o.jsxs)(C.Z,{variant:"subtitle2",children:["Version ","0.
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{84173:function(e,t,r){Promise.resolve().then(r.bind(r,5071)),Promise.resolve().then(r.t.bind(r,5100,23)),Promise.resolve().then(r.t.bind(r,65246,23))},5071:function(e,t,r){"use strict";r.r(t),r.d(t,{PageShell:function(){return J}});var o=r(24004),n=r(14978),s=r(52428),i=r(14819),l=r(52653),a=r(13457),c=r(38640),u=r.n(c),d=r(28891),h=r(39864),f=r(47028);function p(e){let{darkMode:t,onToggleDarkMode:r}=e;return(0,o.jsx)("div",{className:"dark-mode-toggle",onClick:r,children:t?(0,o.jsx)(h.Z,{}):(0,o.jsx)(f.Z,{})})}r(32854);var x=r(58715),m=r(61443),g=r(14089),j=r(68452),b=r(91018),v=r(89394),k=r(91797),C=r(43226),Z=r(25210),S=r(26337),E=r(42834),O=r(49050);let _=[{icon:(0,o.jsx)(b.Z,{fontSize:"small"}),text:"Documentation",href:"https://www.promptfoo.dev/docs/intro"},{icon:(0,o.jsx)(j.Z,{fontSize:"small"}),text:"GitHub Repository",href:"https://github.com/promptfoo/promptfoo"},{icon:(0,o.jsx)(x.Z,{fontSize:"small"}),text:"File an Issue",href:"https://github.com/promptfoo/promptfoo/issues"},{icon:(0,o.jsx)(g.Z,{fontSize:"small"}),text:"Join Our Discord Community",href:"https://discord.gg/gHPS9jjfbs"},{icon:(0,o.jsx)(m.Z,{fontSize:"small"}),text:"Book a Meeting",href:"https://cal.com/team/promptfoo/intro"}];function P(e){let{open:t,onClose:r}=e;return(0,o.jsxs)(v.Z,{open:t,onClose:r,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"about-promptfoo-dialog-title",children:[(0,o.jsx)(k.Z,{id:"about-promptfoo-dialog-title",children:(0,o.jsxs)(a.Z,{children:[(0,o.jsx)(C.Z,{variant:"h6",children:"About Promptfoo"}),(0,o.jsx)(Z.Z,{href:"https://github.com/promptfoo/promptfoo/releases",underline:"none",sx:{color:"inherit"},target:"_blank",children:(0,o.jsxs)(C.Z,{variant:"subtitle2",children:["Version ","0.83.0"]})})]})}),(0,o.jsxs)(S.Z,{children:[(0,o.jsx)(C.Z,{variant:"body2",gutterBottom:!0,children:"Promptfoo is a MIT licensed open-source tool for evaluating LLMs. We make it easy to track the performance of your models and prompts over time with automated support for dataset generation and grading."}),(0,o.jsx)(a.Z,{spacing:2,mt:2,children:_.map((e,t)=>(0,o.jsxs)(a.Z,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap","& .MuiSvgIcon-root":{color:"text.primary"}},children:[e.icon,(0,o.jsx)(Z.Z,{underline:"none",target:"_blank",href:e.href,sx:{color:"inherit"},children:(0,o.jsx)(C.Z,{variant:"body2",children:e.text})})]},t))})]}),(0,o.jsx)(E.Z,{children:(0,o.jsx)(O.Z,{onClick:r,children:"Close"})})]})}var y=r(1445),F=r(3283),N=r(33932),M=r(74309);function w(){let{user:e,logout:t}=(0,y.aC)(),[r,s]=n.useState(null),i=()=>{s(null)},a=async()=>{null==t||t(),i()};return e?(0,o.jsxs)("div",{children:[(0,o.jsx)(l.Z,{edge:"end","aria-label":"account of current user","aria-controls":"menu-appbar","aria-haspopup":"true",onClick:e=>{s(e.currentTarget)},color:"inherit",children:(0,o.jsx)(F.Z,{sx:{width:"1em",height:"1em",bgcolor:"#1976d2"}})}),(0,o.jsxs)(N.Z,{id:"menu-appbar",anchorEl:r,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:!!r,onClose:i,children:[(0,o.jsxs)(M.Z,{disabled:!0,children:["Logged in as ",e.email]}),(0,o.jsx)(M.Z,{onClick:a,children:"Logout"})]})]}):(0,o.jsx)(u(),{href:"/auth/signup/",children:(0,o.jsx)(l.Z,{edge:"end","aria-label":"User not logged in","aria-controls":"menu-appbar","aria-haspopup":"true",color:"inherit",children:(0,o.jsx)(F.Z,{sx:{width:"1em",height:"1em"}})})})}var I=r(79245),T=r(47051),R=r.n(T);function A(){return(0,o.jsx)(u(),{href:"https://promptfoo.dev",passHref:!0,children:(0,o.jsxs)(I.Z,{className:"logo",component:"a",children:[(0,o.jsx)(R(),{width:25,height:25,src:"/logo-panda.svg",alt:"Promptfoo logo"})," ",(0,o.jsx)("span",{children:"promptfoo"})]})})}r(17328),r(5008);var D=r(77580);function B(e){let{href:t,label:r}=e,n=(0,d.usePathname)()||"";return(0,o.jsx)(u(),{href:t,className:n.startsWith(t)?"active":"",children:r})}function L(e){let{darkMode:t,onToggleDarkMode:r}=e,[c,u]=(0,n.useState)(!1),d=()=>u(e=>!e),h=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(A,{}),!D.env.NEXT_PUBLIC_NO_BROWSING&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(B,{href:"/setup",label:"New Eval"}),(0,o.jsx)(B,{href:"/eval",label:"Evals"}),(0,o.jsx)(B,{href:"/prompts",label:"Prompts"}),(0,o.jsx)(B,{href:"/datasets",label:"Datasets"}),(0,o.jsx)(B,{href:"/progress",label:"Progress"})]}),(0,o.jsxs)("div",{className:"right-aligned",children:[s.Ox?(0,o.jsx)(w,{}):null,(0,o.jsx)(l.Z,{onClick:d,sx:{color:"#f0f0f0"},children:(0,o.jsx)(i.Z,{})}),(0,o.jsx)(p,{darkMode:t,onToggleDarkMode:r})]})]});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(P,{open:c,onClose:d}),(0,o.jsx)(a.Z,{direction:"row",spacing:2,className:"nav",children:h})]})}var W=r(30606),U=r(33948),z=r(42714);r(70894);let H=e=>(0,W.Z)({typography:{fontFamily:"inherit"},palette:{mode:e?"dark":"light",background:{default:"#ffffff"}},components:{MuiCard:{styleOverrides:{root:{backgroundColor:e?"#121212":"#fff",boxShadow:e?"none":"0 2px 3px rgba(0, 0, 0, 0.1)",borderRadius:"12px"}}},MuiTableContainer:{styleOverrides:{root:{backgroundColor:e?"#121212":"#fff",boxShadow:e?"none":"0 2px 3px rgba(0, 0, 0, 0.1)",borderRadius:"12px"}}},MuiTableHead:{styleOverrides:{root:{backgroundColor:e?"#1E1E1E":"#F5F5F5"}}},MuiTableCell:{styleOverrides:{head:{backgroundColor:"inherit",color:e?"#FFFFFF":"#000000",fontWeight:"bold"},stickyHeader:{backgroundColor:e?"#1E1E1E":"#F5F5F5"}}},MuiInputBase:{styleOverrides:{root:{backgroundColor:e?"#333":"#fff"}}}}}),G=H(!1),V=H(!0);function X(e){let{children:t}=e;return(0,o.jsx)("div",{children:t})}function J(e){let{children:t}=e,r=(0,z.Z)("(prefers-color-scheme: dark)"),[s,i]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=localStorage.getItem("darkMode");i(null===e?r:"true"===e)},[r]);let l=(0,n.useCallback)(()=>{i(e=>{let t=!e;return localStorage.setItem("darkMode",String(t)),t})},[]);return((0,n.useEffect)(()=>{null!==s&&(s?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme"))},[s]),null===s)?null:(0,o.jsx)(U.Z,{theme:s?V:G,children:(0,o.jsx)(y.Ho,{children:(0,o.jsxs)(X,{children:[(0,o.jsx)(L,{darkMode:s,onToggleDarkMode:l}),(0,o.jsx)("div",{children:t})]})})})}},52428:function(e,t,r){"use strict";r.d(t,{Ox:function(){return s},T8:function(){return n},eA:function(){return i}});var o=r(77580);let n=!o.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,s=!!o.env.NEXT_PUBLIC_PROMPTFOO_USE_SUPABASE,i=""},1445:function(e,t,r){"use strict";r.d(t,{Ho:function(){return d},OQ:function(){return i},aC:function(){return a}});var o=r(24004),n=r(14978),s=r(12594);let i=(0,s.createClientComponentClient)(),l=(0,n.createContext)({}),a=()=>(0,n.useContext)(l),c=(e,t)=>i.auth.signInWithPassword({email:e,password:t}),u=()=>i.auth.signOut(),d=e=>{let{children:t}=e,[r,s]=(0,n.useState)(null),[a,d]=(0,n.useState)(!1),h=(0,n.useCallback)(async()=>{let{data:e}=await i.auth.refreshSession();e&&s(e.user)},[]);return(0,n.useEffect)(()=>{h();let{data:e}=i.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?d(!1):"SIGNED_IN"===e&&t?(s(t.user),d(!0)):"SIGNED_OUT"===e&&(d(!1),s(null))});return()=>{e.subscription.unsubscribe()}},[h]),(0,o.jsx)(l.Provider,{value:{loggedIn:a,user:r,login:c,logout:u},children:t})}},32854:function(){},17328:function(){},5008:function(){},70894:function(){},5100:function(){}},function(e){e.O(0,[148,640,193,65,132,415,470,730,744],function(){return e(e.s=84173)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{18688:function(e,n,t){Promise.resolve().then(t.t.bind(t,27924,23)),Promise.resolve().then(t.t.bind(t,16662,23)),Promise.resolve().then(t.t.bind(t,30910,23)),Promise.resolve().then(t.t.bind(t,81885,23)),Promise.resolve().then(t.t.bind(t,48607,23))},81885:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e,n){for(var t in n)Object.defineProperty(e,t,{enumerable:!0,get:n[t]})}(n,{suspense:function(){return o},NoSSR:function(){return i}}),t(69278),t(14978);let r=t(66995);function o(){let e=Error(r.NEXT_DYNAMIC_NO_SSR_CODE);throw e.digest=r.NEXT_DYNAMIC_NO_SSR_CODE,e}function i(e){let{children:n}=e;return n}},48607:function(){}},function(e){e.O(0,[470,730,744],function(){return e(e.s=18688)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[420],{58004:function(e,t,i){Promise.resolve().then(i.bind(i,24406))},49532:function(e,t,i){"use strict";let a,r;async function n(){if(a||(r||(r=fetch("/api/config").then(e=>e.json()).then(e=>a=e.apiBaseUrl)),await r),void 0===a)throw Error("API base URL is undefined");return a}i.d(t,{b:function(){return n}})},24406:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return ev}});var a,r,n=i(24004),s=i(14978),l=i(49532),o=i(79245),c=i(15133),d=i(47827),u=i(88938),m=i(35266),h=i(80356),p=i(38212),g=i(49658),f=i(13457),v=i(43226),x=i(88469);let j={"Security Risk":["bola","bfla","debug-access","hijacking","pii","prompt-extraction","rbac","shell-injection","sql-injection","ssrf","indirect-prompt-injection"],"Legal Risk":["contracts","harmful:child-exploitation","harmful:copyright-violations","harmful:cybercrime","harmful:hate","harmful:illegal-activities","harmful:illegal-drugs","harmful:intellectual-property","harmful:privacy","harmful:self-harm","harmful:sex-crime","harmful:sexual-content","harmful:specialized-advice","harmful:violent-crime"],"Brand Risk":["policy","competitors","excessive-agency","hallucination","harmful:graphic-content","harmful:harassment-bullying","harmful:indiscriminate-weapons","harmful:insults","harmful:misinformation-disinformation","harmful:non-violent-crime","harmful:profanity","harmful:radicalization","harmful:unsafe-practices","imitation","overreliance","politics"]},y={"Brand Risk":"Risks that can affect the brand reputation and trustworthiness.","Legal Risk":"Risks that can lead to legal consequences or violations.","Technical Risk":"Risks involving malicious activities targeting the system or users."};(a=r||(r={})).Critical="Critical",a.High="High",a.Medium="Medium",a.Low="Low";let b={"debug-access":r.High,"excessive-agency":r.Medium,"harmful:child-exploitation":r.Critical,"harmful:copyright-violations":r.Low,"harmful:cybercrime":r.Low,"harmful:graphic-content":r.Medium,"harmful:harassment-bullying":r.Low,"harmful:hate":r.Critical,"harmful:illegal-activities":r.Medium,"harmful:illegal-drugs":r.Medium,"harmful:indiscriminate-weapons":r.Medium,"harmful:insults":r.Low,"harmful:intellectual-property":r.Medium,"harmful:misinformation-disinformation":r.Medium,"harmful:non-violent-crime":r.Medium,"harmful:privacy":r.High,"harmful:profanity":r.Low,"harmful:radicalization":r.Low,"harmful:self-harm":r.Critical,"harmful:sex-crime":r.High,"harmful:sexual-content":r.Medium,"harmful:specialized-advice":r.Medium,"harmful:unsafe-practices":r.Low,"harmful:violent-crime":r.High,"prompt-injection":r.Medium,"shell-injection":r.High,"sql-injection":r.High,competitors:r.Low,contracts:r.Medium,hallucination:r.Medium,hijacking:r.High,imitation:r.Low,jailbreak:r.Medium,overreliance:r.Low,pii:r.High,politics:r.Low,rbac:r.High,policy:r.High,bola:r.High,bfla:r.High,ssrf:r.High,"indirect-prompt-injection":r.High,"prompt-extraction":r.Medium},Z=Object.entries(j).reduce((e,t)=>{let[i,a]=t;return a.forEach(t=>{e[t]=i}),e},{});Object.keys(Z);let w={bola:"BOLAEnforcement",bfla:"BFLAEnforcement",ssrf:"SSRFEnforcement","debug-access":"DebugAccess","excessive-agency":"ExcessiveAgency","harmful:child-exploitation":"Child Exploitation","harmful:cybercrime":"Cybercrime & Unauthorized Intrusion - Hacking and Malware","harmful:graphic-content":"Graphic & age-restricted content","harmful:harassment-bullying":"Harassment & Bullying","harmful:hate":"Hate","harmful:illegal-activities":"Illegal Activities - Fraud & scams","harmful:illegal-drugs":"Illegal Drugs","harmful:indiscriminate-weapons":"Indiscriminate Weapons","harmful:insults":"Insults and personal attacks","harmful:intellectual-property":"Intellectual Property violation","harmful:misinformation-disinformation":"Misinformation & Disinformation - Harmful lies and propaganda","harmful:non-violent-crime":"Non-Violent Crimes","harmful:privacy":"Privacy violations","harmful:profanity":"Requests containing profanity","harmful:radicalization":"Radicalization","harmful:self-harm":"Self-Harm","harmful:sex-crime":"Sex Crimes","harmful:sexual-content":"Sexual Content","harmful:specialized-advice":"Specialized Advice - Financial","harmful:unsafe-practices":"Promotion of unsafe practices","harmful:violent-crime":"Violent Crimes","harmful:chemical-biological-weapons":"Chemical & Biological Weapons","harmful:copyright-violations":"Copyright Violations - Copyrighted text","prompt-injection":"Harmful/Injection","shell-injection":"ShellInjection","sql-injection":"SqlInjection",competitors:"CompetitorEndorsement",contracts:"ContractualCommitment",hallucination:"Hallucination",hijacking:"Hijacking",imitation:"Imitation",jailbreak:"Harmful/Iterative",overreliance:"Overreliance",pii:"PIILeak",politics:"PoliticalStatement",rbac:"RbacEnforcement",policy:"PolicyViolation","indirect-prompt-injection":"IndirectPromptInjection","prompt-extraction":"PromptExtraction"},k=Object.entries(w).reduce((e,t)=>{let[i,a]=t;return e[a]=i,e},{}),C={bola:"Unauthorized Data Access",bfla:"Privilege Escalation",ssrf:"Malicious Resource Fetching","excessive-agency":"Excessive Agency","prompt-injection":"Prompt Injection",competitors:"Competitor Endorsements",contracts:"Unsupervised Contracts",jailbreak:"Single-shot optimization","jailbreak:tree":"Tree-based optimization",pii:"PII Leaks",politics:"Political Opinions","shell-injection":"Shell Injection","sql-injection":"SQL Injection",rbac:"RBAC Enforcement","debug-access":"Debug Access","harmful:specialized-advice":"Specialized Advice","harmful:illegal-activities":"Illegal Activities","harmful:cybercrime":"Cybercrime","harmful:copyright-violations":"Copyright Violations","harmful:misinformation-disinformation":"Misinformation & disinformation",policy:"Custom Policy",basic:"Basic",crescendo:"Multi-turn","indirect-prompt-injection":"Indirect Prompt Injection","prompt-extraction":"Prompt Extraction"},R={default:"Includes common plugins",basic:"Raw attacks without any special attack strategies",multilingual:"Translates the input into low-resource languages",bola:"Broken Object Level Authorization (BOLA) tests",bfla:"Broken Function Level Authorization (BFLA) tests",ssrf:"Server-Side Request Forgery (SSRF) tests","debug-access":"Attempts to access or use debugging commands","excessive-agency":"Model taking excessive initiative or misunderstanding its capabilities","harmful:chemical-biological-weapons":"Content related to chemical or biological weapons","harmful:child-exploitation":"Content exploiting or harming children","harmful:copyright-violations":"Content violating copyright laws","harmful:cybercrime":"Content related to cybercriminal activities","harmful:graphic-content":"Displaying graphic or violent content","harmful:harassment-bullying":"Content that harasses or bullies individuals","harmful:hate":"Content that promotes hate or discrimination","harmful:illegal-activities":"Content promoting illegal activities","harmful:illegal-drugs":"Content related to illegal drug use or trade","harmful:indiscriminate-weapons":"Content related to weapons without context","harmful:insults":"Content that insults or demeans individuals","harmful:intellectual-property":"Content violating intellectual property rights","harmful:misinformation-disinformation":"Spreading false or misleading information","harmful:non-violent-crime":"Content related to non-violent criminal activities","harmful:privacy":"Content violating privacy rights","harmful:profanity":"Content containing profane or inappropriate language","harmful:radicalization":"Content that promotes radical or extremist views","harmful:self-harm":"Content that encourages self-harm or suicide","harmful:sex-crime":"Content related to sexual crimes","harmful:sexual-content":"Explicit or inappropriate sexual content","harmful:specialized-advice":"Providing advice in specialized fields without expertise","harmful:unsafe-practices":"Content promoting unsafe or harmful practices","harmful:violent-crime":"Content related to violent criminal activities","jailbreak:tree":"Tree-based jailbreak search","pii:api-db":"PII exposed through API or database","pii:direct":"Direct exposure of PII","pii:session":"PII exposed in session data","pii:social":"PII exposed through social engineering","prompt-injection":"Malicious inputs designed to manipulate the model's behavior","shell-injection":"Attempts to execute shell commands through the model","sql-injection":"Attempts to perform SQL injection attacks to manipulate database queries",base64:"Attempts to obfuscate malicious content using Base64 encoding",competitors:"Competitor mentions and endorsements",contracts:"Enters business or legal commitments without supervision",hallucination:"Model generating false or misleading information",harmful:"All harmful categories",hijacking:"Unauthorized or off-topic resource use",imitation:"Imitates people, brands, or organizations",jailbreak:"Attempts to bypass security measures through iterative prompt refinement",leetspeak:"Attempts to obfuscate malicious content using leetspeak",overreliance:"Model susceptible to relying on an incorrect user assumption or input",pii:"All PII categories",policy:"Violates a custom configured policy",politics:"Makes political statements",rbac:"Tests whether the model properly implements Role-Based Access Control (RBAC)",rot13:"Attempts to obfuscate malicious content using ROT13 encoding",crescendo:"Conversational attack strategy","prompt-extraction":"Attempts to get the model to reveal its system prompt","indirect-prompt-injection":"Evaluates how susceptible the prompt is to harmful instructions injected into the prompt"};i(4309);var P=e=>{let{categoryStats:t}=e,i=[r.Critical,r.High,r.Medium,r.Low],a=i.reduce((e,i)=>(e[i]=Object.keys(t).reduce((e,t)=>b[t]===i?e+1:e,0),e),{});return(0,n.jsx)(f.Z,{spacing:2,direction:{xs:"column",sm:"row"},children:i.map(e=>(0,n.jsx)(o.Z,{flex:1,children:(0,n.jsx)(c.Z,{className:"severity-card card-".concat(e.toLowerCase()),children:(0,n.jsxs)(x.Z,{onClick:()=>window.location.hash="#table",children:[(0,n.jsx)(v.Z,{variant:"h6",gutterBottom:!0,children:e}),(0,n.jsx)(v.Z,{variant:"h4",color:"text.primary",children:a[e]}),(0,n.jsx)(v.Z,{variant:"body2",color:"text.secondary",children:"issues"})]})})},e))})},A=i(52481),I=i(52653),N=i(78276),S=i(35193),F=i.n(S),L=i(21629),M=e=>{let{evalDescription:t}=e,i=async()=>{let e=document.documentElement,i=await F()(e,{height:Math.max(e.scrollHeight,e.offsetHeight),windowHeight:document.documentElement.scrollHeight}),a=i.toDataURL("image/png"),r=new L.ZP("p","pt",[i.width,i.height]);r.addImage(a,"PNG",0,0,i.width,i.height);let n=t?"report_".concat(t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),".pdf"):"report.pdf";r.save(n)};return(0,n.jsx)(N.Z,{title:"Download report as PDF",placement:"top",children:(0,n.jsx)(I.Z,{onClick:i,sx:{mt:"4px"},"aria-label":"download report",children:(0,n.jsx)(A.Z,{})})})},H=i(93295),z=i(49050),E=i(89394),B=i(42834),D=i(26337),O=i(91797),T=i(4451),W=i(37204),U=i(94660),V=i(74810);let q={getItem:async e=>await (0,W.U2)(e)||null,setItem:async(e,t)=>{await (0,W.t8)(e,t)},removeItem:async e=>{await (0,W.IV)(e)}},_=(0,U.Ue)()((0,V.tJ)(e=>({showPercentagesOnRiskCards:!1,setShowPercentagesOnRiskCards:t=>e(()=>({showPercentagesOnRiskCards:t})),pluginPassRateThreshold:1,setPluginPassRateThreshold:t=>e(()=>({pluginPassRateThreshold:t}))}),{name:"ReportViewStorage",storage:(0,V.FL)(()=>q)}));var J=()=>{let{showPercentagesOnRiskCards:e,setShowPercentagesOnRiskCards:t,pluginPassRateThreshold:i,setPluginPassRateThreshold:a}=_(),[r,l]=s.useState(!1),o=()=>{l(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(N.Z,{title:"Report Settings",placement:"top",children:(0,n.jsx)(I.Z,{onClick:()=>{l(!0)},"aria-label":"settings",children:(0,n.jsx)(H.Z,{})})}),(0,n.jsxs)(E.Z,{open:r,onClose:o,fullWidth:!0,maxWidth:"sm",children:[(0,n.jsx)(O.Z,{children:"Report Settings"}),(0,n.jsxs)(D.Z,{children:[(0,n.jsx)(v.Z,{component:"div",sx:{padding:"16px 0"},children:(0,n.jsxs)("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[(0,n.jsx)("input",{type:"checkbox",checked:e,onChange:e=>t(e.target.checked),style:{marginRight:"10px"}}),"Show percentages on risk cards"]})}),(0,n.jsxs)(v.Z,{component:"div",sx:{padding:"16px 0"},children:[(0,n.jsxs)("label",{children:["Plugin Pass Rate Threshold: ",(100*i).toFixed(0),"%"]}),(0,n.jsx)(v.Z,{variant:"body2",color:"textSecondary",sx:{mt:1},children:"Sets the threshold for considering a plugin as passed on the risk cards."}),(0,n.jsx)(T.ZP,{value:i,onChange:(e,t)=>a(t),"aria-labelledby":"plugin-pass-rate-threshold-slider",step:.05,marks:!0,min:0,max:1,valueLabelDisplay:"auto",valueLabelFormat:e=>"".concat((100*e).toFixed(0),"%")})]})]}),(0,n.jsx)(B.Z,{children:(0,n.jsx)(z.Z,{onClick:o,variant:"contained",color:"primary",children:"Close"})})]})]})},G=i(70740),K=i(14565),Q=i(28874),Y=i(48670),$=i(64111);i(11674);var X=e=>{let{open:t,onClose:i,category:a,failures:r,evalId:s,numPassed:l,numFailed:c}=e,d=w[a];if(!d)return console.error("[RiskCategoryDrawer] Could not load category",a),null;let u=C[a]||d,p=l+c,g=p>0?Math.round(l/p*100):0;return 0===p?(0,n.jsx)($.ZP,{anchor:"right",open:t,onClose:i,children:(0,n.jsxs)(o.Z,{sx:{width:500,p:2},className:"risk-category-drawer",children:[(0,n.jsx)(v.Z,{variant:"h6",gutterBottom:!0,children:u}),(0,n.jsx)(v.Z,{variant:"body1",sx:{mt:2,textAlign:"center"},children:"No tests have been run for this category."})]})}):(0,n.jsx)($.ZP,{anchor:"right",open:t,onClose:i,children:(0,n.jsxs)(o.Z,{sx:{width:500,p:2},className:"risk-category-drawer",children:[(0,n.jsx)(v.Z,{variant:"h6",gutterBottom:!0,children:u}),(0,n.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,n.jsxs)(o.Z,{sx:{textAlign:"center",flex:1},children:[(0,n.jsx)(v.Z,{variant:"h4",color:"primary",children:l.toString()}),(0,n.jsx)(v.Z,{variant:"body2",children:"Passed"})]}),(0,n.jsxs)(o.Z,{sx:{textAlign:"center",flex:1},children:[(0,n.jsx)(v.Z,{variant:"h4",children:p.toString()}),(0,n.jsx)(v.Z,{variant:"body2",children:"Total"})]}),(0,n.jsxs)(o.Z,{sx:{textAlign:"center",flex:1},children:[(0,n.jsx)(v.Z,{variant:"h4",color:g>=70?"success.main":"error.main",children:"".concat(g,"%")}),(0,n.jsx)(v.Z,{variant:"body2",children:"Pass Rate"})]})]}),(0,n.jsx)(z.Z,{variant:"contained",color:"inherit",fullWidth:!0,onClick:e=>{let t="/eval/?evalId=".concat(s,"&search=").concat(encodeURIComponent("(var=".concat(d,"|metric=").concat(d,")")));e.ctrlKey||e.metaKey?window.open(t,"_blank"):window.location.href=t},children:"View All Logs"}),r.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.Z,{variant:"h6",className:"failed-tests-header",children:"Failed Tests"}),(0,n.jsx)(m.Z,{children:r.slice(0,5).map((e,t)=>(0,n.jsx)(h.ZP,{className:"failure-item",children:(0,n.jsxs)(o.Z,{children:[(0,n.jsx)(v.Z,{variant:"subtitle1",className:"prompt",children:function(e){try{let t=JSON.parse(e);if(Array.isArray(t)){let e=t[t.length-1];if(e.content)return e.content||"-"}}catch(e){}return e}(e.prompt)}),(0,n.jsx)(v.Z,{variant:"body2",className:"output",children:function(e){if("string"==typeof e)return e;if(Array.isArray(e)){let t=e.filter(e=>"function"===e.type);if(t.length>0)return t.map(e=>{var t,i;return"".concat(null===(t=e.function)||void 0===t?void 0:t.name,": (").concat(null===(i=e.function)||void 0===i?void 0:i.arguments,")")}).join("\n")}return JSON.stringify(e)}(e.output)})]})},t))})]}):(0,n.jsx)(o.Z,{sx:{mt:2,textAlign:"center"},children:(0,n.jsx)(v.Z,{variant:"body1",children:"All tests passed successfully"})})]})})};i(46553);var ee=e=>{var t,i;let{title:a,subtitle:r,progressValue:l,numTestsPassed:d,numTestsFailed:u,testTypes:g,evalId:f,failuresByPlugin:j}=e,{showPercentagesOnRiskCards:y,pluginPassRateThreshold:b}=_(),[Z,k]=s.useState(!1),[P,A]=s.useState(""),I=g.filter(e=>e.numPassed+e.numFailed>0);return 0===I.length?null:(0,n.jsx)(c.Z,{children:(0,n.jsxs)(x.Z,{className:"risk-card-container",children:[(0,n.jsxs)(Q.ZP,{container:!0,spacing:3,children:[(0,n.jsxs)(Q.ZP,{item:!0,xs:12,md:6,style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,n.jsx)(v.Z,{variant:"h5",className:"risk-card-title",children:a}),(0,n.jsx)(v.Z,{variant:"subtitle1",color:"textSecondary",mb:2,children:r}),(0,n.jsx)(o.Z,{sx:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:100,height:100},children:(0,n.jsx)(Y.a,{value:l,max:100,thickness:10,arc:{startAngle:-90,endAngle:90,color:"primary.main"},text:Number.isNaN(l)?"-":"".concat(Math.round(l),"%"),sx:{width:"100%",height:"100%"}})}),(0,n.jsxs)(v.Z,{variant:"h6",className:"risk-card-issues",children:[u," failed probes"]}),(0,n.jsxs)(v.Z,{variant:"subtitle1",color:"textSecondary",className:"risk-card-tests-passed",children:[d,"/",d+u," passed"]})]}),(0,n.jsx)(Q.ZP,{item:!0,xs:6,md:4,children:(0,n.jsx)(m.Z,{dense:!0,children:I.map((e,t)=>{let i=e.numPassed/(e.numPassed+e.numFailed);return(0,n.jsx)(N.Z,{title:R[e.name],placement:"left",arrow:!0,children:(0,n.jsxs)(h.ZP,{className:"risk-card-list-item",onClick:()=>{A(e.name),k(!0)},style:{cursor:"pointer"},children:[(0,n.jsx)(p.Z,{primary:C[e.name]||w[e.name],primaryTypographyProps:{variant:"body2"}}),y?(0,n.jsx)(v.Z,{variant:"body2",className:"risk-card-percentage ".concat(i>=.8?"risk-card-percentage-high":i>=.5?"risk-card-percentage-medium":"risk-card-percentage-low"),children:"".concat(Math.round(100*i),"%")}):i>=b?(0,n.jsx)(K.Z,{className:"risk-card-icon-passed"}):(0,n.jsx)(G.Z,{className:"risk-card-icon-failed"})]})},t)})})})]}),P&&(0,n.jsx)(X,{open:Z,onClose:()=>k(!1),category:P,failures:j[P]||[],evalId:f,numPassed:(null===(t=g.find(e=>e.name===P))||void 0===t?void 0:t.numPassed)||0,numFailed:(null===(i=g.find(e=>e.name===P))||void 0===i?void 0:i.numFailed)||0})]})})};i(32991);var et=e=>{let{categoryStats:t,evalId:i,failuresByPlugin:a}=e,r=Object.keys(j).map(e=>({name:e,passed:j[e].every(e=>{var i,a;return(null===(i=t[e])||void 0===i?void 0:i.pass)===(null===(a=t[e])||void 0===a?void 0:a.total)})}));return(0,n.jsx)(f.Z,{spacing:4,children:r.map((e,r)=>{let s=e.name,l=j[s],o=l.reduce((e,i)=>{var a;return e+((null===(a=t[i])||void 0===a?void 0:a.pass)||0)},0),c=l.reduce((e,i)=>{var a;return e+((null===(a=t[i])||void 0===a?void 0:a.total)||0)},0);return(0,n.jsx)(ee,{title:e.name,subtitle:y[s],progressValue:o/c*100,numTestsPassed:o,numTestsFailed:c-o,testTypes:l.map(e=>{var i,a,r,n,s;return{name:e,categoryPassed:(null===(i=t[e])||void 0===i?void 0:i.pass)===(null===(a=t[e])||void 0===a?void 0:a.total),numPassed:(null===(r=t[e])||void 0===r?void 0:r.pass)||0,numFailed:((null===(n=t[e])||void 0===n?void 0:n.total)||0)-((null===(s=t[e])||void 0===s?void 0:s.pass)||0)}}),evalId:i,failuresByPlugin:a},r)})})},ei=i(54755),ea=i(12120),er=i(35843);i(44097);let en=(0,er.ZP)(ei.Z)(e=>{let{theme:t}=e;return{height:8,borderRadius:8,["&.".concat(ea.Z.colorPrimary)]:{backgroundColor:"light"===t.palette.mode?"#e0e0e0":"#424242"},["& .".concat(ea.Z.bar)]:{borderRadius:8,backgroundColor:"light"===t.palette.mode?"#ff1744":"#ff8a80"}}});var es=e=>{let{strategyStats:t}=e,i=Object.entries(t).sort((e,t)=>(t[1].total-t[1].pass)/t[1].total-(e[1].total-e[1].pass)/e[1].total);return(0,n.jsx)(c.Z,{className:"strategy-stats-card",children:(0,n.jsxs)(x.Z,{className:"strategy-stats-content",children:[(0,n.jsx)(v.Z,{variant:"h5",mb:2,children:"Attack success rates"}),(0,n.jsx)(o.Z,{className:"strategy-grid",children:i.map(e=>{let[t,{pass:i,total:a}]=e,r=(a-i)/a*100;return(0,n.jsxs)(o.Z,{className:"strategy-item",children:[(0,n.jsx)(v.Z,{variant:"body1",className:"strategy-name",children:C[t]||t}),(0,n.jsx)(v.Z,{variant:"body2",color:"text.secondary",className:"strategy-description",children:R[t]||""}),(0,n.jsxs)(o.Z,{display:"flex",alignItems:"center",className:"progress-container",children:[(0,n.jsx)(o.Z,{width:"100%",mr:1,children:(0,n.jsx)(en,{variant:"determinate",value:r})}),(0,n.jsx)(o.Z,{minWidth:45,className:"fail-rate",children:(0,n.jsxs)(v.Z,{variant:"body2",color:"text.secondary",children:[r.toFixed(1),"%"]})})]}),(0,n.jsxs)(v.Z,{variant:"caption",color:"text.secondary",className:"attack-stats",children:[a-i," / ",a," attacks succeeded"]})]},t)})})]})})},el=i(73701),eo=i(39279),ec=i(30666),ed=i(15795),eu=i(66988),em=i(15646),eh=i(98489),ep=i(95781);i(93091);let eg=e=>{let t=[];for(let i of Object.values(j))for(let a of i)t.push({pluginName:a,type:w[a]||a,description:R[a]||"",passRate:e[a]?(e[a].pass/e[a].total*100).toFixed(1)+"%":"N/A",passRateWithFilter:e[a]?(e[a].passWithFilter/e[a].total*100).toFixed(1)+"%":"N/A",severity:b[a]||"Unknown"});return t.sort((e,t)=>"N/A"===e.passRate?1:"N/A"===t.passRate?-1:Number.parseFloat(e.passRate)-Number.parseFloat(t.passRate))};var ef=e=>{let{evalId:t,categoryStats:i}=e,a=eg(i).filter(e=>"N/A"!==e.passRate),[r,l]=s.useState(0),[c,d]=s.useState(10),[u,m]=s.useState("asc"),[h,p]=s.useState("default"),g=e=>{let t=h===e&&"asc"===u;m(t?"desc":"asc"),p(e)};return(0,n.jsxs)(o.Z,{children:[(0,n.jsx)(v.Z,{variant:"h5",gutterBottom:!0,id:"table",children:"Vulnerabilities and Mitigations"}),(0,n.jsxs)(ed.Z,{children:[(0,n.jsxs)(el.Z,{children:[(0,n.jsx)(eu.Z,{children:(0,n.jsxs)(eh.Z,{children:[(0,n.jsx)(ec.Z,{children:"Type"}),(0,n.jsx)(ec.Z,{children:"Description"}),(0,n.jsx)(ec.Z,{children:(0,n.jsx)(ep.Z,{active:"passRate"===h,direction:"passRate"===h?u:"asc",onClick:()=>g("passRate"),children:"Pass rate"})}),(0,n.jsx)(ec.Z,{children:(0,n.jsx)(ep.Z,{active:"severity"===h,direction:"severity"===h?u:"asc",onClick:()=>g("severity"),children:"Severity"})}),(0,n.jsx)(ec.Z,{style:{minWidth:"275px"},children:"Actions"})]})}),(0,n.jsx)(eo.Z,{children:a.sort((e,t)=>{if("passRate"===h)return"N/A"===e.passRate?1:"N/A"===t.passRate?-1:"asc"===u?Number.parseFloat(e.passRate)-Number.parseFloat(t.passRate):Number.parseFloat(t.passRate)-Number.parseFloat(e.passRate);if("severity"===h){if("N/A"===e.passRate)return 1;if("N/A"===t.passRate)return -1;let i={Critical:4,High:3,Medium:2,Low:1};return"asc"===u?i[e.severity]-i[t.severity]:i[t.severity]-i[e.severity]}{let i={Critical:4,High:3,Medium:2,Low:1};return e.severity===t.severity?Number.parseFloat(e.passRate)-Number.parseFloat(t.passRate):i[t.severity]-i[e.severity]}}).slice(r*c,r*c+c).map((e,t)=>{let i="";if("N/A"!==e.passRate){let t=Number.parseFloat(e.passRate);i=t>=75?"pass-high":t>=50?"pass-medium":"pass-low"}return(0,n.jsxs)(eh.Z,{children:[(0,n.jsx)(ec.Z,{children:(0,n.jsx)("span",{style:{fontWeight:500},children:C[e.pluginName]||e.type})}),(0,n.jsx)(ec.Z,{children:e.description}),(0,n.jsxs)(ec.Z,{className:i,children:[(0,n.jsx)("strong",{children:e.passRate}),e.passRateWithFilter===e.passRate?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("br",{}),"(",e.passRateWithFilter," with mitigation)"]})]}),(0,n.jsx)(ec.Z,{className:"vuln-".concat(e.severity.toLowerCase()),children:e.severity}),(0,n.jsxs)(ec.Z,{style:{minWidth:270},children:[(0,n.jsx)(z.Z,{variant:"contained",size:"small",onClick:()=>{let t=new URLSearchParams(window.location.search),i=t.get("evalId");window.location.href="/eval/?evalId=".concat(i,"&search=").concat(encodeURIComponent("(var=".concat(e.type,"|metric=").concat(e.type,")")))},children:"View logs"}),(0,n.jsx)(N.Z,{title:"Temporarily disabled while in beta, click to contact us to enable",children:(0,n.jsx)(z.Z,{variant:"contained",size:"small",color:"inherit",style:{marginLeft:8},onClick:()=>{window.location.href="mailto:inquiries@promptfoo.dev?subject=Promptfoo%20automatic%20vulnerability%20mitigation&body=Hello%20Promptfoo%20Team,%0D%0A%0D%0AI%20am%20interested%20in%20learning%20more%20about%20the%20automatic%20vulnerability%20mitigation%20beta.%20Please%20provide%20me%20with%20more%20details.%0D%0A%0D%0A"},children:"Apply mitigation"})})]})]},t)})})]}),a.length>c&&(0,n.jsx)(em.Z,{rowsPerPageOptions:[10,25,50],component:"div",count:a.length,rowsPerPage:c,page:r,onPageChange:(e,t)=>{l(t)},onRowsPerPageChange:e=>{d(Number.parseInt(e.target.value,10)),l(0)}})]})]})};i(67667);var ev=()=>{let[e,t]=s.useState(null),[i,a]=s.useState(null),[r,x]=s.useState(0),[j,y]=s.useState(!1),b=s.useMemo(()=>{let e={};return null==i||i.results.results.forEach(t=>{var i,a,r;let n=function(e){var t,i,a;let r=e.vars.harmCategory;if(r)return k[r];let n=(null===(i=e.gradingResult)||void 0===i?void 0:null===(t=i.componentResults)||void 0===t?void 0:t.map(e=>{var t;return null===(t=e.assertion)||void 0===t?void 0:t.metric}))||[],s=null===(a=n[0])||void 0===a?void 0:a.split("/")[0];return s?k[s]:null}(t);if(!n){console.warn("Could not get failures for plugin ".concat(n));return}!n||(null===(i=t.gradingResult)||void 0===i?void 0:i.pass)||(e[n]||(e[n]=[]),e[n].push({prompt:(null===(a=t.vars.query)||void 0===a?void 0:a.toString())||t.prompt.raw,output:null===(r=t.response)||void 0===r?void 0:r.output}))}),e},[i]);if(s.useEffect(()=>{let e=async e=>{let t=await fetch("".concat(await (0,l.b)(),"/api/results/").concat(e),{cache:"no-store"}),i=await t.json();a(i.data)},i=new URLSearchParams(window.location.search);if(!i)return;let r=i.get("evalId");r&&(t(r),e(r))},[]),s.useEffect(()=>{document.title="Report: ".concat((null==i?void 0:i.config.description)||e||"Red Team"," | promptfoo")},[i,e]),!i||!e)return(0,n.jsx)(o.Z,{sx:{width:"100%",textAlign:"center"},children:"Loading..."});let Z=i.results.table.head.prompts,w=Z[r],C=i.results.table.body,R=i.results.results.reduce((e,t)=>{var i,a,r,n,s,l,o,c;let d=t.vars.harmCategory,u=(null===(a=t.gradingResult)||void 0===a?void 0:null===(i=a.componentResults)||void 0===i?void 0:i.map(e=>{var t;return null===(t=e.assertion)||void 0===t?void 0:t.metric}))||[],m=[d,...u].filter(e=>e);for(let i of m){if("string"!=typeof i)continue;let a=k[i.split("/")[0]];if(!a){console.log("Unknown harm category:",i);break}let d=null===(n=t.gradingResult)||void 0===n?void 0:null===(r=n.componentResults)||void 0===r?void 0:r.some(e=>{var t;let i=(null===(t=e.assertion)||void 0===t?void 0:t.type)==="moderation",a=e.pass;return i&&a}),u=null===(l=t.gradingResult)||void 0===l?void 0:null===(s=l.componentResults)||void 0===s?void 0:s.some(e=>{var t,i;let a=(null===(t=e.assertion)||void 0===t?void 0:t.type)==="llm-rubric"||(null===(i=e.assertion)||void 0===i?void 0:i.type.startsWith("promptfoo:redteam")),r=e.pass;return a&&r}),m=null===(c=t.gradingResult)||void 0===c?void 0:null===(o=c.componentResults)||void 0===o?void 0:o.some(e=>{var t;let i=(null===(t=e.assertion)||void 0===t?void 0:t.type)==="human",a=e.pass;return i&&a});e[a]=e[a]||{pass:0,total:0,passWithFilter:0},e[a].total++,u||m?(e[a].pass++,e[a].passWithFilter++):!d&&e[a].passWithFilter++}return e},{}),A=i.results.results.reduce((e,t)=>{var i,a,r,n;let s=(null===(a=t.gradingResult)||void 0===a?void 0:null===(i=a.componentResults)||void 0===i?void 0:i.map(e=>{var t;return null===(t=e.assertion)||void 0===t?void 0:t.metric}))||[];for(let i of s){if("string"!=typeof i)continue;let a=function(e){let t=e.split("/")[1];if(t){if("Iterative"===t)return"jailbreak";if("IterativeTree"===t)return"jailbreak:tree";if("Crescendo"===t)return"crescendo";if("Injection"===t)return"prompt-injection"}return null}(i);a||(a="basic"),e[a]||(e[a]={pass:0,total:0}),e[a].total++;let s=null===(n=t.gradingResult)||void 0===n?void 0:null===(r=n.componentResults)||void 0===r?void 0:r.some(e=>{var t;return(null===(t=e.assertion)||void 0===t?void 0:t.metric)===i&&e.pass});s&&e[a].pass++}return e},{}),I=()=>{Z.length>1&&y(!0)},N=e=>{x(e),y(!1)};return(0,n.jsxs)(u.Z,{children:[(0,n.jsxs)(f.Z,{spacing:4,pb:8,pt:2,children:[(0,n.jsxs)(c.Z,{className:"report-header",sx:{position:"relative"},children:[(0,n.jsxs)(o.Z,{sx:{position:"absolute",top:8,right:8,display:"flex"},children:[(0,n.jsx)(M,{evalDescription:i.config.description||e}),(0,n.jsx)(J,{})]}),(0,n.jsxs)(v.Z,{variant:"h4",children:[(0,n.jsx)("strong",{children:"LLM Risk Assessment"}),i.config.description&&": ".concat(i.config.description)]}),(0,n.jsx)(v.Z,{variant:"subtitle1",mb:2,children:new Date(i.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}),(0,n.jsxs)(o.Z,{className:"report-details",children:[(0,n.jsx)(d.Z,{size:"small",label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:"Model:"})," ",w.provider]}),onClick:I,style:{cursor:Z.length>1?"pointer":"default"}}),(0,n.jsx)(d.Z,{size:"small",label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:"Dataset:"})," ",C.length," probes"]})}),(0,n.jsx)(d.Z,{size:"small",label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:"Prompt:"}),' "',w.raw.length>40?"".concat(w.raw.substring(0,40),"..."):w.raw,'"']}),onClick:I,style:{cursor:Z.length>1?"pointer":"default"}})]})]}),(0,n.jsx)(P,{categoryStats:R}),(0,n.jsx)(es,{strategyStats:A}),(0,n.jsx)(et,{categoryStats:R,evalId:e,failuresByPlugin:b}),(0,n.jsx)(ef,{evalId:e,categoryStats:R})]}),(0,n.jsx)(g.Z,{open:j,onClose:()=>y(!1),"aria-labelledby":"prompt-modal-title",sx:{"& .MuiModal-root":{display:"flex",alignItems:"center",justifyContent:"center"},"& .MuiBox-root":{width:"80%",maxWidth:800,maxHeight:"90vh",overflowY:"auto"}},children:(0,n.jsxs)(o.Z,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",boxShadow:24,p:4},children:[(0,n.jsx)(v.Z,{id:"prompt-modal-title",variant:"h6",component:"h2",gutterBottom:!0,children:"View results for..."}),(0,n.jsx)(m.Z,{children:Z.map((e,t)=>(0,n.jsx)(h.ZP,{button:!0,onClick:()=>N(t),selected:t===r,children:(0,n.jsx)(p.Z,{primary:"".concat(e.provider),secondary:e.raw.length>100?"".concat(e.raw.substring(0,100),"..."):e.raw})},t))})]})})]})}},4309:function(){},67667:function(){},46553:function(){},32991:function(){},11674:function(){},44097:function(){},93091:function(){}},function(e){e.O(0,[949,799,148,193,391,654,65,276,874,264,459,178,470,730,744],function(){return e(e.s=58004)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[420],{58004:function(e,t,i){Promise.resolve().then(i.bind(i,24406))},49532:function(e,t,i){"use strict";let a,r;async function n(){if(a||(r||(r=fetch("/api/config").then(e=>e.json()).then(e=>a=e.apiBaseUrl)),await r),void 0===a)throw Error("API base URL is undefined");return a}i.d(t,{b:function(){return n}})},24406:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return ev}});var a,r,n=i(24004),s=i(14978),l=i(49532),o=i(79245),c=i(15133),d=i(47827),u=i(88938),m=i(35266),h=i(80356),p=i(38212),g=i(49658),f=i(13457),v=i(43226),x=i(88469);let j={"Security Risk":["bola","bfla","debug-access","hijacking","pii","prompt-extraction","rbac","shell-injection","sql-injection","ssrf","indirect-prompt-injection"],"Legal Risk":["contracts","harmful:child-exploitation","harmful:copyright-violations","harmful:cybercrime","harmful:hate","harmful:illegal-activities","harmful:illegal-drugs","harmful:intellectual-property","harmful:privacy","harmful:self-harm","harmful:sex-crime","harmful:sexual-content","harmful:specialized-advice","harmful:violent-crime"],"Brand Risk":["policy","competitors","excessive-agency","hallucination","harmful:graphic-content","harmful:harassment-bullying","harmful:indiscriminate-weapons","harmful:insults","harmful:misinformation-disinformation","harmful:non-violent-crime","harmful:profanity","harmful:radicalization","harmful:unsafe-practices","imitation","overreliance","politics"]},y={"Brand Risk":"Risks that can affect the brand reputation and trustworthiness.","Legal Risk":"Risks that can lead to legal consequences or violations.","Technical Risk":"Risks involving malicious activities targeting the system or users."};(a=r||(r={})).Critical="Critical",a.High="High",a.Medium="Medium",a.Low="Low";let b={"debug-access":r.High,"excessive-agency":r.Medium,"harmful:child-exploitation":r.Critical,"harmful:copyright-violations":r.Low,"harmful:cybercrime":r.Low,"harmful:graphic-content":r.Medium,"harmful:harassment-bullying":r.Low,"harmful:hate":r.Critical,"harmful:illegal-activities":r.Medium,"harmful:illegal-drugs":r.Medium,"harmful:indiscriminate-weapons":r.Medium,"harmful:insults":r.Low,"harmful:intellectual-property":r.Medium,"harmful:misinformation-disinformation":r.Medium,"harmful:non-violent-crime":r.Medium,"harmful:privacy":r.High,"harmful:profanity":r.Low,"harmful:radicalization":r.Low,"harmful:self-harm":r.Critical,"harmful:sex-crime":r.High,"harmful:sexual-content":r.Medium,"harmful:specialized-advice":r.Medium,"harmful:unsafe-practices":r.Low,"harmful:violent-crime":r.High,"prompt-injection":r.Medium,"shell-injection":r.High,"sql-injection":r.High,competitors:r.Low,contracts:r.Medium,hallucination:r.Medium,hijacking:r.High,imitation:r.Low,jailbreak:r.Medium,overreliance:r.Low,pii:r.High,politics:r.Low,rbac:r.High,policy:r.High,bola:r.High,bfla:r.High,ssrf:r.High,"indirect-prompt-injection":r.High,"prompt-extraction":r.Medium},Z=Object.entries(j).reduce((e,t)=>{let[i,a]=t;return a.forEach(t=>{e[t]=i}),e},{});Object.keys(Z);let w={bola:"BOLAEnforcement",bfla:"BFLAEnforcement",ssrf:"SSRFEnforcement","debug-access":"DebugAccess","excessive-agency":"ExcessiveAgency","harmful:child-exploitation":"Child Exploitation","harmful:cybercrime":"Cybercrime & Unauthorized Intrusion - Hacking and Malware","harmful:graphic-content":"Graphic & age-restricted content","harmful:harassment-bullying":"Harassment & Bullying","harmful:hate":"Hate","harmful:illegal-activities":"Illegal Activities - Fraud & scams","harmful:illegal-drugs":"Illegal Drugs","harmful:indiscriminate-weapons":"Indiscriminate Weapons","harmful:insults":"Insults and personal attacks","harmful:intellectual-property":"Intellectual Property violation","harmful:misinformation-disinformation":"Misinformation & Disinformation - Harmful lies and propaganda","harmful:non-violent-crime":"Non-Violent Crimes","harmful:privacy":"Privacy violations","harmful:profanity":"Requests containing profanity","harmful:radicalization":"Radicalization","harmful:self-harm":"Self-Harm","harmful:sex-crime":"Sex Crimes","harmful:sexual-content":"Sexual Content","harmful:specialized-advice":"Specialized Advice - Financial","harmful:unsafe-practices":"Promotion of unsafe practices","harmful:violent-crime":"Violent Crimes","harmful:chemical-biological-weapons":"Chemical & Biological Weapons","harmful:copyright-violations":"Copyright Violations - Copyrighted text","prompt-injection":"Harmful/Injection","shell-injection":"ShellInjection","sql-injection":"SqlInjection",competitors:"CompetitorEndorsement",contracts:"ContractualCommitment",hallucination:"Hallucination",hijacking:"Hijacking",imitation:"Imitation",jailbreak:"Harmful/Iterative",overreliance:"Overreliance",pii:"PIILeak",politics:"PoliticalStatement",rbac:"RbacEnforcement",policy:"PolicyViolation","indirect-prompt-injection":"IndirectPromptInjection","prompt-extraction":"PromptExtraction"},k=Object.entries(w).reduce((e,t)=>{let[i,a]=t;return e[a]=i,e},{}),C={bola:"Unauthorized Data Access",bfla:"Privilege Escalation",ssrf:"Malicious Resource Fetching","excessive-agency":"Excessive Agency","prompt-injection":"Prompt Injection",competitors:"Competitor Endorsements",contracts:"Unsupervised Contracts",jailbreak:"Single-shot optimization","jailbreak:tree":"Tree-based optimization",pii:"PII Leaks",politics:"Political Opinions","shell-injection":"Shell Injection","sql-injection":"SQL Injection",rbac:"RBAC Enforcement","debug-access":"Debug Access","harmful:specialized-advice":"Specialized Advice","harmful:illegal-activities":"Illegal Activities","harmful:cybercrime":"Cybercrime","harmful:copyright-violations":"Copyright Violations","harmful:misinformation-disinformation":"Misinformation & disinformation",policy:"Custom Policy",basic:"Basic",crescendo:"Multi-turn","indirect-prompt-injection":"Indirect Prompt Injection","prompt-extraction":"Prompt Extraction"},R={default:"Includes common plugins",basic:"Raw attacks without any special attack strategies",multilingual:"Translates the input into low-resource languages",bola:"Broken Object Level Authorization (BOLA) tests",bfla:"Broken Function Level Authorization (BFLA) tests",ssrf:"Server-Side Request Forgery (SSRF) tests","debug-access":"Attempts to access or use debugging commands","excessive-agency":"Model taking excessive initiative or misunderstanding its capabilities","harmful:chemical-biological-weapons":"Content related to chemical or biological weapons","harmful:child-exploitation":"Content exploiting or harming children","harmful:copyright-violations":"Content violating copyright laws","harmful:cybercrime":"Content related to cybercriminal activities","harmful:graphic-content":"Displaying graphic or violent content","harmful:harassment-bullying":"Content that harasses or bullies individuals","harmful:hate":"Content that promotes hate or discrimination","harmful:illegal-activities":"Content promoting illegal activities","harmful:illegal-drugs":"Content related to illegal drug use or trade","harmful:indiscriminate-weapons":"Content related to weapons without context","harmful:insults":"Content that insults or demeans individuals","harmful:intellectual-property":"Content violating intellectual property rights","harmful:misinformation-disinformation":"Spreading false or misleading information","harmful:non-violent-crime":"Content related to non-violent criminal activities","harmful:privacy":"Content violating privacy rights","harmful:profanity":"Content containing profane or inappropriate language","harmful:radicalization":"Content that promotes radical or extremist views","harmful:self-harm":"Content that encourages self-harm or suicide","harmful:sex-crime":"Content related to sexual crimes","harmful:sexual-content":"Explicit or inappropriate sexual content","harmful:specialized-advice":"Providing advice in specialized fields without expertise","harmful:unsafe-practices":"Content promoting unsafe or harmful practices","harmful:violent-crime":"Content related to violent criminal activities","jailbreak:tree":"Tree-based jailbreak search","pii:api-db":"PII exposed through API or database","pii:direct":"Direct exposure of PII","pii:session":"PII exposed in session data","pii:social":"PII exposed through social engineering","prompt-injection":"Malicious inputs designed to manipulate the model's behavior","shell-injection":"Attempts to execute shell commands through the model","sql-injection":"Attempts to perform SQL injection attacks to manipulate database queries",base64:"Attempts to obfuscate malicious content using Base64 encoding",competitors:"Competitor mentions and endorsements",contracts:"Enters business or legal commitments without supervision",hallucination:"Model generating false or misleading information",harmful:"All harmful categories",hijacking:"Unauthorized or off-topic resource use",imitation:"Imitates people, brands, or organizations",jailbreak:"Attempts to bypass security measures through iterative prompt refinement",leetspeak:"Attempts to obfuscate malicious content using leetspeak",overreliance:"Model susceptible to relying on an incorrect user assumption or input",pii:"All PII categories",policy:"Violates a custom configured policy",politics:"Makes political statements",rbac:"Tests whether the model properly implements Role-Based Access Control (RBAC)",rot13:"Attempts to obfuscate malicious content using ROT13 encoding",crescendo:"Conversational attack strategy","prompt-extraction":"Attempts to get the model to reveal its system prompt","indirect-prompt-injection":"Evaluates how susceptible the prompt is to harmful instructions injected into the prompt"};i(4309);var P=e=>{let{categoryStats:t}=e,i=[r.Critical,r.High,r.Medium,r.Low],a=i.reduce((e,i)=>(e[i]=Object.keys(t).reduce((e,t)=>b[t]===i?e+1:e,0),e),{});return(0,n.jsx)(f.Z,{spacing:2,direction:{xs:"column",sm:"row"},children:i.map(e=>(0,n.jsx)(o.Z,{flex:1,children:(0,n.jsx)(c.Z,{className:"severity-card card-".concat(e.toLowerCase()),children:(0,n.jsxs)(x.Z,{onClick:()=>window.location.hash="#table",children:[(0,n.jsx)(v.Z,{variant:"h6",gutterBottom:!0,children:e}),(0,n.jsx)(v.Z,{variant:"h4",color:"text.primary",children:a[e]}),(0,n.jsx)(v.Z,{variant:"body2",color:"text.secondary",children:"issues"})]})})},e))})},A=i(52481),I=i(52653),N=i(78276),S=i(35193),F=i.n(S),L=i(21629),M=e=>{let{evalDescription:t}=e,i=async()=>{let e=document.documentElement,i=await F()(e,{height:Math.max(e.scrollHeight,e.offsetHeight),windowHeight:document.documentElement.scrollHeight}),a=i.toDataURL("image/png"),r=new L.ZP("p","pt",[i.width,i.height]);r.addImage(a,"PNG",0,0,i.width,i.height);let n=t?"report_".concat(t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),".pdf"):"report.pdf";r.save(n)};return(0,n.jsx)(N.Z,{title:"Download report as PDF",placement:"top",children:(0,n.jsx)(I.Z,{onClick:i,sx:{mt:"4px"},"aria-label":"download report",children:(0,n.jsx)(A.Z,{})})})},H=i(93295),z=i(49050),E=i(89394),B=i(42834),D=i(26337),O=i(91797),T=i(4451),W=i(37204),U=i(94660),V=i(74810);let q={getItem:async e=>await (0,W.U2)(e)||null,setItem:async(e,t)=>{await (0,W.t8)(e,t)},removeItem:async e=>{await (0,W.IV)(e)}},_=(0,U.Ue)()((0,V.tJ)(e=>({showPercentagesOnRiskCards:!1,setShowPercentagesOnRiskCards:t=>e(()=>({showPercentagesOnRiskCards:t})),pluginPassRateThreshold:1,setPluginPassRateThreshold:t=>e(()=>({pluginPassRateThreshold:t}))}),{name:"ReportViewStorage",storage:(0,V.FL)(()=>q)}));var J=()=>{let{showPercentagesOnRiskCards:e,setShowPercentagesOnRiskCards:t,pluginPassRateThreshold:i,setPluginPassRateThreshold:a}=_(),[r,l]=s.useState(!1),o=()=>{l(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(N.Z,{title:"Report Settings",placement:"top",children:(0,n.jsx)(I.Z,{onClick:()=>{l(!0)},"aria-label":"settings",children:(0,n.jsx)(H.Z,{})})}),(0,n.jsxs)(E.Z,{open:r,onClose:o,fullWidth:!0,maxWidth:"sm",children:[(0,n.jsx)(O.Z,{children:"Report Settings"}),(0,n.jsxs)(D.Z,{children:[(0,n.jsx)(v.Z,{component:"div",sx:{padding:"16px 0"},children:(0,n.jsxs)("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[(0,n.jsx)("input",{type:"checkbox",checked:e,onChange:e=>t(e.target.checked),style:{marginRight:"10px"}}),"Show percentages on risk cards"]})}),(0,n.jsxs)(v.Z,{component:"div",sx:{padding:"16px 0"},children:[(0,n.jsxs)("label",{children:["Plugin Pass Rate Threshold: ",(100*i).toFixed(0),"%"]}),(0,n.jsx)(v.Z,{variant:"body2",color:"textSecondary",sx:{mt:1},children:"Sets the threshold for considering a plugin as passed on the risk cards."}),(0,n.jsx)(T.ZP,{value:i,onChange:(e,t)=>a(t),"aria-labelledby":"plugin-pass-rate-threshold-slider",step:.05,marks:!0,min:0,max:1,valueLabelDisplay:"auto",valueLabelFormat:e=>"".concat((100*e).toFixed(0),"%")})]})]}),(0,n.jsx)(B.Z,{children:(0,n.jsx)(z.Z,{onClick:o,variant:"contained",color:"primary",children:"Close"})})]})]})},G=i(70740),K=i(14565),Q=i(28874),Y=i(48670),$=i(64111);i(11674);var X=e=>{let{open:t,onClose:i,category:a,failures:r,evalId:s,numPassed:l,numFailed:c}=e,d=w[a];if(!d)return console.error("[RiskCategoryDrawer] Could not load category",a),null;let u=C[a]||d,p=l+c,g=p>0?Math.round(l/p*100):0;return 0===p?(0,n.jsx)($.ZP,{anchor:"right",open:t,onClose:i,children:(0,n.jsxs)(o.Z,{sx:{width:500,p:2},className:"risk-category-drawer",children:[(0,n.jsx)(v.Z,{variant:"h6",gutterBottom:!0,children:u}),(0,n.jsx)(v.Z,{variant:"body1",sx:{mt:2,textAlign:"center"},children:"No tests have been run for this category."})]})}):(0,n.jsx)($.ZP,{anchor:"right",open:t,onClose:i,children:(0,n.jsxs)(o.Z,{sx:{width:500,p:2},className:"risk-category-drawer",children:[(0,n.jsx)(v.Z,{variant:"h6",gutterBottom:!0,children:u}),(0,n.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,n.jsxs)(o.Z,{sx:{textAlign:"center",flex:1},children:[(0,n.jsx)(v.Z,{variant:"h4",color:"primary",children:l.toString()}),(0,n.jsx)(v.Z,{variant:"body2",children:"Passed"})]}),(0,n.jsxs)(o.Z,{sx:{textAlign:"center",flex:1},children:[(0,n.jsx)(v.Z,{variant:"h4",children:p.toString()}),(0,n.jsx)(v.Z,{variant:"body2",children:"Total"})]}),(0,n.jsxs)(o.Z,{sx:{textAlign:"center",flex:1},children:[(0,n.jsx)(v.Z,{variant:"h4",color:g>=70?"success.main":"error.main",children:"".concat(g,"%")}),(0,n.jsx)(v.Z,{variant:"body2",children:"Pass Rate"})]})]}),(0,n.jsx)(z.Z,{variant:"contained",color:"inherit",fullWidth:!0,onClick:e=>{let t="/eval/?evalId=".concat(s,"&search=").concat(encodeURIComponent("(var=".concat(d,"|metric=").concat(d,")")));e.ctrlKey||e.metaKey?window.open(t,"_blank"):window.location.href=t},children:"View All Logs"}),r.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.Z,{variant:"h6",className:"failed-tests-header",children:"Failed Tests"}),(0,n.jsx)(m.Z,{children:r.slice(0,5).map((e,t)=>(0,n.jsx)(h.ZP,{className:"failure-item",children:(0,n.jsxs)(o.Z,{children:[(0,n.jsx)(v.Z,{variant:"subtitle1",className:"prompt",children:function(e){try{let t=JSON.parse(e);if(Array.isArray(t)){let e=t[t.length-1];if(e.content)return e.content||"-"}}catch(e){}return e}(e.prompt)}),(0,n.jsx)(v.Z,{variant:"body2",className:"output",children:function(e){if("string"==typeof e)return e;if(Array.isArray(e)){let t=e.filter(e=>"function"===e.type);if(t.length>0)return t.map(e=>{var t,i;return"".concat(null===(t=e.function)||void 0===t?void 0:t.name,": (").concat(null===(i=e.function)||void 0===i?void 0:i.arguments,")")}).join("\n")}return JSON.stringify(e)}(e.output)})]})},t))})]}):(0,n.jsx)(o.Z,{sx:{mt:2,textAlign:"center"},children:(0,n.jsx)(v.Z,{variant:"body1",children:"All tests passed successfully"})})]})})};i(46553);var ee=e=>{var t,i;let{title:a,subtitle:r,progressValue:l,numTestsPassed:d,numTestsFailed:u,testTypes:g,evalId:f,failuresByPlugin:j}=e,{showPercentagesOnRiskCards:y,pluginPassRateThreshold:b}=_(),[Z,k]=s.useState(!1),[P,A]=s.useState(""),I=g.filter(e=>e.numPassed+e.numFailed>0);return 0===I.length?null:(0,n.jsx)(c.Z,{children:(0,n.jsxs)(x.Z,{className:"risk-card-container",children:[(0,n.jsxs)(Q.ZP,{container:!0,spacing:3,children:[(0,n.jsxs)(Q.ZP,{item:!0,xs:12,md:6,style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,n.jsx)(v.Z,{variant:"h5",className:"risk-card-title",children:a}),(0,n.jsx)(v.Z,{variant:"subtitle1",color:"textSecondary",mb:2,children:r}),(0,n.jsx)(o.Z,{sx:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:100,height:100},children:(0,n.jsx)(Y.a,{value:l,max:100,thickness:10,arc:{startAngle:-90,endAngle:90,color:"primary.main"},text:Number.isNaN(l)?"-":"".concat(Math.round(l),"%"),sx:{width:"100%",height:"100%"}})}),(0,n.jsxs)(v.Z,{variant:"h6",className:"risk-card-issues",children:[u," failed probes"]}),(0,n.jsxs)(v.Z,{variant:"subtitle1",color:"textSecondary",className:"risk-card-tests-passed",children:[d,"/",d+u," passed"]})]}),(0,n.jsx)(Q.ZP,{item:!0,xs:6,md:4,children:(0,n.jsx)(m.Z,{dense:!0,children:I.map((e,t)=>{let i=e.numPassed/(e.numPassed+e.numFailed);return(0,n.jsx)(N.Z,{title:R[e.name],placement:"left",arrow:!0,children:(0,n.jsxs)(h.ZP,{className:"risk-card-list-item",onClick:()=>{A(e.name),k(!0)},style:{cursor:"pointer"},children:[(0,n.jsx)(p.Z,{primary:C[e.name]||w[e.name],primaryTypographyProps:{variant:"body2"}}),y?(0,n.jsx)(v.Z,{variant:"body2",className:"risk-card-percentage ".concat(i>=.8?"risk-card-percentage-high":i>=.5?"risk-card-percentage-medium":"risk-card-percentage-low"),children:"".concat(Math.round(100*i),"%")}):i>=b?(0,n.jsx)(K.Z,{className:"risk-card-icon-passed"}):(0,n.jsx)(G.Z,{className:"risk-card-icon-failed"})]})},t)})})})]}),P&&(0,n.jsx)(X,{open:Z,onClose:()=>k(!1),category:P,failures:j[P]||[],evalId:f,numPassed:(null===(t=g.find(e=>e.name===P))||void 0===t?void 0:t.numPassed)||0,numFailed:(null===(i=g.find(e=>e.name===P))||void 0===i?void 0:i.numFailed)||0})]})})};i(32991);var et=e=>{let{categoryStats:t,evalId:i,failuresByPlugin:a}=e,r=Object.keys(j).map(e=>({name:e,passed:j[e].every(e=>{var i,a;return(null===(i=t[e])||void 0===i?void 0:i.pass)===(null===(a=t[e])||void 0===a?void 0:a.total)})}));return(0,n.jsx)(f.Z,{spacing:4,children:r.map((e,r)=>{let s=e.name,l=j[s],o=l.reduce((e,i)=>{var a;return e+((null===(a=t[i])||void 0===a?void 0:a.pass)||0)},0),c=l.reduce((e,i)=>{var a;return e+((null===(a=t[i])||void 0===a?void 0:a.total)||0)},0);return(0,n.jsx)(ee,{title:e.name,subtitle:y[s],progressValue:o/c*100,numTestsPassed:o,numTestsFailed:c-o,testTypes:l.map(e=>{var i,a,r,n,s;return{name:e,categoryPassed:(null===(i=t[e])||void 0===i?void 0:i.pass)===(null===(a=t[e])||void 0===a?void 0:a.total),numPassed:(null===(r=t[e])||void 0===r?void 0:r.pass)||0,numFailed:((null===(n=t[e])||void 0===n?void 0:n.total)||0)-((null===(s=t[e])||void 0===s?void 0:s.pass)||0)}}),evalId:i,failuresByPlugin:a},r)})})},ei=i(54755),ea=i(12120),er=i(35843);i(44097);let en=(0,er.ZP)(ei.Z)(e=>{let{theme:t}=e;return{height:8,borderRadius:8,["&.".concat(ea.Z.colorPrimary)]:{backgroundColor:"light"===t.palette.mode?"#e0e0e0":"#424242"},["& .".concat(ea.Z.bar)]:{borderRadius:8,backgroundColor:"light"===t.palette.mode?"#ff1744":"#ff8a80"}}});var es=e=>{let{strategyStats:t}=e,i=Object.entries(t).sort((e,t)=>(t[1].total-t[1].pass)/t[1].total-(e[1].total-e[1].pass)/e[1].total);return(0,n.jsx)(c.Z,{className:"strategy-stats-card",children:(0,n.jsxs)(x.Z,{className:"strategy-stats-content",children:[(0,n.jsx)(v.Z,{variant:"h5",mb:2,children:"Attack success rates"}),(0,n.jsx)(o.Z,{className:"strategy-grid",children:i.map(e=>{let[t,{pass:i,total:a}]=e,r=(a-i)/a*100;return(0,n.jsxs)(o.Z,{className:"strategy-item",children:[(0,n.jsx)(v.Z,{variant:"body1",className:"strategy-name",children:C[t]||t}),(0,n.jsx)(v.Z,{variant:"body2",color:"text.secondary",className:"strategy-description",children:R[t]||""}),(0,n.jsxs)(o.Z,{display:"flex",alignItems:"center",className:"progress-container",children:[(0,n.jsx)(o.Z,{width:"100%",mr:1,children:(0,n.jsx)(en,{variant:"determinate",value:r})}),(0,n.jsx)(o.Z,{minWidth:45,className:"fail-rate",children:(0,n.jsxs)(v.Z,{variant:"body2",color:"text.secondary",children:[r.toFixed(1),"%"]})})]}),(0,n.jsxs)(v.Z,{variant:"caption",color:"text.secondary",className:"attack-stats",children:[a-i," / ",a," attacks succeeded"]})]},t)})})]})})},el=i(73701),eo=i(39279),ec=i(30666),ed=i(15795),eu=i(66988),em=i(15646),eh=i(98489),ep=i(95781);i(93091);let eg=e=>{let t=[];for(let i of Object.values(j))for(let a of i)t.push({pluginName:a,type:w[a]||a,description:R[a]||"",passRate:e[a]?(e[a].pass/e[a].total*100).toFixed(1)+"%":"N/A",passRateWithFilter:e[a]?(e[a].passWithFilter/e[a].total*100).toFixed(1)+"%":"N/A",severity:b[a]||"Unknown"});return t.sort((e,t)=>"N/A"===e.passRate?1:"N/A"===t.passRate?-1:Number.parseFloat(e.passRate)-Number.parseFloat(t.passRate))};var ef=e=>{let{evalId:t,categoryStats:i}=e,a=eg(i).filter(e=>"N/A"!==e.passRate),[r,l]=s.useState(0),[c,d]=s.useState(10),[u,m]=s.useState("asc"),[h,p]=s.useState("default"),g=e=>{let t=h===e&&"asc"===u;m(t?"desc":"asc"),p(e)};return(0,n.jsxs)(o.Z,{children:[(0,n.jsx)(v.Z,{variant:"h5",gutterBottom:!0,id:"table",children:"Vulnerabilities and Mitigations"}),(0,n.jsxs)(ed.Z,{children:[(0,n.jsxs)(el.Z,{children:[(0,n.jsx)(eu.Z,{children:(0,n.jsxs)(eh.Z,{children:[(0,n.jsx)(ec.Z,{children:"Type"}),(0,n.jsx)(ec.Z,{children:"Description"}),(0,n.jsx)(ec.Z,{children:(0,n.jsx)(ep.Z,{active:"passRate"===h,direction:"passRate"===h?u:"asc",onClick:()=>g("passRate"),children:"Pass rate"})}),(0,n.jsx)(ec.Z,{children:(0,n.jsx)(ep.Z,{active:"severity"===h,direction:"severity"===h?u:"asc",onClick:()=>g("severity"),children:"Severity"})}),(0,n.jsx)(ec.Z,{style:{minWidth:"275px"},children:"Actions"})]})}),(0,n.jsx)(eo.Z,{children:a.sort((e,t)=>{if("passRate"===h)return"N/A"===e.passRate?1:"N/A"===t.passRate?-1:"asc"===u?Number.parseFloat(e.passRate)-Number.parseFloat(t.passRate):Number.parseFloat(t.passRate)-Number.parseFloat(e.passRate);if("severity"===h){if("N/A"===e.passRate)return 1;if("N/A"===t.passRate)return -1;let i={Critical:4,High:3,Medium:2,Low:1};return"asc"===u?i[e.severity]-i[t.severity]:i[t.severity]-i[e.severity]}{let i={Critical:4,High:3,Medium:2,Low:1};return e.severity===t.severity?Number.parseFloat(e.passRate)-Number.parseFloat(t.passRate):i[t.severity]-i[e.severity]}}).slice(r*c,r*c+c).map((e,t)=>{let i="";if("N/A"!==e.passRate){let t=Number.parseFloat(e.passRate);i=t>=75?"pass-high":t>=50?"pass-medium":"pass-low"}return(0,n.jsxs)(eh.Z,{children:[(0,n.jsx)(ec.Z,{children:(0,n.jsx)("span",{style:{fontWeight:500},children:C[e.pluginName]||e.type})}),(0,n.jsx)(ec.Z,{children:e.description}),(0,n.jsxs)(ec.Z,{className:i,children:[(0,n.jsx)("strong",{children:e.passRate}),e.passRateWithFilter===e.passRate?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("br",{}),"(",e.passRateWithFilter," with mitigation)"]})]}),(0,n.jsx)(ec.Z,{className:"vuln-".concat(e.severity.toLowerCase()),children:e.severity}),(0,n.jsxs)(ec.Z,{style:{minWidth:270},children:[(0,n.jsx)(z.Z,{variant:"contained",size:"small",onClick:()=>{let t=new URLSearchParams(window.location.search),i=t.get("evalId");window.location.href="/eval/?evalId=".concat(i,"&search=").concat(encodeURIComponent("(var=".concat(e.type,"|metric=").concat(e.type,")")))},children:"View logs"}),(0,n.jsx)(N.Z,{title:"Temporarily disabled while in beta, click to contact us to enable",children:(0,n.jsx)(z.Z,{variant:"contained",size:"small",color:"inherit",style:{marginLeft:8},onClick:()=>{window.location.href="mailto:inquiries@promptfoo.dev?subject=Promptfoo%20automatic%20vulnerability%20mitigation&body=Hello%20Promptfoo%20Team,%0D%0A%0D%0AI%20am%20interested%20in%20learning%20more%20about%20the%20automatic%20vulnerability%20mitigation%20beta.%20Please%20provide%20me%20with%20more%20details.%0D%0A%0D%0A"},children:"Apply mitigation"})})]})]},t)})})]}),a.length>c&&(0,n.jsx)(em.Z,{rowsPerPageOptions:[10,25,50],component:"div",count:a.length,rowsPerPage:c,page:r,onPageChange:(e,t)=>{l(t)},onRowsPerPageChange:e=>{d(Number.parseInt(e.target.value,10)),l(0)}})]})]})};i(67667);var ev=()=>{let[e,t]=s.useState(null),[i,a]=s.useState(null),[r,x]=s.useState(0),[j,y]=s.useState(!1),b=s.useMemo(()=>{let e={};return null==i||i.results.results.forEach(t=>{var i,a,r;let n=function(e){var t,i,a;let r=e.vars.harmCategory;if(r)return k[r];let n=(null===(i=e.gradingResult)||void 0===i?void 0:null===(t=i.componentResults)||void 0===t?void 0:t.map(e=>{var t;return null===(t=e.assertion)||void 0===t?void 0:t.metric}))||[],s=null===(a=n[0])||void 0===a?void 0:a.split("/")[0];return s?k[s]:null}(t);if(!n){console.warn("Could not get failures for plugin ".concat(n));return}!n||(null===(i=t.gradingResult)||void 0===i?void 0:i.pass)||(e[n]||(e[n]=[]),e[n].push({prompt:(null===(a=t.vars.query)||void 0===a?void 0:a.toString())||t.prompt.raw,output:null===(r=t.response)||void 0===r?void 0:r.output}))}),e},[i]);if(s.useEffect(()=>{let e=async e=>{let t=await fetch("".concat(await (0,l.b)(),"/api/results/").concat(e),{cache:"no-store"}),i=await t.json();a(i.data)},i=new URLSearchParams(window.location.search);if(!i)return;let r=i.get("evalId");r&&(t(r),e(r))},[]),s.useEffect(()=>{document.title="Report: ".concat((null==i?void 0:i.config.description)||e||"Red Team"," | promptfoo")},[i,e]),!i||!e)return(0,n.jsx)(o.Z,{sx:{width:"100%",textAlign:"center"},children:"Loading..."});let Z=i.results.table.head.prompts,w=Z[r],C=i.results.table.body,R=i.results.results.reduce((e,t)=>{var i,a,r,n,s,l,o,c;let d=t.vars.harmCategory,u=(null===(a=t.gradingResult)||void 0===a?void 0:null===(i=a.componentResults)||void 0===i?void 0:i.map(e=>{var t;return null===(t=e.assertion)||void 0===t?void 0:t.metric}))||[],m=[d,...u].filter(e=>e);for(let i of m){if("string"!=typeof i)continue;let a=k[i.split("/")[0]];if(!a){console.log("Unknown harm category:",i);break}let d=null===(n=t.gradingResult)||void 0===n?void 0:null===(r=n.componentResults)||void 0===r?void 0:r.some(e=>{var t;let i=(null===(t=e.assertion)||void 0===t?void 0:t.type)==="moderation",a=e.pass;return i&&a}),u=null===(l=t.gradingResult)||void 0===l?void 0:null===(s=l.componentResults)||void 0===s?void 0:s.some(e=>{var t,i;let a=(null===(t=e.assertion)||void 0===t?void 0:t.type)==="llm-rubric"||(null===(i=e.assertion)||void 0===i?void 0:i.type.startsWith("promptfoo:redteam")),r=e.pass;return a&&r}),m=null===(c=t.gradingResult)||void 0===c?void 0:null===(o=c.componentResults)||void 0===o?void 0:o.some(e=>{var t;let i=(null===(t=e.assertion)||void 0===t?void 0:t.type)==="human",a=e.pass;return i&&a});e[a]=e[a]||{pass:0,total:0,passWithFilter:0},e[a].total++,u||m?(e[a].pass++,e[a].passWithFilter++):!d&&e[a].passWithFilter++}return e},{}),A=i.results.results.reduce((e,t)=>{var i,a,r,n;let s=(null===(a=t.gradingResult)||void 0===a?void 0:null===(i=a.componentResults)||void 0===i?void 0:i.map(e=>{var t;return null===(t=e.assertion)||void 0===t?void 0:t.metric}))||[];for(let i of s){if("string"!=typeof i)continue;let a=function(e){let t=e.split("/")[1];if(t){if("Iterative"===t)return"jailbreak";if("IterativeTree"===t)return"jailbreak:tree";if("Crescendo"===t)return"crescendo";if("Injection"===t)return"prompt-injection";else if("Rot13"===t)return"rot13";else if("Base64"===t)return"base64";else if("Leetspeak"===t)return"leetspeak";else if(t.startsWith("Multilingual"))return"multilingual"}return null}(i);a||(a="basic"),e[a]||(e[a]={pass:0,total:0}),e[a].total++;let s=null===(n=t.gradingResult)||void 0===n?void 0:null===(r=n.componentResults)||void 0===r?void 0:r.some(e=>{var t;return(null===(t=e.assertion)||void 0===t?void 0:t.metric)===i&&e.pass});s&&e[a].pass++}return e},{}),I=()=>{Z.length>1&&y(!0)},N=e=>{x(e),y(!1)};return(0,n.jsxs)(u.Z,{children:[(0,n.jsxs)(f.Z,{spacing:4,pb:8,pt:2,children:[(0,n.jsxs)(c.Z,{className:"report-header",sx:{position:"relative"},children:[(0,n.jsxs)(o.Z,{sx:{position:"absolute",top:8,right:8,display:"flex"},children:[(0,n.jsx)(M,{evalDescription:i.config.description||e}),(0,n.jsx)(J,{})]}),(0,n.jsxs)(v.Z,{variant:"h4",children:[(0,n.jsx)("strong",{children:"LLM Risk Assessment"}),i.config.description&&": ".concat(i.config.description)]}),(0,n.jsx)(v.Z,{variant:"subtitle1",mb:2,children:new Date(i.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}),(0,n.jsxs)(o.Z,{className:"report-details",children:[(0,n.jsx)(d.Z,{size:"small",label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:"Model:"})," ",w.provider]}),onClick:I,style:{cursor:Z.length>1?"pointer":"default"}}),(0,n.jsx)(d.Z,{size:"small",label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:"Dataset:"})," ",C.length," probes"]})}),(0,n.jsx)(d.Z,{size:"small",label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:"Prompt:"}),' "',w.raw.length>40?"".concat(w.raw.substring(0,40),"..."):w.raw,'"']}),onClick:I,style:{cursor:Z.length>1?"pointer":"default"}})]})]}),(0,n.jsx)(P,{categoryStats:R}),(0,n.jsx)(es,{strategyStats:A}),(0,n.jsx)(et,{categoryStats:R,evalId:e,failuresByPlugin:b}),(0,n.jsx)(ef,{evalId:e,categoryStats:R})]}),(0,n.jsx)(g.Z,{open:j,onClose:()=>y(!1),"aria-labelledby":"prompt-modal-title",sx:{"& .MuiModal-root":{display:"flex",alignItems:"center",justifyContent:"center"},"& .MuiBox-root":{width:"80%",maxWidth:800,maxHeight:"90vh",overflowY:"auto"}},children:(0,n.jsxs)(o.Z,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",boxShadow:24,p:4},children:[(0,n.jsx)(v.Z,{id:"prompt-modal-title",variant:"h6",component:"h2",gutterBottom:!0,children:"View results for..."}),(0,n.jsx)(m.Z,{children:Z.map((e,t)=>(0,n.jsx)(h.ZP,{button:!0,onClick:()=>N(t),selected:t===r,children:(0,n.jsx)(p.Z,{primary:"".concat(e.provider),secondary:e.raw.length>100?"".concat(e.raw.substring(0,100),"..."):e.raw})},t))})]})})]})}},4309:function(){},67667:function(){},46553:function(){},32991:function(){},11674:function(){},44097:function(){},93091:function(){}},function(e){e.O(0,[949,799,148,193,391,654,65,276,874,264,459,178,470,730,744],function(){return e(e.s=58004)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{3680:function(e,n,t){Promise.resolve().then(t.t.bind(t,6020,23)),Promise.resolve().then(t.t.bind(t,83507,23)),Promise.resolve().then(t.t.bind(t,27883,23)),Promise.resolve().then(t.t.bind(t,27382,23)),Promise.resolve().then(t.t.bind(t,46785,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[470,730],function(){return n(11409),n(3680)}),_N_E=e.O()}]);
|