/** * Leaper Agent – Skill Guard (skills/skill-guard.ts) * * Security scanner for skill files, translating Python tools/skills_guard.py. * Scans skill source code for known threat patterns (exfiltration, injection, * destructive commands, persistence, obfuscation, and network abuse) before * installing or executing community-sourced skills. */ export type Severity = 'critical' | 'high' | 'medium' | 'low'; export type Category = 'exfiltration' | 'injection' | 'destructive' | 'persistence' | 'network' | 'obfuscation'; export type TrustLevel = 'builtin' | 'trusted' | 'community' | 'agent-created'; export type Verdict = 'safe' | 'caution' | 'dangerous'; export type InstallDecision = 'allow' | 'block' | 'ask'; export interface Finding { patternId: string; severity: Severity; category: Category; file: string; line: number; match: string; description: string; } export interface ScanResult { skillName: string; source: string; trustLevel: TrustLevel; verdict: Verdict; findings: Finding[]; scannedAt: string; summary: string; } export declare const TRUSTED_REPOS: ReadonlySet; /** SHA-256 hex digest of arbitrary content. */ export declare function contentHash(content: string): string; /** Determine TrustLevel from a source string. */ export declare function determineTrustLevel(source: string): TrustLevel; /** Derive verdict from a set of findings. */ export declare function determineVerdict(findings: Finding[]): Verdict; /** * Determine whether a skill install should proceed based on its scan result. * Returns [decision, reason]. */ export declare function shouldAllowInstall(result: ScanResult): [InstallDecision, string]; /** * Scan the text content of a single file for threat patterns. * Returns an array of findings (may be empty). */ export declare function scanFileContent(content: string, filename: string): Finding[]; /** * Scan a skill directory. Reads SKILL.md and all text files recursively. * * @param skillPath Absolute path to the skill directory. * @param source Origin tag (e.g. 'builtin', 'openai/skills', 'agent-created'). */ export declare function scanSkill(skillPath: string, source?: string): Promise; /** * Format a ScanResult as a human-readable multi-line string. */ export declare function formatScanReport(result: ScanResult): string; //# sourceMappingURL=skill-guard.d.ts.map