agentshield-sdk 7.0.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/CHANGELOG.md +191 -0
- package/LICENSE +21 -0
- package/README.md +975 -0
- package/bin/agent-shield.js +680 -0
- package/package.json +118 -0
- package/src/adaptive.js +330 -0
- package/src/agent-protocol.js +998 -0
- package/src/alert-tuning.js +480 -0
- package/src/allowlist.js +603 -0
- package/src/audit-immutable.js +914 -0
- package/src/audit-streaming.js +469 -0
- package/src/badges.js +196 -0
- package/src/behavior-profiling.js +289 -0
- package/src/benchmark-harness.js +804 -0
- package/src/canary.js +271 -0
- package/src/certification.js +563 -0
- package/src/circuit-breaker.js +321 -0
- package/src/compliance.js +617 -0
- package/src/confidence-tuning.js +324 -0
- package/src/confused-deputy.js +624 -0
- package/src/context-scoring.js +360 -0
- package/src/conversation.js +494 -0
- package/src/cost-optimizer.js +1024 -0
- package/src/ctf.js +462 -0
- package/src/detector-core.js +1999 -0
- package/src/distributed.js +359 -0
- package/src/document-scanner.js +795 -0
- package/src/embedding.js +307 -0
- package/src/encoding.js +429 -0
- package/src/enterprise.js +405 -0
- package/src/errors.js +100 -0
- package/src/eu-ai-act.js +523 -0
- package/src/fuzzer.js +764 -0
- package/src/honeypot.js +328 -0
- package/src/i18n-patterns.js +523 -0
- package/src/index.js +430 -0
- package/src/integrations.js +528 -0
- package/src/llm-redteam.js +670 -0
- package/src/main.js +741 -0
- package/src/main.mjs +38 -0
- package/src/mcp-bridge.js +542 -0
- package/src/mcp-certification.js +846 -0
- package/src/mcp-sdk-integration.js +355 -0
- package/src/mcp-security-runtime.js +741 -0
- package/src/mcp-server.js +740 -0
- package/src/middleware.js +208 -0
- package/src/model-finetuning.js +884 -0
- package/src/model-fingerprint.js +1042 -0
- package/src/multi-agent-trust.js +453 -0
- package/src/multi-agent.js +404 -0
- package/src/multimodal.js +296 -0
- package/src/nist-mapping.js +505 -0
- package/src/observability.js +330 -0
- package/src/openclaw.js +450 -0
- package/src/otel.js +544 -0
- package/src/owasp-2025.js +483 -0
- package/src/pii.js +390 -0
- package/src/plugin-marketplace.js +628 -0
- package/src/plugin-system.js +349 -0
- package/src/policy-dsl.js +775 -0
- package/src/policy-extended.js +635 -0
- package/src/policy.js +443 -0
- package/src/presets.js +409 -0
- package/src/production.js +557 -0
- package/src/prompt-leakage.js +321 -0
- package/src/rag-vulnerability.js +579 -0
- package/src/redteam.js +475 -0
- package/src/response-handler.js +429 -0
- package/src/scanners.js +357 -0
- package/src/self-healing.js +363 -0
- package/src/semantic.js +339 -0
- package/src/shield-score.js +250 -0
- package/src/sso-saml.js +897 -0
- package/src/stream-scanner.js +806 -0
- package/src/testing.js +505 -0
- package/src/threat-encyclopedia.js +629 -0
- package/src/threat-intel-network.js +1017 -0
- package/src/token-analysis.js +467 -0
- package/src/tool-guard.js +412 -0
- package/src/tool-output-validator.js +354 -0
- package/src/utils.js +83 -0
- package/src/watermark.js +235 -0
- package/src/worker-scanner.js +601 -0
- package/types/index.d.ts +2088 -0
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,2088 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Shield — TypeScript Declarations
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// =========================================================================
|
|
6
|
+
// Core
|
|
7
|
+
// =========================================================================
|
|
8
|
+
|
|
9
|
+
export interface ScanResult {
|
|
10
|
+
status: 'safe' | 'danger' | 'warning' | 'caution';
|
|
11
|
+
threats: Threat[];
|
|
12
|
+
blocked: boolean;
|
|
13
|
+
stats: {
|
|
14
|
+
totalThreats: number;
|
|
15
|
+
scanTimeMs: number;
|
|
16
|
+
patternsChecked?: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface Threat {
|
|
21
|
+
severity: 'critical' | 'high' | 'medium' | 'low';
|
|
22
|
+
category: string;
|
|
23
|
+
description: string;
|
|
24
|
+
detail?: string;
|
|
25
|
+
confidence: number;
|
|
26
|
+
confidenceLabel: string;
|
|
27
|
+
matched?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ShieldOptions {
|
|
31
|
+
sensitivity?: 'low' | 'medium' | 'high';
|
|
32
|
+
blockOnThreat?: boolean;
|
|
33
|
+
blockThreshold?: 'low' | 'medium' | 'high' | 'critical';
|
|
34
|
+
logging?: boolean;
|
|
35
|
+
customPatterns?: Pattern[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface Pattern {
|
|
39
|
+
pattern: RegExp;
|
|
40
|
+
severity: 'critical' | 'high' | 'medium' | 'low';
|
|
41
|
+
category: string;
|
|
42
|
+
description: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ShieldStats {
|
|
46
|
+
totalScans: number;
|
|
47
|
+
threatsDetected: number;
|
|
48
|
+
blocked: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export declare class AgentShield {
|
|
52
|
+
constructor(options?: ShieldOptions);
|
|
53
|
+
scan(text: string, options?: { source?: string }): ScanResult;
|
|
54
|
+
scanInput(text: string): ScanResult;
|
|
55
|
+
scanOutput(text: string): ScanResult;
|
|
56
|
+
getPatterns(): Pattern[];
|
|
57
|
+
getStats(): ShieldStats;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export declare function scanText(text: string, sensitivity?: string): ScanResult;
|
|
61
|
+
export declare function getPatterns(): Pattern[];
|
|
62
|
+
|
|
63
|
+
// =========================================================================
|
|
64
|
+
// Middleware
|
|
65
|
+
// =========================================================================
|
|
66
|
+
|
|
67
|
+
export interface MiddlewareOptions extends ShieldOptions {
|
|
68
|
+
configPath?: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export declare function expressMiddleware(options?: MiddlewareOptions): (req: any, res: any, next: any) => void;
|
|
72
|
+
export declare function wrapAgent(agentFn: Function, options?: ShieldOptions): Function;
|
|
73
|
+
export declare function shieldTools(tools: any[], options?: ShieldOptions): any[];
|
|
74
|
+
|
|
75
|
+
// =========================================================================
|
|
76
|
+
// Circuit Breaker
|
|
77
|
+
// =========================================================================
|
|
78
|
+
|
|
79
|
+
export declare const STATE: {
|
|
80
|
+
CLOSED: 'closed';
|
|
81
|
+
OPEN: 'open';
|
|
82
|
+
HALF_OPEN: 'half_open';
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export interface CircuitBreakerOptions {
|
|
86
|
+
threshold?: number;
|
|
87
|
+
windowMs?: number;
|
|
88
|
+
cooldownMs?: number;
|
|
89
|
+
onTrip?: (info: { threatCount: number; state: string }) => void;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export declare class CircuitBreaker {
|
|
93
|
+
constructor(options?: CircuitBreakerOptions);
|
|
94
|
+
check(): { allowed: boolean; reason?: string };
|
|
95
|
+
recordThreat(count?: number): void;
|
|
96
|
+
reset(): void;
|
|
97
|
+
getStatus(): { state: string; threatCount: number; lastTrip: string | null };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface RateLimiterOptions {
|
|
101
|
+
maxRequests?: number;
|
|
102
|
+
windowMs?: number;
|
|
103
|
+
maxThreatsPerWindow?: number;
|
|
104
|
+
onLimit?: () => void;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export declare class RateLimiter {
|
|
108
|
+
constructor(options?: RateLimiterOptions);
|
|
109
|
+
recordRequest(): { allowed: boolean; reason?: string };
|
|
110
|
+
getStatus(): { requests: number; threats: number };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export declare function shadowMode(shield: AgentShield, options?: { onThreat?: (result: ScanResult) => void }): AgentShield;
|
|
114
|
+
|
|
115
|
+
// =========================================================================
|
|
116
|
+
// Canary
|
|
117
|
+
// =========================================================================
|
|
118
|
+
|
|
119
|
+
export interface CanaryToken {
|
|
120
|
+
token: string;
|
|
121
|
+
description: string;
|
|
122
|
+
instruction: string;
|
|
123
|
+
createdAt: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface CanaryCheckResult {
|
|
127
|
+
leaked: boolean;
|
|
128
|
+
leaks: Array<{ token: string; description: string }>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export declare class CanaryTokens {
|
|
132
|
+
constructor(options?: { onTriggered?: (leak: any) => void });
|
|
133
|
+
generate(description: string): CanaryToken;
|
|
134
|
+
check(text: string): CanaryCheckResult;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface LeakResult {
|
|
138
|
+
leaked: boolean;
|
|
139
|
+
leaks: Array<{ severity: string; description: string; pattern: string }>;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export declare class PromptLeakDetector {
|
|
143
|
+
constructor(options?: { systemPrompt?: string; sensitiveStrings?: string[] });
|
|
144
|
+
scan(text: string, source?: string): LeakResult;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// =========================================================================
|
|
148
|
+
// PII
|
|
149
|
+
// =========================================================================
|
|
150
|
+
|
|
151
|
+
export interface PIIResult {
|
|
152
|
+
hasPII: boolean;
|
|
153
|
+
findings: Array<{ type: string; description: string; count: number }>;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface RedactResult {
|
|
157
|
+
redacted: string;
|
|
158
|
+
count: number;
|
|
159
|
+
findings: PIIResult['findings'];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export declare class PIIRedactor {
|
|
163
|
+
constructor(options?: { categories?: string[]; logging?: boolean });
|
|
164
|
+
detect(text: string): PIIResult;
|
|
165
|
+
redact(text: string): RedactResult;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface DLPRule {
|
|
169
|
+
name: string;
|
|
170
|
+
pattern: string;
|
|
171
|
+
action: 'block' | 'redact' | 'warn';
|
|
172
|
+
severity?: string;
|
|
173
|
+
replacement?: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export declare class DLPEngine {
|
|
177
|
+
constructor(rules?: DLPRule[]);
|
|
178
|
+
scan(text: string): { violations: Array<{ rule: string; action: string; severity: string }> };
|
|
179
|
+
enforce(text: string): { text: string; blocked: boolean; violations: any[] };
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export declare class ContentPolicy {
|
|
183
|
+
constructor(options?: { blockedCategories?: string[] });
|
|
184
|
+
check(text: string): { allowed: boolean; violations: string[] };
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// =========================================================================
|
|
188
|
+
// Tool Guard
|
|
189
|
+
// =========================================================================
|
|
190
|
+
|
|
191
|
+
export interface ToolCheckResult {
|
|
192
|
+
allowed: boolean;
|
|
193
|
+
reason?: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export declare class PermissionBoundary {
|
|
197
|
+
constructor(options: {
|
|
198
|
+
allowedTools?: string[];
|
|
199
|
+
blockedTools?: string[];
|
|
200
|
+
tools?: Record<string, any>;
|
|
201
|
+
});
|
|
202
|
+
check(toolName: string, args: any): ToolCheckResult;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface SequenceResult {
|
|
206
|
+
suspicious: boolean;
|
|
207
|
+
matches: Array<{ name: string; description: string; severity: string }>;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export declare class ToolSequenceAnalyzer {
|
|
211
|
+
constructor(options?: { onSuspicious?: (info: SequenceResult) => void });
|
|
212
|
+
record(toolName: string, args?: any): SequenceResult;
|
|
213
|
+
reset(): void;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export declare class InputQuarantine {
|
|
217
|
+
constructor(options?: { maxQueueSize?: number });
|
|
218
|
+
quarantine(input: string, metadata?: any): { id: string; input: string };
|
|
219
|
+
release(id: string): any | null;
|
|
220
|
+
reject(id: string): boolean;
|
|
221
|
+
getPending(): any[];
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// =========================================================================
|
|
225
|
+
// Conversation
|
|
226
|
+
// =========================================================================
|
|
227
|
+
|
|
228
|
+
export declare class FragmentationDetector {
|
|
229
|
+
constructor(options?: { windowSize?: number; onDetection?: (info: any) => void });
|
|
230
|
+
addMessage(text: string): { fragmented: boolean; matches?: any[] };
|
|
231
|
+
getHistory(): any[];
|
|
232
|
+
reset(): void;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export declare class LanguageSwitchDetector {
|
|
236
|
+
constructor();
|
|
237
|
+
analyze(text: string): { switched: boolean; scripts: string[]; details: any };
|
|
238
|
+
reset(): void;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export declare class TokenBudgetAnalyzer {
|
|
242
|
+
constructor(options?: { maxTokens?: number });
|
|
243
|
+
analyze(text: string): { tokens: number; overBudget: boolean };
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export declare class InstructionHierarchy {
|
|
247
|
+
constructor(options?: { levels?: string[] });
|
|
248
|
+
classify(text: string): { level: string; priority: number };
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export declare class BehavioralFingerprint {
|
|
252
|
+
constructor(options?: { learningPeriod?: number; stdDevThreshold?: number; onAnomaly?: (info: any) => void });
|
|
253
|
+
record(event: { inputLength?: number; responseTimeMs?: number; toolName?: string; threatCount?: number }): { anomalies: any[]; isLearning: boolean };
|
|
254
|
+
getProfile(): any;
|
|
255
|
+
reset(): void;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// =========================================================================
|
|
259
|
+
// Multi-Agent
|
|
260
|
+
// =========================================================================
|
|
261
|
+
|
|
262
|
+
export declare class AgentFirewall {
|
|
263
|
+
constructor(options?: ShieldOptions);
|
|
264
|
+
validateMessage(from: string, to: string, message: string): ScanResult;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export declare class DelegationChain {
|
|
268
|
+
constructor(options?: { maxDepth?: number });
|
|
269
|
+
start(requestId: string, originAgent: string, originalInput?: string): any;
|
|
270
|
+
delegate(requestId: string, fromAgent: string, toAgent: string, action: string, permissions?: string): { allowed: boolean; depth: number; chain: any; reason?: string };
|
|
271
|
+
complete(requestId: string): void;
|
|
272
|
+
getChain(requestId: string): any;
|
|
273
|
+
getActiveChain(agentId: string): any;
|
|
274
|
+
getAllChains(): any[];
|
|
275
|
+
reset(): void;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export declare class SharedThreatState {
|
|
279
|
+
constructor(options?: { ttlMs?: number; onBroadcast?: (threat: any) => void });
|
|
280
|
+
subscribe(agentId: string, callback: (threat: any) => void): void;
|
|
281
|
+
unsubscribe(agentId: string): void;
|
|
282
|
+
broadcast(reportingAgent: string, threat: { signature: string; category: string; severity: string; description?: string }): void;
|
|
283
|
+
isKnown(signature: string): any | null;
|
|
284
|
+
getActiveThreats(): any[];
|
|
285
|
+
reset(): void;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// =========================================================================
|
|
289
|
+
// Encoding
|
|
290
|
+
// =========================================================================
|
|
291
|
+
|
|
292
|
+
export declare class SteganographyDetector {
|
|
293
|
+
constructor();
|
|
294
|
+
scan(text: string): { detected: boolean; findings: any[] };
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export declare class EncodingBruteforceDetector {
|
|
298
|
+
constructor();
|
|
299
|
+
check(text: string): { detected: boolean; decoded: string; encoding: string };
|
|
300
|
+
reset(): void;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export declare class StructuredDataScanner {
|
|
304
|
+
constructor();
|
|
305
|
+
scanJSON(json: string, source?: string): { clean: boolean; threats: Threat[] };
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// =========================================================================
|
|
309
|
+
// Watermark
|
|
310
|
+
// =========================================================================
|
|
311
|
+
|
|
312
|
+
export declare class OutputWatermark {
|
|
313
|
+
constructor(options?: { key?: string });
|
|
314
|
+
embed(text: string): string;
|
|
315
|
+
extract(text: string): { watermarked: boolean; valid: boolean };
|
|
316
|
+
strip(text: string): string;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export declare class DifferentialPrivacy {
|
|
320
|
+
constructor(options?: { epsilon?: number });
|
|
321
|
+
addNoise(value: number): number;
|
|
322
|
+
anonymize(text: string): string;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// =========================================================================
|
|
326
|
+
// Policy
|
|
327
|
+
// =========================================================================
|
|
328
|
+
|
|
329
|
+
export interface PolicyConfig {
|
|
330
|
+
sensitivity?: string;
|
|
331
|
+
blockOnThreat?: boolean;
|
|
332
|
+
blockThreshold?: string;
|
|
333
|
+
logging?: boolean;
|
|
334
|
+
circuitBreaker?: CircuitBreakerOptions;
|
|
335
|
+
rateLimiter?: RateLimiterOptions;
|
|
336
|
+
permissions?: any;
|
|
337
|
+
pii?: any;
|
|
338
|
+
dlp?: any;
|
|
339
|
+
contentPolicy?: any;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export declare function loadPolicy(config: PolicyConfig): PolicyConfig;
|
|
343
|
+
export declare function loadPolicyFile(filePath: string): PolicyConfig;
|
|
344
|
+
|
|
345
|
+
export declare const LOG_LEVEL: {
|
|
346
|
+
DEBUG: 'debug';
|
|
347
|
+
INFO: 'info';
|
|
348
|
+
WARN: 'warn';
|
|
349
|
+
ERROR: 'error';
|
|
350
|
+
CRITICAL: 'critical';
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
export declare class StructuredLogger {
|
|
354
|
+
constructor(options?: { console?: boolean; file?: string; serviceName?: string });
|
|
355
|
+
log(level: string, event: string, data?: any): void;
|
|
356
|
+
logScan(result: ScanResult, metadata?: any): void;
|
|
357
|
+
logBlock(reason: string, source: string, data?: any): void;
|
|
358
|
+
getEntries(): any[];
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export declare class WebhookAlert {
|
|
362
|
+
constructor(options: { url: string; events?: string[] });
|
|
363
|
+
send(event: string, data: any): Promise<void>;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// =========================================================================
|
|
367
|
+
// Integrations
|
|
368
|
+
// =========================================================================
|
|
369
|
+
|
|
370
|
+
export declare class ShieldCallbackHandler {
|
|
371
|
+
constructor(options?: ShieldOptions & { pii?: boolean; onThreat?: (info: any) => void });
|
|
372
|
+
handleLLMStart(llm: any, prompts: string[]): Promise<void>;
|
|
373
|
+
handleLLMEnd(output: any): Promise<void>;
|
|
374
|
+
handleChainStart(chain: any, inputs: any): Promise<void>;
|
|
375
|
+
handleToolStart(tool: any, input: string): Promise<void>;
|
|
376
|
+
getStats(): ShieldStats;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export declare function shieldAnthropicClient(client: any, options?: ShieldOptions & {
|
|
380
|
+
pii?: boolean;
|
|
381
|
+
circuitBreaker?: CircuitBreakerOptions;
|
|
382
|
+
onThreat?: (info: any) => void;
|
|
383
|
+
}): any;
|
|
384
|
+
|
|
385
|
+
export declare function shieldOpenAIClient(client: any, options?: ShieldOptions & {
|
|
386
|
+
pii?: boolean;
|
|
387
|
+
circuitBreaker?: CircuitBreakerOptions;
|
|
388
|
+
onThreat?: (info: any) => void;
|
|
389
|
+
}): any;
|
|
390
|
+
|
|
391
|
+
export declare function shieldVercelAI(options?: ShieldOptions & {
|
|
392
|
+
onThreat?: (info: any) => void;
|
|
393
|
+
}): any;
|
|
394
|
+
|
|
395
|
+
export declare function shieldFetch(fetchFn: typeof fetch, options?: ShieldOptions): typeof fetch;
|
|
396
|
+
|
|
397
|
+
export declare class ShieldBlockError extends Error {
|
|
398
|
+
threats: Threat[];
|
|
399
|
+
code: string;
|
|
400
|
+
constructor(message: string, threats?: Threat[]);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// =========================================================================
|
|
404
|
+
// Red Team
|
|
405
|
+
// =========================================================================
|
|
406
|
+
|
|
407
|
+
export interface AttackPayload {
|
|
408
|
+
name: string;
|
|
409
|
+
text: string;
|
|
410
|
+
difficulty: 'easy' | 'medium' | 'hard';
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export interface AttackResult {
|
|
414
|
+
category: string;
|
|
415
|
+
attack: string;
|
|
416
|
+
difficulty: string;
|
|
417
|
+
detected: boolean;
|
|
418
|
+
threats: Threat[];
|
|
419
|
+
scanTimeMs: number;
|
|
420
|
+
text: string;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export interface RedTeamReport {
|
|
424
|
+
summary: {
|
|
425
|
+
total: number;
|
|
426
|
+
detected: number;
|
|
427
|
+
missed: number;
|
|
428
|
+
detectionRate: string;
|
|
429
|
+
avgScanTimeMs: number;
|
|
430
|
+
};
|
|
431
|
+
byDifficulty: Array<{ difficulty: string; total: number; detected: number; rate: string }>;
|
|
432
|
+
byCategory: Array<{ category: string; total: number; detected: number; rate: string }>;
|
|
433
|
+
missedAttacks: Array<{ category: string; attack: string; difficulty: string; text: string }>;
|
|
434
|
+
grade: string;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
export declare class AttackSimulator {
|
|
438
|
+
constructor(options?: { sensitivity?: string; customPatterns?: any[] });
|
|
439
|
+
runCategory(category: string): AttackResult[];
|
|
440
|
+
runAll(): Record<string, AttackResult[]>;
|
|
441
|
+
runMultiTurn(scanFn: (message: string, turnIndex: number) => ScanResult): any[];
|
|
442
|
+
runCustom(payloads: AttackPayload[]): AttackResult[];
|
|
443
|
+
generateReport(): RedTeamReport;
|
|
444
|
+
formatReport(): string;
|
|
445
|
+
reset(): void;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
export declare class PayloadFuzzer {
|
|
449
|
+
constructor(options?: { mutations?: number; sensitivity?: string });
|
|
450
|
+
fuzz(basePayload: string): {
|
|
451
|
+
totalMutations: number;
|
|
452
|
+
detected: number;
|
|
453
|
+
evaded: number;
|
|
454
|
+
evasionRate: string;
|
|
455
|
+
evasions: Array<{ mutation: string; text: string }>;
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export declare function getAttackCategories(): Array<{ key: string; name: string; description: string; payloadCount: number }>;
|
|
460
|
+
export declare function getPayloads(category: string): AttackPayload[] | null;
|
|
461
|
+
|
|
462
|
+
// =========================================================================
|
|
463
|
+
// Shield Score & Benchmarks
|
|
464
|
+
// =========================================================================
|
|
465
|
+
|
|
466
|
+
export interface ShieldScore {
|
|
467
|
+
score: number;
|
|
468
|
+
grade: string;
|
|
469
|
+
label: string;
|
|
470
|
+
emoji: string;
|
|
471
|
+
categories: Array<{
|
|
472
|
+
key: string;
|
|
473
|
+
name: string;
|
|
474
|
+
weight: number;
|
|
475
|
+
description: string;
|
|
476
|
+
score: number;
|
|
477
|
+
detected: number;
|
|
478
|
+
total: number;
|
|
479
|
+
}>;
|
|
480
|
+
recommendations: Array<{ category: string; priority: string; message: string; missedAttacks: string[] }>;
|
|
481
|
+
benchmarkTimeMs: number;
|
|
482
|
+
timestamp: string;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export declare class ShieldScoreCalculator {
|
|
486
|
+
constructor(options?: { sensitivity?: string; scanFn?: (text: string) => ScanResult });
|
|
487
|
+
calculate(): ShieldScore;
|
|
488
|
+
formatReport(): string;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
// =========================================================================
|
|
492
|
+
// Threat Encyclopedia
|
|
493
|
+
// =========================================================================
|
|
494
|
+
|
|
495
|
+
export interface ThreatEntry {
|
|
496
|
+
id: string;
|
|
497
|
+
name: string;
|
|
498
|
+
category: string;
|
|
499
|
+
severity: string;
|
|
500
|
+
summary: string;
|
|
501
|
+
description: string;
|
|
502
|
+
aliases: string[];
|
|
503
|
+
discoveredDate: string;
|
|
504
|
+
mitreTactic: string;
|
|
505
|
+
examples: Array<{ name: string; payload?: string; turns?: string[]; explanation: string }>;
|
|
506
|
+
mitigations: string[];
|
|
507
|
+
references: Array<{ title: string; url: string }>;
|
|
508
|
+
relatedThreats: string[];
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
export interface DailyPattern {
|
|
512
|
+
id: string;
|
|
513
|
+
title: string;
|
|
514
|
+
threat: string;
|
|
515
|
+
description: string;
|
|
516
|
+
realWorldExample: string;
|
|
517
|
+
howToDefend: string;
|
|
518
|
+
tags: string[];
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
export declare class ThreatEncyclopedia {
|
|
522
|
+
constructor();
|
|
523
|
+
getAll(): ThreatEntry[];
|
|
524
|
+
get(idOrKey: string): ThreatEntry | null;
|
|
525
|
+
search(query: string): ThreatEntry[];
|
|
526
|
+
getByCategory(category: string): ThreatEntry[];
|
|
527
|
+
getBySeverity(severity: string): ThreatEntry[];
|
|
528
|
+
getPatternOfTheDay(): DailyPattern;
|
|
529
|
+
getAllPatterns(): DailyPattern[];
|
|
530
|
+
getRelated(idOrKey: string): ThreatEntry[];
|
|
531
|
+
getCategories(): Array<{ name: string; count: number; severities: string[] }>;
|
|
532
|
+
formatThreat(idOrKey: string): string;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// =========================================================================
|
|
536
|
+
// Compliance
|
|
537
|
+
// =========================================================================
|
|
538
|
+
|
|
539
|
+
export interface ComplianceReport {
|
|
540
|
+
framework: string;
|
|
541
|
+
version: string;
|
|
542
|
+
date: string;
|
|
543
|
+
summary: { total: number; compliant: number; available: number; manual: number; complianceRate: string };
|
|
544
|
+
controls: Array<{ id: string; name: string; check: string; description: string; status: string; feature: string; module: string | null }>;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
export declare class ComplianceReporter {
|
|
548
|
+
constructor(options?: { enabledModules?: string[]; framework?: string });
|
|
549
|
+
generateReport(frameworkId?: string): ComplianceReport;
|
|
550
|
+
generateAllReports(): Record<string, ComplianceReport>;
|
|
551
|
+
formatReport(report: ComplianceReport): string;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
export declare class AuditTrail {
|
|
555
|
+
constructor(options?: { maxEvents?: number; autoFlush?: boolean; flushPath?: string });
|
|
556
|
+
record(event: any): any;
|
|
557
|
+
recordScan(input: string, result: ScanResult, metadata?: any): any;
|
|
558
|
+
recordBlock(reason: string, input: string, threats?: Threat[], metadata?: any): any;
|
|
559
|
+
recordToolCall(tool: string, args: any, result: any, metadata?: any): any;
|
|
560
|
+
exportJSON(): string;
|
|
561
|
+
exportCSV(): string;
|
|
562
|
+
flush(filePath?: string): void;
|
|
563
|
+
query(filters?: { type?: string; blocked?: boolean; since?: string; until?: string; minThreats?: number }): any[];
|
|
564
|
+
getSummary(): { total: number; scans: number; blocks: number; toolCalls: number; threats: number };
|
|
565
|
+
clear(): void;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
export declare class IncidentPlaybook {
|
|
569
|
+
constructor();
|
|
570
|
+
get(threatType: string): any | null;
|
|
571
|
+
getAll(): any[];
|
|
572
|
+
recommend(scanResult: ScanResult): any | null;
|
|
573
|
+
format(playbook: any): string;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
export interface ChecklistItem {
|
|
577
|
+
item: string;
|
|
578
|
+
priority: 'critical' | 'high' | 'medium' | 'low';
|
|
579
|
+
checked: boolean;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
export interface Checklist {
|
|
583
|
+
environment: string;
|
|
584
|
+
date: string;
|
|
585
|
+
totalItems: number;
|
|
586
|
+
categories: Array<{ name: string; items: ChecklistItem[] }>;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
export declare class SecurityChecklistGenerator {
|
|
590
|
+
constructor();
|
|
591
|
+
generate(environment?: string): Checklist;
|
|
592
|
+
format(checklist: Checklist): string;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
// =========================================================================
|
|
596
|
+
// Enterprise
|
|
597
|
+
// =========================================================================
|
|
598
|
+
|
|
599
|
+
export declare class MultiTenantShield {
|
|
600
|
+
constructor(options?: { defaultPolicy?: ShieldOptions; globalOverrides?: Partial<ShieldOptions>; onTenantCreated?: (id: string, policy: any) => void });
|
|
601
|
+
registerTenant(tenantId: string, policy?: ShieldOptions): MultiTenantShield;
|
|
602
|
+
getTenant(tenantId: string): any;
|
|
603
|
+
scan(tenantId: string, text: string, options?: any): ScanResult & { tenantId: string };
|
|
604
|
+
scanInput(tenantId: string, text: string): ScanResult;
|
|
605
|
+
scanOutput(tenantId: string, text: string): ScanResult;
|
|
606
|
+
updatePolicy(tenantId: string, policy: Partial<ShieldOptions>): any;
|
|
607
|
+
getAllStats(): Record<string, any>;
|
|
608
|
+
removeTenant(tenantId: string): boolean;
|
|
609
|
+
readonly size: number;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
export interface RoleConfig {
|
|
613
|
+
name: string;
|
|
614
|
+
sensitivity: string;
|
|
615
|
+
blockOnThreat: boolean;
|
|
616
|
+
allowedTools: string[] | '*';
|
|
617
|
+
blockedTools: string[] | '*';
|
|
618
|
+
bypassCircuitBreaker: boolean;
|
|
619
|
+
canViewAuditTrail: boolean;
|
|
620
|
+
canModifyPolicy: boolean;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
export declare class RoleBasedPolicy {
|
|
624
|
+
constructor(options?: { customRoles?: Record<string, Partial<RoleConfig>> });
|
|
625
|
+
assignRole(userId: string, role: string): RoleBasedPolicy;
|
|
626
|
+
getPolicy(userId: string): RoleConfig & { role: string };
|
|
627
|
+
scan(userId: string, text: string, options?: any): ScanResult & { userId: string; role: string };
|
|
628
|
+
checkToolAccess(userId: string, toolName: string): ToolCheckResult;
|
|
629
|
+
defineRole(name: string, config: Partial<RoleConfig>): RoleBasedPolicy;
|
|
630
|
+
getRoles(): Array<{ key: string } & RoleConfig>;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export declare class DebugShield {
|
|
634
|
+
constructor(options?: ShieldOptions & { debug?: boolean; maxTraces?: number; verbose?: boolean });
|
|
635
|
+
scan(text: string, options?: any): ScanResult & { _trace: any };
|
|
636
|
+
getTraces(): any[];
|
|
637
|
+
getRecentTraces(n?: number): any[];
|
|
638
|
+
exportTraces(): string;
|
|
639
|
+
clearTraces(): void;
|
|
640
|
+
getTimingStats(): { count: number; min: number; max: number; avg: number; median: number; p95: number; p99: number } | null;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
// =========================================================================
|
|
644
|
+
// Badges
|
|
645
|
+
// =========================================================================
|
|
646
|
+
|
|
647
|
+
export declare class BadgeGenerator {
|
|
648
|
+
static shieldScore(score: number): string;
|
|
649
|
+
static protectionStatus(enabled?: boolean): string;
|
|
650
|
+
static detectionRate(rate: string | number): string;
|
|
651
|
+
static scanCount(count: number): string;
|
|
652
|
+
static compliance(framework: string, rate: string | number): string;
|
|
653
|
+
static custom(label: string, value: string, color?: string): string;
|
|
654
|
+
static markdownBadges(options?: { score?: number; detectionRate?: string }): string;
|
|
655
|
+
static generateSVG(label: string, value: string, color: string): string;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
export declare class GitHubActionReporter {
|
|
659
|
+
constructor();
|
|
660
|
+
reportScan(result: ScanResult, file?: string, line?: number): void;
|
|
661
|
+
setOutputs(results: ScanResult): void;
|
|
662
|
+
createSummary(shieldScore: ShieldScore | null, scanResults: ScanResult | null): string;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
// =========================================================================
|
|
666
|
+
// Allowlist & Feedback
|
|
667
|
+
// =========================================================================
|
|
668
|
+
|
|
669
|
+
export declare class Allowlist {
|
|
670
|
+
constructor(options?: { patterns?: Array<string | RegExp> });
|
|
671
|
+
addRule(pattern: string | RegExp, options?: { threat?: string; reason?: string }): void;
|
|
672
|
+
removeRule(pattern: string): boolean;
|
|
673
|
+
check(text: string): boolean;
|
|
674
|
+
filterThreats(threats: Threat[], text: string): Threat[];
|
|
675
|
+
getRules(): any[];
|
|
676
|
+
getStats(): { totalChecks: number; totalBypasses: number; ruleCount: number };
|
|
677
|
+
exportRules(): string;
|
|
678
|
+
importRules(json: string): void;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
export declare class ConfidenceCalibrator {
|
|
682
|
+
constructor();
|
|
683
|
+
record(predicted: number, actual: boolean): void;
|
|
684
|
+
getMetrics(): { total: number; accuracy: number; precision: number; recall: number };
|
|
685
|
+
getCategoryBreakdown(): Record<string, any>;
|
|
686
|
+
suggestThresholds(): any[];
|
|
687
|
+
reset(): void;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
export declare class FeedbackLoop {
|
|
691
|
+
constructor(options?: { onFeedback?: (entry: any) => void });
|
|
692
|
+
reportFalsePositive(scanResult: ScanResult, reason?: string): any;
|
|
693
|
+
reportMissed(text: string, expectedCategory?: string): any;
|
|
694
|
+
confirmDetection(id: string): void;
|
|
695
|
+
confirmSafe(id: string): void;
|
|
696
|
+
autoAllowlist(allowlist: Allowlist): number;
|
|
697
|
+
getPendingReviews(): any[];
|
|
698
|
+
getSuggestions(): any[];
|
|
699
|
+
getStats(): { falsePositives: number; missed: number; confirmed: number; pending: number; total: number };
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
export declare class ScanCache {
|
|
703
|
+
constructor(options?: { maxSize?: number; ttlMs?: number });
|
|
704
|
+
get(text: string, sensitivity?: string): ScanResult | null;
|
|
705
|
+
set(text: string, sensitivity: string, result: ScanResult): void;
|
|
706
|
+
wrap(scanFn: (text: string, sensitivity: string) => ScanResult): (text: string, sensitivity: string) => ScanResult;
|
|
707
|
+
clear(): void;
|
|
708
|
+
prune(): number;
|
|
709
|
+
getStats(): { hits: number; misses: number; evictions: number; size: number; maxSize: number; hitRate: string };
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
// =========================================================================
|
|
713
|
+
// Presets & Config Builder
|
|
714
|
+
// =========================================================================
|
|
715
|
+
|
|
716
|
+
export declare class ConfigBuilder {
|
|
717
|
+
constructor();
|
|
718
|
+
sensitivity(level: string): ConfigBuilder;
|
|
719
|
+
blockOnThreat(enabled?: boolean): ConfigBuilder;
|
|
720
|
+
logging(enabled?: boolean): ConfigBuilder;
|
|
721
|
+
onThreat(callback: (result: ScanResult) => void): ConfigBuilder;
|
|
722
|
+
build(): ShieldOptions;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
export declare class SnippetGenerator {
|
|
726
|
+
constructor();
|
|
727
|
+
generate(options?: { framework?: string; language?: string }): string;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
export declare function getPresets(): Record<string, any>;
|
|
731
|
+
export declare function getPreset(name: string): any;
|
|
732
|
+
|
|
733
|
+
// =========================================================================
|
|
734
|
+
// Advanced Scanners
|
|
735
|
+
// =========================================================================
|
|
736
|
+
|
|
737
|
+
export declare class RAGScanner {
|
|
738
|
+
constructor(options?: ShieldOptions);
|
|
739
|
+
scanDocument(text: string, source?: string): ScanResult;
|
|
740
|
+
scanChunk(chunk: string, metadata?: any): ScanResult;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
export declare class PromptLinter {
|
|
744
|
+
constructor(options?: { rules?: string[] });
|
|
745
|
+
lint(prompt: string): Array<{ rule: string; severity: string; message: string; line?: number }>;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
export declare class ToolSchemaValidator {
|
|
749
|
+
constructor(options?: { strict?: boolean });
|
|
750
|
+
validate(tool: any): { valid: boolean; issues: string[] };
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
// =========================================================================
|
|
754
|
+
// Production
|
|
755
|
+
// =========================================================================
|
|
756
|
+
|
|
757
|
+
export declare class SamplingScanner {
|
|
758
|
+
constructor(options?: ShieldOptions & { sampleRate?: number });
|
|
759
|
+
scan(text: string, options?: any): ScanResult | null;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
export declare class ShadowComparison {
|
|
763
|
+
constructor(options?: { primary: AgentShield; shadow: AgentShield });
|
|
764
|
+
scan(text: string): { primary: ScanResult; shadow: ScanResult; diverged: boolean };
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
export declare class GracefulScanner {
|
|
768
|
+
constructor(options?: ShieldOptions & { timeoutMs?: number; fallback?: ScanResult });
|
|
769
|
+
scan(text: string, options?: any): ScanResult;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
export declare class ThreatReplay {
|
|
773
|
+
constructor();
|
|
774
|
+
record(input: string, result: ScanResult): void;
|
|
775
|
+
replay(scanFn: (text: string) => ScanResult): Array<{ input: string; original: ScanResult; replayed: ScanResult; match: boolean }>;
|
|
776
|
+
replayOne(index: number, scanFn: (text: string) => ScanResult): any;
|
|
777
|
+
getRecordings(): any[];
|
|
778
|
+
clear(): void;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
export declare class AttackAttributionChain {
|
|
782
|
+
constructor();
|
|
783
|
+
recordMessage(conversationId: string, message: string, scanResult: ScanResult, metadata?: any): void;
|
|
784
|
+
getKillChain(conversationId: string): any;
|
|
785
|
+
getCompromisedConversations(): any[];
|
|
786
|
+
clear(): void;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
export declare class DiffReporter {
|
|
790
|
+
constructor();
|
|
791
|
+
takeSnapshot(name: string, scanResult: ScanResult): void;
|
|
792
|
+
compare(beforeName: string, afterName: string): { added: Threat[]; removed: Threat[]; unchanged: Threat[]; changed: any };
|
|
793
|
+
getSnapshots(): string[];
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
export declare class PostureTracker {
|
|
797
|
+
constructor();
|
|
798
|
+
record(data: { score: number; detectionRate?: number; [key: string]: any }): void;
|
|
799
|
+
getTrend(): { improving: boolean; scores: number[]; average: number };
|
|
800
|
+
getSummary(): any;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
// =========================================================================
|
|
804
|
+
// Testing & Contracts
|
|
805
|
+
// =========================================================================
|
|
806
|
+
|
|
807
|
+
export declare class TestSuiteGenerator {
|
|
808
|
+
constructor(options?: { shield?: AgentShield });
|
|
809
|
+
generate(options?: { categories?: string[] }): Array<{ name: string; input: string; expectedDetected: boolean; category: string }>;
|
|
810
|
+
run(options?: any): { passed: number; failed: number; total: number; results: any[] };
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
export declare class AgentContract {
|
|
814
|
+
constructor(options?: { rules?: Array<{ name: string; check: (result: ScanResult) => boolean }> });
|
|
815
|
+
addRule(name: string, checkFn: (result: ScanResult) => boolean): AgentContract;
|
|
816
|
+
mustNotExfiltrateData(): AgentContract;
|
|
817
|
+
mustNotExecuteCode(): AgentContract;
|
|
818
|
+
mustNotAccessPath(path: string): AgentContract;
|
|
819
|
+
mustStayOnTopic(topic: string): AgentContract;
|
|
820
|
+
maxResponseLength(maxLen: number): AgentContract;
|
|
821
|
+
validate(result: ScanResult): { valid: boolean; violations: string[] };
|
|
822
|
+
getViolations(): any[];
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
export declare class BreakglassProtocol {
|
|
826
|
+
constructor(options?: { defaultDurationMs?: number; onActivate?: () => void; onDeactivate?: () => void });
|
|
827
|
+
activate(options: { reason: string; user?: string; durationMs?: number }): { success: boolean; reason?: string };
|
|
828
|
+
deactivate(user?: string): void;
|
|
829
|
+
isActive(): boolean;
|
|
830
|
+
wrap(scanFn: (text: string) => ScanResult): (text: string) => ScanResult;
|
|
831
|
+
getAuditLog(): any[];
|
|
832
|
+
getStatus(): any;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
// =========================================================================
|
|
836
|
+
// Multi-Agent Trust
|
|
837
|
+
// =========================================================================
|
|
838
|
+
|
|
839
|
+
export declare class MessageSigner {
|
|
840
|
+
constructor(options?: { algorithm?: string });
|
|
841
|
+
registerAgent(agentId: string, secret: string): boolean;
|
|
842
|
+
generateSecret(agentId: string): string;
|
|
843
|
+
sign(fromAgent: string, message: any): { from: string; timestamp: number; nonce: string; payload: any; signature: string };
|
|
844
|
+
verify(envelope: { from: string; timestamp: number; nonce: string; payload: any; signature: string }, maxAgeMs?: number): { valid: boolean; reason?: string };
|
|
845
|
+
getVerificationLog(): any[];
|
|
846
|
+
getStats(): any;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
export declare class CapabilityToken {
|
|
850
|
+
constructor(options?: { issuer?: string; secret?: string });
|
|
851
|
+
issue(agentId: string, capabilities: string[], ttlMs?: number): string;
|
|
852
|
+
verify(token: string, requiredCapability?: string): { valid: boolean; agentId?: string; capabilities?: string[]; expired?: boolean };
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
export declare class DelegationManager {
|
|
856
|
+
constructor(options?: { maxDepth?: number; secret?: string });
|
|
857
|
+
issue(agentId: string, capabilities: string[], options?: { ttlMs?: number; constraints?: any }): string;
|
|
858
|
+
check(tokenId: string, capability: string, context?: any): { allowed: boolean; reason?: string };
|
|
859
|
+
revoke(tokenId: string): boolean;
|
|
860
|
+
getAuditLog(): any[];
|
|
861
|
+
getActiveTokens(): any[];
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
export declare class BlastRadiusContainer {
|
|
865
|
+
constructor(options?: { maxIncidents?: number });
|
|
866
|
+
defineZone(zone: { name: string; agents?: string[]; allowedCapabilities?: string[]; blockedCapabilities?: string[]; canCommunicateWith?: string[]; maxConcurrentActions?: number; description?: string }): boolean;
|
|
867
|
+
checkAction(agentId: string, action: string, targetZone?: string): { allowed: boolean; reason?: string };
|
|
868
|
+
releaseAction(agentId: string): void;
|
|
869
|
+
quarantine(zoneName: string, reason?: string): boolean;
|
|
870
|
+
unquarantine(zoneName: string): boolean;
|
|
871
|
+
getZones(): any[];
|
|
872
|
+
getIncidents(): any[];
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
// =========================================================================
|
|
876
|
+
// Extended Policy & Intelligence
|
|
877
|
+
// =========================================================================
|
|
878
|
+
|
|
879
|
+
export declare class ABTestRunner {
|
|
880
|
+
constructor(options?: { variants: Array<{ name: string; config: ShieldOptions }> });
|
|
881
|
+
run(text: string): Array<{ variant: string; result: ScanResult }>;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
export declare class ThreatIntelFeed {
|
|
885
|
+
constructor();
|
|
886
|
+
addIndicator(indicator: { type: string; value: string; severity?: string }): void;
|
|
887
|
+
check(text: string): { matches: any[] };
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
export declare class PatternBuilder {
|
|
891
|
+
constructor();
|
|
892
|
+
add(regex: RegExp, options: { severity: string; category: string; description: string }): PatternBuilder;
|
|
893
|
+
build(): Pattern[];
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
export declare class Doctor {
|
|
897
|
+
constructor();
|
|
898
|
+
diagnose(shield?: AgentShield): { healthy: boolean; issues: string[]; recommendations: string[] };
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
export declare class GitHubActionGenerator {
|
|
902
|
+
constructor();
|
|
903
|
+
generate(options?: { trigger?: string; nodeVersion?: string }): string;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
export declare class SOCIntegration {
|
|
907
|
+
constructor(options?: { format?: string });
|
|
908
|
+
formatAlert(threat: Threat, metadata?: any): any;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
export declare class MigrationGuide {
|
|
912
|
+
constructor();
|
|
913
|
+
from(version: string): { steps: string[]; breaking: string[] };
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
export declare class Playground {
|
|
917
|
+
constructor(options?: ShieldOptions);
|
|
918
|
+
configure(options: ShieldOptions): void;
|
|
919
|
+
test(text: string): ScanResult & { latencyMs: number };
|
|
920
|
+
getHistory(): any[];
|
|
921
|
+
clear(): void;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
// =========================================================================
|
|
925
|
+
// Streaming
|
|
926
|
+
// =========================================================================
|
|
927
|
+
|
|
928
|
+
export declare class StreamScanner {
|
|
929
|
+
constructor(options?: { sensitivity?: string; chunkSize?: number; onThreat?: (threat: Threat) => void });
|
|
930
|
+
write(chunk: string): { threats: Threat[]; buffered: number };
|
|
931
|
+
flush(): { threats: Threat[] };
|
|
932
|
+
reset(): void;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
export declare class TokenStreamScanner {
|
|
936
|
+
constructor(options?: { sensitivity?: string; windowSize?: number });
|
|
937
|
+
addToken(token: string): { threats: Threat[] };
|
|
938
|
+
flush(): { threats: Threat[] };
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
// =========================================================================
|
|
942
|
+
// Plugin System
|
|
943
|
+
// =========================================================================
|
|
944
|
+
|
|
945
|
+
export declare class PluginManager {
|
|
946
|
+
constructor();
|
|
947
|
+
register(plugin: { name: string; version?: string; hooks?: Record<string, Function> }): void;
|
|
948
|
+
unregister(name: string): boolean;
|
|
949
|
+
getPlugins(): Array<{ name: string; version: string }>;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
export declare class PluginTemplate {
|
|
953
|
+
static create(options: { name: string; version?: string }): any;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
export declare class PluginSandbox {
|
|
957
|
+
constructor(options?: { timeoutMs?: number });
|
|
958
|
+
run(fn: Function, ...args: any[]): any;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
// =========================================================================
|
|
962
|
+
// Token Analysis
|
|
963
|
+
// =========================================================================
|
|
964
|
+
|
|
965
|
+
export declare class EntropyAnalyzer {
|
|
966
|
+
constructor();
|
|
967
|
+
analyze(text: string): { entropy: number; suspicious: boolean; charDistribution: Record<string, number> };
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
export declare class PerplexityEstimator {
|
|
971
|
+
constructor();
|
|
972
|
+
estimate(text: string): { perplexity: number; suspicious: boolean };
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
export declare class BurstDetector {
|
|
976
|
+
constructor(options?: { windowSize?: number; threshold?: number });
|
|
977
|
+
addEvent(event?: any): { burst: boolean; count: number };
|
|
978
|
+
reset(): void;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
export declare class TextStatistics {
|
|
982
|
+
static analyze(text: string): { wordCount: number; charCount: number; avgWordLength: number; uniqueWords: number; entropy: number };
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
// =========================================================================
|
|
986
|
+
// Document Scanner
|
|
987
|
+
// =========================================================================
|
|
988
|
+
|
|
989
|
+
export declare class DocumentScanner {
|
|
990
|
+
constructor(options?: { sensitivity?: string });
|
|
991
|
+
scan(document: string, metadata?: any): ScanResult;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
export declare class TextExtractor {
|
|
995
|
+
static fromHTML(html: string): string;
|
|
996
|
+
static fromMarkdown(md: string): string;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
export declare class IndirectInjectionScanner {
|
|
1000
|
+
constructor(options?: { sensitivity?: string });
|
|
1001
|
+
scan(text: string, source?: string): ScanResult;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
// =========================================================================
|
|
1005
|
+
// Tool Output Validator
|
|
1006
|
+
// =========================================================================
|
|
1007
|
+
|
|
1008
|
+
export declare class ToolOutputValidator {
|
|
1009
|
+
constructor(options?: { sensitivity?: string; maxOutputSize?: number });
|
|
1010
|
+
validate(toolName: string, output: any): { safe: boolean; threats: Threat[]; sanitized?: any };
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
export declare class OutputSanitizer {
|
|
1014
|
+
constructor(options?: { stripHTML?: boolean; maxLength?: number });
|
|
1015
|
+
sanitize(output: string): string;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
// =========================================================================
|
|
1019
|
+
// Response Handler
|
|
1020
|
+
// =========================================================================
|
|
1021
|
+
|
|
1022
|
+
export declare class ResponseHandler {
|
|
1023
|
+
constructor(options?: { templates?: Record<string, string>; defaultAction?: string });
|
|
1024
|
+
handle(scanResult: ScanResult): { action: string; response: string; original?: any };
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
export declare class ResponseTemplates {
|
|
1028
|
+
static get(name: string): string;
|
|
1029
|
+
static getAll(): Record<string, string>;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
export declare class ReviewQueue {
|
|
1033
|
+
constructor(options?: { maxSize?: number });
|
|
1034
|
+
add(item: any): string;
|
|
1035
|
+
approve(id: string): any;
|
|
1036
|
+
reject(id: string): any;
|
|
1037
|
+
getPending(): any[];
|
|
1038
|
+
getStats(): { pending: number; approved: number; rejected: number };
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
// =========================================================================
|
|
1042
|
+
// Worker Scanner
|
|
1043
|
+
// =========================================================================
|
|
1044
|
+
|
|
1045
|
+
export declare class WorkerScanner {
|
|
1046
|
+
constructor(options?: { workerCount?: number });
|
|
1047
|
+
scan(text: string): Promise<ScanResult>;
|
|
1048
|
+
shutdown(): void;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
export declare class ScanQueue {
|
|
1052
|
+
constructor(options?: { concurrency?: number; maxQueue?: number });
|
|
1053
|
+
enqueue(text: string): Promise<ScanResult>;
|
|
1054
|
+
getStats(): { queued: number; processing: number; completed: number };
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
// =========================================================================
|
|
1058
|
+
// Alert Tuning
|
|
1059
|
+
// =========================================================================
|
|
1060
|
+
|
|
1061
|
+
export declare class AlertFatigueAnalyzer {
|
|
1062
|
+
constructor(options?: { windowMs?: number; maxAlerts?: number });
|
|
1063
|
+
record(alert: any): { fatigued: boolean; suppressed: boolean; count: number };
|
|
1064
|
+
getStats(): { total: number; suppressed: number; fatigueRate: string };
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
export declare class AutoTuner {
|
|
1068
|
+
constructor(options?: { targetFPRate?: number });
|
|
1069
|
+
record(scanResult: ScanResult, wasActuallyMalicious: boolean): void;
|
|
1070
|
+
getSuggestions(): Array<{ action: string; reason: string }>;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
export declare class AlertCorrelator {
|
|
1074
|
+
constructor(options?: { windowMs?: number });
|
|
1075
|
+
correlate(alert: any): { correlated: boolean; group?: string; relatedAlerts?: any[] };
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
// =========================================================================
|
|
1079
|
+
// OpenTelemetry
|
|
1080
|
+
// =========================================================================
|
|
1081
|
+
|
|
1082
|
+
export declare class ShieldMetrics {
|
|
1083
|
+
constructor(options?: { serviceName?: string });
|
|
1084
|
+
recordScan(result: ScanResult, durationMs: number): void;
|
|
1085
|
+
recordBlock(reason: string): void;
|
|
1086
|
+
getMetrics(): Record<string, number>;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
export declare class ShieldTracer {
|
|
1090
|
+
constructor(options?: { serviceName?: string });
|
|
1091
|
+
startSpan(name: string): { end: () => void; setAttribute: (key: string, value: any) => void };
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
export declare class MetricsDashboard {
|
|
1095
|
+
constructor(options?: { refreshInterval?: number });
|
|
1096
|
+
getSummary(): any;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
// =========================================================================
|
|
1100
|
+
// Certification
|
|
1101
|
+
// =========================================================================
|
|
1102
|
+
|
|
1103
|
+
export declare class CertificationRunner {
|
|
1104
|
+
constructor(options?: { sensitivity?: string });
|
|
1105
|
+
runCertification(): Promise<{ passed: boolean; score: number; certificate: Certificate }>;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
export declare class Certificate {
|
|
1109
|
+
constructor(data: any);
|
|
1110
|
+
toText(): string;
|
|
1111
|
+
toJSON(): any;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
export declare class CertificationHistory {
|
|
1115
|
+
constructor();
|
|
1116
|
+
record(cert: Certificate): void;
|
|
1117
|
+
getHistory(): Certificate[];
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
// =========================================================================
|
|
1121
|
+
// MCP Server
|
|
1122
|
+
// =========================================================================
|
|
1123
|
+
|
|
1124
|
+
export declare class MCPServer {
|
|
1125
|
+
constructor(options?: { port?: number });
|
|
1126
|
+
start(): Promise<void>;
|
|
1127
|
+
stop(): Promise<void>;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
export declare class MCPToolHandler {
|
|
1131
|
+
constructor(shield: AgentShield);
|
|
1132
|
+
handleToolCall(name: string, args: any): Promise<any>;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
// =========================================================================
|
|
1136
|
+
// CTF
|
|
1137
|
+
// =========================================================================
|
|
1138
|
+
|
|
1139
|
+
export declare class CTFEngine {
|
|
1140
|
+
constructor(options?: { difficulty?: string });
|
|
1141
|
+
getChallenge(id: string): any;
|
|
1142
|
+
submitAnswer(id: string, answer: string): { correct: boolean; score: number };
|
|
1143
|
+
getScoreboard(): any;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
export declare class CTFReporter {
|
|
1147
|
+
constructor();
|
|
1148
|
+
formatReport(scoreboard: any): string;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
export declare const CHALLENGES: any[];
|
|
1152
|
+
|
|
1153
|
+
// =========================================================================
|
|
1154
|
+
// Observability
|
|
1155
|
+
// =========================================================================
|
|
1156
|
+
|
|
1157
|
+
export declare class PrometheusExporter {
|
|
1158
|
+
constructor(options?: { prefix?: string });
|
|
1159
|
+
increment(name: string, labels?: Record<string, string>): void;
|
|
1160
|
+
observe(name: string, value: number, labels?: Record<string, string>): void;
|
|
1161
|
+
set(name: string, value: number, labels?: Record<string, string>): void;
|
|
1162
|
+
metrics(): string;
|
|
1163
|
+
wrapShield(shield: AgentShield): AgentShield;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
export declare class DatadogLogger {
|
|
1167
|
+
constructor(options?: { service?: string; env?: string; version?: string; maxBuffer?: number });
|
|
1168
|
+
log(event: string, data?: any): void;
|
|
1169
|
+
logScan(result: ScanResult, metadata?: any): void;
|
|
1170
|
+
logThreat(threat: Threat, metadata?: any): void;
|
|
1171
|
+
logBlock(reason: string, metadata?: any): void;
|
|
1172
|
+
flush(): any[];
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
export declare class MetricsCollector {
|
|
1176
|
+
constructor(options?: { ttlMs?: number; maxEvents?: number });
|
|
1177
|
+
record(event: { type: string; durationMs?: number; threats?: number; category?: string }): void;
|
|
1178
|
+
getSummary(windowMs?: number): { scansPerSec: number; threatsPerSec: number; p50: number; p95: number; p99: number; topCategories: Array<{ category: string; count: number }> };
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
// =========================================================================
|
|
1182
|
+
// Adaptive Detection
|
|
1183
|
+
// =========================================================================
|
|
1184
|
+
|
|
1185
|
+
export declare class AdaptiveDetector {
|
|
1186
|
+
constructor(options?: { storagePath?: string });
|
|
1187
|
+
recordFalsePositive(text: string, category: string): void;
|
|
1188
|
+
recordFalseNegative(text: string, category: string): void;
|
|
1189
|
+
shouldSuppress(text: string, category: string): boolean;
|
|
1190
|
+
getBoost(text: string, category: string): number;
|
|
1191
|
+
adjustResult(scanResult: ScanResult): ScanResult;
|
|
1192
|
+
getStats(): { falsePositives: number; falseNegatives: number };
|
|
1193
|
+
save(): void;
|
|
1194
|
+
load(): void;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
export declare class SemanticAnalysisHook {
|
|
1198
|
+
constructor(options: { classifier: (text: string, threats: Threat[]) => Promise<{ override: boolean; reason: string }>; timeoutMs?: number });
|
|
1199
|
+
analyze(text: string, scanResult: ScanResult): Promise<ScanResult>;
|
|
1200
|
+
getStats(): { overrides: number; errors: number; avgLatencyMs: number };
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
export declare class CommunityPatterns {
|
|
1204
|
+
constructor(options?: { path?: string });
|
|
1205
|
+
load(): void;
|
|
1206
|
+
getPatterns(): Pattern[];
|
|
1207
|
+
merge(existingPatterns: Pattern[]): Pattern[];
|
|
1208
|
+
getVersion(): string;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
// =========================================================================
|
|
1212
|
+
// Constants
|
|
1213
|
+
// =========================================================================
|
|
1214
|
+
|
|
1215
|
+
export declare const SEVERITY_ORDER: Record<string, number>;
|
|
1216
|
+
export declare const API_KEY_PATTERNS: any[];
|
|
1217
|
+
export declare const PII_PATTERNS: Record<string, any>;
|
|
1218
|
+
export declare const CONTENT_CATEGORIES: Record<string, any>;
|
|
1219
|
+
export declare const SUSPICIOUS_SEQUENCES: any[];
|
|
1220
|
+
export declare const STEGO_PATTERNS: any[];
|
|
1221
|
+
export declare const ATTACK_PAYLOADS: Record<string, any>;
|
|
1222
|
+
export declare const SCORE_CATEGORIES: Record<string, any>;
|
|
1223
|
+
export declare const THREAT_ENCYCLOPEDIA: any[];
|
|
1224
|
+
export declare const DAILY_PATTERNS: any[];
|
|
1225
|
+
export declare const COMPLIANCE_FRAMEWORKS: Record<string, any>;
|
|
1226
|
+
export declare const INCIDENT_PLAYBOOKS: Record<string, any>;
|
|
1227
|
+
export declare const DEFAULT_ROLES: Record<string, any>;
|
|
1228
|
+
export declare const PRESETS: Record<string, any>;
|
|
1229
|
+
export declare const RAG_INJECTION_PATTERNS: any[];
|
|
1230
|
+
export declare const LINT_RULES: any[];
|
|
1231
|
+
export declare const DANGEROUS_TOOL_PATTERNS: any[];
|
|
1232
|
+
export declare const ATTACK_TEMPLATES: Record<string, any>;
|
|
1233
|
+
|
|
1234
|
+
// =========================================================================
|
|
1235
|
+
// Utilities
|
|
1236
|
+
// =========================================================================
|
|
1237
|
+
|
|
1238
|
+
export declare function getGrade(score: number): string;
|
|
1239
|
+
export declare function getGradeLabel(score: number): string;
|
|
1240
|
+
export declare function makeBar(value: number, max: number, width?: number): string;
|
|
1241
|
+
export declare function truncate(text: string, maxLength?: number): string;
|
|
1242
|
+
export declare function formatHeader(text: string): string;
|
|
1243
|
+
export declare function generateId(): string;
|
|
1244
|
+
export declare function extractTextFromBody(body: any): string;
|
|
1245
|
+
|
|
1246
|
+
// =========================================================================
|
|
1247
|
+
// OpenClaw Integration
|
|
1248
|
+
// =========================================================================
|
|
1249
|
+
|
|
1250
|
+
export declare class OpenClawShieldSkill {
|
|
1251
|
+
constructor(options?: ShieldOptions & { pii?: boolean; circuitBreaker?: CircuitBreakerOptions; onThreat?: (info: any) => void });
|
|
1252
|
+
getSkillMetadata(): string;
|
|
1253
|
+
scanInbound(message: string | object): { safe: boolean; blocked: boolean; threats: Threat[]; redacted?: string; pii?: any; stats?: any };
|
|
1254
|
+
scanOutbound(message: string | object): { safe: boolean; blocked: boolean; threats: Threat[]; redacted?: string };
|
|
1255
|
+
scanTool(toolName: string, args: object): { safe: boolean; blocked: boolean; threats: Threat[] };
|
|
1256
|
+
handleToolCall(params?: object): object;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
export declare function shieldOpenClawMessages(options?: ShieldOptions): { scan: (message: string) => ScanResult };
|
|
1260
|
+
export declare function generateOpenClawSkill(outputDir: string): Promise<void>;
|
|
1261
|
+
|
|
1262
|
+
// =========================================================================
|
|
1263
|
+
// Semantic Detection (v1.2)
|
|
1264
|
+
// =========================================================================
|
|
1265
|
+
|
|
1266
|
+
export declare class SemanticClassifier {
|
|
1267
|
+
constructor(options?: { endpoint?: string; model?: string; timeoutMs?: number; apiKey?: string; mode?: string; confidenceThreshold?: number; enabled?: boolean });
|
|
1268
|
+
classify(text: string, context?: object): Promise<{ isThreat: boolean; confidence: number; category: string; reasoning: string; latencyMs: number }>;
|
|
1269
|
+
enhancedScan(text: string, options?: object): Promise<ScanResult>;
|
|
1270
|
+
isAvailable(): Promise<boolean>;
|
|
1271
|
+
getStats(): { totalClassifications: number; threats: number; avgLatencyMs: number };
|
|
1272
|
+
clearCache(): void;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
export declare function httpPost(url: string, body: object, options?: { timeoutMs?: number; apiKey?: string }): Promise<object>;
|
|
1276
|
+
|
|
1277
|
+
// =========================================================================
|
|
1278
|
+
// Embedding Similarity (v1.2)
|
|
1279
|
+
// =========================================================================
|
|
1280
|
+
|
|
1281
|
+
export declare class EmbeddingSimilarityDetector {
|
|
1282
|
+
constructor(options?: { similarityThreshold?: number; topK?: number; customCorpus?: Array<{ text: string; category: string }>; enabled?: boolean });
|
|
1283
|
+
check(text: string): { isSimilar: boolean; topMatches: Array<{ text: string; category: string; similarity: number }>; bestMatch: { text: string; category: string; similarity: number } | null };
|
|
1284
|
+
enhancedScan(text: string, options?: object): ScanResult;
|
|
1285
|
+
addPattern(text: string, category: string): void;
|
|
1286
|
+
getStats(): object;
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
export declare const ATTACK_CORPUS: Array<{ text: string; category: string }>;
|
|
1290
|
+
export declare function tokenizeText(text: string): string[];
|
|
1291
|
+
export declare function cosineSimilarity(vecA: Map<string, number>, vecB: Map<string, number>): number;
|
|
1292
|
+
|
|
1293
|
+
// =========================================================================
|
|
1294
|
+
// Context-Aware Scoring (v1.2)
|
|
1295
|
+
// =========================================================================
|
|
1296
|
+
|
|
1297
|
+
export declare class ConversationContextAnalyzer {
|
|
1298
|
+
constructor(options?: { maxHistory?: number; escalationThreshold?: number; decayFactor?: number; trackTopics?: boolean });
|
|
1299
|
+
addMessage(text: string, role?: string): object;
|
|
1300
|
+
contextualScan(text: string): ScanResult;
|
|
1301
|
+
getSummary(): object;
|
|
1302
|
+
reset(): void;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
export declare const ESCALATION_SIGNALS: Array<{ phase: string; patterns: RegExp[]; weight: number }>;
|
|
1306
|
+
export declare const TOPIC_PIVOT_SIGNALS: Array<{ from: string; to: string; severity: string }>;
|
|
1307
|
+
|
|
1308
|
+
// =========================================================================
|
|
1309
|
+
// Confidence Tuning (v1.2)
|
|
1310
|
+
// =========================================================================
|
|
1311
|
+
|
|
1312
|
+
export declare class ConfidenceTuner {
|
|
1313
|
+
constructor(options?: { dataDir?: string; defaultThreshold?: number; learningRate?: number; minSamples?: number });
|
|
1314
|
+
recordFeedback(scanResult: ScanResult, label: string, notes?: string): object;
|
|
1315
|
+
getThreshold(category: string): number;
|
|
1316
|
+
applyThresholds(scanResult: ScanResult): ScanResult;
|
|
1317
|
+
tunedScan(text: string, options?: object): ScanResult;
|
|
1318
|
+
getMetrics(): { precision: number; recall: number; f1: number; accuracy: number; perCategory: Record<string, any> };
|
|
1319
|
+
getRecommendations(): Array<{ category: string; action: string; reason: string }>;
|
|
1320
|
+
reset(): void;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
// =========================================================================
|
|
1324
|
+
// Plugin Marketplace (v2.0)
|
|
1325
|
+
// =========================================================================
|
|
1326
|
+
|
|
1327
|
+
export declare class PluginValidator {
|
|
1328
|
+
validate(manifest: object): { valid: boolean; errors: string[]; warnings: string[]; score: number; grade: string };
|
|
1329
|
+
runTests(manifest: object): { passed: number; failed: number; total: number; results: any[] };
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
export declare class PluginRegistry {
|
|
1333
|
+
constructor(options?: { pluginDir?: string; autoValidate?: boolean });
|
|
1334
|
+
register(manifest: object): { success: boolean; validation?: object; error?: string };
|
|
1335
|
+
unregister(name: string): boolean;
|
|
1336
|
+
enable(name: string): boolean;
|
|
1337
|
+
disable(name: string): boolean;
|
|
1338
|
+
get(name: string): object | null;
|
|
1339
|
+
list(): Array<object>;
|
|
1340
|
+
search(query: string): Array<object>;
|
|
1341
|
+
scan(text: string): { threats: Threat[]; pluginsUsed: string[] };
|
|
1342
|
+
getStats(): object;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
export declare class MarketplaceClient {
|
|
1346
|
+
constructor(options?: { registryUrl?: string; timeoutMs?: number; registry?: PluginRegistry });
|
|
1347
|
+
browse(filters?: object): Promise<{ plugins: object[]; error?: string }>;
|
|
1348
|
+
install(name: string): Promise<{ success: boolean; plugin?: object; error?: string }>;
|
|
1349
|
+
publish(manifest: object): Promise<{ success: boolean; error?: string; validation?: object }>;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
// =========================================================================
|
|
1353
|
+
// Distributed Scanning (v2.1)
|
|
1354
|
+
// =========================================================================
|
|
1355
|
+
|
|
1356
|
+
export declare class DistributedAdapter {
|
|
1357
|
+
set(key: string, value: any, ttlMs?: number): Promise<void>;
|
|
1358
|
+
get(key: string): Promise<any>;
|
|
1359
|
+
del(key: string): Promise<boolean>;
|
|
1360
|
+
publish(channel: string, message: any): Promise<void>;
|
|
1361
|
+
subscribe(channel: string, handler: (message: any) => void): Promise<void>;
|
|
1362
|
+
incr(key: string, amount?: number): Promise<number>;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
export declare class MemoryAdapter extends DistributedAdapter {
|
|
1366
|
+
constructor();
|
|
1367
|
+
keys(prefix: string): Promise<string[]>;
|
|
1368
|
+
destroy(): void;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
export declare class RedisAdapter extends DistributedAdapter {
|
|
1372
|
+
constructor(options: { client: object; prefix?: string });
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
export declare class DistributedShield {
|
|
1376
|
+
constructor(options?: { adapter?: DistributedAdapter; instanceId?: string; syncIntervalMs?: number; threatTTLMs?: number });
|
|
1377
|
+
start(): Promise<void>;
|
|
1378
|
+
reportThreat(threat: object): Promise<void>;
|
|
1379
|
+
getGlobalStats(): Promise<object>;
|
|
1380
|
+
isKnownThreat(signature: string): Promise<boolean>;
|
|
1381
|
+
markKnownThreat(signature: string, metadata?: object): Promise<void>;
|
|
1382
|
+
stop(): Promise<void>;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
// =========================================================================
|
|
1386
|
+
// Audit Streaming (v2.1)
|
|
1387
|
+
// =========================================================================
|
|
1388
|
+
|
|
1389
|
+
export declare class AuditTransport {
|
|
1390
|
+
send(event: object): Promise<void>;
|
|
1391
|
+
sendBatch(events: object[]): Promise<void>;
|
|
1392
|
+
flush(): Promise<void>;
|
|
1393
|
+
close(): Promise<void>;
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
export declare class FileTransport extends AuditTransport {
|
|
1397
|
+
constructor(options?: { filePath?: string; maxSizeMB?: number; maxFiles?: number });
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
export declare class SplunkTransport extends AuditTransport {
|
|
1401
|
+
constructor(options: { url: string; token: string; index?: string; source?: string; sourcetype?: string; batchSize?: number; flushIntervalMs?: number });
|
|
1402
|
+
getStats(): object;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
export declare class ElasticsearchTransport extends AuditTransport {
|
|
1406
|
+
constructor(options: { url: string; index?: string; apiKey?: string; batchSize?: number; flushIntervalMs?: number });
|
|
1407
|
+
getStats(): object;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
export declare class AuditStreamManager {
|
|
1411
|
+
constructor(options?: { transports?: AuditTransport[]; includeMetadata?: boolean; environment?: string });
|
|
1412
|
+
addTransport(transport: AuditTransport): void;
|
|
1413
|
+
emit(type: string, data?: object): Promise<void>;
|
|
1414
|
+
emitScan(scanResult: ScanResult, context?: object): Promise<void>;
|
|
1415
|
+
emitThreat(threat: Threat, context?: object): Promise<void>;
|
|
1416
|
+
emitBlock(reason: string, context?: object): Promise<void>;
|
|
1417
|
+
flush(): Promise<void>;
|
|
1418
|
+
close(): Promise<void>;
|
|
1419
|
+
getStats(): object;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
// =========================================================================
|
|
1423
|
+
// Self-Healing (v3.0)
|
|
1424
|
+
// =========================================================================
|
|
1425
|
+
|
|
1426
|
+
export declare class SelfHealingEngine {
|
|
1427
|
+
constructor(options?: { maxPatterns?: number; autoApply?: boolean; onHeal?: (patterns: Pattern[]) => void });
|
|
1428
|
+
reportFalseNegative(attackText: string, metadata?: object): { healed: boolean; patterns: Pattern[]; error?: string };
|
|
1429
|
+
scan(text: string, options?: object): ScanResult;
|
|
1430
|
+
getPatterns(): Pattern[];
|
|
1431
|
+
getStats(): object;
|
|
1432
|
+
exportPatterns(): string;
|
|
1433
|
+
reset(): void;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
export declare class SelfHealingPatternGenerator {
|
|
1437
|
+
constructor();
|
|
1438
|
+
generate(attackText: string, options?: { category?: string }): Pattern | null;
|
|
1439
|
+
generateVariants(attackText: string, options?: object): Pattern[];
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
// =========================================================================
|
|
1443
|
+
// Honeypot (v3.0)
|
|
1444
|
+
// =========================================================================
|
|
1445
|
+
|
|
1446
|
+
export declare class HoneypotSession {
|
|
1447
|
+
constructor(sessionId: string, metadata?: object);
|
|
1448
|
+
addMessage(text: string, scanResult: ScanResult): void;
|
|
1449
|
+
getSummary(): object;
|
|
1450
|
+
end(): void;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
export declare class HoneypotEngine {
|
|
1454
|
+
constructor(options?: { maxSessions?: number; sessionTimeoutMs?: number; responseGenerator?: (text: string) => string; onAttack?: (info: any) => void; enabled?: boolean });
|
|
1455
|
+
process(text: string, sessionId?: string): { response: string; session: HoneypotSession; scanResult: ScanResult; isAttack: boolean; honeypotActive: boolean };
|
|
1456
|
+
getIntelligenceReport(): object;
|
|
1457
|
+
getCompletedSessions(): HoneypotSession[];
|
|
1458
|
+
endAllSessions(): void;
|
|
1459
|
+
getStats(): object;
|
|
1460
|
+
reset(): void;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
// =========================================================================
|
|
1464
|
+
// Multi-Modal (v3.0)
|
|
1465
|
+
// =========================================================================
|
|
1466
|
+
|
|
1467
|
+
export declare class ModalityExtractor {
|
|
1468
|
+
constructor();
|
|
1469
|
+
extractFromImage(imageData: object): Array<{ text: string; source: string }>;
|
|
1470
|
+
extractFromAudio(audioData: object): Array<{ text: string; source: string }>;
|
|
1471
|
+
extractFromPDF(pdfData: object): Array<{ text: string; source: string }>;
|
|
1472
|
+
extractFromToolOutput(toolOutput: object, toolName?: string): Array<{ text: string; source: string }>;
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
export declare class MultiModalScanner {
|
|
1476
|
+
constructor(options?: { sensitivity?: string; onThreat?: (threat: Threat) => void });
|
|
1477
|
+
scanImage(imageData: object): ScanResult;
|
|
1478
|
+
scanAudio(audioData: object): ScanResult;
|
|
1479
|
+
scanPDF(pdfData: object): ScanResult;
|
|
1480
|
+
scanToolOutput(toolOutput: object, toolName?: string): ScanResult;
|
|
1481
|
+
scanRaw(modality: string, texts: Array<{ text: string; source: string }>): ScanResult;
|
|
1482
|
+
getStats(): object;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
// =========================================================================
|
|
1486
|
+
// Behavior Profiling (v3.0)
|
|
1487
|
+
// =========================================================================
|
|
1488
|
+
|
|
1489
|
+
export declare class BehaviorProfile {
|
|
1490
|
+
constructor(options?: { windowSize?: number; learningPeriod?: number; anomalyThreshold?: number });
|
|
1491
|
+
record(observation: { responseLength?: number; responseTimeMs?: number; toolsCalled?: string[]; threatScore?: number; topic?: string }): { anomalies: any[]; isLearning: boolean };
|
|
1492
|
+
getBaseline(): object;
|
|
1493
|
+
getReport(): object;
|
|
1494
|
+
healthCheck(): { normal: boolean; riskLevel: string; concerns: string[] };
|
|
1495
|
+
reset(): void;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
// =========================================================================
|
|
1499
|
+
// SSO/SAML (v2.1)
|
|
1500
|
+
// =========================================================================
|
|
1501
|
+
|
|
1502
|
+
export declare class SSOSession {
|
|
1503
|
+
constructor(identity: object, role: string, permissions: string[], ttl: number);
|
|
1504
|
+
isValid(): boolean;
|
|
1505
|
+
hasPermission(permission: string): boolean;
|
|
1506
|
+
toJSON(): object;
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
export declare class IdentityMapper {
|
|
1510
|
+
constructor(mappingRules?: Array<{ idpGroup: string; shieldRole: string; permissions: string[] }>);
|
|
1511
|
+
addRule(rule: { idpGroup: string; shieldRole: string; permissions: string[] }): this;
|
|
1512
|
+
mapIdentity(identity: object): { role: string; permissions: string[] };
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
export declare class SAMLParser {
|
|
1516
|
+
constructor();
|
|
1517
|
+
parseAssertion(xml: string): { issuer: string; subject: string; conditions: object; attributes: object; raw: string };
|
|
1518
|
+
validateAssertion(assertion: object, provider: object): { valid: boolean; errors: string[] };
|
|
1519
|
+
extractAttributes(assertion: object): { email: string; name: string; groups: string[]; roles: string[]; custom: Record<string, any> };
|
|
1520
|
+
buildAuthnRequest(provider: object): string;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
export declare class OIDCHandler {
|
|
1524
|
+
constructor(config?: { clientId?: string; issuer?: string; redirectUri?: string });
|
|
1525
|
+
buildAuthorizationUrl(state: string): string;
|
|
1526
|
+
exchangeCode(code: string): { access_token: string; id_token: string; token_type: string; expires_in: number };
|
|
1527
|
+
validateIdToken(token: string): { valid: boolean; claims: object; errors: string[] };
|
|
1528
|
+
getUserInfo(accessToken: string): { sub: string; email: string; name: string; groups: string[] };
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
export declare class SSOManager {
|
|
1532
|
+
constructor(config?: { providers?: object[]; defaultRole?: string; sessionTTL?: number; auditLog?: boolean });
|
|
1533
|
+
registerProvider(provider: object): this;
|
|
1534
|
+
authenticate(providerType: string, assertion: string): SSOSession;
|
|
1535
|
+
mapToRole(identity: object): { role: string; permissions: string[] };
|
|
1536
|
+
getSession(sessionId: string): SSOSession | null;
|
|
1537
|
+
revokeSession(sessionId: string): boolean;
|
|
1538
|
+
listActiveSessions(): SSOSession[];
|
|
1539
|
+
getAuditLog(): object[];
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
export declare const SSO_DEFAULT_MAPPINGS: Array<{ idpGroup: string; shieldRole: string; permissions: string[] }>;
|
|
1543
|
+
|
|
1544
|
+
// =========================================================================
|
|
1545
|
+
// Model Fine-Tuning (v2.1)
|
|
1546
|
+
// =========================================================================
|
|
1547
|
+
|
|
1548
|
+
export declare class FineTunedModel {
|
|
1549
|
+
constructor(weights: number[], vocabulary: string[], config: object);
|
|
1550
|
+
predict(text: string): { label: string; confidence: number };
|
|
1551
|
+
predictBatch(texts: string[]): Array<{ label: string; confidence: number }>;
|
|
1552
|
+
export(): object;
|
|
1553
|
+
static load(json: object): FineTunedModel;
|
|
1554
|
+
getFeatureImportance(topN?: number): Array<{ term: string; weight: number }>;
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
export declare class DatasetManager {
|
|
1558
|
+
constructor();
|
|
1559
|
+
addSample(text: string, label: string, metadata?: object): this;
|
|
1560
|
+
addFromScanHistory(scanResults: ScanResult[]): this;
|
|
1561
|
+
augment(): this;
|
|
1562
|
+
split(ratio?: number): { train: any[]; validation: any[]; test: any[] };
|
|
1563
|
+
getStats(): object;
|
|
1564
|
+
export(): object;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
export declare class ModelTrainer {
|
|
1568
|
+
constructor(config?: { learningRate?: number; epochs?: number; batchSize?: number; validationSplit?: number });
|
|
1569
|
+
train(dataset: Array<{ text: string; label: string }>): FineTunedModel;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
export declare class ModelEvaluator {
|
|
1573
|
+
constructor();
|
|
1574
|
+
evaluate(model: FineTunedModel, testSet: Array<{ text: string; label: string }>): { accuracy: number; precision: number; recall: number; f1: number; confusionMatrix: object; roc_auc: number };
|
|
1575
|
+
generateReport(): string;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
export declare class TrainingPipeline {
|
|
1579
|
+
constructor(options?: { config?: object; datasetManager?: DatasetManager; trainer?: ModelTrainer; evaluator?: ModelEvaluator });
|
|
1580
|
+
run(dataset: Array<{ text: string; label: string }>): Promise<{ model: FineTunedModel; evaluation: object }>;
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
// =========================================================================
|
|
1584
|
+
// Threat Intelligence Network (v3.0)
|
|
1585
|
+
// =========================================================================
|
|
1586
|
+
|
|
1587
|
+
export declare class PatternAnonymizer {
|
|
1588
|
+
constructor(level?: 'low' | 'medium' | 'high');
|
|
1589
|
+
anonymize(pattern: object): object;
|
|
1590
|
+
hashPattern(pattern: object): string;
|
|
1591
|
+
generalize(regex: string): string;
|
|
1592
|
+
stripMetadata(metadata: object): object;
|
|
1593
|
+
addNoise(stats: object, sensitivity?: number, epsilon?: number): object;
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
export declare class PeerNode {
|
|
1597
|
+
constructor(nodeId: string, config?: { heartbeatIntervalMs?: number; heartbeatTimeoutMs?: number });
|
|
1598
|
+
connect(peerInfo: object): boolean;
|
|
1599
|
+
send(message: object): boolean;
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
export declare class ConsensusEngine {
|
|
1603
|
+
constructor(options?: { quorum?: number; votingTimeoutMs?: number });
|
|
1604
|
+
propose(pattern: object): Promise<{ accepted: boolean; votes: number }>;
|
|
1605
|
+
vote(proposalId: string, accept: boolean): void;
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
export declare class ThreatFeed {
|
|
1609
|
+
constructor(options?: { maxPatterns?: number; ttlMs?: number });
|
|
1610
|
+
add(pattern: object): void;
|
|
1611
|
+
getPatterns(): object[];
|
|
1612
|
+
getRecent(count?: number): object[];
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
export declare class ThreatIntelNetwork {
|
|
1616
|
+
constructor(options?: { nodeId?: string; anonymizationLevel?: string; consensusQuorum?: number });
|
|
1617
|
+
start(): Promise<void>;
|
|
1618
|
+
sharePattern(pattern: object): Promise<void>;
|
|
1619
|
+
getSharedPatterns(): object[];
|
|
1620
|
+
stop(): void;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
export declare const NETWORK_DEFAULTS: object;
|
|
1624
|
+
|
|
1625
|
+
// =========================================================================
|
|
1626
|
+
// I18n Patterns (v4.0)
|
|
1627
|
+
// =========================================================================
|
|
1628
|
+
|
|
1629
|
+
export declare class I18nPatternManager {
|
|
1630
|
+
constructor(options?: { languages?: string[] });
|
|
1631
|
+
getPatterns(language?: string): Pattern[];
|
|
1632
|
+
addPattern(language: string, pattern: Pattern): void;
|
|
1633
|
+
getAllPatterns(): Pattern[];
|
|
1634
|
+
getSupportedLanguages(): string[];
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
export declare const CJK_PATTERNS: Array<{ regex: RegExp; severity: string; category: string; description: string; language: string }>;
|
|
1638
|
+
export declare const ARABIC_PATTERNS: Array<{ regex: RegExp; severity: string; category: string; description: string; language: string }>;
|
|
1639
|
+
export declare const CYRILLIC_PATTERNS: Array<{ regex: RegExp; severity: string; category: string; description: string; language: string }>;
|
|
1640
|
+
export declare const INDIC_PATTERNS: Array<{ regex: RegExp; severity: string; category: string; description: string; language: string }>;
|
|
1641
|
+
export declare const MULTILINGUAL_PATTERNS: any[];
|
|
1642
|
+
export declare function getI18nPatterns(language?: string): Pattern[];
|
|
1643
|
+
|
|
1644
|
+
// =========================================================================
|
|
1645
|
+
// LLM Red Team Suite (v4.0)
|
|
1646
|
+
// =========================================================================
|
|
1647
|
+
|
|
1648
|
+
export declare class AdversarialGenerator {
|
|
1649
|
+
constructor();
|
|
1650
|
+
generatePayloads(category: string, count?: number): Array<{ payload: string; category: string; technique: string }>;
|
|
1651
|
+
mutate(payload: string): string;
|
|
1652
|
+
chainAttacks(payloads: string[]): Array<string[]>;
|
|
1653
|
+
generateEvasion(payload: string, technique: string): string;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
export declare class JailbreakLibrary {
|
|
1657
|
+
constructor();
|
|
1658
|
+
getTemplates(category: string): string[];
|
|
1659
|
+
getCategories(): string[];
|
|
1660
|
+
addTemplate(category: string, template: string): void;
|
|
1661
|
+
search(keyword: string): string[];
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
export declare class EvasionTester {
|
|
1665
|
+
constructor(options?: { sensitivity?: string; mutations?: number });
|
|
1666
|
+
test(payload: string): { totalMutations: number; detected: number; evaded: number; evasionRate: string; evasions: Array<{ mutation: string; text: string }> };
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
export declare class LLMRedTeamSuite {
|
|
1670
|
+
constructor(options?: { sensitivity?: string });
|
|
1671
|
+
runAll(): object;
|
|
1672
|
+
runCategory(category: string): object;
|
|
1673
|
+
generateReport(): object;
|
|
1674
|
+
formatReport(): string;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
export declare const JAILBREAK_TEMPLATES: Record<string, string[]>;
|
|
1678
|
+
export declare const MUTATION_TECHNIQUES: string[];
|
|
1679
|
+
|
|
1680
|
+
// =========================================================================
|
|
1681
|
+
// Agent Protocol (v5.0)
|
|
1682
|
+
// =========================================================================
|
|
1683
|
+
|
|
1684
|
+
export declare class ProtocolMessage {
|
|
1685
|
+
constructor(type: string, payload: any, senderId: string, sequenceNum: number);
|
|
1686
|
+
serialize(): string;
|
|
1687
|
+
static deserialize(raw: string): ProtocolMessage;
|
|
1688
|
+
isExpired(timeout: number): boolean;
|
|
1689
|
+
static TYPES: string[];
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
export declare class AgentIdentity {
|
|
1693
|
+
constructor(agentId: string, capabilities?: string[], metadata?: object);
|
|
1694
|
+
sign(secretKey: string): string;
|
|
1695
|
+
verify(signature: string, secretKey: string): boolean;
|
|
1696
|
+
hasCapability(cap: string): boolean;
|
|
1697
|
+
toJSON(): object;
|
|
1698
|
+
static fromJSON(json: object): AgentIdentity;
|
|
1699
|
+
static TRUST_LEVELS: string[];
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
export declare class SecureChannel {
|
|
1703
|
+
constructor(localIdentity: AgentIdentity, remoteIdentity: AgentIdentity, sharedSecret: string);
|
|
1704
|
+
send(payload: any, type?: string): string;
|
|
1705
|
+
receive(encrypted: string): { valid: boolean; message?: ProtocolMessage; error?: string };
|
|
1706
|
+
getStats(): object;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
export declare class HandshakeManager {
|
|
1710
|
+
constructor(options?: { timeoutMs?: number });
|
|
1711
|
+
initiate(localIdentity: AgentIdentity, remoteIdentity: AgentIdentity): { challenge: string; sessionId: string };
|
|
1712
|
+
respond(challenge: string, identity: AgentIdentity): { response: string; sessionId: string };
|
|
1713
|
+
verify(response: string, sessionId: string): { valid: boolean; channel?: SecureChannel };
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
export declare class MessageRouter {
|
|
1717
|
+
constructor();
|
|
1718
|
+
register(agentId: string, handler: (message: ProtocolMessage) => void): void;
|
|
1719
|
+
unregister(agentId: string): void;
|
|
1720
|
+
route(message: ProtocolMessage): boolean;
|
|
1721
|
+
broadcast(message: ProtocolMessage, exclude?: string[]): number;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
export declare class AgentProtocol {
|
|
1725
|
+
constructor(options?: { identity?: AgentIdentity; secret?: string });
|
|
1726
|
+
connect(remoteIdentity: AgentIdentity): SecureChannel;
|
|
1727
|
+
listen(handler: (message: ProtocolMessage, channel: SecureChannel) => void): void;
|
|
1728
|
+
getConnections(): object[];
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
export declare const PROTOCOL_VERSION: string;
|
|
1732
|
+
|
|
1733
|
+
// =========================================================================
|
|
1734
|
+
// Policy DSL (v5.0)
|
|
1735
|
+
// =========================================================================
|
|
1736
|
+
|
|
1737
|
+
export declare class PolicyParser {
|
|
1738
|
+
constructor();
|
|
1739
|
+
tokenize(source: string): Array<{ type: string; value: string; line: number; col: number }>;
|
|
1740
|
+
parse(tokens: any[]): { type: string; policies: any[] };
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
export declare class PolicyCompiler {
|
|
1744
|
+
constructor();
|
|
1745
|
+
compile(ast: object): { execute: (context: object) => object };
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
export declare class PolicyRuntime {
|
|
1749
|
+
constructor(options?: { builtins?: Record<string, Function> });
|
|
1750
|
+
load(source: string): void;
|
|
1751
|
+
evaluate(context: object): { allowed: boolean; violations: string[]; actions: string[] };
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
export declare class PolicyValidator {
|
|
1755
|
+
constructor();
|
|
1756
|
+
validate(source: string): { valid: boolean; errors: string[]; warnings: string[] };
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
export declare class PolicyDSL {
|
|
1760
|
+
constructor(options?: { source?: string; strict?: boolean });
|
|
1761
|
+
load(source: string): void;
|
|
1762
|
+
evaluate(context: object): { allowed: boolean; violations: string[]; actions: string[] };
|
|
1763
|
+
validate(): { valid: boolean; errors: string[]; warnings: string[] };
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
export declare const DSL_BUILTINS: Record<string, Function>;
|
|
1767
|
+
export declare const EXAMPLE_STRICT_POLICY: string;
|
|
1768
|
+
export declare const EXAMPLE_PERMISSIVE_POLICY: string;
|
|
1769
|
+
export declare const EXAMPLE_CUSTOM_RULES_POLICY: string;
|
|
1770
|
+
|
|
1771
|
+
// =========================================================================
|
|
1772
|
+
// Fuzzing Harness (v5.0)
|
|
1773
|
+
// =========================================================================
|
|
1774
|
+
|
|
1775
|
+
export declare class InputGenerator {
|
|
1776
|
+
constructor(options?: { seed?: number });
|
|
1777
|
+
generate(count?: number): string[];
|
|
1778
|
+
generateFromGrammar(grammar?: object): string;
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
export declare class FuzzMutationEngine {
|
|
1782
|
+
constructor(options?: { seed?: number });
|
|
1783
|
+
mutate(input: string): string;
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
export declare class CoverageTracker {
|
|
1787
|
+
constructor();
|
|
1788
|
+
record(input: string, result: ScanResult): void;
|
|
1789
|
+
getCoverage(): { categories: string[]; patterns: number; totalInputs: number; coverageRate: string };
|
|
1790
|
+
getUncovered(): string[];
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
export declare class FuzzReport {
|
|
1794
|
+
constructor(results: any[]);
|
|
1795
|
+
getSummary(): { total: number; crashes: number; uniqueFindings: number; coverageRate: string };
|
|
1796
|
+
format(): string;
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
export declare class CrashCollector {
|
|
1800
|
+
constructor(options?: { maxCrashes?: number });
|
|
1801
|
+
record(input: string, error: Error): void;
|
|
1802
|
+
getCrashes(): Array<{ input: string; error: string; timestamp: number }>;
|
|
1803
|
+
deduplicate(): Array<{ input: string; error: string; count: number }>;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
export declare class FuzzingHarness {
|
|
1807
|
+
constructor(options?: { iterations?: number; seed?: number; timeoutMs?: number; scanFn?: (text: string) => ScanResult });
|
|
1808
|
+
run(options?: { iterations?: number }): FuzzReport;
|
|
1809
|
+
getResults(): any[];
|
|
1810
|
+
getCoverage(): object;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
export declare const SEED_CORPUS: string[];
|
|
1814
|
+
|
|
1815
|
+
// =========================================================================
|
|
1816
|
+
// Model Fingerprinting (v5.0)
|
|
1817
|
+
// =========================================================================
|
|
1818
|
+
|
|
1819
|
+
export declare class ResponseAnalyzer {
|
|
1820
|
+
constructor();
|
|
1821
|
+
analyze(text: string): { features: Record<string, number>; wordCount: number; sentenceCount: number };
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
export declare class StyleProfile {
|
|
1825
|
+
constructor(samples?: string[]);
|
|
1826
|
+
addSample(text: string): void;
|
|
1827
|
+
getProfile(): { mean: Record<string, number>; stddev: Record<string, number>; sampleCount: number };
|
|
1828
|
+
similarity(other: StyleProfile): number;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
export declare class FingerprintDatabase {
|
|
1832
|
+
constructor();
|
|
1833
|
+
register(name: string, profile: StyleProfile): void;
|
|
1834
|
+
identify(text: string): Array<{ name: string; similarity: number }>;
|
|
1835
|
+
list(): string[];
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
export declare class SupplyChainDetector {
|
|
1839
|
+
constructor(options?: { database?: FingerprintDatabase });
|
|
1840
|
+
check(text: string, expectedModel?: string): { match: boolean; detectedModel: string; confidence: number; warning?: string };
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
export declare class ModelFingerprinter {
|
|
1844
|
+
constructor(options?: { database?: FingerprintDatabase });
|
|
1845
|
+
fingerprint(text: string): { profile: object; bestMatch: { name: string; similarity: number } | null };
|
|
1846
|
+
register(name: string, samples: string[]): void;
|
|
1847
|
+
identify(text: string): Array<{ name: string; similarity: number }>;
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
export declare const MODEL_SIGNATURES: Record<string, { mean: Record<string, number>; stddev: Record<string, number> }>;
|
|
1851
|
+
|
|
1852
|
+
// =========================================================================
|
|
1853
|
+
// Cost/Latency Optimizer (v5.0)
|
|
1854
|
+
// =========================================================================
|
|
1855
|
+
|
|
1856
|
+
export declare class ScanPlan {
|
|
1857
|
+
constructor(tier: string, config?: { costPerStep?: number; description?: string });
|
|
1858
|
+
addStep(name: string, config?: { timeout?: number; cost?: number; required?: boolean; type?: string }): this;
|
|
1859
|
+
getEstimatedLatency(): number;
|
|
1860
|
+
getEstimatedCost(): number;
|
|
1861
|
+
getSteps(): object[];
|
|
1862
|
+
toJSON(): object;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
export declare class TierManager {
|
|
1866
|
+
constructor();
|
|
1867
|
+
defineTier(name: string, config: object): void;
|
|
1868
|
+
getTier(name: string): object | null;
|
|
1869
|
+
listTiers(): string[];
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
export declare class LatencyBudget {
|
|
1873
|
+
constructor(options?: { budgetMs?: number; overheadMs?: number });
|
|
1874
|
+
allocate(stepName: string, estimatedMs: number): { allowed: boolean; allocated: number; remaining: number };
|
|
1875
|
+
isExhausted(): boolean;
|
|
1876
|
+
reset(): void;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
export declare class AdaptiveScanner {
|
|
1880
|
+
constructor(options?: ShieldOptions & { tiers?: Record<string, object>; defaultTier?: string });
|
|
1881
|
+
scan(text: string, options?: { tier?: string; budgetMs?: number }): ScanResult;
|
|
1882
|
+
selectTier(text: string): string;
|
|
1883
|
+
getStats(): object;
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
export declare class PerformanceMonitor {
|
|
1887
|
+
constructor(options?: { windowMs?: number; maxSamples?: number });
|
|
1888
|
+
record(durationMs: number, tier: string): void;
|
|
1889
|
+
getPercentiles(): { p50: number; p95: number; p99: number; mean: number };
|
|
1890
|
+
getTierBreakdown(): Record<string, { count: number; avgMs: number }>;
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
export declare class CostOptimizer {
|
|
1894
|
+
constructor(options?: { budgetPerMinute?: number; latencyTargetMs?: number });
|
|
1895
|
+
optimize(text: string, shield: AgentShield): ScanResult;
|
|
1896
|
+
getRecommendations(): Array<{ action: string; reason: string; impact: string }>;
|
|
1897
|
+
getStats(): object;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
export declare const OPTIMIZATION_PRESETS: Record<string, object>;
|
|
1901
|
+
|
|
1902
|
+
// =========================================================================
|
|
1903
|
+
// Worker Scanner (additional)
|
|
1904
|
+
// =========================================================================
|
|
1905
|
+
|
|
1906
|
+
export declare class ThreadedWorkerScanner {
|
|
1907
|
+
constructor(options?: { poolSize?: number; timeout?: number });
|
|
1908
|
+
scan(text: string, options?: object): Promise<ScanResult>;
|
|
1909
|
+
scanBatch(texts: string[], options?: object): Promise<ScanResult[]>;
|
|
1910
|
+
getStats(): { activeWorkers: number; queuedJobs: number; completed: number; errors: number; poolSize: number; terminated: boolean };
|
|
1911
|
+
terminate(): void;
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
// =========================================================================
|
|
1915
|
+
// v7.0 — MCP Security Runtime
|
|
1916
|
+
// =========================================================================
|
|
1917
|
+
|
|
1918
|
+
export interface MCPSecurityRuntimeOptions {
|
|
1919
|
+
signingKey?: string;
|
|
1920
|
+
enforceAuth?: boolean;
|
|
1921
|
+
enableBehaviorMonitoring?: boolean;
|
|
1922
|
+
enableStateMachine?: boolean;
|
|
1923
|
+
maxSessionsPerUser?: number;
|
|
1924
|
+
maxDelegationDepth?: number;
|
|
1925
|
+
sessionTtlMs?: number;
|
|
1926
|
+
maxToolCallsPerMinute?: number;
|
|
1927
|
+
maxAuditEntries?: number;
|
|
1928
|
+
allowedTools?: string[];
|
|
1929
|
+
blockedTools?: string[];
|
|
1930
|
+
policies?: any[];
|
|
1931
|
+
onThreat?: (event: any) => void;
|
|
1932
|
+
onBlock?: (event: any) => void;
|
|
1933
|
+
onAudit?: (event: any) => void;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
export interface SecureToolCallResult {
|
|
1937
|
+
allowed: boolean;
|
|
1938
|
+
threats: Threat[];
|
|
1939
|
+
violations: Array<{ type: string; message: string; tool?: string }>;
|
|
1940
|
+
anomalies: any[];
|
|
1941
|
+
token: { tokenId: string; token: string; expiresAt: number; scopes: string[] } | null;
|
|
1942
|
+
reason?: string;
|
|
1943
|
+
sanitizedArgs?: any;
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
export interface MCPSessionInfo {
|
|
1947
|
+
sessionId: string;
|
|
1948
|
+
authCtx: AuthorizationContext;
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
export declare class MCPSecurityRuntime {
|
|
1952
|
+
stats: {
|
|
1953
|
+
sessionsCreated: number;
|
|
1954
|
+
toolCallsProcessed: number;
|
|
1955
|
+
toolCallsBlocked: number;
|
|
1956
|
+
threatsDetected: number;
|
|
1957
|
+
authFailures: number;
|
|
1958
|
+
behaviorAnomalies: number;
|
|
1959
|
+
stateViolations: number;
|
|
1960
|
+
};
|
|
1961
|
+
constructor(options?: MCPSecurityRuntimeOptions);
|
|
1962
|
+
createSession(params: { userId: string; agentId: string; roles?: string[]; scopes?: string[]; intent?: string; maxToolCalls?: number; maxTokenBudget?: number; allowedTools?: string[] }): MCPSessionInfo;
|
|
1963
|
+
terminateSession(sessionId: string): boolean;
|
|
1964
|
+
secureToolCall(sessionId: string, toolName: string, args?: any): SecureToolCallResult;
|
|
1965
|
+
secureToolResult(sessionId: string, toolName: string, result: any): { safe: boolean; threats: Threat[]; sanitizedResult?: any };
|
|
1966
|
+
secureResource(uri: string, content: string, mimeType?: string): { safe: boolean; threats: Threat[] };
|
|
1967
|
+
registerTool(toolName: string, requirements?: { scopes?: string[]; roles?: string[]; requiresHumanApproval?: boolean; allowedIntents?: string[] }): void;
|
|
1968
|
+
addPolicy(rule: any): void;
|
|
1969
|
+
delegateSession(sessionId: string, delegateAgentId: string, delegateScopes?: string[]): MCPSessionInfo;
|
|
1970
|
+
createMiddleware(): {
|
|
1971
|
+
createSession(params: any): MCPSessionInfo;
|
|
1972
|
+
onToolCall(sessionId: string, toolName: string, args: any): SecureToolCallResult;
|
|
1973
|
+
onToolResult(sessionId: string, toolName: string, result: any): { safe: boolean; threats: Threat[] };
|
|
1974
|
+
onResourceAccess(uri: string, content: string, mimeType: string): { safe: boolean; threats: Threat[] };
|
|
1975
|
+
terminateSession(sessionId: string): boolean;
|
|
1976
|
+
getStats(): any;
|
|
1977
|
+
};
|
|
1978
|
+
getReport(): any;
|
|
1979
|
+
getAuditLog(limit?: number): any[];
|
|
1980
|
+
getBehaviorProfile(userId: string): any | null;
|
|
1981
|
+
shutdown(): void;
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
export declare class MCPSessionStateMachine {
|
|
1985
|
+
sessionId: string;
|
|
1986
|
+
state: string;
|
|
1987
|
+
transitions: Array<{ from: string; to: string; timestamp: number }>;
|
|
1988
|
+
constructor(sessionId: string);
|
|
1989
|
+
transition(newState: string): { allowed: boolean; from: string; to: string; reason?: string };
|
|
1990
|
+
isTerminated(): boolean;
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
export declare const SESSION_STATES: Readonly<Record<string, string[]>>;
|
|
1994
|
+
|
|
1995
|
+
// =========================================================================
|
|
1996
|
+
// v7.0 — MCP Certification & Trust
|
|
1997
|
+
// =========================================================================
|
|
1998
|
+
|
|
1999
|
+
export interface CertificationResult {
|
|
2000
|
+
certified: boolean;
|
|
2001
|
+
level: string;
|
|
2002
|
+
score: number;
|
|
2003
|
+
badge: string;
|
|
2004
|
+
timestamp: number;
|
|
2005
|
+
results: Array<{ id: string; name: string; category: string; severity: string; passed: boolean; description: string }>;
|
|
2006
|
+
recommendations: Array<{ id: string; priority: string; action: string }>;
|
|
2007
|
+
summary: { total: number; passed: number; failed: number; criticalFailures: number };
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
export declare class MCPCertification {
|
|
2011
|
+
static evaluate(config: any): CertificationResult;
|
|
2012
|
+
static formatReport(evaluation: CertificationResult): string;
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
export declare class AgentThreatIntelligence {
|
|
2016
|
+
stats: { patternsLearned: number; attacksObserved: number; trendsGenerated: number };
|
|
2017
|
+
constructor(options?: { maxPatterns?: number; decayHalfLifeMs?: number; minConfidence?: number });
|
|
2018
|
+
recordAttack(attack: { category: string; pattern: string; source?: string; context?: any; blocked?: boolean }): { patternId: string; isNew: boolean; confidence: number };
|
|
2019
|
+
checkAgainstIntel(input: string): { matches: any[]; riskScore: number };
|
|
2020
|
+
getTrends(windowMs?: number): { topCategories: any[]; attackRate: number; trendDirection: string; bypassRate: number; totalObserved: number };
|
|
2021
|
+
exportCorpus(): any;
|
|
2022
|
+
importCorpus(corpus: any): { imported: number; merged: number; skipped: number };
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
export declare class CrossOrgAgentTrust {
|
|
2026
|
+
stats: { issued: number; verified: number; rejected: number; revoked: number };
|
|
2027
|
+
constructor(options: { orgId: string; signingKey: string; certificateTtlMs?: number; maxCertificates?: number });
|
|
2028
|
+
issueCertificate(params: { agentId: string; capabilities?: string[]; allowedOrgs?: string[]; trustLevel?: number }): any;
|
|
2029
|
+
verifyCertificate(certificate: any): { valid: boolean; reason?: string; trustLevel: number };
|
|
2030
|
+
revokeCertificate(certId: string): boolean;
|
|
2031
|
+
trustOrganization(orgId: string, publicKey: string, trustLevel?: number): void;
|
|
2032
|
+
untrustOrganization(orgId: string): void;
|
|
2033
|
+
getTrustReport(): any;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
export declare const MCP_THREAT_CATEGORIES: Readonly<Record<string, { severity: string; weight: number }>>;
|
|
2037
|
+
export declare const CERTIFICATION_REQUIREMENTS: ReadonlyArray<{ id: string; name: string; category: string; severity: string; description: string }>;
|
|
2038
|
+
export declare const CERTIFICATION_LEVELS: Readonly<Record<string, { minScore: number; label: string; badge: string }>>;
|
|
2039
|
+
|
|
2040
|
+
// =========================================================================
|
|
2041
|
+
// v7.0 — Authorization Context (enhanced)
|
|
2042
|
+
// =========================================================================
|
|
2043
|
+
|
|
2044
|
+
export declare class AuthorizationContext {
|
|
2045
|
+
contextId: string;
|
|
2046
|
+
userId: string;
|
|
2047
|
+
agentId: string;
|
|
2048
|
+
roles: readonly string[];
|
|
2049
|
+
scopes: readonly string[];
|
|
2050
|
+
intent: string | null;
|
|
2051
|
+
createdAt: number;
|
|
2052
|
+
expiresAt: number;
|
|
2053
|
+
parentContextId: string | null;
|
|
2054
|
+
delegationDepth: number;
|
|
2055
|
+
constructor(params: { userId: string; agentId: string; roles?: string[]; scopes?: string[]; intent?: string; ttlMs?: number; parentContextId?: string; signingKey?: string });
|
|
2056
|
+
isExpired(): boolean;
|
|
2057
|
+
hasScope(scope: string): boolean;
|
|
2058
|
+
hasRole(role: string): boolean;
|
|
2059
|
+
delegate(delegateAgentId: string, delegateScopes?: string[]): AuthorizationContext;
|
|
2060
|
+
verify(): boolean;
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
export declare class EphemeralTokenManager {
|
|
2064
|
+
constructor(options?: { tokenTtlMs?: number; maxTokensPerUser?: number; rotationWindowMs?: number; signingKey?: string });
|
|
2065
|
+
issueToken(authCtx: AuthorizationContext, scopes?: string[]): { tokenId: string; token: string; expiresAt: number; scopes: string[] };
|
|
2066
|
+
validateToken(tokenId: string): { valid: boolean; reason: string | null; userId: string | null; scopes: string[] };
|
|
2067
|
+
rotateToken(tokenId: string, authCtx: AuthorizationContext): any;
|
|
2068
|
+
revokeToken(tokenId: string): void;
|
|
2069
|
+
startCleanup(intervalMs?: number): void;
|
|
2070
|
+
stopCleanup(): void;
|
|
2071
|
+
getStats(): { issued: number; rotated: number; revoked: number; expired: number; validated: number };
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
export declare class IntentValidator {
|
|
2075
|
+
constructor(options?: any);
|
|
2076
|
+
addPolicy(policy: { tool: string; requiredScopes?: string[]; requiredRoles?: string[]; allowedIntents?: string[]; requiresHumanApproval?: boolean }): void;
|
|
2077
|
+
validateAction(toolName: string, args: any, authCtx: AuthorizationContext): { allowed: boolean; violations: any[]; requiresApproval: boolean };
|
|
2078
|
+
getAuditLog(limit?: number): any[];
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
export declare class ConfusedDeputyGuard {
|
|
2082
|
+
stats: { checked: number; allowed: number; denied: number; escalations: number };
|
|
2083
|
+
constructor(options?: { enforceContext?: boolean; logOnly?: boolean; signingKey?: string });
|
|
2084
|
+
registerTool(toolName: string, requirements?: { scopes?: string[]; roles?: string[]; requiresHumanApproval?: boolean }): void;
|
|
2085
|
+
wrapToolCall(toolName: string, args: any, authCtx?: AuthorizationContext): { allowed: boolean; violations: any[]; requiresApproval: boolean; token: any | null };
|
|
2086
|
+
getStats(): any;
|
|
2087
|
+
getAuditLog(limit?: number): any[];
|
|
2088
|
+
}
|