@aws-cdk/aws-bedrock-agentcore-alpha 2.252.0-alpha.0 → 2.253.0-alpha.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.
Files changed (61) hide show
  1. package/.jsii +11191 -7249
  2. package/.jsii.tabl.json.gz +0 -0
  3. package/.warnings.jsii.js +30 -0
  4. package/README.md +422 -0
  5. package/lib/evaluation/custom-evaluator.d.ts +153 -0
  6. package/lib/evaluation/custom-evaluator.js +256 -0
  7. package/lib/evaluation/data-source.d.ts +106 -0
  8. package/lib/evaluation/data-source.js +156 -0
  9. package/lib/evaluation/evaluator-base.d.ts +82 -0
  10. package/lib/evaluation/evaluator-base.js +55 -0
  11. package/lib/evaluation/evaluator-config.d.ts +195 -0
  12. package/lib/evaluation/evaluator-config.js +184 -0
  13. package/lib/evaluation/evaluator.d.ts +68 -0
  14. package/lib/evaluation/evaluator.js +90 -0
  15. package/lib/evaluation/online-evaluation-base.d.ts +96 -0
  16. package/lib/evaluation/online-evaluation-base.js +55 -0
  17. package/lib/evaluation/online-evaluation.d.ts +134 -0
  18. package/lib/evaluation/online-evaluation.js +388 -0
  19. package/lib/evaluation/perms.d.ts +34 -0
  20. package/lib/evaluation/perms.js +53 -0
  21. package/lib/evaluation/types.d.ts +461 -0
  22. package/lib/evaluation/types.js +229 -0
  23. package/lib/evaluation/validation-helpers.d.ts +133 -0
  24. package/lib/evaluation/validation-helpers.js +349 -0
  25. package/lib/gateway/gateway-base.js +1 -1
  26. package/lib/gateway/gateway.js +2 -2
  27. package/lib/gateway/inbound-auth/authorizer.js +4 -4
  28. package/lib/gateway/inbound-auth/custom-claim.js +1 -1
  29. package/lib/gateway/interceptor.js +1 -1
  30. package/lib/gateway/outbound-auth/api-key.js +1 -1
  31. package/lib/gateway/outbound-auth/credential-provider.js +1 -1
  32. package/lib/gateway/protocol.js +2 -2
  33. package/lib/gateway/targets/schema/api-schema.js +4 -4
  34. package/lib/gateway/targets/schema/tool-schema.js +4 -4
  35. package/lib/gateway/targets/target-base.js +1 -1
  36. package/lib/gateway/targets/target-configuration.js +6 -6
  37. package/lib/gateway/targets/target.js +1 -1
  38. package/lib/index.d.ts +9 -0
  39. package/lib/index.js +13 -1
  40. package/lib/memory/memory-strategy.js +1 -1
  41. package/lib/memory/memory.js +2 -2
  42. package/lib/memory/strategies/managed-strategy.js +1 -1
  43. package/lib/memory/strategies/self-managed-strategy.js +8 -5
  44. package/lib/network/network-configuration.js +4 -4
  45. package/lib/policy/policy-base.js +1 -1
  46. package/lib/policy/policy-engine-base.js +1 -1
  47. package/lib/policy/policy-engine.js +1 -1
  48. package/lib/policy/policy-statement.js +5 -5
  49. package/lib/policy/policy-types.js +1 -1
  50. package/lib/policy/policy.js +1 -1
  51. package/lib/runtime/inbound-auth/custom-claim.js +1 -1
  52. package/lib/runtime/inbound-auth/runtime-authorizer-configuration.js +1 -1
  53. package/lib/runtime/observability.js +2 -2
  54. package/lib/runtime/runtime-artifact.js +1 -1
  55. package/lib/runtime/runtime-base.js +1 -1
  56. package/lib/runtime/runtime-endpoint-base.js +1 -1
  57. package/lib/runtime/runtime-endpoint.js +1 -1
  58. package/lib/runtime/runtime.js +1 -1
  59. package/lib/tools/browser.js +2 -2
  60. package/lib/tools/code-interpreter.js +2 -2
  61. package/package.json +10 -9
