@agent-inspect/eval 2.4.0 → 2.6.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/dist/index.d.ts CHANGED
@@ -1,5 +1,89 @@
1
1
  import { TraceReadResult } from 'agent-inspect/readers';
2
2
 
3
+ type CircuitRuleId = "circuit.same-tool-repetition" | "circuit.same-args-repetition" | "circuit.max-loop-iterations" | "circuit.max-retries" | "circuit.tool-timeout" | "circuit.runaway-llm-loop" | "circuit.excessive-branch-width";
4
+ interface ThresholdRule {
5
+ maxRepeats: number;
6
+ }
7
+ interface MaxIterationsRule {
8
+ maxIterations: number;
9
+ }
10
+ interface MaxRetriesRule {
11
+ maxRetries: number;
12
+ }
13
+ interface ToolTimeoutRule {
14
+ maxDurationMs: number;
15
+ }
16
+ interface RunawayLlmLoopRule {
17
+ maxLlmCalls: number;
18
+ }
19
+ interface ExcessiveBranchWidthRule {
20
+ maxWidth: number;
21
+ }
22
+ interface RunCircuitsOptions {
23
+ rules?: readonly CircuitRuleId[];
24
+ sameToolRepetition?: ThresholdRule;
25
+ sameArgsRepetition?: ThresholdRule;
26
+ maxLoopIterations?: MaxIterationsRule;
27
+ maxRetries?: MaxRetriesRule;
28
+ toolTimeout?: ToolTimeoutRule;
29
+ runawayLlmLoop?: RunawayLlmLoopRule;
30
+ excessiveBranchWidth?: ExcessiveBranchWidthRule;
31
+ }
32
+
33
+ type GuardrailRuleId = "guardrail.banned-phrase" | "guardrail.pii-leak" | "guardrail.unsafe-tool-args" | "guardrail.prompt-injection" | "guardrail.structured-output" | "guardrail.oversize-output" | "guardrail.required-json-shape";
34
+ interface BannedPhraseOptions {
35
+ phrases: readonly string[];
36
+ caseInsensitive?: boolean;
37
+ }
38
+ interface PiiLeakOptions {
39
+ profile?: "local" | "share" | "strict";
40
+ minSeverity?: "info" | "warning" | "error";
41
+ }
42
+ interface UnsafeToolArgsOptions {
43
+ blockedTools?: readonly string[];
44
+ maxDepth?: number;
45
+ maxStringLength?: number;
46
+ }
47
+ interface PromptInjectionOptions {
48
+ patterns?: readonly string[];
49
+ }
50
+ interface JsonSchemaField {
51
+ type?: "string" | "number" | "boolean" | "object" | "array";
52
+ enum?: readonly unknown[];
53
+ required?: readonly string[];
54
+ }
55
+ interface StructuredOutputOptions {
56
+ schema: Record<string, JsonSchemaField>;
57
+ }
58
+ interface OversizeOutputOptions {
59
+ maxLength?: number;
60
+ maxSerializedLength?: number;
61
+ }
62
+ interface RequiredJsonShapeOptions {
63
+ requiredKeys: readonly string[];
64
+ }
65
+ interface GuardrailRuleOptions {
66
+ bannedPhrase?: BannedPhraseOptions;
67
+ piiLeak?: PiiLeakOptions;
68
+ unsafeToolArgs?: UnsafeToolArgsOptions;
69
+ promptInjection?: PromptInjectionOptions;
70
+ structuredOutput?: StructuredOutputOptions;
71
+ oversizeOutput?: OversizeOutputOptions;
72
+ requiredJsonShape?: RequiredJsonShapeOptions;
73
+ }
74
+ interface RunGuardrailsOptions extends GuardrailRuleOptions {
75
+ rules?: readonly GuardrailRuleId[];
76
+ }
77
+
78
+ interface EvalGuardrailRuleOptions extends RunGuardrailsOptions {
79
+ rules: readonly GuardrailRuleId[];
80
+ }
81
+ interface EvalCircuitRuleOptions extends RunCircuitsOptions {
82
+ rules: readonly CircuitRuleId[];
83
+ }
84
+ declare function createEvalGuardrailRule(options: EvalGuardrailRuleOptions): EvalRule;
85
+ declare function createEvalCircuitRule(options: EvalCircuitRuleOptions): EvalRule;
86
+
3
87
  type EvalStatus = "pass" | "fail" | "error";
4
88
  type EvalSeverity = "error" | "warning" | "info";
5
89
  type EvalFindingStatus = "pass" | "fail" | "warning";
@@ -126,4 +210,4 @@ declare const checks: {
126
210
  };
127
211
  declare function renderEvalMarkdown(result: EvalRunResult): string;
128
212
 
129
- export { type AnswerLengthBoundsOptions, type BannedUnsupportedPhrasesOptions, type CitationPresenceOptions, type ContextOverlapOptions, type EvalContext, type EvalDiagnostic, type EvalDiagnosticCode, type EvalEvidence, type EvalFinding, type EvalFindingStatus, type EvalInput, type EvalRule, type EvalRuleCategory, type EvalRunInput, type EvalRunOptions, type EvalRunResult, type EvalSeverity, type EvalStatus, type EvalSummary, type QuoteOverlapOptions, type RequiredSourceIdsOptions, checks, evalRun, renderEvalMarkdown };
213
+ export { type AnswerLengthBoundsOptions, type BannedUnsupportedPhrasesOptions, type CitationPresenceOptions, type ContextOverlapOptions, type EvalCircuitRuleOptions, type EvalContext, type EvalDiagnostic, type EvalDiagnosticCode, type EvalEvidence, type EvalFinding, type EvalFindingStatus, type EvalGuardrailRuleOptions, type EvalInput, type EvalRule, type EvalRuleCategory, type EvalRunInput, type EvalRunOptions, type EvalRunResult, type EvalSeverity, type EvalStatus, type EvalSummary, type QuoteOverlapOptions, type RequiredSourceIdsOptions, checks, createEvalCircuitRule, createEvalGuardrailRule, evalRun, renderEvalMarkdown };