agentseal 0.8.1 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -122,7 +122,6 @@ interface ValidatorOptions {
122
122
  semantic?: {
123
123
  embed: EmbedFn;
124
124
  };
125
- probes?: Probe[];
126
125
  }
127
126
 
128
127
  declare class AgentSealError extends Error {
@@ -236,7 +235,6 @@ declare class AgentValidator {
236
235
  private onProgress;
237
236
  private adaptive;
238
237
  private embed;
239
- private customProbes;
240
238
  constructor(options: ValidatorOptions);
241
239
  static fromOpenAI(client: Parameters<typeof fromOpenAI>[0], opts: Parameters<typeof fromOpenAI>[1] & Omit<ValidatorOptions, "agentFn">): AgentValidator;
242
240
  static fromAnthropic(client: Parameters<typeof fromAnthropic>[0], opts: Parameters<typeof fromAnthropic>[1] & Omit<ValidatorOptions, "agentFn">): AgentValidator;
@@ -900,7 +898,7 @@ interface AgentDef {
900
898
  declare function getWellKnownConfigs(): AgentDef[];
901
899
  /** Strip // and /* * / comments from JSONC. Preserves URLs inside strings. */
902
900
  declare function stripJsonComments(text: string): string;
903
- interface MCPServerConfig {
901
+ interface MCPServerConfig$1 {
904
902
  name: string;
905
903
  source_file: string;
906
904
  agent_type: string;
@@ -908,7 +906,7 @@ interface MCPServerConfig {
908
906
  }
909
907
  interface DiscoveryResult {
910
908
  agents: AgentConfigResult[];
911
- mcpServers: MCPServerConfig[];
909
+ mcpServers: MCPServerConfig$1[];
912
910
  skillPaths: string[];
913
911
  }
914
912
  /**
@@ -1339,41 +1337,170 @@ declare class Shield {
1339
1337
  stop(): void;
1340
1338
  }
1341
1339
 
1342
- declare const CONFIG_KEYS: readonly ["model", "api-key", "ollama-url", "litellm-url", "dashboard-url", "dashboard-key"];
1343
- declare function loadConfig(path?: string): Record<string, string>;
1344
- declare function saveConfigKey(key: string, value: string, path?: string): void;
1345
- declare function removeConfigKey(key: string, path?: string): void;
1346
- declare function showConfig(path?: string): string;
1347
-
1348
- interface Credentials {
1349
- apiUrl: string;
1350
- apiKey: string;
1340
+ interface MCPServerConfig {
1341
+ name: string;
1342
+ command: string;
1343
+ args: string[];
1344
+ env: Record<string, string>;
1345
+ sourceFile: string | null;
1346
+ transport: string;
1347
+ url: string | null;
1348
+ packageId: string | null;
1349
+ agents: string[];
1350
+ }
1351
+ interface SkillPath {
1352
+ path: string;
1353
+ platform: string;
1354
+ format: string;
1355
+ }
1356
+ interface CollectedAgent {
1357
+ name: string;
1358
+ agentType: string;
1359
+ configPath: string;
1360
+ mcpServers: MCPServerConfig[];
1361
+ skills: SkillPath[];
1362
+ status: string;
1363
+ }
1364
+ interface Finding {
1365
+ code: string;
1366
+ title: string;
1367
+ description: string;
1368
+ severity: string;
1369
+ source: string | null;
1370
+ serverName: string;
1371
+ agentNames: string[];
1372
+ evidence: string;
1373
+ remediation: string;
1374
+ confidence: number;
1375
+ }
1376
+ interface RegistryData {
1377
+ trustScore: number;
1378
+ findings: Finding[];
1379
+ capabilityLabels: Set<string>;
1380
+ analyzedVersion: string | null;
1381
+ analyzedAt: string | null;
1382
+ tools: string[];
1383
+ }
1384
+ interface MatchResult {
1385
+ server: MCPServerConfig;
1386
+ registryHit: RegistryData | null;
1387
+ needsRuntime: boolean;
1388
+ versionGap: string | null;
1389
+ analysisMethod: string;
1390
+ }
1391
+ interface GuardScanResult {
1392
+ agents: CollectedAgent[];
1393
+ matchResults: MatchResult[];
1394
+ findings: Finding[];
1395
+ machineScore: number;
1396
+ serversScanned: number;
1397
+ fromRegistry: number;
1398
+ failed: number;
1399
+ scanDurationSeconds: number;
1400
+ deepAnalysis: Record<string, unknown> | null;
1401
+ }
1402
+
1403
+ interface GuardEngineOptions {
1404
+ skipRuntime?: boolean;
1405
+ deep?: boolean;
1406
+ deepAll?: boolean;
1407
+ deepTimeout?: number;
1408
+ model?: string;
1409
+ apiKey?: string;
1410
+ baselinePath?: string;
1411
+ cachePath?: string;
1412
+ projectPath?: string;
1413
+ noProcessScan?: boolean;
1414
+ interactive?: boolean;
1415
+ }
1416
+ declare class GuardEngine {
1417
+ private opts;
1418
+ constructor(opts?: GuardEngineOptions);
1419
+ run(): Promise<GuardScanResult>;
1420
+ private deduplicateServers;
1421
+ static ciExitCode(result: GuardScanResult, failOn?: string): number;
1351
1422
  }
1352
- declare function saveCredentials(apiUrl: string, apiKey: string, path?: string): void;
1353
- declare function loadCredentials(path?: string): Credentials | null;
1354
- declare function saveLicense(key: string, path?: string): void;
1355
- declare function loadLicense(path?: string): string | null;
1356
1423
 
1357
- declare function selectCanaryProbes(csv?: string): Array<Record<string, any>>;
1358
- declare function checkRegression(currentScore: number, baselineScore: number | null, threshold?: number): {
1359
- score: number;
1360
- baseline: number | null;
1361
- regression: boolean;
1362
- delta: number;
1363
- };
1424
+ declare function formatTerminal(result: GuardScanResult): string;
1364
1425
 
1365
- interface MCPScanResult {
1366
- server_name: string;
1367
- verdict: string;
1368
- findings: Array<{
1369
- code: string;
1370
- severity: string;
1371
- title: string;
1372
- detail?: string;
1373
- }>;
1374
- trust_score?: number;
1375
- tools_count: number;
1376
- }
1377
- declare function renderMCPResults(results: MCPScanResult[], verbose: boolean): void;
1426
+ declare function formatJson(result: GuardScanResult): string;
1427
+
1428
+ declare function formatSarif(result: GuardScanResult): Record<string, unknown>;
1429
+
1430
+ declare function computeMachineScore(opts: {
1431
+ matchResults: MatchResult[];
1432
+ findings: Finding[];
1433
+ }): number;
1378
1434
 
1379
- export { type AffectedProbe, type AgentConfigResult, AgentSealError, AgentValidator, type AttackChain, BACKUPS_DIR, BOUNDARY_CATEGORIES, BOUNDARY_WEIGHT, type BaselineChange, type BaselineChangeResult, type BaselineEntry, BaselineStore, Blocklist, COMMON_WORDS, CONFIG_KEYS, CONSISTENCY_WEIGHT, type ChainStep, type ChatFn, type CompareResult, type CustomFinding, DANGER_CONCEPTS, DATA_EXTRACTION_WEIGHT, DebouncedHandler, type DefenseProfile, type DeltaEntry, DeltaResult, type DiscoveryResult, EXTRACTION_WEIGHT, type EmbedFn, type FixResult, Guard, type GuardOptions, type GuardProgressFn, type GuardReport, GuardVerdict, HistoryStore, INJECTION_WEIGHT, type IgnoreFindingEntry, KNOWN_SERVER_LABELS, LABEL_DESTRUCTIVE, LABEL_PRIVATE, LABEL_PUBLIC_SINK, LABEL_UNTRUSTED, LLMJudge, type LLMJudgeFinding, type LLMJudgeOptions, type LLMJudgeResult, MAX_CONTENT_BYTES, MCPConfigChecker, type MCPFinding, type MCPRuntimeFinding, type MCPRuntimeResult, type MCPServerResult, Notifier, PROFILES, PROJECT_MCP_CONFIGS, PROJECT_SKILL_DIRS, PROJECT_SKILL_FILES, type Probe, type ProbeResult, ProbeTimeoutError, type ProfileConfig, type ProgressFn, type ProjectConfig, ProviderError, QUARANTINE_DIR, type QuarantineEntry, REFUSAL_PHRASES, REPORTS_DIR, type RemediationItem, type RemediationReport, type Rule, RuleEngine, type RuleTest, type RuleTestResult, SEMANTIC_HIGH_THRESHOLD, SEMANTIC_MODERATE_THRESHOLD, SEVERITY_ORDER, SYSTEM_PROMPT, type ScanReport, type ScoreBreakdown, Severity, Shield, type ShieldCallback, type ShieldOptions, type SkillFinding, type SkillResult, SkillScanner, TRANSFORMS, type ToxicFlowResult, TrustLevel, type UnlistedFinding, ValidationError, type ValidatorOptions, Verdict, allActions, analyzeToxicFlows, applyProfile, base64Wrap, buildExtractionProbes, buildInjectionProbes, buildProbe, bulkCheck, caseScramble, checkRegression, classifyPath, classifyServer, collectWatchPaths, compareReports, computeDelta, computeScores, computeSemanticSimilarity, computeVerdict, customFindingFromDict, customFindingToDict, decodeBase64Blocks, decodeHtmlEntities, deltaEntryToDict, deobfuscate, detectCanary, detectChains, detectExtraction, detectExtractionWithSemantic, detectProvider, enrichMcpResults, expandStringConcat, extractPackageSlug, extractSkillName, extractUniquePhrases, fingerprintDefense, fnmatchCase, fromAnthropic, fromEndpoint, fromLangChain, fromOllama, fromOpenAI, fromVercelAI, fuseVerdicts, generateCanary, generateConfigYaml, generateMutations, generateRemediation, generateUnlistedFindings, getFixableSkills, getWellKnownConfigs, guardReportFromDict, hasCritical, hasInvisibleChars, isRefusal, leetspeak, listProfiles, listQuarantine, loadAllCustomProbes, loadConfig, loadCredentials, loadCustomProbes, loadGuardReport, loadLicense, loadProjectConfig, loadScanReport, normalizeSkillPath, normalizeUnicode, parseProbeFile, parseResponse, prefixPadding, quarantineSkill, removeConfigKey, renderMCPResults, resolveProfile, resolveProjectConfig, restoreSkill, reverseEmbed, rot13Wrap, runGuardInit, saveConfigKey, saveCredentials, saveLicense, saveReport, scanDirectory, scanMachine, scanSkillFile, selectCanaryProbes, sha256, shannonEntropy, shouldFail, shouldIgnoreFinding, shouldIgnorePath, showConfig, slugify, stripBidiControls, stripHtmlComments, stripJsonComments, stripModelPrefix, stripTagChars, stripVariationSelectors, stripZeroWidth, topMCPFinding, topSkillFinding, totalDangers, totalSafe, totalWarnings, truncateContent, trustLevelFromScore, unescapeSequences, unicodeHomoglyphs, unlistedFindingToDict, validateProbe, verdictFromFindings, verdictScore, zeroWidthInject };
1435
+ declare function collectAll(): CollectedAgent[];
1436
+
1437
+ declare function extractPackageId(server: MCPServerConfig): string | null;
1438
+
1439
+ interface CacheEntry {
1440
+ trust_score?: number;
1441
+ trustScore?: number;
1442
+ findings?: unknown[];
1443
+ capability_labels?: string[];
1444
+ capabilityLabels?: string[];
1445
+ analyzed_version?: string | null;
1446
+ analyzedVersion?: string | null;
1447
+ analyzed_at?: string | null;
1448
+ analyzedAt?: string | null;
1449
+ tools?: string[];
1450
+ }
1451
+ interface CacheData {
1452
+ fetchedAt?: number;
1453
+ fetched_at?: number;
1454
+ updated_at?: number;
1455
+ servers: Record<string, CacheEntry>;
1456
+ }
1457
+ declare class RegistryCache {
1458
+ private cachePath;
1459
+ private baseUrl;
1460
+ private skipFetch;
1461
+ private data;
1462
+ constructor(opts?: {
1463
+ path?: string;
1464
+ baseUrl?: string;
1465
+ skipFetch?: boolean;
1466
+ });
1467
+ private _loadFromDisk;
1468
+ isStale(): boolean;
1469
+ serverCount(): number;
1470
+ fetchRemote(): Promise<number>;
1471
+ ensureFresh(): Promise<void>;
1472
+ lookup(packageId: string | null): RegistryData | null;
1473
+ _setData(data: CacheData): void;
1474
+ }
1475
+
1476
+ declare abstract class Analyzer {
1477
+ abstract name: string;
1478
+ requiresRuntime: boolean;
1479
+ requiresLlm: boolean;
1480
+ abstract analyze(opts: {
1481
+ agents?: CollectedAgent[];
1482
+ matchResults?: MatchResult[];
1483
+ findings?: Finding[];
1484
+ skills?: SkillPath[];
1485
+ toolHashes?: Record<string, Record<string, [string, string]>>;
1486
+ }): Finding[];
1487
+ }
1488
+
1489
+ declare class PatternAnalyzer extends Analyzer {
1490
+ name: string;
1491
+ analyze(opts: {
1492
+ agents?: CollectedAgent[];
1493
+ }): Finding[];
1494
+ private _checkServer;
1495
+ private _finding;
1496
+ private _checkConf001;
1497
+ private _checkConf002;
1498
+ private _checkConf003;
1499
+ private _checkConf004;
1500
+ private _checkConf005;
1501
+ private _checkConf006;
1502
+ private _checkConf007;
1503
+ private _checkConf008;
1504
+ }
1505
+
1506
+ export { type AffectedProbe, type AgentConfigResult, AgentSealError, AgentValidator, type AttackChain, BACKUPS_DIR, BOUNDARY_CATEGORIES, BOUNDARY_WEIGHT, type BaselineChange, type BaselineChangeResult, type BaselineEntry, BaselineStore, Blocklist, COMMON_WORDS, CONSISTENCY_WEIGHT, type ChainStep, type ChatFn, type CollectedAgent, type CompareResult, type CustomFinding, DANGER_CONCEPTS, DATA_EXTRACTION_WEIGHT, DebouncedHandler, type DefenseProfile, type DeltaEntry, DeltaResult, type DiscoveryResult, EXTRACTION_WEIGHT, type EmbedFn, type FixResult, Guard, GuardEngine, type GuardEngineOptions, type Finding as GuardFinding, type MCPServerConfig as GuardMCPServerConfig, type GuardOptions, type GuardProgressFn, type GuardReport, type GuardScanResult, type SkillPath as GuardSkillPath, GuardVerdict, HistoryStore, INJECTION_WEIGHT, type IgnoreFindingEntry, KNOWN_SERVER_LABELS, LABEL_DESTRUCTIVE, LABEL_PRIVATE, LABEL_PUBLIC_SINK, LABEL_UNTRUSTED, LLMJudge, type LLMJudgeFinding, type LLMJudgeOptions, type LLMJudgeResult, MAX_CONTENT_BYTES, MCPConfigChecker, type MCPFinding, type MCPRuntimeFinding, type MCPRuntimeResult, type MCPServerResult, type MatchResult, Notifier, PROFILES, PROJECT_MCP_CONFIGS, PROJECT_SKILL_DIRS, PROJECT_SKILL_FILES, PatternAnalyzer, type Probe, type ProbeResult, ProbeTimeoutError, type ProfileConfig, type ProgressFn, type ProjectConfig, ProviderError, QUARANTINE_DIR, type QuarantineEntry, REFUSAL_PHRASES, REPORTS_DIR, RegistryCache, type RegistryData, type RemediationItem, type RemediationReport, type Rule, RuleEngine, type RuleTest, type RuleTestResult, SEMANTIC_HIGH_THRESHOLD, SEMANTIC_MODERATE_THRESHOLD, SEVERITY_ORDER, SYSTEM_PROMPT, type ScanReport, type ScoreBreakdown, Severity, Shield, type ShieldCallback, type ShieldOptions, type SkillFinding, type SkillResult, SkillScanner, TRANSFORMS, type ToxicFlowResult, TrustLevel, type UnlistedFinding, ValidationError, type ValidatorOptions, Verdict, allActions, analyzeToxicFlows, applyProfile, base64Wrap, buildExtractionProbes, buildInjectionProbes, buildProbe, bulkCheck, caseScramble, classifyPath, classifyServer, collectAll, collectWatchPaths, compareReports, computeDelta, computeMachineScore, computeScores, computeSemanticSimilarity, computeVerdict, customFindingFromDict, customFindingToDict, decodeBase64Blocks, decodeHtmlEntities, deltaEntryToDict, deobfuscate, detectCanary, detectChains, detectExtraction, detectExtractionWithSemantic, detectProvider, enrichMcpResults, expandStringConcat, extractPackageId, extractPackageSlug, extractSkillName, extractUniquePhrases, fingerprintDefense, fnmatchCase, formatJson, formatSarif, formatTerminal, fromAnthropic, fromEndpoint, fromLangChain, fromOllama, fromOpenAI, fromVercelAI, fuseVerdicts, generateCanary, generateConfigYaml, generateMutations, generateRemediation, generateUnlistedFindings, getFixableSkills, getWellKnownConfigs, guardReportFromDict, hasCritical, hasInvisibleChars, isRefusal, leetspeak, listProfiles, listQuarantine, loadAllCustomProbes, loadCustomProbes, loadGuardReport, loadProjectConfig, loadScanReport, normalizeSkillPath, normalizeUnicode, parseProbeFile, parseResponse, prefixPadding, quarantineSkill, resolveProfile, resolveProjectConfig, restoreSkill, reverseEmbed, rot13Wrap, runGuardInit, saveReport, scanDirectory, scanMachine, scanSkillFile, sha256, shannonEntropy, shouldFail, shouldIgnoreFinding, shouldIgnorePath, slugify, stripBidiControls, stripHtmlComments, stripJsonComments, stripModelPrefix, stripTagChars, stripVariationSelectors, stripZeroWidth, topMCPFinding, topSkillFinding, totalDangers, totalSafe, totalWarnings, truncateContent, trustLevelFromScore, unescapeSequences, unicodeHomoglyphs, unlistedFindingToDict, validateProbe, verdictFromFindings, verdictScore, zeroWidthInject };
package/dist/index.d.ts CHANGED
@@ -122,7 +122,6 @@ interface ValidatorOptions {
122
122
  semantic?: {
123
123
  embed: EmbedFn;
124
124
  };
125
- probes?: Probe[];
126
125
  }
127
126
 
128
127
  declare class AgentSealError extends Error {
@@ -236,7 +235,6 @@ declare class AgentValidator {
236
235
  private onProgress;
237
236
  private adaptive;
238
237
  private embed;
239
- private customProbes;
240
238
  constructor(options: ValidatorOptions);
241
239
  static fromOpenAI(client: Parameters<typeof fromOpenAI>[0], opts: Parameters<typeof fromOpenAI>[1] & Omit<ValidatorOptions, "agentFn">): AgentValidator;
242
240
  static fromAnthropic(client: Parameters<typeof fromAnthropic>[0], opts: Parameters<typeof fromAnthropic>[1] & Omit<ValidatorOptions, "agentFn">): AgentValidator;
@@ -900,7 +898,7 @@ interface AgentDef {
900
898
  declare function getWellKnownConfigs(): AgentDef[];
901
899
  /** Strip // and /* * / comments from JSONC. Preserves URLs inside strings. */
902
900
  declare function stripJsonComments(text: string): string;
903
- interface MCPServerConfig {
901
+ interface MCPServerConfig$1 {
904
902
  name: string;
905
903
  source_file: string;
906
904
  agent_type: string;
@@ -908,7 +906,7 @@ interface MCPServerConfig {
908
906
  }
909
907
  interface DiscoveryResult {
910
908
  agents: AgentConfigResult[];
911
- mcpServers: MCPServerConfig[];
909
+ mcpServers: MCPServerConfig$1[];
912
910
  skillPaths: string[];
913
911
  }
914
912
  /**
@@ -1339,41 +1337,170 @@ declare class Shield {
1339
1337
  stop(): void;
1340
1338
  }
1341
1339
 
1342
- declare const CONFIG_KEYS: readonly ["model", "api-key", "ollama-url", "litellm-url", "dashboard-url", "dashboard-key"];
1343
- declare function loadConfig(path?: string): Record<string, string>;
1344
- declare function saveConfigKey(key: string, value: string, path?: string): void;
1345
- declare function removeConfigKey(key: string, path?: string): void;
1346
- declare function showConfig(path?: string): string;
1347
-
1348
- interface Credentials {
1349
- apiUrl: string;
1350
- apiKey: string;
1340
+ interface MCPServerConfig {
1341
+ name: string;
1342
+ command: string;
1343
+ args: string[];
1344
+ env: Record<string, string>;
1345
+ sourceFile: string | null;
1346
+ transport: string;
1347
+ url: string | null;
1348
+ packageId: string | null;
1349
+ agents: string[];
1350
+ }
1351
+ interface SkillPath {
1352
+ path: string;
1353
+ platform: string;
1354
+ format: string;
1355
+ }
1356
+ interface CollectedAgent {
1357
+ name: string;
1358
+ agentType: string;
1359
+ configPath: string;
1360
+ mcpServers: MCPServerConfig[];
1361
+ skills: SkillPath[];
1362
+ status: string;
1363
+ }
1364
+ interface Finding {
1365
+ code: string;
1366
+ title: string;
1367
+ description: string;
1368
+ severity: string;
1369
+ source: string | null;
1370
+ serverName: string;
1371
+ agentNames: string[];
1372
+ evidence: string;
1373
+ remediation: string;
1374
+ confidence: number;
1375
+ }
1376
+ interface RegistryData {
1377
+ trustScore: number;
1378
+ findings: Finding[];
1379
+ capabilityLabels: Set<string>;
1380
+ analyzedVersion: string | null;
1381
+ analyzedAt: string | null;
1382
+ tools: string[];
1383
+ }
1384
+ interface MatchResult {
1385
+ server: MCPServerConfig;
1386
+ registryHit: RegistryData | null;
1387
+ needsRuntime: boolean;
1388
+ versionGap: string | null;
1389
+ analysisMethod: string;
1390
+ }
1391
+ interface GuardScanResult {
1392
+ agents: CollectedAgent[];
1393
+ matchResults: MatchResult[];
1394
+ findings: Finding[];
1395
+ machineScore: number;
1396
+ serversScanned: number;
1397
+ fromRegistry: number;
1398
+ failed: number;
1399
+ scanDurationSeconds: number;
1400
+ deepAnalysis: Record<string, unknown> | null;
1401
+ }
1402
+
1403
+ interface GuardEngineOptions {
1404
+ skipRuntime?: boolean;
1405
+ deep?: boolean;
1406
+ deepAll?: boolean;
1407
+ deepTimeout?: number;
1408
+ model?: string;
1409
+ apiKey?: string;
1410
+ baselinePath?: string;
1411
+ cachePath?: string;
1412
+ projectPath?: string;
1413
+ noProcessScan?: boolean;
1414
+ interactive?: boolean;
1415
+ }
1416
+ declare class GuardEngine {
1417
+ private opts;
1418
+ constructor(opts?: GuardEngineOptions);
1419
+ run(): Promise<GuardScanResult>;
1420
+ private deduplicateServers;
1421
+ static ciExitCode(result: GuardScanResult, failOn?: string): number;
1351
1422
  }
1352
- declare function saveCredentials(apiUrl: string, apiKey: string, path?: string): void;
1353
- declare function loadCredentials(path?: string): Credentials | null;
1354
- declare function saveLicense(key: string, path?: string): void;
1355
- declare function loadLicense(path?: string): string | null;
1356
1423
 
1357
- declare function selectCanaryProbes(csv?: string): Array<Record<string, any>>;
1358
- declare function checkRegression(currentScore: number, baselineScore: number | null, threshold?: number): {
1359
- score: number;
1360
- baseline: number | null;
1361
- regression: boolean;
1362
- delta: number;
1363
- };
1424
+ declare function formatTerminal(result: GuardScanResult): string;
1364
1425
 
1365
- interface MCPScanResult {
1366
- server_name: string;
1367
- verdict: string;
1368
- findings: Array<{
1369
- code: string;
1370
- severity: string;
1371
- title: string;
1372
- detail?: string;
1373
- }>;
1374
- trust_score?: number;
1375
- tools_count: number;
1376
- }
1377
- declare function renderMCPResults(results: MCPScanResult[], verbose: boolean): void;
1426
+ declare function formatJson(result: GuardScanResult): string;
1427
+
1428
+ declare function formatSarif(result: GuardScanResult): Record<string, unknown>;
1429
+
1430
+ declare function computeMachineScore(opts: {
1431
+ matchResults: MatchResult[];
1432
+ findings: Finding[];
1433
+ }): number;
1378
1434
 
1379
- export { type AffectedProbe, type AgentConfigResult, AgentSealError, AgentValidator, type AttackChain, BACKUPS_DIR, BOUNDARY_CATEGORIES, BOUNDARY_WEIGHT, type BaselineChange, type BaselineChangeResult, type BaselineEntry, BaselineStore, Blocklist, COMMON_WORDS, CONFIG_KEYS, CONSISTENCY_WEIGHT, type ChainStep, type ChatFn, type CompareResult, type CustomFinding, DANGER_CONCEPTS, DATA_EXTRACTION_WEIGHT, DebouncedHandler, type DefenseProfile, type DeltaEntry, DeltaResult, type DiscoveryResult, EXTRACTION_WEIGHT, type EmbedFn, type FixResult, Guard, type GuardOptions, type GuardProgressFn, type GuardReport, GuardVerdict, HistoryStore, INJECTION_WEIGHT, type IgnoreFindingEntry, KNOWN_SERVER_LABELS, LABEL_DESTRUCTIVE, LABEL_PRIVATE, LABEL_PUBLIC_SINK, LABEL_UNTRUSTED, LLMJudge, type LLMJudgeFinding, type LLMJudgeOptions, type LLMJudgeResult, MAX_CONTENT_BYTES, MCPConfigChecker, type MCPFinding, type MCPRuntimeFinding, type MCPRuntimeResult, type MCPServerResult, Notifier, PROFILES, PROJECT_MCP_CONFIGS, PROJECT_SKILL_DIRS, PROJECT_SKILL_FILES, type Probe, type ProbeResult, ProbeTimeoutError, type ProfileConfig, type ProgressFn, type ProjectConfig, ProviderError, QUARANTINE_DIR, type QuarantineEntry, REFUSAL_PHRASES, REPORTS_DIR, type RemediationItem, type RemediationReport, type Rule, RuleEngine, type RuleTest, type RuleTestResult, SEMANTIC_HIGH_THRESHOLD, SEMANTIC_MODERATE_THRESHOLD, SEVERITY_ORDER, SYSTEM_PROMPT, type ScanReport, type ScoreBreakdown, Severity, Shield, type ShieldCallback, type ShieldOptions, type SkillFinding, type SkillResult, SkillScanner, TRANSFORMS, type ToxicFlowResult, TrustLevel, type UnlistedFinding, ValidationError, type ValidatorOptions, Verdict, allActions, analyzeToxicFlows, applyProfile, base64Wrap, buildExtractionProbes, buildInjectionProbes, buildProbe, bulkCheck, caseScramble, checkRegression, classifyPath, classifyServer, collectWatchPaths, compareReports, computeDelta, computeScores, computeSemanticSimilarity, computeVerdict, customFindingFromDict, customFindingToDict, decodeBase64Blocks, decodeHtmlEntities, deltaEntryToDict, deobfuscate, detectCanary, detectChains, detectExtraction, detectExtractionWithSemantic, detectProvider, enrichMcpResults, expandStringConcat, extractPackageSlug, extractSkillName, extractUniquePhrases, fingerprintDefense, fnmatchCase, fromAnthropic, fromEndpoint, fromLangChain, fromOllama, fromOpenAI, fromVercelAI, fuseVerdicts, generateCanary, generateConfigYaml, generateMutations, generateRemediation, generateUnlistedFindings, getFixableSkills, getWellKnownConfigs, guardReportFromDict, hasCritical, hasInvisibleChars, isRefusal, leetspeak, listProfiles, listQuarantine, loadAllCustomProbes, loadConfig, loadCredentials, loadCustomProbes, loadGuardReport, loadLicense, loadProjectConfig, loadScanReport, normalizeSkillPath, normalizeUnicode, parseProbeFile, parseResponse, prefixPadding, quarantineSkill, removeConfigKey, renderMCPResults, resolveProfile, resolveProjectConfig, restoreSkill, reverseEmbed, rot13Wrap, runGuardInit, saveConfigKey, saveCredentials, saveLicense, saveReport, scanDirectory, scanMachine, scanSkillFile, selectCanaryProbes, sha256, shannonEntropy, shouldFail, shouldIgnoreFinding, shouldIgnorePath, showConfig, slugify, stripBidiControls, stripHtmlComments, stripJsonComments, stripModelPrefix, stripTagChars, stripVariationSelectors, stripZeroWidth, topMCPFinding, topSkillFinding, totalDangers, totalSafe, totalWarnings, truncateContent, trustLevelFromScore, unescapeSequences, unicodeHomoglyphs, unlistedFindingToDict, validateProbe, verdictFromFindings, verdictScore, zeroWidthInject };
1435
+ declare function collectAll(): CollectedAgent[];
1436
+
1437
+ declare function extractPackageId(server: MCPServerConfig): string | null;
1438
+
1439
+ interface CacheEntry {
1440
+ trust_score?: number;
1441
+ trustScore?: number;
1442
+ findings?: unknown[];
1443
+ capability_labels?: string[];
1444
+ capabilityLabels?: string[];
1445
+ analyzed_version?: string | null;
1446
+ analyzedVersion?: string | null;
1447
+ analyzed_at?: string | null;
1448
+ analyzedAt?: string | null;
1449
+ tools?: string[];
1450
+ }
1451
+ interface CacheData {
1452
+ fetchedAt?: number;
1453
+ fetched_at?: number;
1454
+ updated_at?: number;
1455
+ servers: Record<string, CacheEntry>;
1456
+ }
1457
+ declare class RegistryCache {
1458
+ private cachePath;
1459
+ private baseUrl;
1460
+ private skipFetch;
1461
+ private data;
1462
+ constructor(opts?: {
1463
+ path?: string;
1464
+ baseUrl?: string;
1465
+ skipFetch?: boolean;
1466
+ });
1467
+ private _loadFromDisk;
1468
+ isStale(): boolean;
1469
+ serverCount(): number;
1470
+ fetchRemote(): Promise<number>;
1471
+ ensureFresh(): Promise<void>;
1472
+ lookup(packageId: string | null): RegistryData | null;
1473
+ _setData(data: CacheData): void;
1474
+ }
1475
+
1476
+ declare abstract class Analyzer {
1477
+ abstract name: string;
1478
+ requiresRuntime: boolean;
1479
+ requiresLlm: boolean;
1480
+ abstract analyze(opts: {
1481
+ agents?: CollectedAgent[];
1482
+ matchResults?: MatchResult[];
1483
+ findings?: Finding[];
1484
+ skills?: SkillPath[];
1485
+ toolHashes?: Record<string, Record<string, [string, string]>>;
1486
+ }): Finding[];
1487
+ }
1488
+
1489
+ declare class PatternAnalyzer extends Analyzer {
1490
+ name: string;
1491
+ analyze(opts: {
1492
+ agents?: CollectedAgent[];
1493
+ }): Finding[];
1494
+ private _checkServer;
1495
+ private _finding;
1496
+ private _checkConf001;
1497
+ private _checkConf002;
1498
+ private _checkConf003;
1499
+ private _checkConf004;
1500
+ private _checkConf005;
1501
+ private _checkConf006;
1502
+ private _checkConf007;
1503
+ private _checkConf008;
1504
+ }
1505
+
1506
+ export { type AffectedProbe, type AgentConfigResult, AgentSealError, AgentValidator, type AttackChain, BACKUPS_DIR, BOUNDARY_CATEGORIES, BOUNDARY_WEIGHT, type BaselineChange, type BaselineChangeResult, type BaselineEntry, BaselineStore, Blocklist, COMMON_WORDS, CONSISTENCY_WEIGHT, type ChainStep, type ChatFn, type CollectedAgent, type CompareResult, type CustomFinding, DANGER_CONCEPTS, DATA_EXTRACTION_WEIGHT, DebouncedHandler, type DefenseProfile, type DeltaEntry, DeltaResult, type DiscoveryResult, EXTRACTION_WEIGHT, type EmbedFn, type FixResult, Guard, GuardEngine, type GuardEngineOptions, type Finding as GuardFinding, type MCPServerConfig as GuardMCPServerConfig, type GuardOptions, type GuardProgressFn, type GuardReport, type GuardScanResult, type SkillPath as GuardSkillPath, GuardVerdict, HistoryStore, INJECTION_WEIGHT, type IgnoreFindingEntry, KNOWN_SERVER_LABELS, LABEL_DESTRUCTIVE, LABEL_PRIVATE, LABEL_PUBLIC_SINK, LABEL_UNTRUSTED, LLMJudge, type LLMJudgeFinding, type LLMJudgeOptions, type LLMJudgeResult, MAX_CONTENT_BYTES, MCPConfigChecker, type MCPFinding, type MCPRuntimeFinding, type MCPRuntimeResult, type MCPServerResult, type MatchResult, Notifier, PROFILES, PROJECT_MCP_CONFIGS, PROJECT_SKILL_DIRS, PROJECT_SKILL_FILES, PatternAnalyzer, type Probe, type ProbeResult, ProbeTimeoutError, type ProfileConfig, type ProgressFn, type ProjectConfig, ProviderError, QUARANTINE_DIR, type QuarantineEntry, REFUSAL_PHRASES, REPORTS_DIR, RegistryCache, type RegistryData, type RemediationItem, type RemediationReport, type Rule, RuleEngine, type RuleTest, type RuleTestResult, SEMANTIC_HIGH_THRESHOLD, SEMANTIC_MODERATE_THRESHOLD, SEVERITY_ORDER, SYSTEM_PROMPT, type ScanReport, type ScoreBreakdown, Severity, Shield, type ShieldCallback, type ShieldOptions, type SkillFinding, type SkillResult, SkillScanner, TRANSFORMS, type ToxicFlowResult, TrustLevel, type UnlistedFinding, ValidationError, type ValidatorOptions, Verdict, allActions, analyzeToxicFlows, applyProfile, base64Wrap, buildExtractionProbes, buildInjectionProbes, buildProbe, bulkCheck, caseScramble, classifyPath, classifyServer, collectAll, collectWatchPaths, compareReports, computeDelta, computeMachineScore, computeScores, computeSemanticSimilarity, computeVerdict, customFindingFromDict, customFindingToDict, decodeBase64Blocks, decodeHtmlEntities, deltaEntryToDict, deobfuscate, detectCanary, detectChains, detectExtraction, detectExtractionWithSemantic, detectProvider, enrichMcpResults, expandStringConcat, extractPackageId, extractPackageSlug, extractSkillName, extractUniquePhrases, fingerprintDefense, fnmatchCase, formatJson, formatSarif, formatTerminal, fromAnthropic, fromEndpoint, fromLangChain, fromOllama, fromOpenAI, fromVercelAI, fuseVerdicts, generateCanary, generateConfigYaml, generateMutations, generateRemediation, generateUnlistedFindings, getFixableSkills, getWellKnownConfigs, guardReportFromDict, hasCritical, hasInvisibleChars, isRefusal, leetspeak, listProfiles, listQuarantine, loadAllCustomProbes, loadCustomProbes, loadGuardReport, loadProjectConfig, loadScanReport, normalizeSkillPath, normalizeUnicode, parseProbeFile, parseResponse, prefixPadding, quarantineSkill, resolveProfile, resolveProjectConfig, restoreSkill, reverseEmbed, rot13Wrap, runGuardInit, saveReport, scanDirectory, scanMachine, scanSkillFile, sha256, shannonEntropy, shouldFail, shouldIgnoreFinding, shouldIgnorePath, slugify, stripBidiControls, stripHtmlComments, stripJsonComments, stripModelPrefix, stripTagChars, stripVariationSelectors, stripZeroWidth, topMCPFinding, topSkillFinding, totalDangers, totalSafe, totalWarnings, truncateContent, trustLevelFromScore, unescapeSequences, unicodeHomoglyphs, unlistedFindingToDict, validateProbe, verdictFromFindings, verdictScore, zeroWidthInject };