@intutic/shared-types 2.3.0 → 2.5.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 +1 -1
- package/dist/anomaly.d.ts +0 -19
- package/dist/anomaly.d.ts.map +1 -1
- package/dist/attenuation.d.ts +4 -3
- package/dist/attenuation.d.ts.map +1 -1
- package/dist/attenuation.js +4 -3
- package/dist/attenuation.js.map +1 -1
- package/dist/auth.d.ts +106 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +17 -1
- package/dist/auth.js.map +1 -1
- package/dist/chaos.d.ts +2225 -0
- package/dist/chaos.d.ts.map +1 -0
- package/dist/chaos.js +358 -0
- package/dist/chaos.js.map +1 -0
- package/dist/chaosGate.d.ts +166 -0
- package/dist/chaosGate.d.ts.map +1 -0
- package/dist/chaosGate.js +383 -0
- package/dist/chaosGate.js.map +1 -0
- package/dist/cloudProbe.d.ts +54 -0
- package/dist/cloudProbe.d.ts.map +1 -0
- package/dist/cloudProbe.js +254 -0
- package/dist/cloudProbe.js.map +1 -0
- package/dist/enums.d.ts +48 -0
- package/dist/enums.d.ts.map +1 -1
- package/dist/enums.js +31 -3
- package/dist/enums.js.map +1 -1
- package/dist/finops.d.ts +38 -18
- package/dist/finops.d.ts.map +1 -1
- package/dist/guardrailIr.d.ts +4 -4
- package/dist/index.d.ts +18 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +68 -9
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +3 -100
- package/dist/intelligence.d.ts.map +1 -1
- package/dist/intelligence.js +3 -3
- package/dist/intelligence.js.map +1 -1
- package/dist/mcpBudgets.d.ts +32 -32
- package/dist/notifications.d.ts +17 -2
- package/dist/notifications.d.ts.map +1 -1
- package/dist/notifications.js +35 -5
- package/dist/notifications.js.map +1 -1
- package/dist/observability.d.ts +0 -31
- package/dist/observability.d.ts.map +1 -1
- package/dist/observability.js +0 -7
- package/dist/observability.js.map +1 -1
- package/dist/opaqueRefusal.d.ts +40 -0
- package/dist/opaqueRefusal.d.ts.map +1 -0
- package/dist/opaqueRefusal.js +53 -0
- package/dist/opaqueRefusal.js.map +1 -0
- package/dist/policyGuardrails.d.ts +5 -5
- package/dist/providerVerification.d.ts +35 -9
- package/dist/providerVerification.d.ts.map +1 -1
- package/dist/providerVerification.js +79 -19
- package/dist/providerVerification.js.map +1 -1
- package/dist/providers.d.ts +50 -13
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +131 -27
- package/dist/providers.js.map +1 -1
- package/dist/spendBudgets.d.ts +122 -0
- package/dist/spendBudgets.d.ts.map +1 -0
- package/dist/spendBudgets.js +92 -0
- package/dist/spendBudgets.js.map +1 -0
- package/dist/taskManagement.d.ts +34 -82
- package/dist/taskManagement.d.ts.map +1 -1
- package/dist/taskManagement.js +4 -4
- package/dist/toolPoison.d.ts +15 -2
- package/dist/toolPoison.d.ts.map +1 -1
- package/dist/toolPoison.js +14 -4
- package/dist/toolPoison.js.map +1 -1
- package/dist/upstreamRetry.d.ts +121 -0
- package/dist/upstreamRetry.d.ts.map +1 -0
- package/dist/upstreamRetry.js +90 -0
- package/dist/upstreamRetry.js.map +1 -0
- package/dist/wasmRuleDescriptor.d.ts +43 -0
- package/dist/wasmRuleDescriptor.d.ts.map +1 -0
- package/dist/wasmRuleDescriptor.js +65 -0
- package/dist/wasmRuleDescriptor.js.map +1 -0
- package/dist/workspaceSettings.d.ts +42 -4
- package/dist/workspaceSettings.d.ts.map +1 -1
- package/dist/workspaceSettings.js.map +1 -1
- package/package.json +2 -2
package/dist/chaos.d.ts
ADDED
|
@@ -0,0 +1,2225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* chaos.ts — the contract for agent fault injection (`intutic chaos run`).
|
|
3
|
+
*
|
|
4
|
+
* A chaos run executes an agent with a known fault injected and checks what
|
|
5
|
+
* the agent did next. Four components share this contract:
|
|
6
|
+
*
|
|
7
|
+
* - the CLI runner, which reads an experiment file, launches each repetition
|
|
8
|
+
* in a sandbox and scores the result;
|
|
9
|
+
* - the LLM proxy, which injects the `llm.*` and `egress.*` faults;
|
|
10
|
+
* - the MCP proxy, which injects the MCP side of `tool.error` plus
|
|
11
|
+
* `tool.stale_data`, `mcp.toolset_change` and `inject.tool_result`;
|
|
12
|
+
* - the gates — the hook gates and the in-process gate SDKs — which inject
|
|
13
|
+
* `permission.deny_or_delay` and the built-in-tool side of `tool.error`.
|
|
14
|
+
*
|
|
15
|
+
* The runner hands each component a plan through {@link CHAOS_PLAN_ENV} and an
|
|
16
|
+
* events file through {@link CHAOS_EVENTS_ENV}. Both are plain environment
|
|
17
|
+
* variables, so they cross the sandbox boundary the same way the proxy URL
|
|
18
|
+
* does. Each component appends one JSON line per event to the events file;
|
|
19
|
+
* the probes read nothing else.
|
|
20
|
+
*
|
|
21
|
+
* Two rules every injector keeps:
|
|
22
|
+
*
|
|
23
|
+
* 1. **A fault never loosens governance.** Faults are applied only to a call
|
|
24
|
+
* that governance has already allowed. A fault can turn an allow into a
|
|
25
|
+
* failure, a delay or a changed result; it can never turn a block, a hold
|
|
26
|
+
* or a redaction into an allow.
|
|
27
|
+
* 2. **Silence is not success.** A component that loads a plan reports
|
|
28
|
+
* `plan_loaded`, so the runner can tell "the fault fired and the agent
|
|
29
|
+
* coped" from "the component never saw the plan".
|
|
30
|
+
*
|
|
31
|
+
* The Rust proxy decodes the same plan with serde; its tests read the fixture
|
|
32
|
+
* at `src/__tests__/fixtures/chaos-plan.json`, which this module's tests also
|
|
33
|
+
* validate, so the two decoders cannot drift apart.
|
|
34
|
+
*
|
|
35
|
+
* @module
|
|
36
|
+
*/
|
|
37
|
+
import { z } from 'zod';
|
|
38
|
+
/** Environment variable carrying the plan: base64url-encoded JSON {@link ChaosPlan}. */
|
|
39
|
+
export declare const CHAOS_PLAN_ENV = "INTUTIC_CHAOS_PLAN";
|
|
40
|
+
/** Environment variable carrying the path of the append-only JSONL events file. */
|
|
41
|
+
export declare const CHAOS_EVENTS_ENV = "INTUTIC_CHAOS_EVENTS";
|
|
42
|
+
/** Wire version of {@link ChaosPlan}. A component refuses any other version. */
|
|
43
|
+
export declare const CHAOS_PLAN_VERSION = 1;
|
|
44
|
+
/** Every fault the catalog knows, by id. */
|
|
45
|
+
export declare const FAULT_IDS: readonly ["llm.rate_limit", "llm.upstream_5xx", "llm.context_trim", "llm.model_degrade", "tool.error", "tool.stale_data", "mcp.toolset_change", "permission.deny_or_delay", "inject.tool_result", "egress.dns_fail", "egress.credential_401"];
|
|
46
|
+
export type FaultId = (typeof FAULT_IDS)[number];
|
|
47
|
+
/** The components that inject faults or report events. */
|
|
48
|
+
export type ChaosComponent = 'runner' | 'proxy' | 'mcp-proxy' | 'gate';
|
|
49
|
+
/**
|
|
50
|
+
* Whether a fault is safe outside a sandbox. Fail-safe faults deny, delay or
|
|
51
|
+
* error; mutating faults change what the agent sees and run only in a sandbox.
|
|
52
|
+
*/
|
|
53
|
+
export type FaultSafety = 'fail_safe' | 'mutating';
|
|
54
|
+
/** Which component injects each fault, and its safety class. */
|
|
55
|
+
export declare const FAULT_CATALOG: Readonly<Record<FaultId, {
|
|
56
|
+
injectedBy: readonly ChaosComponent[];
|
|
57
|
+
safety: FaultSafety;
|
|
58
|
+
}>>;
|
|
59
|
+
/**
|
|
60
|
+
* Which calls a fault applies to. Every field present must match; an absent
|
|
61
|
+
* field matches anything. `tool` and `host` match exactly, or by suffix when
|
|
62
|
+
* they start with `*` (`*.npmjs.org`). `model` matches the requested model id.
|
|
63
|
+
*/
|
|
64
|
+
declare const MatchSchema: z.ZodObject<{
|
|
65
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
66
|
+
host: z.ZodOptional<z.ZodString>;
|
|
67
|
+
model: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, "strict", z.ZodTypeAny, {
|
|
69
|
+
tool?: string | undefined;
|
|
70
|
+
host?: string | undefined;
|
|
71
|
+
model?: string | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
tool?: string | undefined;
|
|
74
|
+
host?: string | undefined;
|
|
75
|
+
model?: string | undefined;
|
|
76
|
+
}>;
|
|
77
|
+
export type FaultMatch = z.infer<typeof MatchSchema>;
|
|
78
|
+
export declare const FaultSchema: z.ZodDiscriminatedUnion<"id", [z.ZodObject<{
|
|
79
|
+
retry_after_s: z.ZodDefault<z.ZodNumber>;
|
|
80
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
82
|
+
host: z.ZodOptional<z.ZodString>;
|
|
83
|
+
model: z.ZodOptional<z.ZodString>;
|
|
84
|
+
}, "strict", z.ZodTypeAny, {
|
|
85
|
+
tool?: string | undefined;
|
|
86
|
+
host?: string | undefined;
|
|
87
|
+
model?: string | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
tool?: string | undefined;
|
|
90
|
+
host?: string | undefined;
|
|
91
|
+
model?: string | undefined;
|
|
92
|
+
}>>;
|
|
93
|
+
/** Skip this many matching calls before the first injection. */
|
|
94
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
95
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
96
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
id: z.ZodLiteral<"llm.rate_limit">;
|
|
98
|
+
}, "strict", z.ZodTypeAny, {
|
|
99
|
+
id: "llm.rate_limit";
|
|
100
|
+
retry_after_s: number;
|
|
101
|
+
after_calls: number;
|
|
102
|
+
match?: {
|
|
103
|
+
tool?: string | undefined;
|
|
104
|
+
host?: string | undefined;
|
|
105
|
+
model?: string | undefined;
|
|
106
|
+
} | undefined;
|
|
107
|
+
times?: number | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
id: "llm.rate_limit";
|
|
110
|
+
retry_after_s?: number | undefined;
|
|
111
|
+
match?: {
|
|
112
|
+
tool?: string | undefined;
|
|
113
|
+
host?: string | undefined;
|
|
114
|
+
model?: string | undefined;
|
|
115
|
+
} | undefined;
|
|
116
|
+
after_calls?: number | undefined;
|
|
117
|
+
times?: number | undefined;
|
|
118
|
+
}>, z.ZodObject<{
|
|
119
|
+
status: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<500>, z.ZodLiteral<502>, z.ZodLiteral<503>, z.ZodLiteral<529>]>>;
|
|
120
|
+
/** Cut a streamed response after this many chunks instead of failing the request. */
|
|
121
|
+
stream_cut_after_chunks: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
123
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
124
|
+
host: z.ZodOptional<z.ZodString>;
|
|
125
|
+
model: z.ZodOptional<z.ZodString>;
|
|
126
|
+
}, "strict", z.ZodTypeAny, {
|
|
127
|
+
tool?: string | undefined;
|
|
128
|
+
host?: string | undefined;
|
|
129
|
+
model?: string | undefined;
|
|
130
|
+
}, {
|
|
131
|
+
tool?: string | undefined;
|
|
132
|
+
host?: string | undefined;
|
|
133
|
+
model?: string | undefined;
|
|
134
|
+
}>>;
|
|
135
|
+
/** Skip this many matching calls before the first injection. */
|
|
136
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
137
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
138
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
id: z.ZodLiteral<"llm.upstream_5xx">;
|
|
140
|
+
}, "strict", z.ZodTypeAny, {
|
|
141
|
+
status: 500 | 502 | 503 | 529;
|
|
142
|
+
id: "llm.upstream_5xx";
|
|
143
|
+
after_calls: number;
|
|
144
|
+
match?: {
|
|
145
|
+
tool?: string | undefined;
|
|
146
|
+
host?: string | undefined;
|
|
147
|
+
model?: string | undefined;
|
|
148
|
+
} | undefined;
|
|
149
|
+
times?: number | undefined;
|
|
150
|
+
stream_cut_after_chunks?: number | undefined;
|
|
151
|
+
}, {
|
|
152
|
+
id: "llm.upstream_5xx";
|
|
153
|
+
status?: 500 | 502 | 503 | 529 | undefined;
|
|
154
|
+
match?: {
|
|
155
|
+
tool?: string | undefined;
|
|
156
|
+
host?: string | undefined;
|
|
157
|
+
model?: string | undefined;
|
|
158
|
+
} | undefined;
|
|
159
|
+
after_calls?: number | undefined;
|
|
160
|
+
times?: number | undefined;
|
|
161
|
+
stream_cut_after_chunks?: number | undefined;
|
|
162
|
+
}>, z.ZodObject<{
|
|
163
|
+
drop_oldest: z.ZodDefault<z.ZodNumber>;
|
|
164
|
+
drop_system: z.ZodDefault<z.ZodBoolean>;
|
|
165
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
166
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
167
|
+
host: z.ZodOptional<z.ZodString>;
|
|
168
|
+
model: z.ZodOptional<z.ZodString>;
|
|
169
|
+
}, "strict", z.ZodTypeAny, {
|
|
170
|
+
tool?: string | undefined;
|
|
171
|
+
host?: string | undefined;
|
|
172
|
+
model?: string | undefined;
|
|
173
|
+
}, {
|
|
174
|
+
tool?: string | undefined;
|
|
175
|
+
host?: string | undefined;
|
|
176
|
+
model?: string | undefined;
|
|
177
|
+
}>>;
|
|
178
|
+
/** Skip this many matching calls before the first injection. */
|
|
179
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
180
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
181
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
id: z.ZodLiteral<"llm.context_trim">;
|
|
183
|
+
}, "strict", z.ZodTypeAny, {
|
|
184
|
+
id: "llm.context_trim";
|
|
185
|
+
after_calls: number;
|
|
186
|
+
drop_oldest: number;
|
|
187
|
+
drop_system: boolean;
|
|
188
|
+
match?: {
|
|
189
|
+
tool?: string | undefined;
|
|
190
|
+
host?: string | undefined;
|
|
191
|
+
model?: string | undefined;
|
|
192
|
+
} | undefined;
|
|
193
|
+
times?: number | undefined;
|
|
194
|
+
}, {
|
|
195
|
+
id: "llm.context_trim";
|
|
196
|
+
match?: {
|
|
197
|
+
tool?: string | undefined;
|
|
198
|
+
host?: string | undefined;
|
|
199
|
+
model?: string | undefined;
|
|
200
|
+
} | undefined;
|
|
201
|
+
after_calls?: number | undefined;
|
|
202
|
+
times?: number | undefined;
|
|
203
|
+
drop_oldest?: number | undefined;
|
|
204
|
+
drop_system?: boolean | undefined;
|
|
205
|
+
}>, z.ZodObject<{
|
|
206
|
+
to_model: z.ZodString;
|
|
207
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
208
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
209
|
+
host: z.ZodOptional<z.ZodString>;
|
|
210
|
+
model: z.ZodOptional<z.ZodString>;
|
|
211
|
+
}, "strict", z.ZodTypeAny, {
|
|
212
|
+
tool?: string | undefined;
|
|
213
|
+
host?: string | undefined;
|
|
214
|
+
model?: string | undefined;
|
|
215
|
+
}, {
|
|
216
|
+
tool?: string | undefined;
|
|
217
|
+
host?: string | undefined;
|
|
218
|
+
model?: string | undefined;
|
|
219
|
+
}>>;
|
|
220
|
+
/** Skip this many matching calls before the first injection. */
|
|
221
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
222
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
223
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
224
|
+
id: z.ZodLiteral<"llm.model_degrade">;
|
|
225
|
+
}, "strict", z.ZodTypeAny, {
|
|
226
|
+
id: "llm.model_degrade";
|
|
227
|
+
after_calls: number;
|
|
228
|
+
to_model: string;
|
|
229
|
+
match?: {
|
|
230
|
+
tool?: string | undefined;
|
|
231
|
+
host?: string | undefined;
|
|
232
|
+
model?: string | undefined;
|
|
233
|
+
} | undefined;
|
|
234
|
+
times?: number | undefined;
|
|
235
|
+
}, {
|
|
236
|
+
id: "llm.model_degrade";
|
|
237
|
+
to_model: string;
|
|
238
|
+
match?: {
|
|
239
|
+
tool?: string | undefined;
|
|
240
|
+
host?: string | undefined;
|
|
241
|
+
model?: string | undefined;
|
|
242
|
+
} | undefined;
|
|
243
|
+
after_calls?: number | undefined;
|
|
244
|
+
times?: number | undefined;
|
|
245
|
+
}>, z.ZodObject<{
|
|
246
|
+
message: z.ZodDefault<z.ZodString>;
|
|
247
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
248
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
249
|
+
host: z.ZodOptional<z.ZodString>;
|
|
250
|
+
model: z.ZodOptional<z.ZodString>;
|
|
251
|
+
}, "strict", z.ZodTypeAny, {
|
|
252
|
+
tool?: string | undefined;
|
|
253
|
+
host?: string | undefined;
|
|
254
|
+
model?: string | undefined;
|
|
255
|
+
}, {
|
|
256
|
+
tool?: string | undefined;
|
|
257
|
+
host?: string | undefined;
|
|
258
|
+
model?: string | undefined;
|
|
259
|
+
}>>;
|
|
260
|
+
/** Skip this many matching calls before the first injection. */
|
|
261
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
262
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
263
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
264
|
+
id: z.ZodLiteral<"tool.error">;
|
|
265
|
+
}, "strict", z.ZodTypeAny, {
|
|
266
|
+
message: string;
|
|
267
|
+
id: "tool.error";
|
|
268
|
+
after_calls: number;
|
|
269
|
+
match?: {
|
|
270
|
+
tool?: string | undefined;
|
|
271
|
+
host?: string | undefined;
|
|
272
|
+
model?: string | undefined;
|
|
273
|
+
} | undefined;
|
|
274
|
+
times?: number | undefined;
|
|
275
|
+
}, {
|
|
276
|
+
id: "tool.error";
|
|
277
|
+
message?: string | undefined;
|
|
278
|
+
match?: {
|
|
279
|
+
tool?: string | undefined;
|
|
280
|
+
host?: string | undefined;
|
|
281
|
+
model?: string | undefined;
|
|
282
|
+
} | undefined;
|
|
283
|
+
after_calls?: number | undefined;
|
|
284
|
+
times?: number | undefined;
|
|
285
|
+
}>, z.ZodObject<{
|
|
286
|
+
result: z.ZodString;
|
|
287
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
288
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
289
|
+
host: z.ZodOptional<z.ZodString>;
|
|
290
|
+
model: z.ZodOptional<z.ZodString>;
|
|
291
|
+
}, "strict", z.ZodTypeAny, {
|
|
292
|
+
tool?: string | undefined;
|
|
293
|
+
host?: string | undefined;
|
|
294
|
+
model?: string | undefined;
|
|
295
|
+
}, {
|
|
296
|
+
tool?: string | undefined;
|
|
297
|
+
host?: string | undefined;
|
|
298
|
+
model?: string | undefined;
|
|
299
|
+
}>>;
|
|
300
|
+
/** Skip this many matching calls before the first injection. */
|
|
301
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
302
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
303
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
304
|
+
id: z.ZodLiteral<"tool.stale_data">;
|
|
305
|
+
}, "strict", z.ZodTypeAny, {
|
|
306
|
+
id: "tool.stale_data";
|
|
307
|
+
after_calls: number;
|
|
308
|
+
result: string;
|
|
309
|
+
match?: {
|
|
310
|
+
tool?: string | undefined;
|
|
311
|
+
host?: string | undefined;
|
|
312
|
+
model?: string | undefined;
|
|
313
|
+
} | undefined;
|
|
314
|
+
times?: number | undefined;
|
|
315
|
+
}, {
|
|
316
|
+
id: "tool.stale_data";
|
|
317
|
+
result: string;
|
|
318
|
+
match?: {
|
|
319
|
+
tool?: string | undefined;
|
|
320
|
+
host?: string | undefined;
|
|
321
|
+
model?: string | undefined;
|
|
322
|
+
} | undefined;
|
|
323
|
+
after_calls?: number | undefined;
|
|
324
|
+
times?: number | undefined;
|
|
325
|
+
}>, z.ZodObject<{
|
|
326
|
+
remove: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
327
|
+
/** Tool name → the description it is redefined with. */
|
|
328
|
+
redefine: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
329
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
330
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
331
|
+
host: z.ZodOptional<z.ZodString>;
|
|
332
|
+
model: z.ZodOptional<z.ZodString>;
|
|
333
|
+
}, "strict", z.ZodTypeAny, {
|
|
334
|
+
tool?: string | undefined;
|
|
335
|
+
host?: string | undefined;
|
|
336
|
+
model?: string | undefined;
|
|
337
|
+
}, {
|
|
338
|
+
tool?: string | undefined;
|
|
339
|
+
host?: string | undefined;
|
|
340
|
+
model?: string | undefined;
|
|
341
|
+
}>>;
|
|
342
|
+
/** Skip this many matching calls before the first injection. */
|
|
343
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
344
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
345
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
346
|
+
id: z.ZodLiteral<"mcp.toolset_change">;
|
|
347
|
+
}, "strict", z.ZodTypeAny, {
|
|
348
|
+
id: "mcp.toolset_change";
|
|
349
|
+
after_calls: number;
|
|
350
|
+
remove: string[];
|
|
351
|
+
redefine: Record<string, string>;
|
|
352
|
+
match?: {
|
|
353
|
+
tool?: string | undefined;
|
|
354
|
+
host?: string | undefined;
|
|
355
|
+
model?: string | undefined;
|
|
356
|
+
} | undefined;
|
|
357
|
+
times?: number | undefined;
|
|
358
|
+
}, {
|
|
359
|
+
id: "mcp.toolset_change";
|
|
360
|
+
match?: {
|
|
361
|
+
tool?: string | undefined;
|
|
362
|
+
host?: string | undefined;
|
|
363
|
+
model?: string | undefined;
|
|
364
|
+
} | undefined;
|
|
365
|
+
after_calls?: number | undefined;
|
|
366
|
+
times?: number | undefined;
|
|
367
|
+
remove?: string[] | undefined;
|
|
368
|
+
redefine?: Record<string, string> | undefined;
|
|
369
|
+
}>, z.ZodObject<{
|
|
370
|
+
mode: z.ZodDefault<z.ZodEnum<["deny", "delay", "hold_then_deny"]>>;
|
|
371
|
+
/**
|
|
372
|
+
* `delay` and `hold_then_deny`: how long a held call stays held. The
|
|
373
|
+
* call is refused as held, the way an approval hold refuses it, and so
|
|
374
|
+
* is its identical retry until this many seconds have passed since the
|
|
375
|
+
* first refusal; then the retry is allowed (`delay`) or denied
|
|
376
|
+
* (`hold_then_deny`). Nothing waits: 0 holds the call once and allows
|
|
377
|
+
* (or denies) the first retry.
|
|
378
|
+
*/
|
|
379
|
+
delay_s: z.ZodDefault<z.ZodNumber>;
|
|
380
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
381
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
382
|
+
host: z.ZodOptional<z.ZodString>;
|
|
383
|
+
model: z.ZodOptional<z.ZodString>;
|
|
384
|
+
}, "strict", z.ZodTypeAny, {
|
|
385
|
+
tool?: string | undefined;
|
|
386
|
+
host?: string | undefined;
|
|
387
|
+
model?: string | undefined;
|
|
388
|
+
}, {
|
|
389
|
+
tool?: string | undefined;
|
|
390
|
+
host?: string | undefined;
|
|
391
|
+
model?: string | undefined;
|
|
392
|
+
}>>;
|
|
393
|
+
/** Skip this many matching calls before the first injection. */
|
|
394
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
395
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
396
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
397
|
+
id: z.ZodLiteral<"permission.deny_or_delay">;
|
|
398
|
+
}, "strict", z.ZodTypeAny, {
|
|
399
|
+
id: "permission.deny_or_delay";
|
|
400
|
+
after_calls: number;
|
|
401
|
+
mode: "deny" | "delay" | "hold_then_deny";
|
|
402
|
+
delay_s: number;
|
|
403
|
+
match?: {
|
|
404
|
+
tool?: string | undefined;
|
|
405
|
+
host?: string | undefined;
|
|
406
|
+
model?: string | undefined;
|
|
407
|
+
} | undefined;
|
|
408
|
+
times?: number | undefined;
|
|
409
|
+
}, {
|
|
410
|
+
id: "permission.deny_or_delay";
|
|
411
|
+
match?: {
|
|
412
|
+
tool?: string | undefined;
|
|
413
|
+
host?: string | undefined;
|
|
414
|
+
model?: string | undefined;
|
|
415
|
+
} | undefined;
|
|
416
|
+
after_calls?: number | undefined;
|
|
417
|
+
times?: number | undefined;
|
|
418
|
+
mode?: "deny" | "delay" | "hold_then_deny" | undefined;
|
|
419
|
+
delay_s?: number | undefined;
|
|
420
|
+
}>, z.ZodObject<{
|
|
421
|
+
payload: z.ZodString;
|
|
422
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
423
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
424
|
+
host: z.ZodOptional<z.ZodString>;
|
|
425
|
+
model: z.ZodOptional<z.ZodString>;
|
|
426
|
+
}, "strict", z.ZodTypeAny, {
|
|
427
|
+
tool?: string | undefined;
|
|
428
|
+
host?: string | undefined;
|
|
429
|
+
model?: string | undefined;
|
|
430
|
+
}, {
|
|
431
|
+
tool?: string | undefined;
|
|
432
|
+
host?: string | undefined;
|
|
433
|
+
model?: string | undefined;
|
|
434
|
+
}>>;
|
|
435
|
+
/** Skip this many matching calls before the first injection. */
|
|
436
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
437
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
438
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
439
|
+
id: z.ZodLiteral<"inject.tool_result">;
|
|
440
|
+
}, "strict", z.ZodTypeAny, {
|
|
441
|
+
id: "inject.tool_result";
|
|
442
|
+
after_calls: number;
|
|
443
|
+
payload: string;
|
|
444
|
+
match?: {
|
|
445
|
+
tool?: string | undefined;
|
|
446
|
+
host?: string | undefined;
|
|
447
|
+
model?: string | undefined;
|
|
448
|
+
} | undefined;
|
|
449
|
+
times?: number | undefined;
|
|
450
|
+
}, {
|
|
451
|
+
id: "inject.tool_result";
|
|
452
|
+
payload: string;
|
|
453
|
+
match?: {
|
|
454
|
+
tool?: string | undefined;
|
|
455
|
+
host?: string | undefined;
|
|
456
|
+
model?: string | undefined;
|
|
457
|
+
} | undefined;
|
|
458
|
+
after_calls?: number | undefined;
|
|
459
|
+
times?: number | undefined;
|
|
460
|
+
}>, z.ZodObject<{
|
|
461
|
+
match: z.ZodObject<{
|
|
462
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
463
|
+
model: z.ZodOptional<z.ZodString>;
|
|
464
|
+
} & {
|
|
465
|
+
host: z.ZodString;
|
|
466
|
+
}, "strict", z.ZodTypeAny, {
|
|
467
|
+
host: string;
|
|
468
|
+
tool?: string | undefined;
|
|
469
|
+
model?: string | undefined;
|
|
470
|
+
}, {
|
|
471
|
+
host: string;
|
|
472
|
+
tool?: string | undefined;
|
|
473
|
+
model?: string | undefined;
|
|
474
|
+
}>;
|
|
475
|
+
/** Skip this many matching calls before the first injection. */
|
|
476
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
477
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
478
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
479
|
+
id: z.ZodLiteral<"egress.dns_fail">;
|
|
480
|
+
}, "strict", z.ZodTypeAny, {
|
|
481
|
+
id: "egress.dns_fail";
|
|
482
|
+
match: {
|
|
483
|
+
host: string;
|
|
484
|
+
tool?: string | undefined;
|
|
485
|
+
model?: string | undefined;
|
|
486
|
+
};
|
|
487
|
+
after_calls: number;
|
|
488
|
+
times?: number | undefined;
|
|
489
|
+
}, {
|
|
490
|
+
id: "egress.dns_fail";
|
|
491
|
+
match: {
|
|
492
|
+
host: string;
|
|
493
|
+
tool?: string | undefined;
|
|
494
|
+
model?: string | undefined;
|
|
495
|
+
};
|
|
496
|
+
after_calls?: number | undefined;
|
|
497
|
+
times?: number | undefined;
|
|
498
|
+
}>, z.ZodObject<{
|
|
499
|
+
match: z.ZodObject<{
|
|
500
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
501
|
+
model: z.ZodOptional<z.ZodString>;
|
|
502
|
+
} & {
|
|
503
|
+
host: z.ZodString;
|
|
504
|
+
}, "strict", z.ZodTypeAny, {
|
|
505
|
+
host: string;
|
|
506
|
+
tool?: string | undefined;
|
|
507
|
+
model?: string | undefined;
|
|
508
|
+
}, {
|
|
509
|
+
host: string;
|
|
510
|
+
tool?: string | undefined;
|
|
511
|
+
model?: string | undefined;
|
|
512
|
+
}>;
|
|
513
|
+
/** Skip this many matching calls before the first injection. */
|
|
514
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
515
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
516
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
517
|
+
id: z.ZodLiteral<"egress.credential_401">;
|
|
518
|
+
}, "strict", z.ZodTypeAny, {
|
|
519
|
+
id: "egress.credential_401";
|
|
520
|
+
match: {
|
|
521
|
+
host: string;
|
|
522
|
+
tool?: string | undefined;
|
|
523
|
+
model?: string | undefined;
|
|
524
|
+
};
|
|
525
|
+
after_calls: number;
|
|
526
|
+
times?: number | undefined;
|
|
527
|
+
}, {
|
|
528
|
+
id: "egress.credential_401";
|
|
529
|
+
match: {
|
|
530
|
+
host: string;
|
|
531
|
+
tool?: string | undefined;
|
|
532
|
+
model?: string | undefined;
|
|
533
|
+
};
|
|
534
|
+
after_calls?: number | undefined;
|
|
535
|
+
times?: number | undefined;
|
|
536
|
+
}>]>;
|
|
537
|
+
export type Fault = z.infer<typeof FaultSchema>;
|
|
538
|
+
export declare const ChaosPlanSchema: z.ZodObject<{
|
|
539
|
+
v: z.ZodLiteral<1>;
|
|
540
|
+
runId: z.ZodString;
|
|
541
|
+
/** 0-based repetition index; baseline repetitions carry no faults. */
|
|
542
|
+
repetition: z.ZodNumber;
|
|
543
|
+
/** Token every injected error text carries, so `failure_surfaced` needs no model. */
|
|
544
|
+
canary: z.ZodString;
|
|
545
|
+
faults: z.ZodArray<z.ZodDiscriminatedUnion<"id", [z.ZodObject<{
|
|
546
|
+
retry_after_s: z.ZodDefault<z.ZodNumber>;
|
|
547
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
548
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
549
|
+
host: z.ZodOptional<z.ZodString>;
|
|
550
|
+
model: z.ZodOptional<z.ZodString>;
|
|
551
|
+
}, "strict", z.ZodTypeAny, {
|
|
552
|
+
tool?: string | undefined;
|
|
553
|
+
host?: string | undefined;
|
|
554
|
+
model?: string | undefined;
|
|
555
|
+
}, {
|
|
556
|
+
tool?: string | undefined;
|
|
557
|
+
host?: string | undefined;
|
|
558
|
+
model?: string | undefined;
|
|
559
|
+
}>>;
|
|
560
|
+
/** Skip this many matching calls before the first injection. */
|
|
561
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
562
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
563
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
564
|
+
id: z.ZodLiteral<"llm.rate_limit">;
|
|
565
|
+
}, "strict", z.ZodTypeAny, {
|
|
566
|
+
id: "llm.rate_limit";
|
|
567
|
+
retry_after_s: number;
|
|
568
|
+
after_calls: number;
|
|
569
|
+
match?: {
|
|
570
|
+
tool?: string | undefined;
|
|
571
|
+
host?: string | undefined;
|
|
572
|
+
model?: string | undefined;
|
|
573
|
+
} | undefined;
|
|
574
|
+
times?: number | undefined;
|
|
575
|
+
}, {
|
|
576
|
+
id: "llm.rate_limit";
|
|
577
|
+
retry_after_s?: number | undefined;
|
|
578
|
+
match?: {
|
|
579
|
+
tool?: string | undefined;
|
|
580
|
+
host?: string | undefined;
|
|
581
|
+
model?: string | undefined;
|
|
582
|
+
} | undefined;
|
|
583
|
+
after_calls?: number | undefined;
|
|
584
|
+
times?: number | undefined;
|
|
585
|
+
}>, z.ZodObject<{
|
|
586
|
+
status: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<500>, z.ZodLiteral<502>, z.ZodLiteral<503>, z.ZodLiteral<529>]>>;
|
|
587
|
+
/** Cut a streamed response after this many chunks instead of failing the request. */
|
|
588
|
+
stream_cut_after_chunks: z.ZodOptional<z.ZodNumber>;
|
|
589
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
590
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
591
|
+
host: z.ZodOptional<z.ZodString>;
|
|
592
|
+
model: z.ZodOptional<z.ZodString>;
|
|
593
|
+
}, "strict", z.ZodTypeAny, {
|
|
594
|
+
tool?: string | undefined;
|
|
595
|
+
host?: string | undefined;
|
|
596
|
+
model?: string | undefined;
|
|
597
|
+
}, {
|
|
598
|
+
tool?: string | undefined;
|
|
599
|
+
host?: string | undefined;
|
|
600
|
+
model?: string | undefined;
|
|
601
|
+
}>>;
|
|
602
|
+
/** Skip this many matching calls before the first injection. */
|
|
603
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
604
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
605
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
606
|
+
id: z.ZodLiteral<"llm.upstream_5xx">;
|
|
607
|
+
}, "strict", z.ZodTypeAny, {
|
|
608
|
+
status: 500 | 502 | 503 | 529;
|
|
609
|
+
id: "llm.upstream_5xx";
|
|
610
|
+
after_calls: number;
|
|
611
|
+
match?: {
|
|
612
|
+
tool?: string | undefined;
|
|
613
|
+
host?: string | undefined;
|
|
614
|
+
model?: string | undefined;
|
|
615
|
+
} | undefined;
|
|
616
|
+
times?: number | undefined;
|
|
617
|
+
stream_cut_after_chunks?: number | undefined;
|
|
618
|
+
}, {
|
|
619
|
+
id: "llm.upstream_5xx";
|
|
620
|
+
status?: 500 | 502 | 503 | 529 | undefined;
|
|
621
|
+
match?: {
|
|
622
|
+
tool?: string | undefined;
|
|
623
|
+
host?: string | undefined;
|
|
624
|
+
model?: string | undefined;
|
|
625
|
+
} | undefined;
|
|
626
|
+
after_calls?: number | undefined;
|
|
627
|
+
times?: number | undefined;
|
|
628
|
+
stream_cut_after_chunks?: number | undefined;
|
|
629
|
+
}>, z.ZodObject<{
|
|
630
|
+
drop_oldest: z.ZodDefault<z.ZodNumber>;
|
|
631
|
+
drop_system: z.ZodDefault<z.ZodBoolean>;
|
|
632
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
633
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
634
|
+
host: z.ZodOptional<z.ZodString>;
|
|
635
|
+
model: z.ZodOptional<z.ZodString>;
|
|
636
|
+
}, "strict", z.ZodTypeAny, {
|
|
637
|
+
tool?: string | undefined;
|
|
638
|
+
host?: string | undefined;
|
|
639
|
+
model?: string | undefined;
|
|
640
|
+
}, {
|
|
641
|
+
tool?: string | undefined;
|
|
642
|
+
host?: string | undefined;
|
|
643
|
+
model?: string | undefined;
|
|
644
|
+
}>>;
|
|
645
|
+
/** Skip this many matching calls before the first injection. */
|
|
646
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
647
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
648
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
649
|
+
id: z.ZodLiteral<"llm.context_trim">;
|
|
650
|
+
}, "strict", z.ZodTypeAny, {
|
|
651
|
+
id: "llm.context_trim";
|
|
652
|
+
after_calls: number;
|
|
653
|
+
drop_oldest: number;
|
|
654
|
+
drop_system: boolean;
|
|
655
|
+
match?: {
|
|
656
|
+
tool?: string | undefined;
|
|
657
|
+
host?: string | undefined;
|
|
658
|
+
model?: string | undefined;
|
|
659
|
+
} | undefined;
|
|
660
|
+
times?: number | undefined;
|
|
661
|
+
}, {
|
|
662
|
+
id: "llm.context_trim";
|
|
663
|
+
match?: {
|
|
664
|
+
tool?: string | undefined;
|
|
665
|
+
host?: string | undefined;
|
|
666
|
+
model?: string | undefined;
|
|
667
|
+
} | undefined;
|
|
668
|
+
after_calls?: number | undefined;
|
|
669
|
+
times?: number | undefined;
|
|
670
|
+
drop_oldest?: number | undefined;
|
|
671
|
+
drop_system?: boolean | undefined;
|
|
672
|
+
}>, z.ZodObject<{
|
|
673
|
+
to_model: z.ZodString;
|
|
674
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
675
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
676
|
+
host: z.ZodOptional<z.ZodString>;
|
|
677
|
+
model: z.ZodOptional<z.ZodString>;
|
|
678
|
+
}, "strict", z.ZodTypeAny, {
|
|
679
|
+
tool?: string | undefined;
|
|
680
|
+
host?: string | undefined;
|
|
681
|
+
model?: string | undefined;
|
|
682
|
+
}, {
|
|
683
|
+
tool?: string | undefined;
|
|
684
|
+
host?: string | undefined;
|
|
685
|
+
model?: string | undefined;
|
|
686
|
+
}>>;
|
|
687
|
+
/** Skip this many matching calls before the first injection. */
|
|
688
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
689
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
690
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
691
|
+
id: z.ZodLiteral<"llm.model_degrade">;
|
|
692
|
+
}, "strict", z.ZodTypeAny, {
|
|
693
|
+
id: "llm.model_degrade";
|
|
694
|
+
after_calls: number;
|
|
695
|
+
to_model: string;
|
|
696
|
+
match?: {
|
|
697
|
+
tool?: string | undefined;
|
|
698
|
+
host?: string | undefined;
|
|
699
|
+
model?: string | undefined;
|
|
700
|
+
} | undefined;
|
|
701
|
+
times?: number | undefined;
|
|
702
|
+
}, {
|
|
703
|
+
id: "llm.model_degrade";
|
|
704
|
+
to_model: string;
|
|
705
|
+
match?: {
|
|
706
|
+
tool?: string | undefined;
|
|
707
|
+
host?: string | undefined;
|
|
708
|
+
model?: string | undefined;
|
|
709
|
+
} | undefined;
|
|
710
|
+
after_calls?: number | undefined;
|
|
711
|
+
times?: number | undefined;
|
|
712
|
+
}>, z.ZodObject<{
|
|
713
|
+
message: z.ZodDefault<z.ZodString>;
|
|
714
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
715
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
716
|
+
host: z.ZodOptional<z.ZodString>;
|
|
717
|
+
model: z.ZodOptional<z.ZodString>;
|
|
718
|
+
}, "strict", z.ZodTypeAny, {
|
|
719
|
+
tool?: string | undefined;
|
|
720
|
+
host?: string | undefined;
|
|
721
|
+
model?: string | undefined;
|
|
722
|
+
}, {
|
|
723
|
+
tool?: string | undefined;
|
|
724
|
+
host?: string | undefined;
|
|
725
|
+
model?: string | undefined;
|
|
726
|
+
}>>;
|
|
727
|
+
/** Skip this many matching calls before the first injection. */
|
|
728
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
729
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
730
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
731
|
+
id: z.ZodLiteral<"tool.error">;
|
|
732
|
+
}, "strict", z.ZodTypeAny, {
|
|
733
|
+
message: string;
|
|
734
|
+
id: "tool.error";
|
|
735
|
+
after_calls: number;
|
|
736
|
+
match?: {
|
|
737
|
+
tool?: string | undefined;
|
|
738
|
+
host?: string | undefined;
|
|
739
|
+
model?: string | undefined;
|
|
740
|
+
} | undefined;
|
|
741
|
+
times?: number | undefined;
|
|
742
|
+
}, {
|
|
743
|
+
id: "tool.error";
|
|
744
|
+
message?: string | undefined;
|
|
745
|
+
match?: {
|
|
746
|
+
tool?: string | undefined;
|
|
747
|
+
host?: string | undefined;
|
|
748
|
+
model?: string | undefined;
|
|
749
|
+
} | undefined;
|
|
750
|
+
after_calls?: number | undefined;
|
|
751
|
+
times?: number | undefined;
|
|
752
|
+
}>, z.ZodObject<{
|
|
753
|
+
result: z.ZodString;
|
|
754
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
755
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
756
|
+
host: z.ZodOptional<z.ZodString>;
|
|
757
|
+
model: z.ZodOptional<z.ZodString>;
|
|
758
|
+
}, "strict", z.ZodTypeAny, {
|
|
759
|
+
tool?: string | undefined;
|
|
760
|
+
host?: string | undefined;
|
|
761
|
+
model?: string | undefined;
|
|
762
|
+
}, {
|
|
763
|
+
tool?: string | undefined;
|
|
764
|
+
host?: string | undefined;
|
|
765
|
+
model?: string | undefined;
|
|
766
|
+
}>>;
|
|
767
|
+
/** Skip this many matching calls before the first injection. */
|
|
768
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
769
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
770
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
771
|
+
id: z.ZodLiteral<"tool.stale_data">;
|
|
772
|
+
}, "strict", z.ZodTypeAny, {
|
|
773
|
+
id: "tool.stale_data";
|
|
774
|
+
after_calls: number;
|
|
775
|
+
result: string;
|
|
776
|
+
match?: {
|
|
777
|
+
tool?: string | undefined;
|
|
778
|
+
host?: string | undefined;
|
|
779
|
+
model?: string | undefined;
|
|
780
|
+
} | undefined;
|
|
781
|
+
times?: number | undefined;
|
|
782
|
+
}, {
|
|
783
|
+
id: "tool.stale_data";
|
|
784
|
+
result: string;
|
|
785
|
+
match?: {
|
|
786
|
+
tool?: string | undefined;
|
|
787
|
+
host?: string | undefined;
|
|
788
|
+
model?: string | undefined;
|
|
789
|
+
} | undefined;
|
|
790
|
+
after_calls?: number | undefined;
|
|
791
|
+
times?: number | undefined;
|
|
792
|
+
}>, z.ZodObject<{
|
|
793
|
+
remove: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
794
|
+
/** Tool name → the description it is redefined with. */
|
|
795
|
+
redefine: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
796
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
797
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
798
|
+
host: z.ZodOptional<z.ZodString>;
|
|
799
|
+
model: z.ZodOptional<z.ZodString>;
|
|
800
|
+
}, "strict", z.ZodTypeAny, {
|
|
801
|
+
tool?: string | undefined;
|
|
802
|
+
host?: string | undefined;
|
|
803
|
+
model?: string | undefined;
|
|
804
|
+
}, {
|
|
805
|
+
tool?: string | undefined;
|
|
806
|
+
host?: string | undefined;
|
|
807
|
+
model?: string | undefined;
|
|
808
|
+
}>>;
|
|
809
|
+
/** Skip this many matching calls before the first injection. */
|
|
810
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
811
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
812
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
813
|
+
id: z.ZodLiteral<"mcp.toolset_change">;
|
|
814
|
+
}, "strict", z.ZodTypeAny, {
|
|
815
|
+
id: "mcp.toolset_change";
|
|
816
|
+
after_calls: number;
|
|
817
|
+
remove: string[];
|
|
818
|
+
redefine: Record<string, string>;
|
|
819
|
+
match?: {
|
|
820
|
+
tool?: string | undefined;
|
|
821
|
+
host?: string | undefined;
|
|
822
|
+
model?: string | undefined;
|
|
823
|
+
} | undefined;
|
|
824
|
+
times?: number | undefined;
|
|
825
|
+
}, {
|
|
826
|
+
id: "mcp.toolset_change";
|
|
827
|
+
match?: {
|
|
828
|
+
tool?: string | undefined;
|
|
829
|
+
host?: string | undefined;
|
|
830
|
+
model?: string | undefined;
|
|
831
|
+
} | undefined;
|
|
832
|
+
after_calls?: number | undefined;
|
|
833
|
+
times?: number | undefined;
|
|
834
|
+
remove?: string[] | undefined;
|
|
835
|
+
redefine?: Record<string, string> | undefined;
|
|
836
|
+
}>, z.ZodObject<{
|
|
837
|
+
mode: z.ZodDefault<z.ZodEnum<["deny", "delay", "hold_then_deny"]>>;
|
|
838
|
+
/**
|
|
839
|
+
* `delay` and `hold_then_deny`: how long a held call stays held. The
|
|
840
|
+
* call is refused as held, the way an approval hold refuses it, and so
|
|
841
|
+
* is its identical retry until this many seconds have passed since the
|
|
842
|
+
* first refusal; then the retry is allowed (`delay`) or denied
|
|
843
|
+
* (`hold_then_deny`). Nothing waits: 0 holds the call once and allows
|
|
844
|
+
* (or denies) the first retry.
|
|
845
|
+
*/
|
|
846
|
+
delay_s: z.ZodDefault<z.ZodNumber>;
|
|
847
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
848
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
849
|
+
host: z.ZodOptional<z.ZodString>;
|
|
850
|
+
model: z.ZodOptional<z.ZodString>;
|
|
851
|
+
}, "strict", z.ZodTypeAny, {
|
|
852
|
+
tool?: string | undefined;
|
|
853
|
+
host?: string | undefined;
|
|
854
|
+
model?: string | undefined;
|
|
855
|
+
}, {
|
|
856
|
+
tool?: string | undefined;
|
|
857
|
+
host?: string | undefined;
|
|
858
|
+
model?: string | undefined;
|
|
859
|
+
}>>;
|
|
860
|
+
/** Skip this many matching calls before the first injection. */
|
|
861
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
862
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
863
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
864
|
+
id: z.ZodLiteral<"permission.deny_or_delay">;
|
|
865
|
+
}, "strict", z.ZodTypeAny, {
|
|
866
|
+
id: "permission.deny_or_delay";
|
|
867
|
+
after_calls: number;
|
|
868
|
+
mode: "deny" | "delay" | "hold_then_deny";
|
|
869
|
+
delay_s: number;
|
|
870
|
+
match?: {
|
|
871
|
+
tool?: string | undefined;
|
|
872
|
+
host?: string | undefined;
|
|
873
|
+
model?: string | undefined;
|
|
874
|
+
} | undefined;
|
|
875
|
+
times?: number | undefined;
|
|
876
|
+
}, {
|
|
877
|
+
id: "permission.deny_or_delay";
|
|
878
|
+
match?: {
|
|
879
|
+
tool?: string | undefined;
|
|
880
|
+
host?: string | undefined;
|
|
881
|
+
model?: string | undefined;
|
|
882
|
+
} | undefined;
|
|
883
|
+
after_calls?: number | undefined;
|
|
884
|
+
times?: number | undefined;
|
|
885
|
+
mode?: "deny" | "delay" | "hold_then_deny" | undefined;
|
|
886
|
+
delay_s?: number | undefined;
|
|
887
|
+
}>, z.ZodObject<{
|
|
888
|
+
payload: z.ZodString;
|
|
889
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
890
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
891
|
+
host: z.ZodOptional<z.ZodString>;
|
|
892
|
+
model: z.ZodOptional<z.ZodString>;
|
|
893
|
+
}, "strict", z.ZodTypeAny, {
|
|
894
|
+
tool?: string | undefined;
|
|
895
|
+
host?: string | undefined;
|
|
896
|
+
model?: string | undefined;
|
|
897
|
+
}, {
|
|
898
|
+
tool?: string | undefined;
|
|
899
|
+
host?: string | undefined;
|
|
900
|
+
model?: string | undefined;
|
|
901
|
+
}>>;
|
|
902
|
+
/** Skip this many matching calls before the first injection. */
|
|
903
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
904
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
905
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
906
|
+
id: z.ZodLiteral<"inject.tool_result">;
|
|
907
|
+
}, "strict", z.ZodTypeAny, {
|
|
908
|
+
id: "inject.tool_result";
|
|
909
|
+
after_calls: number;
|
|
910
|
+
payload: string;
|
|
911
|
+
match?: {
|
|
912
|
+
tool?: string | undefined;
|
|
913
|
+
host?: string | undefined;
|
|
914
|
+
model?: string | undefined;
|
|
915
|
+
} | undefined;
|
|
916
|
+
times?: number | undefined;
|
|
917
|
+
}, {
|
|
918
|
+
id: "inject.tool_result";
|
|
919
|
+
payload: string;
|
|
920
|
+
match?: {
|
|
921
|
+
tool?: string | undefined;
|
|
922
|
+
host?: string | undefined;
|
|
923
|
+
model?: string | undefined;
|
|
924
|
+
} | undefined;
|
|
925
|
+
after_calls?: number | undefined;
|
|
926
|
+
times?: number | undefined;
|
|
927
|
+
}>, z.ZodObject<{
|
|
928
|
+
match: z.ZodObject<{
|
|
929
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
930
|
+
model: z.ZodOptional<z.ZodString>;
|
|
931
|
+
} & {
|
|
932
|
+
host: z.ZodString;
|
|
933
|
+
}, "strict", z.ZodTypeAny, {
|
|
934
|
+
host: string;
|
|
935
|
+
tool?: string | undefined;
|
|
936
|
+
model?: string | undefined;
|
|
937
|
+
}, {
|
|
938
|
+
host: string;
|
|
939
|
+
tool?: string | undefined;
|
|
940
|
+
model?: string | undefined;
|
|
941
|
+
}>;
|
|
942
|
+
/** Skip this many matching calls before the first injection. */
|
|
943
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
944
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
945
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
946
|
+
id: z.ZodLiteral<"egress.dns_fail">;
|
|
947
|
+
}, "strict", z.ZodTypeAny, {
|
|
948
|
+
id: "egress.dns_fail";
|
|
949
|
+
match: {
|
|
950
|
+
host: string;
|
|
951
|
+
tool?: string | undefined;
|
|
952
|
+
model?: string | undefined;
|
|
953
|
+
};
|
|
954
|
+
after_calls: number;
|
|
955
|
+
times?: number | undefined;
|
|
956
|
+
}, {
|
|
957
|
+
id: "egress.dns_fail";
|
|
958
|
+
match: {
|
|
959
|
+
host: string;
|
|
960
|
+
tool?: string | undefined;
|
|
961
|
+
model?: string | undefined;
|
|
962
|
+
};
|
|
963
|
+
after_calls?: number | undefined;
|
|
964
|
+
times?: number | undefined;
|
|
965
|
+
}>, z.ZodObject<{
|
|
966
|
+
match: z.ZodObject<{
|
|
967
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
968
|
+
model: z.ZodOptional<z.ZodString>;
|
|
969
|
+
} & {
|
|
970
|
+
host: z.ZodString;
|
|
971
|
+
}, "strict", z.ZodTypeAny, {
|
|
972
|
+
host: string;
|
|
973
|
+
tool?: string | undefined;
|
|
974
|
+
model?: string | undefined;
|
|
975
|
+
}, {
|
|
976
|
+
host: string;
|
|
977
|
+
tool?: string | undefined;
|
|
978
|
+
model?: string | undefined;
|
|
979
|
+
}>;
|
|
980
|
+
/** Skip this many matching calls before the first injection. */
|
|
981
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
982
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
983
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
984
|
+
id: z.ZodLiteral<"egress.credential_401">;
|
|
985
|
+
}, "strict", z.ZodTypeAny, {
|
|
986
|
+
id: "egress.credential_401";
|
|
987
|
+
match: {
|
|
988
|
+
host: string;
|
|
989
|
+
tool?: string | undefined;
|
|
990
|
+
model?: string | undefined;
|
|
991
|
+
};
|
|
992
|
+
after_calls: number;
|
|
993
|
+
times?: number | undefined;
|
|
994
|
+
}, {
|
|
995
|
+
id: "egress.credential_401";
|
|
996
|
+
match: {
|
|
997
|
+
host: string;
|
|
998
|
+
tool?: string | undefined;
|
|
999
|
+
model?: string | undefined;
|
|
1000
|
+
};
|
|
1001
|
+
after_calls?: number | undefined;
|
|
1002
|
+
times?: number | undefined;
|
|
1003
|
+
}>]>, "many">;
|
|
1004
|
+
}, "strict", z.ZodTypeAny, {
|
|
1005
|
+
v: 1;
|
|
1006
|
+
runId: string;
|
|
1007
|
+
repetition: number;
|
|
1008
|
+
canary: string;
|
|
1009
|
+
faults: ({
|
|
1010
|
+
id: "llm.rate_limit";
|
|
1011
|
+
retry_after_s: number;
|
|
1012
|
+
after_calls: number;
|
|
1013
|
+
match?: {
|
|
1014
|
+
tool?: string | undefined;
|
|
1015
|
+
host?: string | undefined;
|
|
1016
|
+
model?: string | undefined;
|
|
1017
|
+
} | undefined;
|
|
1018
|
+
times?: number | undefined;
|
|
1019
|
+
} | {
|
|
1020
|
+
status: 500 | 502 | 503 | 529;
|
|
1021
|
+
id: "llm.upstream_5xx";
|
|
1022
|
+
after_calls: number;
|
|
1023
|
+
match?: {
|
|
1024
|
+
tool?: string | undefined;
|
|
1025
|
+
host?: string | undefined;
|
|
1026
|
+
model?: string | undefined;
|
|
1027
|
+
} | undefined;
|
|
1028
|
+
times?: number | undefined;
|
|
1029
|
+
stream_cut_after_chunks?: number | undefined;
|
|
1030
|
+
} | {
|
|
1031
|
+
id: "llm.context_trim";
|
|
1032
|
+
after_calls: number;
|
|
1033
|
+
drop_oldest: number;
|
|
1034
|
+
drop_system: boolean;
|
|
1035
|
+
match?: {
|
|
1036
|
+
tool?: string | undefined;
|
|
1037
|
+
host?: string | undefined;
|
|
1038
|
+
model?: string | undefined;
|
|
1039
|
+
} | undefined;
|
|
1040
|
+
times?: number | undefined;
|
|
1041
|
+
} | {
|
|
1042
|
+
id: "llm.model_degrade";
|
|
1043
|
+
after_calls: number;
|
|
1044
|
+
to_model: string;
|
|
1045
|
+
match?: {
|
|
1046
|
+
tool?: string | undefined;
|
|
1047
|
+
host?: string | undefined;
|
|
1048
|
+
model?: string | undefined;
|
|
1049
|
+
} | undefined;
|
|
1050
|
+
times?: number | undefined;
|
|
1051
|
+
} | {
|
|
1052
|
+
message: string;
|
|
1053
|
+
id: "tool.error";
|
|
1054
|
+
after_calls: number;
|
|
1055
|
+
match?: {
|
|
1056
|
+
tool?: string | undefined;
|
|
1057
|
+
host?: string | undefined;
|
|
1058
|
+
model?: string | undefined;
|
|
1059
|
+
} | undefined;
|
|
1060
|
+
times?: number | undefined;
|
|
1061
|
+
} | {
|
|
1062
|
+
id: "tool.stale_data";
|
|
1063
|
+
after_calls: number;
|
|
1064
|
+
result: string;
|
|
1065
|
+
match?: {
|
|
1066
|
+
tool?: string | undefined;
|
|
1067
|
+
host?: string | undefined;
|
|
1068
|
+
model?: string | undefined;
|
|
1069
|
+
} | undefined;
|
|
1070
|
+
times?: number | undefined;
|
|
1071
|
+
} | {
|
|
1072
|
+
id: "mcp.toolset_change";
|
|
1073
|
+
after_calls: number;
|
|
1074
|
+
remove: string[];
|
|
1075
|
+
redefine: Record<string, string>;
|
|
1076
|
+
match?: {
|
|
1077
|
+
tool?: string | undefined;
|
|
1078
|
+
host?: string | undefined;
|
|
1079
|
+
model?: string | undefined;
|
|
1080
|
+
} | undefined;
|
|
1081
|
+
times?: number | undefined;
|
|
1082
|
+
} | {
|
|
1083
|
+
id: "permission.deny_or_delay";
|
|
1084
|
+
after_calls: number;
|
|
1085
|
+
mode: "deny" | "delay" | "hold_then_deny";
|
|
1086
|
+
delay_s: number;
|
|
1087
|
+
match?: {
|
|
1088
|
+
tool?: string | undefined;
|
|
1089
|
+
host?: string | undefined;
|
|
1090
|
+
model?: string | undefined;
|
|
1091
|
+
} | undefined;
|
|
1092
|
+
times?: number | undefined;
|
|
1093
|
+
} | {
|
|
1094
|
+
id: "inject.tool_result";
|
|
1095
|
+
after_calls: number;
|
|
1096
|
+
payload: string;
|
|
1097
|
+
match?: {
|
|
1098
|
+
tool?: string | undefined;
|
|
1099
|
+
host?: string | undefined;
|
|
1100
|
+
model?: string | undefined;
|
|
1101
|
+
} | undefined;
|
|
1102
|
+
times?: number | undefined;
|
|
1103
|
+
} | {
|
|
1104
|
+
id: "egress.dns_fail";
|
|
1105
|
+
match: {
|
|
1106
|
+
host: string;
|
|
1107
|
+
tool?: string | undefined;
|
|
1108
|
+
model?: string | undefined;
|
|
1109
|
+
};
|
|
1110
|
+
after_calls: number;
|
|
1111
|
+
times?: number | undefined;
|
|
1112
|
+
} | {
|
|
1113
|
+
id: "egress.credential_401";
|
|
1114
|
+
match: {
|
|
1115
|
+
host: string;
|
|
1116
|
+
tool?: string | undefined;
|
|
1117
|
+
model?: string | undefined;
|
|
1118
|
+
};
|
|
1119
|
+
after_calls: number;
|
|
1120
|
+
times?: number | undefined;
|
|
1121
|
+
})[];
|
|
1122
|
+
}, {
|
|
1123
|
+
v: 1;
|
|
1124
|
+
runId: string;
|
|
1125
|
+
repetition: number;
|
|
1126
|
+
canary: string;
|
|
1127
|
+
faults: ({
|
|
1128
|
+
id: "llm.rate_limit";
|
|
1129
|
+
retry_after_s?: number | undefined;
|
|
1130
|
+
match?: {
|
|
1131
|
+
tool?: string | undefined;
|
|
1132
|
+
host?: string | undefined;
|
|
1133
|
+
model?: string | undefined;
|
|
1134
|
+
} | undefined;
|
|
1135
|
+
after_calls?: number | undefined;
|
|
1136
|
+
times?: number | undefined;
|
|
1137
|
+
} | {
|
|
1138
|
+
id: "llm.upstream_5xx";
|
|
1139
|
+
status?: 500 | 502 | 503 | 529 | undefined;
|
|
1140
|
+
match?: {
|
|
1141
|
+
tool?: string | undefined;
|
|
1142
|
+
host?: string | undefined;
|
|
1143
|
+
model?: string | undefined;
|
|
1144
|
+
} | undefined;
|
|
1145
|
+
after_calls?: number | undefined;
|
|
1146
|
+
times?: number | undefined;
|
|
1147
|
+
stream_cut_after_chunks?: number | undefined;
|
|
1148
|
+
} | {
|
|
1149
|
+
id: "llm.context_trim";
|
|
1150
|
+
match?: {
|
|
1151
|
+
tool?: string | undefined;
|
|
1152
|
+
host?: string | undefined;
|
|
1153
|
+
model?: string | undefined;
|
|
1154
|
+
} | undefined;
|
|
1155
|
+
after_calls?: number | undefined;
|
|
1156
|
+
times?: number | undefined;
|
|
1157
|
+
drop_oldest?: number | undefined;
|
|
1158
|
+
drop_system?: boolean | undefined;
|
|
1159
|
+
} | {
|
|
1160
|
+
id: "llm.model_degrade";
|
|
1161
|
+
to_model: string;
|
|
1162
|
+
match?: {
|
|
1163
|
+
tool?: string | undefined;
|
|
1164
|
+
host?: string | undefined;
|
|
1165
|
+
model?: string | undefined;
|
|
1166
|
+
} | undefined;
|
|
1167
|
+
after_calls?: number | undefined;
|
|
1168
|
+
times?: number | undefined;
|
|
1169
|
+
} | {
|
|
1170
|
+
id: "tool.error";
|
|
1171
|
+
message?: string | undefined;
|
|
1172
|
+
match?: {
|
|
1173
|
+
tool?: string | undefined;
|
|
1174
|
+
host?: string | undefined;
|
|
1175
|
+
model?: string | undefined;
|
|
1176
|
+
} | undefined;
|
|
1177
|
+
after_calls?: number | undefined;
|
|
1178
|
+
times?: number | undefined;
|
|
1179
|
+
} | {
|
|
1180
|
+
id: "tool.stale_data";
|
|
1181
|
+
result: string;
|
|
1182
|
+
match?: {
|
|
1183
|
+
tool?: string | undefined;
|
|
1184
|
+
host?: string | undefined;
|
|
1185
|
+
model?: string | undefined;
|
|
1186
|
+
} | undefined;
|
|
1187
|
+
after_calls?: number | undefined;
|
|
1188
|
+
times?: number | undefined;
|
|
1189
|
+
} | {
|
|
1190
|
+
id: "mcp.toolset_change";
|
|
1191
|
+
match?: {
|
|
1192
|
+
tool?: string | undefined;
|
|
1193
|
+
host?: string | undefined;
|
|
1194
|
+
model?: string | undefined;
|
|
1195
|
+
} | undefined;
|
|
1196
|
+
after_calls?: number | undefined;
|
|
1197
|
+
times?: number | undefined;
|
|
1198
|
+
remove?: string[] | undefined;
|
|
1199
|
+
redefine?: Record<string, string> | undefined;
|
|
1200
|
+
} | {
|
|
1201
|
+
id: "permission.deny_or_delay";
|
|
1202
|
+
match?: {
|
|
1203
|
+
tool?: string | undefined;
|
|
1204
|
+
host?: string | undefined;
|
|
1205
|
+
model?: string | undefined;
|
|
1206
|
+
} | undefined;
|
|
1207
|
+
after_calls?: number | undefined;
|
|
1208
|
+
times?: number | undefined;
|
|
1209
|
+
mode?: "deny" | "delay" | "hold_then_deny" | undefined;
|
|
1210
|
+
delay_s?: number | undefined;
|
|
1211
|
+
} | {
|
|
1212
|
+
id: "inject.tool_result";
|
|
1213
|
+
payload: string;
|
|
1214
|
+
match?: {
|
|
1215
|
+
tool?: string | undefined;
|
|
1216
|
+
host?: string | undefined;
|
|
1217
|
+
model?: string | undefined;
|
|
1218
|
+
} | undefined;
|
|
1219
|
+
after_calls?: number | undefined;
|
|
1220
|
+
times?: number | undefined;
|
|
1221
|
+
} | {
|
|
1222
|
+
id: "egress.dns_fail";
|
|
1223
|
+
match: {
|
|
1224
|
+
host: string;
|
|
1225
|
+
tool?: string | undefined;
|
|
1226
|
+
model?: string | undefined;
|
|
1227
|
+
};
|
|
1228
|
+
after_calls?: number | undefined;
|
|
1229
|
+
times?: number | undefined;
|
|
1230
|
+
} | {
|
|
1231
|
+
id: "egress.credential_401";
|
|
1232
|
+
match: {
|
|
1233
|
+
host: string;
|
|
1234
|
+
tool?: string | undefined;
|
|
1235
|
+
model?: string | undefined;
|
|
1236
|
+
};
|
|
1237
|
+
after_calls?: number | undefined;
|
|
1238
|
+
times?: number | undefined;
|
|
1239
|
+
})[];
|
|
1240
|
+
}>;
|
|
1241
|
+
export type ChaosPlan = z.infer<typeof ChaosPlanSchema>;
|
|
1242
|
+
/** Encode a plan for {@link CHAOS_PLAN_ENV}. */
|
|
1243
|
+
export declare function encodeChaosPlan(plan: ChaosPlan): string;
|
|
1244
|
+
/**
|
|
1245
|
+
* Decode {@link CHAOS_PLAN_ENV}. Returns null when the variable is unset or
|
|
1246
|
+
* empty; throws when it is set but not a valid plan, so a component can say
|
|
1247
|
+
* so instead of silently injecting nothing.
|
|
1248
|
+
*/
|
|
1249
|
+
export declare function decodeChaosPlan(raw: string | undefined): ChaosPlan | null;
|
|
1250
|
+
/** Whether `value` matches a fault's `tool`/`host` pattern (exact, or `*suffix`). */
|
|
1251
|
+
export declare function matchesPattern(pattern: string | undefined, value: string | undefined): boolean;
|
|
1252
|
+
/** Whether a fault's `match` covers a call. */
|
|
1253
|
+
export declare function faultMatches(fault: Fault, call: {
|
|
1254
|
+
tool?: string;
|
|
1255
|
+
host?: string;
|
|
1256
|
+
model?: string;
|
|
1257
|
+
}): boolean;
|
|
1258
|
+
/**
|
|
1259
|
+
* Per-process injection counter: decides whether the nth matching call of a
|
|
1260
|
+
* fault is hit, honouring `after_calls` and `times`. One instance per
|
|
1261
|
+
* component process; the plan is per run, so per-process state is per run.
|
|
1262
|
+
*/
|
|
1263
|
+
export declare class FaultCounter {
|
|
1264
|
+
private seen;
|
|
1265
|
+
private hit;
|
|
1266
|
+
/** Call once per matching call; returns true when this call is injected. */
|
|
1267
|
+
shouldInject(faultIndex: number, fault: Fault): boolean;
|
|
1268
|
+
}
|
|
1269
|
+
/** The error text an injected failure carries: the base message plus the canary. */
|
|
1270
|
+
export declare function faultMessage(plan: Pick<ChaosPlan, 'canary'>, base: string): string;
|
|
1271
|
+
export declare const ChaosEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1272
|
+
type: z.ZodLiteral<"plan_loaded">;
|
|
1273
|
+
faults: z.ZodNumber;
|
|
1274
|
+
ts: z.ZodString;
|
|
1275
|
+
runId: z.ZodString;
|
|
1276
|
+
component: z.ZodEnum<["runner", "proxy", "mcp-proxy", "gate"]>;
|
|
1277
|
+
}, "strip", z.ZodTypeAny, {
|
|
1278
|
+
type: "plan_loaded";
|
|
1279
|
+
runId: string;
|
|
1280
|
+
faults: number;
|
|
1281
|
+
ts: string;
|
|
1282
|
+
component: "runner" | "proxy" | "mcp-proxy" | "gate";
|
|
1283
|
+
}, {
|
|
1284
|
+
type: "plan_loaded";
|
|
1285
|
+
runId: string;
|
|
1286
|
+
faults: number;
|
|
1287
|
+
ts: string;
|
|
1288
|
+
component: "runner" | "proxy" | "mcp-proxy" | "gate";
|
|
1289
|
+
}>, z.ZodObject<{
|
|
1290
|
+
type: z.ZodLiteral<"fault_injected">;
|
|
1291
|
+
faultId: z.ZodEnum<["llm.rate_limit", "llm.upstream_5xx", "llm.context_trim", "llm.model_degrade", "tool.error", "tool.stale_data", "mcp.toolset_change", "permission.deny_or_delay", "inject.tool_result", "egress.dns_fail", "egress.credential_401"]>;
|
|
1292
|
+
/** The 1-based index of the matching call that was hit. */
|
|
1293
|
+
call: z.ZodNumber;
|
|
1294
|
+
target: z.ZodOptional<z.ZodString>;
|
|
1295
|
+
ts: z.ZodString;
|
|
1296
|
+
runId: z.ZodString;
|
|
1297
|
+
component: z.ZodEnum<["runner", "proxy", "mcp-proxy", "gate"]>;
|
|
1298
|
+
}, "strip", z.ZodTypeAny, {
|
|
1299
|
+
type: "fault_injected";
|
|
1300
|
+
runId: string;
|
|
1301
|
+
ts: string;
|
|
1302
|
+
component: "runner" | "proxy" | "mcp-proxy" | "gate";
|
|
1303
|
+
faultId: "llm.rate_limit" | "llm.upstream_5xx" | "llm.context_trim" | "llm.model_degrade" | "tool.error" | "tool.stale_data" | "mcp.toolset_change" | "permission.deny_or_delay" | "inject.tool_result" | "egress.dns_fail" | "egress.credential_401";
|
|
1304
|
+
call: number;
|
|
1305
|
+
target?: string | undefined;
|
|
1306
|
+
}, {
|
|
1307
|
+
type: "fault_injected";
|
|
1308
|
+
runId: string;
|
|
1309
|
+
ts: string;
|
|
1310
|
+
component: "runner" | "proxy" | "mcp-proxy" | "gate";
|
|
1311
|
+
faultId: "llm.rate_limit" | "llm.upstream_5xx" | "llm.context_trim" | "llm.model_degrade" | "tool.error" | "tool.stale_data" | "mcp.toolset_change" | "permission.deny_or_delay" | "inject.tool_result" | "egress.dns_fail" | "egress.credential_401";
|
|
1312
|
+
call: number;
|
|
1313
|
+
target?: string | undefined;
|
|
1314
|
+
}>, z.ZodObject<{
|
|
1315
|
+
type: z.ZodLiteral<"tool_call">;
|
|
1316
|
+
tool: z.ZodString;
|
|
1317
|
+
ok: z.ZodBoolean;
|
|
1318
|
+
ts: z.ZodString;
|
|
1319
|
+
runId: z.ZodString;
|
|
1320
|
+
component: z.ZodEnum<["runner", "proxy", "mcp-proxy", "gate"]>;
|
|
1321
|
+
}, "strip", z.ZodTypeAny, {
|
|
1322
|
+
type: "tool_call";
|
|
1323
|
+
tool: string;
|
|
1324
|
+
runId: string;
|
|
1325
|
+
ts: string;
|
|
1326
|
+
component: "runner" | "proxy" | "mcp-proxy" | "gate";
|
|
1327
|
+
ok: boolean;
|
|
1328
|
+
}, {
|
|
1329
|
+
type: "tool_call";
|
|
1330
|
+
tool: string;
|
|
1331
|
+
runId: string;
|
|
1332
|
+
ts: string;
|
|
1333
|
+
component: "runner" | "proxy" | "mcp-proxy" | "gate";
|
|
1334
|
+
ok: boolean;
|
|
1335
|
+
}>, z.ZodObject<{
|
|
1336
|
+
type: z.ZodLiteral<"gate_decision">;
|
|
1337
|
+
tool: z.ZodString;
|
|
1338
|
+
decision: z.ZodEnum<["allow", "deny", "ask", "hold"]>;
|
|
1339
|
+
ruleId: z.ZodOptional<z.ZodString>;
|
|
1340
|
+
/** The call hit the destructive-command tier, whether or not it was blocked. */
|
|
1341
|
+
destructive: z.ZodBoolean;
|
|
1342
|
+
/** An enforce-mode rule fired on the call. */
|
|
1343
|
+
policyHit: z.ZodBoolean;
|
|
1344
|
+
ts: z.ZodString;
|
|
1345
|
+
runId: z.ZodString;
|
|
1346
|
+
component: z.ZodEnum<["runner", "proxy", "mcp-proxy", "gate"]>;
|
|
1347
|
+
}, "strip", z.ZodTypeAny, {
|
|
1348
|
+
type: "gate_decision";
|
|
1349
|
+
tool: string;
|
|
1350
|
+
runId: string;
|
|
1351
|
+
ts: string;
|
|
1352
|
+
component: "runner" | "proxy" | "mcp-proxy" | "gate";
|
|
1353
|
+
decision: "deny" | "allow" | "ask" | "hold";
|
|
1354
|
+
destructive: boolean;
|
|
1355
|
+
policyHit: boolean;
|
|
1356
|
+
ruleId?: string | undefined;
|
|
1357
|
+
}, {
|
|
1358
|
+
type: "gate_decision";
|
|
1359
|
+
tool: string;
|
|
1360
|
+
runId: string;
|
|
1361
|
+
ts: string;
|
|
1362
|
+
component: "runner" | "proxy" | "mcp-proxy" | "gate";
|
|
1363
|
+
decision: "deny" | "allow" | "ask" | "hold";
|
|
1364
|
+
destructive: boolean;
|
|
1365
|
+
policyHit: boolean;
|
|
1366
|
+
ruleId?: string | undefined;
|
|
1367
|
+
}>, z.ZodObject<{
|
|
1368
|
+
type: z.ZodLiteral<"llm_usage">;
|
|
1369
|
+
model: z.ZodString;
|
|
1370
|
+
inputTokens: z.ZodNumber;
|
|
1371
|
+
outputTokens: z.ZodNumber;
|
|
1372
|
+
costUsd: z.ZodNumber;
|
|
1373
|
+
ts: z.ZodString;
|
|
1374
|
+
runId: z.ZodString;
|
|
1375
|
+
component: z.ZodEnum<["runner", "proxy", "mcp-proxy", "gate"]>;
|
|
1376
|
+
}, "strip", z.ZodTypeAny, {
|
|
1377
|
+
type: "llm_usage";
|
|
1378
|
+
outputTokens: number;
|
|
1379
|
+
model: string;
|
|
1380
|
+
runId: string;
|
|
1381
|
+
ts: string;
|
|
1382
|
+
component: "runner" | "proxy" | "mcp-proxy" | "gate";
|
|
1383
|
+
inputTokens: number;
|
|
1384
|
+
costUsd: number;
|
|
1385
|
+
}, {
|
|
1386
|
+
type: "llm_usage";
|
|
1387
|
+
outputTokens: number;
|
|
1388
|
+
model: string;
|
|
1389
|
+
runId: string;
|
|
1390
|
+
ts: string;
|
|
1391
|
+
component: "runner" | "proxy" | "mcp-proxy" | "gate";
|
|
1392
|
+
inputTokens: number;
|
|
1393
|
+
costUsd: number;
|
|
1394
|
+
}>, z.ZodObject<{
|
|
1395
|
+
type: z.ZodLiteral<"abort">;
|
|
1396
|
+
reason: z.ZodString;
|
|
1397
|
+
ts: z.ZodString;
|
|
1398
|
+
runId: z.ZodString;
|
|
1399
|
+
component: z.ZodEnum<["runner", "proxy", "mcp-proxy", "gate"]>;
|
|
1400
|
+
}, "strip", z.ZodTypeAny, {
|
|
1401
|
+
type: "abort";
|
|
1402
|
+
reason: string;
|
|
1403
|
+
runId: string;
|
|
1404
|
+
ts: string;
|
|
1405
|
+
component: "runner" | "proxy" | "mcp-proxy" | "gate";
|
|
1406
|
+
}, {
|
|
1407
|
+
type: "abort";
|
|
1408
|
+
reason: string;
|
|
1409
|
+
runId: string;
|
|
1410
|
+
ts: string;
|
|
1411
|
+
component: "runner" | "proxy" | "mcp-proxy" | "gate";
|
|
1412
|
+
}>]>;
|
|
1413
|
+
export type ChaosEvent = z.infer<typeof ChaosEventSchema>;
|
|
1414
|
+
/** Parse an events file's text; malformed lines are counted, not thrown. */
|
|
1415
|
+
export declare function parseChaosEvents(text: string): {
|
|
1416
|
+
events: ChaosEvent[];
|
|
1417
|
+
malformed: number;
|
|
1418
|
+
};
|
|
1419
|
+
export declare const PROBE_IDS: readonly ["task_success", "no_destructive_attempt", "failure_surfaced", "no_policy_hits", "cost_multiplier_below", "recovered_within"];
|
|
1420
|
+
export type ProbeId = (typeof PROBE_IDS)[number];
|
|
1421
|
+
export declare const ExperimentSchema: z.ZodObject<{
|
|
1422
|
+
name: z.ZodString;
|
|
1423
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1424
|
+
/** The agent command, run in the sandbox through a shell. */
|
|
1425
|
+
agent: z.ZodString;
|
|
1426
|
+
/** Run in the sandbox after the agent; exit 0 means the task succeeded. */
|
|
1427
|
+
verify: z.ZodString;
|
|
1428
|
+
/** Faulted repetitions; the same number of baseline repetitions run first. */
|
|
1429
|
+
repeat: z.ZodDefault<z.ZodNumber>;
|
|
1430
|
+
faults: z.ZodArray<z.ZodDiscriminatedUnion<"id", [z.ZodObject<{
|
|
1431
|
+
retry_after_s: z.ZodDefault<z.ZodNumber>;
|
|
1432
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
1433
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
1434
|
+
host: z.ZodOptional<z.ZodString>;
|
|
1435
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1436
|
+
}, "strict", z.ZodTypeAny, {
|
|
1437
|
+
tool?: string | undefined;
|
|
1438
|
+
host?: string | undefined;
|
|
1439
|
+
model?: string | undefined;
|
|
1440
|
+
}, {
|
|
1441
|
+
tool?: string | undefined;
|
|
1442
|
+
host?: string | undefined;
|
|
1443
|
+
model?: string | undefined;
|
|
1444
|
+
}>>;
|
|
1445
|
+
/** Skip this many matching calls before the first injection. */
|
|
1446
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
1447
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
1448
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
1449
|
+
id: z.ZodLiteral<"llm.rate_limit">;
|
|
1450
|
+
}, "strict", z.ZodTypeAny, {
|
|
1451
|
+
id: "llm.rate_limit";
|
|
1452
|
+
retry_after_s: number;
|
|
1453
|
+
after_calls: number;
|
|
1454
|
+
match?: {
|
|
1455
|
+
tool?: string | undefined;
|
|
1456
|
+
host?: string | undefined;
|
|
1457
|
+
model?: string | undefined;
|
|
1458
|
+
} | undefined;
|
|
1459
|
+
times?: number | undefined;
|
|
1460
|
+
}, {
|
|
1461
|
+
id: "llm.rate_limit";
|
|
1462
|
+
retry_after_s?: number | undefined;
|
|
1463
|
+
match?: {
|
|
1464
|
+
tool?: string | undefined;
|
|
1465
|
+
host?: string | undefined;
|
|
1466
|
+
model?: string | undefined;
|
|
1467
|
+
} | undefined;
|
|
1468
|
+
after_calls?: number | undefined;
|
|
1469
|
+
times?: number | undefined;
|
|
1470
|
+
}>, z.ZodObject<{
|
|
1471
|
+
status: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<500>, z.ZodLiteral<502>, z.ZodLiteral<503>, z.ZodLiteral<529>]>>;
|
|
1472
|
+
/** Cut a streamed response after this many chunks instead of failing the request. */
|
|
1473
|
+
stream_cut_after_chunks: z.ZodOptional<z.ZodNumber>;
|
|
1474
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
1475
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
1476
|
+
host: z.ZodOptional<z.ZodString>;
|
|
1477
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1478
|
+
}, "strict", z.ZodTypeAny, {
|
|
1479
|
+
tool?: string | undefined;
|
|
1480
|
+
host?: string | undefined;
|
|
1481
|
+
model?: string | undefined;
|
|
1482
|
+
}, {
|
|
1483
|
+
tool?: string | undefined;
|
|
1484
|
+
host?: string | undefined;
|
|
1485
|
+
model?: string | undefined;
|
|
1486
|
+
}>>;
|
|
1487
|
+
/** Skip this many matching calls before the first injection. */
|
|
1488
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
1489
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
1490
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
1491
|
+
id: z.ZodLiteral<"llm.upstream_5xx">;
|
|
1492
|
+
}, "strict", z.ZodTypeAny, {
|
|
1493
|
+
status: 500 | 502 | 503 | 529;
|
|
1494
|
+
id: "llm.upstream_5xx";
|
|
1495
|
+
after_calls: number;
|
|
1496
|
+
match?: {
|
|
1497
|
+
tool?: string | undefined;
|
|
1498
|
+
host?: string | undefined;
|
|
1499
|
+
model?: string | undefined;
|
|
1500
|
+
} | undefined;
|
|
1501
|
+
times?: number | undefined;
|
|
1502
|
+
stream_cut_after_chunks?: number | undefined;
|
|
1503
|
+
}, {
|
|
1504
|
+
id: "llm.upstream_5xx";
|
|
1505
|
+
status?: 500 | 502 | 503 | 529 | undefined;
|
|
1506
|
+
match?: {
|
|
1507
|
+
tool?: string | undefined;
|
|
1508
|
+
host?: string | undefined;
|
|
1509
|
+
model?: string | undefined;
|
|
1510
|
+
} | undefined;
|
|
1511
|
+
after_calls?: number | undefined;
|
|
1512
|
+
times?: number | undefined;
|
|
1513
|
+
stream_cut_after_chunks?: number | undefined;
|
|
1514
|
+
}>, z.ZodObject<{
|
|
1515
|
+
drop_oldest: z.ZodDefault<z.ZodNumber>;
|
|
1516
|
+
drop_system: z.ZodDefault<z.ZodBoolean>;
|
|
1517
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
1518
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
1519
|
+
host: z.ZodOptional<z.ZodString>;
|
|
1520
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1521
|
+
}, "strict", z.ZodTypeAny, {
|
|
1522
|
+
tool?: string | undefined;
|
|
1523
|
+
host?: string | undefined;
|
|
1524
|
+
model?: string | undefined;
|
|
1525
|
+
}, {
|
|
1526
|
+
tool?: string | undefined;
|
|
1527
|
+
host?: string | undefined;
|
|
1528
|
+
model?: string | undefined;
|
|
1529
|
+
}>>;
|
|
1530
|
+
/** Skip this many matching calls before the first injection. */
|
|
1531
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
1532
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
1533
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
1534
|
+
id: z.ZodLiteral<"llm.context_trim">;
|
|
1535
|
+
}, "strict", z.ZodTypeAny, {
|
|
1536
|
+
id: "llm.context_trim";
|
|
1537
|
+
after_calls: number;
|
|
1538
|
+
drop_oldest: number;
|
|
1539
|
+
drop_system: boolean;
|
|
1540
|
+
match?: {
|
|
1541
|
+
tool?: string | undefined;
|
|
1542
|
+
host?: string | undefined;
|
|
1543
|
+
model?: string | undefined;
|
|
1544
|
+
} | undefined;
|
|
1545
|
+
times?: number | undefined;
|
|
1546
|
+
}, {
|
|
1547
|
+
id: "llm.context_trim";
|
|
1548
|
+
match?: {
|
|
1549
|
+
tool?: string | undefined;
|
|
1550
|
+
host?: string | undefined;
|
|
1551
|
+
model?: string | undefined;
|
|
1552
|
+
} | undefined;
|
|
1553
|
+
after_calls?: number | undefined;
|
|
1554
|
+
times?: number | undefined;
|
|
1555
|
+
drop_oldest?: number | undefined;
|
|
1556
|
+
drop_system?: boolean | undefined;
|
|
1557
|
+
}>, z.ZodObject<{
|
|
1558
|
+
to_model: z.ZodString;
|
|
1559
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
1560
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
1561
|
+
host: z.ZodOptional<z.ZodString>;
|
|
1562
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1563
|
+
}, "strict", z.ZodTypeAny, {
|
|
1564
|
+
tool?: string | undefined;
|
|
1565
|
+
host?: string | undefined;
|
|
1566
|
+
model?: string | undefined;
|
|
1567
|
+
}, {
|
|
1568
|
+
tool?: string | undefined;
|
|
1569
|
+
host?: string | undefined;
|
|
1570
|
+
model?: string | undefined;
|
|
1571
|
+
}>>;
|
|
1572
|
+
/** Skip this many matching calls before the first injection. */
|
|
1573
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
1574
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
1575
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
1576
|
+
id: z.ZodLiteral<"llm.model_degrade">;
|
|
1577
|
+
}, "strict", z.ZodTypeAny, {
|
|
1578
|
+
id: "llm.model_degrade";
|
|
1579
|
+
after_calls: number;
|
|
1580
|
+
to_model: string;
|
|
1581
|
+
match?: {
|
|
1582
|
+
tool?: string | undefined;
|
|
1583
|
+
host?: string | undefined;
|
|
1584
|
+
model?: string | undefined;
|
|
1585
|
+
} | undefined;
|
|
1586
|
+
times?: number | undefined;
|
|
1587
|
+
}, {
|
|
1588
|
+
id: "llm.model_degrade";
|
|
1589
|
+
to_model: string;
|
|
1590
|
+
match?: {
|
|
1591
|
+
tool?: string | undefined;
|
|
1592
|
+
host?: string | undefined;
|
|
1593
|
+
model?: string | undefined;
|
|
1594
|
+
} | undefined;
|
|
1595
|
+
after_calls?: number | undefined;
|
|
1596
|
+
times?: number | undefined;
|
|
1597
|
+
}>, z.ZodObject<{
|
|
1598
|
+
message: z.ZodDefault<z.ZodString>;
|
|
1599
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
1600
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
1601
|
+
host: z.ZodOptional<z.ZodString>;
|
|
1602
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1603
|
+
}, "strict", z.ZodTypeAny, {
|
|
1604
|
+
tool?: string | undefined;
|
|
1605
|
+
host?: string | undefined;
|
|
1606
|
+
model?: string | undefined;
|
|
1607
|
+
}, {
|
|
1608
|
+
tool?: string | undefined;
|
|
1609
|
+
host?: string | undefined;
|
|
1610
|
+
model?: string | undefined;
|
|
1611
|
+
}>>;
|
|
1612
|
+
/** Skip this many matching calls before the first injection. */
|
|
1613
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
1614
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
1615
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
1616
|
+
id: z.ZodLiteral<"tool.error">;
|
|
1617
|
+
}, "strict", z.ZodTypeAny, {
|
|
1618
|
+
message: string;
|
|
1619
|
+
id: "tool.error";
|
|
1620
|
+
after_calls: number;
|
|
1621
|
+
match?: {
|
|
1622
|
+
tool?: string | undefined;
|
|
1623
|
+
host?: string | undefined;
|
|
1624
|
+
model?: string | undefined;
|
|
1625
|
+
} | undefined;
|
|
1626
|
+
times?: number | undefined;
|
|
1627
|
+
}, {
|
|
1628
|
+
id: "tool.error";
|
|
1629
|
+
message?: string | undefined;
|
|
1630
|
+
match?: {
|
|
1631
|
+
tool?: string | undefined;
|
|
1632
|
+
host?: string | undefined;
|
|
1633
|
+
model?: string | undefined;
|
|
1634
|
+
} | undefined;
|
|
1635
|
+
after_calls?: number | undefined;
|
|
1636
|
+
times?: number | undefined;
|
|
1637
|
+
}>, z.ZodObject<{
|
|
1638
|
+
result: z.ZodString;
|
|
1639
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
1640
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
1641
|
+
host: z.ZodOptional<z.ZodString>;
|
|
1642
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1643
|
+
}, "strict", z.ZodTypeAny, {
|
|
1644
|
+
tool?: string | undefined;
|
|
1645
|
+
host?: string | undefined;
|
|
1646
|
+
model?: string | undefined;
|
|
1647
|
+
}, {
|
|
1648
|
+
tool?: string | undefined;
|
|
1649
|
+
host?: string | undefined;
|
|
1650
|
+
model?: string | undefined;
|
|
1651
|
+
}>>;
|
|
1652
|
+
/** Skip this many matching calls before the first injection. */
|
|
1653
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
1654
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
1655
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
1656
|
+
id: z.ZodLiteral<"tool.stale_data">;
|
|
1657
|
+
}, "strict", z.ZodTypeAny, {
|
|
1658
|
+
id: "tool.stale_data";
|
|
1659
|
+
after_calls: number;
|
|
1660
|
+
result: string;
|
|
1661
|
+
match?: {
|
|
1662
|
+
tool?: string | undefined;
|
|
1663
|
+
host?: string | undefined;
|
|
1664
|
+
model?: string | undefined;
|
|
1665
|
+
} | undefined;
|
|
1666
|
+
times?: number | undefined;
|
|
1667
|
+
}, {
|
|
1668
|
+
id: "tool.stale_data";
|
|
1669
|
+
result: string;
|
|
1670
|
+
match?: {
|
|
1671
|
+
tool?: string | undefined;
|
|
1672
|
+
host?: string | undefined;
|
|
1673
|
+
model?: string | undefined;
|
|
1674
|
+
} | undefined;
|
|
1675
|
+
after_calls?: number | undefined;
|
|
1676
|
+
times?: number | undefined;
|
|
1677
|
+
}>, z.ZodObject<{
|
|
1678
|
+
remove: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1679
|
+
/** Tool name → the description it is redefined with. */
|
|
1680
|
+
redefine: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1681
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
1682
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
1683
|
+
host: z.ZodOptional<z.ZodString>;
|
|
1684
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1685
|
+
}, "strict", z.ZodTypeAny, {
|
|
1686
|
+
tool?: string | undefined;
|
|
1687
|
+
host?: string | undefined;
|
|
1688
|
+
model?: string | undefined;
|
|
1689
|
+
}, {
|
|
1690
|
+
tool?: string | undefined;
|
|
1691
|
+
host?: string | undefined;
|
|
1692
|
+
model?: string | undefined;
|
|
1693
|
+
}>>;
|
|
1694
|
+
/** Skip this many matching calls before the first injection. */
|
|
1695
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
1696
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
1697
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
1698
|
+
id: z.ZodLiteral<"mcp.toolset_change">;
|
|
1699
|
+
}, "strict", z.ZodTypeAny, {
|
|
1700
|
+
id: "mcp.toolset_change";
|
|
1701
|
+
after_calls: number;
|
|
1702
|
+
remove: string[];
|
|
1703
|
+
redefine: Record<string, string>;
|
|
1704
|
+
match?: {
|
|
1705
|
+
tool?: string | undefined;
|
|
1706
|
+
host?: string | undefined;
|
|
1707
|
+
model?: string | undefined;
|
|
1708
|
+
} | undefined;
|
|
1709
|
+
times?: number | undefined;
|
|
1710
|
+
}, {
|
|
1711
|
+
id: "mcp.toolset_change";
|
|
1712
|
+
match?: {
|
|
1713
|
+
tool?: string | undefined;
|
|
1714
|
+
host?: string | undefined;
|
|
1715
|
+
model?: string | undefined;
|
|
1716
|
+
} | undefined;
|
|
1717
|
+
after_calls?: number | undefined;
|
|
1718
|
+
times?: number | undefined;
|
|
1719
|
+
remove?: string[] | undefined;
|
|
1720
|
+
redefine?: Record<string, string> | undefined;
|
|
1721
|
+
}>, z.ZodObject<{
|
|
1722
|
+
mode: z.ZodDefault<z.ZodEnum<["deny", "delay", "hold_then_deny"]>>;
|
|
1723
|
+
/**
|
|
1724
|
+
* `delay` and `hold_then_deny`: how long a held call stays held. The
|
|
1725
|
+
* call is refused as held, the way an approval hold refuses it, and so
|
|
1726
|
+
* is its identical retry until this many seconds have passed since the
|
|
1727
|
+
* first refusal; then the retry is allowed (`delay`) or denied
|
|
1728
|
+
* (`hold_then_deny`). Nothing waits: 0 holds the call once and allows
|
|
1729
|
+
* (or denies) the first retry.
|
|
1730
|
+
*/
|
|
1731
|
+
delay_s: z.ZodDefault<z.ZodNumber>;
|
|
1732
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
1733
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
1734
|
+
host: z.ZodOptional<z.ZodString>;
|
|
1735
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1736
|
+
}, "strict", z.ZodTypeAny, {
|
|
1737
|
+
tool?: string | undefined;
|
|
1738
|
+
host?: string | undefined;
|
|
1739
|
+
model?: string | undefined;
|
|
1740
|
+
}, {
|
|
1741
|
+
tool?: string | undefined;
|
|
1742
|
+
host?: string | undefined;
|
|
1743
|
+
model?: string | undefined;
|
|
1744
|
+
}>>;
|
|
1745
|
+
/** Skip this many matching calls before the first injection. */
|
|
1746
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
1747
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
1748
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
1749
|
+
id: z.ZodLiteral<"permission.deny_or_delay">;
|
|
1750
|
+
}, "strict", z.ZodTypeAny, {
|
|
1751
|
+
id: "permission.deny_or_delay";
|
|
1752
|
+
after_calls: number;
|
|
1753
|
+
mode: "deny" | "delay" | "hold_then_deny";
|
|
1754
|
+
delay_s: number;
|
|
1755
|
+
match?: {
|
|
1756
|
+
tool?: string | undefined;
|
|
1757
|
+
host?: string | undefined;
|
|
1758
|
+
model?: string | undefined;
|
|
1759
|
+
} | undefined;
|
|
1760
|
+
times?: number | undefined;
|
|
1761
|
+
}, {
|
|
1762
|
+
id: "permission.deny_or_delay";
|
|
1763
|
+
match?: {
|
|
1764
|
+
tool?: string | undefined;
|
|
1765
|
+
host?: string | undefined;
|
|
1766
|
+
model?: string | undefined;
|
|
1767
|
+
} | undefined;
|
|
1768
|
+
after_calls?: number | undefined;
|
|
1769
|
+
times?: number | undefined;
|
|
1770
|
+
mode?: "deny" | "delay" | "hold_then_deny" | undefined;
|
|
1771
|
+
delay_s?: number | undefined;
|
|
1772
|
+
}>, z.ZodObject<{
|
|
1773
|
+
payload: z.ZodString;
|
|
1774
|
+
match: z.ZodOptional<z.ZodObject<{
|
|
1775
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
1776
|
+
host: z.ZodOptional<z.ZodString>;
|
|
1777
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1778
|
+
}, "strict", z.ZodTypeAny, {
|
|
1779
|
+
tool?: string | undefined;
|
|
1780
|
+
host?: string | undefined;
|
|
1781
|
+
model?: string | undefined;
|
|
1782
|
+
}, {
|
|
1783
|
+
tool?: string | undefined;
|
|
1784
|
+
host?: string | undefined;
|
|
1785
|
+
model?: string | undefined;
|
|
1786
|
+
}>>;
|
|
1787
|
+
/** Skip this many matching calls before the first injection. */
|
|
1788
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
1789
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
1790
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
1791
|
+
id: z.ZodLiteral<"inject.tool_result">;
|
|
1792
|
+
}, "strict", z.ZodTypeAny, {
|
|
1793
|
+
id: "inject.tool_result";
|
|
1794
|
+
after_calls: number;
|
|
1795
|
+
payload: string;
|
|
1796
|
+
match?: {
|
|
1797
|
+
tool?: string | undefined;
|
|
1798
|
+
host?: string | undefined;
|
|
1799
|
+
model?: string | undefined;
|
|
1800
|
+
} | undefined;
|
|
1801
|
+
times?: number | undefined;
|
|
1802
|
+
}, {
|
|
1803
|
+
id: "inject.tool_result";
|
|
1804
|
+
payload: string;
|
|
1805
|
+
match?: {
|
|
1806
|
+
tool?: string | undefined;
|
|
1807
|
+
host?: string | undefined;
|
|
1808
|
+
model?: string | undefined;
|
|
1809
|
+
} | undefined;
|
|
1810
|
+
after_calls?: number | undefined;
|
|
1811
|
+
times?: number | undefined;
|
|
1812
|
+
}>, z.ZodObject<{
|
|
1813
|
+
match: z.ZodObject<{
|
|
1814
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
1815
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1816
|
+
} & {
|
|
1817
|
+
host: z.ZodString;
|
|
1818
|
+
}, "strict", z.ZodTypeAny, {
|
|
1819
|
+
host: string;
|
|
1820
|
+
tool?: string | undefined;
|
|
1821
|
+
model?: string | undefined;
|
|
1822
|
+
}, {
|
|
1823
|
+
host: string;
|
|
1824
|
+
tool?: string | undefined;
|
|
1825
|
+
model?: string | undefined;
|
|
1826
|
+
}>;
|
|
1827
|
+
/** Skip this many matching calls before the first injection. */
|
|
1828
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
1829
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
1830
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
1831
|
+
id: z.ZodLiteral<"egress.dns_fail">;
|
|
1832
|
+
}, "strict", z.ZodTypeAny, {
|
|
1833
|
+
id: "egress.dns_fail";
|
|
1834
|
+
match: {
|
|
1835
|
+
host: string;
|
|
1836
|
+
tool?: string | undefined;
|
|
1837
|
+
model?: string | undefined;
|
|
1838
|
+
};
|
|
1839
|
+
after_calls: number;
|
|
1840
|
+
times?: number | undefined;
|
|
1841
|
+
}, {
|
|
1842
|
+
id: "egress.dns_fail";
|
|
1843
|
+
match: {
|
|
1844
|
+
host: string;
|
|
1845
|
+
tool?: string | undefined;
|
|
1846
|
+
model?: string | undefined;
|
|
1847
|
+
};
|
|
1848
|
+
after_calls?: number | undefined;
|
|
1849
|
+
times?: number | undefined;
|
|
1850
|
+
}>, z.ZodObject<{
|
|
1851
|
+
match: z.ZodObject<{
|
|
1852
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
1853
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1854
|
+
} & {
|
|
1855
|
+
host: z.ZodString;
|
|
1856
|
+
}, "strict", z.ZodTypeAny, {
|
|
1857
|
+
host: string;
|
|
1858
|
+
tool?: string | undefined;
|
|
1859
|
+
model?: string | undefined;
|
|
1860
|
+
}, {
|
|
1861
|
+
host: string;
|
|
1862
|
+
tool?: string | undefined;
|
|
1863
|
+
model?: string | undefined;
|
|
1864
|
+
}>;
|
|
1865
|
+
/** Skip this many matching calls before the first injection. */
|
|
1866
|
+
after_calls: z.ZodDefault<z.ZodNumber>;
|
|
1867
|
+
/** Inject at most this many times; absent means every matching call. */
|
|
1868
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
1869
|
+
id: z.ZodLiteral<"egress.credential_401">;
|
|
1870
|
+
}, "strict", z.ZodTypeAny, {
|
|
1871
|
+
id: "egress.credential_401";
|
|
1872
|
+
match: {
|
|
1873
|
+
host: string;
|
|
1874
|
+
tool?: string | undefined;
|
|
1875
|
+
model?: string | undefined;
|
|
1876
|
+
};
|
|
1877
|
+
after_calls: number;
|
|
1878
|
+
times?: number | undefined;
|
|
1879
|
+
}, {
|
|
1880
|
+
id: "egress.credential_401";
|
|
1881
|
+
match: {
|
|
1882
|
+
host: string;
|
|
1883
|
+
tool?: string | undefined;
|
|
1884
|
+
model?: string | undefined;
|
|
1885
|
+
};
|
|
1886
|
+
after_calls?: number | undefined;
|
|
1887
|
+
times?: number | undefined;
|
|
1888
|
+
}>]>, "many">;
|
|
1889
|
+
probes: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
1890
|
+
id: z.ZodEnum<["task_success", "no_destructive_attempt", "failure_surfaced", "no_policy_hits", "cost_multiplier_below", "recovered_within"]>;
|
|
1891
|
+
weight: z.ZodNumber;
|
|
1892
|
+
/** Threshold for `cost_multiplier_below` (a ratio) and `recovered_within` (calls). */
|
|
1893
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
1894
|
+
}, "strict", z.ZodTypeAny, {
|
|
1895
|
+
id: "task_success" | "no_destructive_attempt" | "failure_surfaced" | "no_policy_hits" | "cost_multiplier_below" | "recovered_within";
|
|
1896
|
+
weight: number;
|
|
1897
|
+
value?: number | undefined;
|
|
1898
|
+
}, {
|
|
1899
|
+
id: "task_success" | "no_destructive_attempt" | "failure_surfaced" | "no_policy_hits" | "cost_multiplier_below" | "recovered_within";
|
|
1900
|
+
weight: number;
|
|
1901
|
+
value?: number | undefined;
|
|
1902
|
+
}>, {
|
|
1903
|
+
id: "task_success" | "no_destructive_attempt" | "failure_surfaced" | "no_policy_hits" | "cost_multiplier_below" | "recovered_within";
|
|
1904
|
+
weight: number;
|
|
1905
|
+
value?: number | undefined;
|
|
1906
|
+
}, {
|
|
1907
|
+
id: "task_success" | "no_destructive_attempt" | "failure_surfaced" | "no_policy_hits" | "cost_multiplier_below" | "recovered_within";
|
|
1908
|
+
weight: number;
|
|
1909
|
+
value?: number | undefined;
|
|
1910
|
+
}>, "many">;
|
|
1911
|
+
/** A cost ceiling is mandatory: every run spends real tokens. */
|
|
1912
|
+
abort: z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"destructive_attempt">, z.ZodObject<{
|
|
1913
|
+
cost_usd_above: z.ZodNumber;
|
|
1914
|
+
}, "strict", z.ZodTypeAny, {
|
|
1915
|
+
cost_usd_above: number;
|
|
1916
|
+
}, {
|
|
1917
|
+
cost_usd_above: number;
|
|
1918
|
+
}>, z.ZodObject<{
|
|
1919
|
+
wall_clock_s_above: z.ZodNumber;
|
|
1920
|
+
}, "strict", z.ZodTypeAny, {
|
|
1921
|
+
wall_clock_s_above: number;
|
|
1922
|
+
}, {
|
|
1923
|
+
wall_clock_s_above: number;
|
|
1924
|
+
}>]>, "many">, ("destructive_attempt" | {
|
|
1925
|
+
cost_usd_above: number;
|
|
1926
|
+
} | {
|
|
1927
|
+
wall_clock_s_above: number;
|
|
1928
|
+
})[], ("destructive_attempt" | {
|
|
1929
|
+
cost_usd_above: number;
|
|
1930
|
+
} | {
|
|
1931
|
+
wall_clock_s_above: number;
|
|
1932
|
+
})[]>;
|
|
1933
|
+
sandbox_image: z.ZodOptional<z.ZodString>;
|
|
1934
|
+
}, "strict", z.ZodTypeAny, {
|
|
1935
|
+
name: string;
|
|
1936
|
+
faults: ({
|
|
1937
|
+
id: "llm.rate_limit";
|
|
1938
|
+
retry_after_s: number;
|
|
1939
|
+
after_calls: number;
|
|
1940
|
+
match?: {
|
|
1941
|
+
tool?: string | undefined;
|
|
1942
|
+
host?: string | undefined;
|
|
1943
|
+
model?: string | undefined;
|
|
1944
|
+
} | undefined;
|
|
1945
|
+
times?: number | undefined;
|
|
1946
|
+
} | {
|
|
1947
|
+
status: 500 | 502 | 503 | 529;
|
|
1948
|
+
id: "llm.upstream_5xx";
|
|
1949
|
+
after_calls: number;
|
|
1950
|
+
match?: {
|
|
1951
|
+
tool?: string | undefined;
|
|
1952
|
+
host?: string | undefined;
|
|
1953
|
+
model?: string | undefined;
|
|
1954
|
+
} | undefined;
|
|
1955
|
+
times?: number | undefined;
|
|
1956
|
+
stream_cut_after_chunks?: number | undefined;
|
|
1957
|
+
} | {
|
|
1958
|
+
id: "llm.context_trim";
|
|
1959
|
+
after_calls: number;
|
|
1960
|
+
drop_oldest: number;
|
|
1961
|
+
drop_system: boolean;
|
|
1962
|
+
match?: {
|
|
1963
|
+
tool?: string | undefined;
|
|
1964
|
+
host?: string | undefined;
|
|
1965
|
+
model?: string | undefined;
|
|
1966
|
+
} | undefined;
|
|
1967
|
+
times?: number | undefined;
|
|
1968
|
+
} | {
|
|
1969
|
+
id: "llm.model_degrade";
|
|
1970
|
+
after_calls: number;
|
|
1971
|
+
to_model: string;
|
|
1972
|
+
match?: {
|
|
1973
|
+
tool?: string | undefined;
|
|
1974
|
+
host?: string | undefined;
|
|
1975
|
+
model?: string | undefined;
|
|
1976
|
+
} | undefined;
|
|
1977
|
+
times?: number | undefined;
|
|
1978
|
+
} | {
|
|
1979
|
+
message: string;
|
|
1980
|
+
id: "tool.error";
|
|
1981
|
+
after_calls: number;
|
|
1982
|
+
match?: {
|
|
1983
|
+
tool?: string | undefined;
|
|
1984
|
+
host?: string | undefined;
|
|
1985
|
+
model?: string | undefined;
|
|
1986
|
+
} | undefined;
|
|
1987
|
+
times?: number | undefined;
|
|
1988
|
+
} | {
|
|
1989
|
+
id: "tool.stale_data";
|
|
1990
|
+
after_calls: number;
|
|
1991
|
+
result: string;
|
|
1992
|
+
match?: {
|
|
1993
|
+
tool?: string | undefined;
|
|
1994
|
+
host?: string | undefined;
|
|
1995
|
+
model?: string | undefined;
|
|
1996
|
+
} | undefined;
|
|
1997
|
+
times?: number | undefined;
|
|
1998
|
+
} | {
|
|
1999
|
+
id: "mcp.toolset_change";
|
|
2000
|
+
after_calls: number;
|
|
2001
|
+
remove: string[];
|
|
2002
|
+
redefine: Record<string, string>;
|
|
2003
|
+
match?: {
|
|
2004
|
+
tool?: string | undefined;
|
|
2005
|
+
host?: string | undefined;
|
|
2006
|
+
model?: string | undefined;
|
|
2007
|
+
} | undefined;
|
|
2008
|
+
times?: number | undefined;
|
|
2009
|
+
} | {
|
|
2010
|
+
id: "permission.deny_or_delay";
|
|
2011
|
+
after_calls: number;
|
|
2012
|
+
mode: "deny" | "delay" | "hold_then_deny";
|
|
2013
|
+
delay_s: number;
|
|
2014
|
+
match?: {
|
|
2015
|
+
tool?: string | undefined;
|
|
2016
|
+
host?: string | undefined;
|
|
2017
|
+
model?: string | undefined;
|
|
2018
|
+
} | undefined;
|
|
2019
|
+
times?: number | undefined;
|
|
2020
|
+
} | {
|
|
2021
|
+
id: "inject.tool_result";
|
|
2022
|
+
after_calls: number;
|
|
2023
|
+
payload: string;
|
|
2024
|
+
match?: {
|
|
2025
|
+
tool?: string | undefined;
|
|
2026
|
+
host?: string | undefined;
|
|
2027
|
+
model?: string | undefined;
|
|
2028
|
+
} | undefined;
|
|
2029
|
+
times?: number | undefined;
|
|
2030
|
+
} | {
|
|
2031
|
+
id: "egress.dns_fail";
|
|
2032
|
+
match: {
|
|
2033
|
+
host: string;
|
|
2034
|
+
tool?: string | undefined;
|
|
2035
|
+
model?: string | undefined;
|
|
2036
|
+
};
|
|
2037
|
+
after_calls: number;
|
|
2038
|
+
times?: number | undefined;
|
|
2039
|
+
} | {
|
|
2040
|
+
id: "egress.credential_401";
|
|
2041
|
+
match: {
|
|
2042
|
+
host: string;
|
|
2043
|
+
tool?: string | undefined;
|
|
2044
|
+
model?: string | undefined;
|
|
2045
|
+
};
|
|
2046
|
+
after_calls: number;
|
|
2047
|
+
times?: number | undefined;
|
|
2048
|
+
})[];
|
|
2049
|
+
abort: ("destructive_attempt" | {
|
|
2050
|
+
cost_usd_above: number;
|
|
2051
|
+
} | {
|
|
2052
|
+
wall_clock_s_above: number;
|
|
2053
|
+
})[];
|
|
2054
|
+
agent: string;
|
|
2055
|
+
verify: string;
|
|
2056
|
+
repeat: number;
|
|
2057
|
+
probes: {
|
|
2058
|
+
id: "task_success" | "no_destructive_attempt" | "failure_surfaced" | "no_policy_hits" | "cost_multiplier_below" | "recovered_within";
|
|
2059
|
+
weight: number;
|
|
2060
|
+
value?: number | undefined;
|
|
2061
|
+
}[];
|
|
2062
|
+
description?: string | undefined;
|
|
2063
|
+
sandbox_image?: string | undefined;
|
|
2064
|
+
}, {
|
|
2065
|
+
name: string;
|
|
2066
|
+
faults: ({
|
|
2067
|
+
id: "llm.rate_limit";
|
|
2068
|
+
retry_after_s?: number | undefined;
|
|
2069
|
+
match?: {
|
|
2070
|
+
tool?: string | undefined;
|
|
2071
|
+
host?: string | undefined;
|
|
2072
|
+
model?: string | undefined;
|
|
2073
|
+
} | undefined;
|
|
2074
|
+
after_calls?: number | undefined;
|
|
2075
|
+
times?: number | undefined;
|
|
2076
|
+
} | {
|
|
2077
|
+
id: "llm.upstream_5xx";
|
|
2078
|
+
status?: 500 | 502 | 503 | 529 | undefined;
|
|
2079
|
+
match?: {
|
|
2080
|
+
tool?: string | undefined;
|
|
2081
|
+
host?: string | undefined;
|
|
2082
|
+
model?: string | undefined;
|
|
2083
|
+
} | undefined;
|
|
2084
|
+
after_calls?: number | undefined;
|
|
2085
|
+
times?: number | undefined;
|
|
2086
|
+
stream_cut_after_chunks?: number | undefined;
|
|
2087
|
+
} | {
|
|
2088
|
+
id: "llm.context_trim";
|
|
2089
|
+
match?: {
|
|
2090
|
+
tool?: string | undefined;
|
|
2091
|
+
host?: string | undefined;
|
|
2092
|
+
model?: string | undefined;
|
|
2093
|
+
} | undefined;
|
|
2094
|
+
after_calls?: number | undefined;
|
|
2095
|
+
times?: number | undefined;
|
|
2096
|
+
drop_oldest?: number | undefined;
|
|
2097
|
+
drop_system?: boolean | undefined;
|
|
2098
|
+
} | {
|
|
2099
|
+
id: "llm.model_degrade";
|
|
2100
|
+
to_model: string;
|
|
2101
|
+
match?: {
|
|
2102
|
+
tool?: string | undefined;
|
|
2103
|
+
host?: string | undefined;
|
|
2104
|
+
model?: string | undefined;
|
|
2105
|
+
} | undefined;
|
|
2106
|
+
after_calls?: number | undefined;
|
|
2107
|
+
times?: number | undefined;
|
|
2108
|
+
} | {
|
|
2109
|
+
id: "tool.error";
|
|
2110
|
+
message?: string | undefined;
|
|
2111
|
+
match?: {
|
|
2112
|
+
tool?: string | undefined;
|
|
2113
|
+
host?: string | undefined;
|
|
2114
|
+
model?: string | undefined;
|
|
2115
|
+
} | undefined;
|
|
2116
|
+
after_calls?: number | undefined;
|
|
2117
|
+
times?: number | undefined;
|
|
2118
|
+
} | {
|
|
2119
|
+
id: "tool.stale_data";
|
|
2120
|
+
result: string;
|
|
2121
|
+
match?: {
|
|
2122
|
+
tool?: string | undefined;
|
|
2123
|
+
host?: string | undefined;
|
|
2124
|
+
model?: string | undefined;
|
|
2125
|
+
} | undefined;
|
|
2126
|
+
after_calls?: number | undefined;
|
|
2127
|
+
times?: number | undefined;
|
|
2128
|
+
} | {
|
|
2129
|
+
id: "mcp.toolset_change";
|
|
2130
|
+
match?: {
|
|
2131
|
+
tool?: string | undefined;
|
|
2132
|
+
host?: string | undefined;
|
|
2133
|
+
model?: string | undefined;
|
|
2134
|
+
} | undefined;
|
|
2135
|
+
after_calls?: number | undefined;
|
|
2136
|
+
times?: number | undefined;
|
|
2137
|
+
remove?: string[] | undefined;
|
|
2138
|
+
redefine?: Record<string, string> | undefined;
|
|
2139
|
+
} | {
|
|
2140
|
+
id: "permission.deny_or_delay";
|
|
2141
|
+
match?: {
|
|
2142
|
+
tool?: string | undefined;
|
|
2143
|
+
host?: string | undefined;
|
|
2144
|
+
model?: string | undefined;
|
|
2145
|
+
} | undefined;
|
|
2146
|
+
after_calls?: number | undefined;
|
|
2147
|
+
times?: number | undefined;
|
|
2148
|
+
mode?: "deny" | "delay" | "hold_then_deny" | undefined;
|
|
2149
|
+
delay_s?: number | undefined;
|
|
2150
|
+
} | {
|
|
2151
|
+
id: "inject.tool_result";
|
|
2152
|
+
payload: string;
|
|
2153
|
+
match?: {
|
|
2154
|
+
tool?: string | undefined;
|
|
2155
|
+
host?: string | undefined;
|
|
2156
|
+
model?: string | undefined;
|
|
2157
|
+
} | undefined;
|
|
2158
|
+
after_calls?: number | undefined;
|
|
2159
|
+
times?: number | undefined;
|
|
2160
|
+
} | {
|
|
2161
|
+
id: "egress.dns_fail";
|
|
2162
|
+
match: {
|
|
2163
|
+
host: string;
|
|
2164
|
+
tool?: string | undefined;
|
|
2165
|
+
model?: string | undefined;
|
|
2166
|
+
};
|
|
2167
|
+
after_calls?: number | undefined;
|
|
2168
|
+
times?: number | undefined;
|
|
2169
|
+
} | {
|
|
2170
|
+
id: "egress.credential_401";
|
|
2171
|
+
match: {
|
|
2172
|
+
host: string;
|
|
2173
|
+
tool?: string | undefined;
|
|
2174
|
+
model?: string | undefined;
|
|
2175
|
+
};
|
|
2176
|
+
after_calls?: number | undefined;
|
|
2177
|
+
times?: number | undefined;
|
|
2178
|
+
})[];
|
|
2179
|
+
abort: ("destructive_attempt" | {
|
|
2180
|
+
cost_usd_above: number;
|
|
2181
|
+
} | {
|
|
2182
|
+
wall_clock_s_above: number;
|
|
2183
|
+
})[];
|
|
2184
|
+
agent: string;
|
|
2185
|
+
verify: string;
|
|
2186
|
+
probes: {
|
|
2187
|
+
id: "task_success" | "no_destructive_attempt" | "failure_surfaced" | "no_policy_hits" | "cost_multiplier_below" | "recovered_within";
|
|
2188
|
+
weight: number;
|
|
2189
|
+
value?: number | undefined;
|
|
2190
|
+
}[];
|
|
2191
|
+
description?: string | undefined;
|
|
2192
|
+
repeat?: number | undefined;
|
|
2193
|
+
sandbox_image?: string | undefined;
|
|
2194
|
+
}>;
|
|
2195
|
+
export type Experiment = z.infer<typeof ExperimentSchema>;
|
|
2196
|
+
/** One probe's outcome across a run's faulted repetitions. */
|
|
2197
|
+
export interface ProbeOutcome {
|
|
2198
|
+
id: ProbeId;
|
|
2199
|
+
weight: number;
|
|
2200
|
+
/** Repetitions that passed ÷ repetitions evaluated, 0–1. */
|
|
2201
|
+
passRate: number;
|
|
2202
|
+
evaluated: number;
|
|
2203
|
+
}
|
|
2204
|
+
export type RunVerdict = {
|
|
2205
|
+
kind: 'scored';
|
|
2206
|
+
score: number;
|
|
2207
|
+
probes: ProbeOutcome[];
|
|
2208
|
+
}
|
|
2209
|
+
/** The baseline failed `task_success`: the task is broken, not the agent. */
|
|
2210
|
+
| {
|
|
2211
|
+
kind: 'invalid';
|
|
2212
|
+
reason: string;
|
|
2213
|
+
} | {
|
|
2214
|
+
kind: 'aborted';
|
|
2215
|
+
reason: string;
|
|
2216
|
+
score: number;
|
|
2217
|
+
probes: ProbeOutcome[];
|
|
2218
|
+
};
|
|
2219
|
+
/**
|
|
2220
|
+
* The resilience score: Σ(weight × pass rate) ÷ Σ(weight) × 100, rounded to
|
|
2221
|
+
* one decimal. Probes that evaluated no repetition are left out of both sums.
|
|
2222
|
+
*/
|
|
2223
|
+
export declare function resilienceScore(probes: readonly ProbeOutcome[]): number;
|
|
2224
|
+
export {};
|
|
2225
|
+
//# sourceMappingURL=chaos.d.ts.map
|