/** 单条扫描发现 */ export interface ShieldFinding { /** 扫描类别(五类之一) */ category: 'mcp-risk' | 'hook-injection' | 'agent-config' | 'secret-enhanced' | 'shadow-ai'; /** 严重度(与 24 规则同语义) */ severity: 'FAIL' | 'WARN' | 'INFO'; /** 目标(文件路径/进程名/端点名) */ target: string; /** 发现描述 */ message: string; /** 证据(匹配行/命令输出片段) */ evidence: string; } export interface ShieldScanResult { findings: ShieldFinding[]; /** 扫描统计 */ stats: { category: ShieldFinding['category'] | 'total'; count: number; }[]; } export interface ShieldOptions { /** Shadow AI 已知进程白名单(默认含常见合法 AI 工具——白名单内零告警) */ knownAgentWhitelist?: string[]; /** 是否扫描进程源(默认 true——CI 环境可关) */ scanProcesses?: boolean; /** 注入检测模式列表(Agent 配置审查用,可扩展) */ injectionPatterns?: RegExp[]; } /** 默认已知合法 AI 工具进程白名单(可配置扩展——决议 6) */ export declare const DEFAULT_KNOWN_AGENTS: string[]; /** * 创建 AgentShield 扫描器。 */ export declare function createAgentShield(options?: ShieldOptions): { /** 类别 1:MCP 配置风险画像——扫 mcpServers JSON 配置 */ scanMcpConfig(configPath: string): ShieldFinding[]; /** 类别 2:Hook 注入分析——扫 git hooks / session hooks 目录 */ scanHooks(hooksDir: string): ShieldFinding[]; /** 类别 3:Agent 配置审查——SKILL.md / fde.md 等约束文件 */ scanAgentConfig(configPath: string): ShieldFinding[]; /** 类别 4:密钥检测增强——A2 扩展扫配置文件(不只 git diff) */ scanSecrets(filePath: string): ShieldFinding[]; /** 类别 5:Shadow AI 发现——进程/配置/仓库三源 */ scanShadowAi(repoDir: string): ShieldFinding[]; /** 全量扫描(五类一次跑完,汇总统计) */ scanAll(paths: { mcpConfig?: string; hooksDir?: string; agentConfigs?: string[]; secretTargets?: string[]; repoDir?: string; }): ShieldScanResult; /** 白名单(供外部查询/扩展) */ whitelistView(): string[]; }; export type AgentShield = ReturnType; //# sourceMappingURL=agent-shield.d.ts.map