@@ -0,0 +1,461 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
5
+ * with the License. A copy of the License is located at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
10
+ * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
11
+ * and limitations under the License.
12
+ */
13
+ import type { Duration } from 'aws-cdk-lib';
14
+ import type * as iam from 'aws-cdk-lib/aws-iam';
15
+ /**
16
+ * Built-in evaluators provided by Amazon Bedrock AgentCore.
17
+ *
18
+ * These evaluators assess different aspects of agent performance
19
+ * at various levels (session, trace, or tool call).
20
+ */
21
+ export declare class BuiltinEvaluator {
22
+ /**
23
+ * Evaluates whether the information in the agent's response is factually accurate.
24
+ */
25
+ static readonly CORRECTNESS: BuiltinEvaluator;
26
+ /**
27
+ * Evaluates whether information in the response is supported by provided context/sources.
28
+ */
29
+ static readonly FAITHFULNESS: BuiltinEvaluator;
30
+ /**
31
+ * Evaluates from user's perspective how useful and valuable the agent's response is.
32
+ */
33
+ static readonly HELPFULNESS: BuiltinEvaluator;
34
+ /**
35
+ * Evaluates whether the response appropriately addresses the user's query.
36
+ */
37
+ static readonly RESPONSE_RELEVANCE: BuiltinEvaluator;
38
+ /**
39
+ * Evaluates whether the response is appropriately brief without missing key information.
40
+ */
41
+ static readonly CONCISENESS: BuiltinEvaluator;
42
+ /**
43
+ * Evaluates whether the response is logically structured and coherent.
44
+ */
45
+ static readonly COHERENCE: BuiltinEvaluator;
46
+ /**
47
+ * Measures how well the agent follows the provided system instructions.
48
+ */
49
+ static readonly INSTRUCTION_FOLLOWING: BuiltinEvaluator;
50
+ /**
51
+ * Detects when agent evades questions or directly refuses to answer.
52
+ */
53
+ static readonly REFUSAL: BuiltinEvaluator;
54
+ /**
55
+ * Evaluates whether the conversation successfully meets the user's goals.
56
+ */
57
+ static readonly GOAL_SUCCESS_RATE: BuiltinEvaluator;
58
+ /**
59
+ * Evaluates whether the agent selected the appropriate tool for the task.
60
+ */
61
+ static readonly TOOL_SELECTION_ACCURACY: BuiltinEvaluator;
62
+ /**
63
+ * Evaluates how accurately the agent extracts parameters from user queries.
64
+ */
65
+ static readonly TOOL_PARAMETER_ACCURACY: BuiltinEvaluator;
66
+ /**
67
+ * Evaluates whether the response contains harmful content.
68
+ */
69
+ static readonly HARMFULNESS: BuiltinEvaluator;
70
+ /**
71
+ * Detects content that makes generalizations about individuals or groups.
72
+ */
73
+ static readonly STEREOTYPING: BuiltinEvaluator;
74
+ /**
75
+ * The string value of the built-in evaluator.
76
+ */
77
+ readonly value: string;
78
+ /**
79
+ * @param value - The evaluator identifier string
80
+ */
81
+ constructor(value: string);
82
+ }
83
+ /**
84
+ * The execution status of an online evaluation configuration.
85
+ */
86
+ export declare class ExecutionStatus {
87
+ /**
88
+ * The evaluation is enabled and actively processing agent traces.
89
+ */
90
+ static readonly ENABLED: ExecutionStatus;
91
+ /**
92
+ * The evaluation is disabled and not processing agent traces.
93
+ */
94
+ static readonly DISABLED: ExecutionStatus;
95
+ /**
96
+ * The string value of the execution status.
97
+ */
98
+ readonly value: string;
99
+ /**
100
+ * @param value - The execution status string
101
+ */
102
+ constructor(value: string);
103
+ }
104
+ /**
105
+ * Filter operators for online evaluation filtering.
106
+ */
107
+ export declare class FilterOperator {
108
+ /**
109
+ * Exact equality comparison.
110
+ */
111
+ static readonly EQUAL: FilterOperator;
112
+ /**
113
+ * Not equal comparison.
114
+ */
115
+ static readonly NOT_EQUAL: FilterOperator;
116
+ /**
117
+ * Greater than comparison (numeric values).
118
+ */
119
+ static readonly GREATER_THAN: FilterOperator;
120
+ /**
121
+ * Less than comparison (numeric values).
122
+ */
123
+ static readonly LESS_THAN: FilterOperator;
124
+ /**
125
+ * Greater than or equal comparison (numeric values).
126
+ */
127
+ static readonly GREATER_THAN_OR_EQUAL: FilterOperator;
128
+ /**
129
+ * Less than or equal comparison (numeric values).
130
+ */
131
+ static readonly LESS_THAN_OR_EQUAL: FilterOperator;
132
+ /**
133
+ * String contains comparison.
134
+ */
135
+ static readonly CONTAINS: FilterOperator;
136
+ /**
137
+ * String does not contain comparison.
138
+ */
139
+ static readonly NOT_CONTAINS: FilterOperator;
140
+ /**
141
+ * The string value of the filter operator.
142
+ */
143
+ readonly value: string;
144
+ /**
145
+ * @param value - The filter operator string
146
+ */
147
+ constructor(value: string);
148
+ }
149
+ /**
150
+ * A typed filter value for online evaluation filtering.
151
+ *
152
+ * Use the static factory methods to create filter values:
153
+ * - `FilterValue.string()` for string comparisons
154
+ * - `FilterValue.number()` for numeric comparisons
155
+ * - `FilterValue.boolean()` for boolean comparisons
156
+ */
157
+ export declare class FilterValue {
158
+ /**
159
+ * Creates a string filter value.
160
+ *
161
+ * @param value - The string value to compare against
162
+ */
163
+ static string(value: string): FilterValue;
164
+ /**
165
+ * Creates a numeric filter value.
166
+ *
167
+ * @param value - The numeric value to compare against
168
+ */
169
+ static number(value: number): FilterValue;
170
+ /**
171
+ * Creates a boolean filter value.
172
+ *
173
+ * @param value - The boolean value to compare against
174
+ */
175
+ static boolean(value: boolean): FilterValue;
176
+ private readonly filterValue;
177
+ private constructor();
178
+ /**
179
+ * Binds the filter value to produce the L1 property.
180
+ * @internal
181
+ */
182
+ _bind(): {
183
+ stringValue?: string;
184
+ doubleValue?: number;
185
+ booleanValue?: boolean;
186
+ };
187
+ }
188
+ /**
189
+ * Filter configuration for online evaluation.
190
+ *
191
+ * Filters determine which agent traces should be included in the evaluation
192
+ * based on trace properties.
193
+ */
194
+ export interface FilterConfig {
195
+ /**
196
+ * The key or field name to filter on within the agent trace data.
197
+ *
198
+ * @example 'user.region'
199
+ */
200
+ readonly key: string;
201
+ /**
202
+ * The comparison operator to use for filtering.
203
+ */
204
+ readonly operator: FilterOperator;
205
+ /**
206
+ * The value to compare against using the specified operator.
207
+ *
208
+ * Use `FilterValue.string()`, `FilterValue.number()`, or `FilterValue.boolean()`
209
+ * to create typed filter values.
210
+ */
211
+ readonly value: FilterValue;
212
+ }
213
+ /**
214
+ * Configuration for CloudWatch Logs data source.
215
+ */
216
+ export interface CloudWatchLogsDataSourceConfig {
217
+ /**
218
+ * The list of CloudWatch log group names to monitor for agent traces.
219
+ *
220
+ * @minimum 1
221
+ * @maximum 5
222
+ */
223
+ readonly logGroupNames: string[];
224
+ /**
225
+ * The list of service names to filter traces within the specified log groups.
226
+ * Used to identify relevant agent sessions.
227
+ *
228
+ * For agents hosted on AgentCore Runtime, service name follows the format:
229
+ * `<agent-runtime-name>.<agent-runtime-endpoint-name>`
230
+ *
231
+ * @minimum 1
232
+ * @maximum 1
233
+ */
234
+ readonly serviceNames: string[];
235
+ }
236
+ /**
237
+ * Base properties for creating an OnlineEvaluationConfig.
238
+ * The actual OnlineEvaluationProps is defined in online-evaluation-config.ts
239
+ * to avoid circular dependencies.
240
+ */
241
+ export interface OnlineEvaluationBaseProps {
242
+ /**
243
+ * The name of the online evaluation configuration.
244
+ *
245
+ * Must be unique within your account. Valid characters are a-z, A-Z, 0-9, _ (underscore).
246
+ * Must start with a letter and can be up to 48 characters long.
247
+ *
248
+ * @pattern ^[a-zA-Z][a-zA-Z0-9_]{0,47}$
249
+ */
250
+ readonly onlineEvaluationConfigName: string;
251
+ /**
252
+ * The IAM role that provides permissions for the evaluation to access AWS services.
253
+ *
254
+ * If not provided, a role will be created automatically with the required permissions
255
+ * including cross-region Bedrock model invocation (to support cross-region inference
256
+ * profiles). For strict cost controls or data residency compliance, provide a custom
257
+ * role with region-scoped permissions.
258
+ *
259
+ * @default - A new role will be created
260
+ */
261
+ readonly executionRole?: iam.IRole;
262
+ /**
263
+ * The description of the online evaluation configuration.
264
+ *
265
+ * @default - No description
266
+ * @maxLength 200
267
+ */
268
+ readonly description?: string;
269
+ /**
270
+ * The percentage of agent traces to sample for evaluation.
271
+ *
272
+ * @default 10
273
+ * @minimum 0.01
274
+ * @maximum 100
275
+ */
276
+ readonly samplingPercentage?: number;
277
+ /**
278
+ * The list of filters that determine which agent traces should be evaluated.
279
+ *
280
+ * @default - No filters (evaluate all sampled traces)
281
+ * @maximum 5
282
+ */
283
+ readonly filters?: FilterConfig[];
284
+ /**
285
+ * The duration of inactivity after which an agent session
286
+ * is considered complete and ready for evaluation.
287
+ *
288
+ * Must be between 1 minute and 1440 minutes (24 hours).
289
+ *
290
+ * @default Duration.minutes(15)
291
+ */
292
+ readonly sessionTimeout?: Duration;
293
+ /**
294
+ * The execution status of the online evaluation configuration.
295
+ *
296
+ * Controls whether the evaluation actively processes agent traces.
297
+ *
298
+ * @default ExecutionStatus.ENABLED
299
+ */
300
+ readonly executionStatus?: ExecutionStatus;
301
+ }
302
+ /**
303
+ * The result of binding an EvaluatorReference.
304
+ */
305
+ export interface EvaluatorReferenceBindResult {
306
+ /**
307
+ * The evaluator identifier.
308
+ */
309
+ readonly evaluatorId: string;
310
+ }
311
+ /**
312
+ * The result of binding a DataSourceConfig.
313
+ */
314
+ export interface DataSourceConfigBindResult {
315
+ /**
316
+ * The CloudWatch Logs data source configuration.
317
+ */
318
+ readonly cloudWatchLogs: CloudWatchLogsDataSourceConfig;
319
+ }
320
+ /**
321
+ * The level at which a custom evaluator assesses agent performance.
322
+ *
323
+ * Determines what granularity of data the evaluator operates on.
324
+ */
325
+ export declare class EvaluationLevel {
326
+ /**
327
+ * Evaluates individual tool call invocations within a trace.
328
+ */
329
+ static readonly TOOL_CALL: EvaluationLevel;
330
+ /**
331
+ * Evaluates a complete agent trace (a single request-response cycle).
332
+ */
333
+ static readonly TRACE: EvaluationLevel;
334
+ /**
335
+ * Evaluates an entire agent session (multiple traces across a conversation).
336
+ */
337
+ static readonly SESSION: EvaluationLevel;
338
+ /**
339
+ * The string value of the evaluation level.
340
+ */
341
+ readonly value: string;
342
+ /**
343
+ * @param value - The evaluation level string
344
+ */
345
+ constructor(value: string);
346
+ }
347
+ /**
348
+ * A categorical rating scale option for custom evaluators.
349
+ *
350
+ * Categorical scales define discrete labels for scoring agent performance.
351
+ */
352
+ export interface CategoricalRatingOption {
353
+ /**
354
+ * The label for this rating option.
355
+ *
356
+ * @example 'Good'
357
+ */
358
+ readonly label: string;
359
+ /**
360
+ * The description that explains what this rating represents.
361
+ *
362
+ * @example 'The response fully addresses the user query with accurate information.'
363
+ */
364
+ readonly definition: string;
365
+ }
366
+ /**
367
+ * A numerical rating scale option for custom evaluators.
368
+ *
369
+ * Numerical scales define labeled numeric values for scoring agent performance.
370
+ */
371
+ export interface NumericalRatingOption {
372
+ /**
373
+ * The label for this rating option.
374
+ *
375
+ * @example 'Excellent'
376
+ */
377
+ readonly label: string;
378
+ /**
379
+ * The description that explains what this numerical rating represents.
380
+ *
381
+ * @example 'The response is comprehensive, accurate, and well-structured.'
382
+ */
383
+ readonly definition: string;
384
+ /**
385
+ * The numerical value for this rating scale option.
386
+ *
387
+ * @example 5
388
+ */
389
+ readonly value: number;
390
+ }
391
+ /**
392
+ * Inference configuration for a custom LLM-as-a-Judge evaluator.
393
+ *
394
+ * Controls how the foundation model generates evaluation responses.
395
+ */
396
+ export interface EvaluatorInferenceConfig {
397
+ /**
398
+ * The maximum number of tokens to generate in the model response.
399
+ *
400
+ * @default - The foundation model's default maximum token limit is used
401
+ */
402
+ readonly maxTokens?: number;
403
+ /**
404
+ * The temperature value that controls randomness in the model's responses.
405
+ *
406
+ * Higher values produce more diverse outputs. Range: 0.0 to 1.0.
407
+ *
408
+ * @default - The foundation model's default temperature is used
409
+ */
410
+ readonly temperature?: number;
411
+ /**
412
+ * The top-p sampling parameter that controls the diversity of the model's responses.
413
+ *
414
+ * Range: 0.0 to 1.0.
415
+ *
416
+ * @default - The foundation model's default top-p value is used
417
+ */
418
+ readonly topP?: number;
419
+ }
420
+ /**
421
+ * Attributes for importing an existing Evaluator.
422
+ */
423
+ export interface EvaluatorAttributes {
424
+ /**
425
+ * The ARN of the evaluator.
426
+ */
427
+ readonly evaluatorArn: string;
428
+ /**
429
+ * The ID of the evaluator.
430
+ */
431
+ readonly evaluatorId: string;
432
+ /**
433
+ * The name of the evaluator.
434
+ *
435
+ * @default - No name available
436
+ */
437
+ readonly evaluatorName?: string;
438
+ }
439
+ /**
440
+ * Attributes for importing an existing OnlineEvaluationConfig.
441
+ */
442
+ export interface OnlineEvaluationConfigAttributes {
443
+ /**
444
+ * The ARN of the online evaluation configuration.
445
+ */
446
+ readonly onlineEvaluationConfigArn: string;
447
+ /**
448
+ * The ID of the online evaluation configuration.
449
+ */
450
+ readonly onlineEvaluationConfigId: string;
451
+ /**
452
+ * The name of the online evaluation configuration.
453
+ */
454
+ readonly onlineEvaluationConfigName: string;
455
+ /**
456
+ * The ARN of the IAM execution role.
457
+ *
458
+ * @default - No role ARN provided
459
+ */
460
+ readonly executionRoleArn?: string;
461
+ }