/** * Enterprise Certification System - Type Definitions */ export type AgentType = "security" | "reliability" | "typesafety" | "performance" | "quality" | "redteam" | "agent-redteam" | "agent-privacy" | "agent-integrity" | "adversary" | "antagonist"; export type Severity = "critical" | "high" | "medium" | "low" | "info"; export type CertificationLevel = "CERTIFIED" | "APPROVED" | "REVIEW_REQUIRED" | "BLOCKED"; export type CertificationStatus = "not_started" | "in_progress" | "completed" | "failed"; export type VerificationVerdict = "confirmed" | "disputed" | "inconclusive"; /** * Standard finding categories */ export type FindingCategory = "sql-injection" | "xss" | "auth-bypass" | "broken-access-control" | "session-management" | "cryptographic-failure" | "injection" | "insecure-design" | "security-misconfiguration" | "vulnerable-component" | "identification-failure" | "integrity-failure" | "logging-failure" | "ssrf" | "path-traversal" | "command-injection" | "code-injection" | "hardcoded-secret" | "weak-password" | "insecure-random" | "missing-encryption" | "pii-exposure" | "dependency-vuln" | "type-safety" | "error-handling" | "resource-exhaustion" | "race-condition" | "prompt-injection" | "insecure-output" | "training-data-poisoning" | "model-denial-of-service" | "supply-chain-vuln" | "sensitive-disclosure" | "insecure-plugin" | "excessive-agency" | "overreliance" | "model-theft" | "manifest-drift" | "exfil-path" | "overscoped-permission" | "missing-sandbox" | "credential-overscoped" | "tool-drift" | "unsigned-change" | "consensus-manipulation" | "binary-security" | "memory-safety" | "logic-flaw" | "exploit-chain" | "zero-day" | "authentication" | "authorization" | "cryptography" | "input-validation" | "api-security" | "resource-management" | "deserialization" | "open-redirect" | "secret-management" | "code-quality" | "phi-exposure" | "sud-disclosure" | "consent-bypass" | "consent-missing" | "redisclosure-violation" | "qsoa-violation" | "audit-gap" | "phi-in-logs" | "data-retention" | "third-party-risk" | "other"; /** * Location of a finding instance */ export interface FindingInstance { file: string; line?: number; evidence?: string; } export interface Finding { id: string; severity: Severity; category: FindingCategory | string; file?: string; line?: number; description: string; evidence: string; confidence: number; cross_references?: string[]; verifications: Verification[]; created_at: string; /** Multiple instances of the same finding (for deduplication) */ instances?: FindingInstance[]; /** Source scanner if this is a deterministic finding (confidence: 100) */ scanner_source?: "semgrep" | "npm-audit" | "gitleaks" | "tsc" | "eslint" | "bandit" | "gosec" | "brakeman" | "trivy" | "binary-analysis" | "memory-safety" | "race-condition" | "zero-day-hunter" | "logic-flaw-detector" | "exploit-chain-analyzer" | "manifest-audit" | "tool-description-drift" | "prompt-injection-fuzzer" | "exfil-path-graph" | "permission-minimiser" | "supply-chain-mcp" | "sandbox-audit" | "credential-scope-audit" | "adversary" | "detection" | "adversary-tactics" | "ai-code"; /** Original rule ID from the scanner */ scanner_rule_id?: string; /** CWE IDs from scanner */ cwe_ids?: string[]; /** CVE IDs from scanner (for dependency vulns) */ cve_ids?: string[]; /** Additional metadata from scanner/agent */ metadata?: Record; } export interface Verification { verifying_agent: AgentType; verdict: VerificationVerdict; evidence: string; adjusted_confidence?: number; created_at: string; } export interface AgentSummary { total_findings: number; by_severity: Record; confidence_score: number; coverage_areas: string[]; notes?: string; } export interface AgentFindings { agent: AgentType; started_at: string; completed_at?: string; status: "running" | "completed" | "failed"; findings: Finding[]; summary?: AgentSummary; } export interface RedTeamChallenge { id: string; target_agent: AgentType; area: string; challenge_type: "missed_issue" | "false_negative" | "incomplete_coverage" | "edge_case"; evidence: string; severity_if_valid: Severity; resolution?: { accepted: boolean; response: string; }; created_at: string; } export interface CrossVerification { finding_id: string; verifying_agent: AgentType; verdict: VerificationVerdict; evidence: string; adjusted_confidence?: number; created_at: string; } export interface ConsensusResult { overall_score: number; certification_level: CertificationLevel; agent_scores: Record; agent_confidences: Record; total_findings: number; by_severity: Record; cross_verification_rate: number; red_team_challenges_accepted: number; red_team_challenges_total: number; calculated_at: string; } export interface CertificationMetadata { id: string; project_name: string; project_path: string; started_at: string; completed_at?: string; status: CertificationStatus; agents_requested: AgentType[]; agents_completed: AgentType[]; certification_level?: CertificationLevel; final_score?: number; expires_at?: string; /** SHA-256 hash of project files at certification time */ project_hash?: string; /** Whether deterministic scanners were run */ scanners_run?: boolean; /** Timestamp when scanners completed */ scanners_completed_at?: string; /** Count of findings from deterministic scanners */ scanner_findings_count?: number; /** * Dependency-advisory keys (`|`) present at * certification time. Used as the baseline for advisory-drift detection — * new CVEs against the certified dependency set. Populated at finalization. */ advisory_baseline?: string[]; /** ISO timestamp of the last drift check run against this certification. */ last_drift_check_at?: string; /** Summary of the most recent drift check. */ detected_drift?: { newAdvisoryCount: number; fixedAdvisoryCount: number; checkedAt: string; }; } export interface Certification { metadata: CertificationMetadata; agents: Partial>; cross_verifications: CrossVerification[]; red_team_challenges: RedTeamChallenge[]; consensus?: ConsensusResult; } export declare const AGENT_WEIGHTS: Record; export declare const SEVERITY_PENALTIES: Record; export declare const CERTIFICATION_THRESHOLDS: { CERTIFIED: number; APPROVED: number; REVIEW_REQUIRED: number; BLOCKED: number; }; export declare const CERTIFICATION_VALIDITY_DAYS = 30; //# sourceMappingURL=types.d.ts.map