/** * Secret detection for memory content (v39 memory scope isolation, S4; * docs/plans/2026-07-01-memory-scope-isolation.md). * * Conservative, provider-bounded patterns only - a bare `sk-` in prose must * NOT flag. Detection gates two surfaces: * - producer: shareMemory/autoShare never promote flagged rows to the * global store; * - consumer: ambient context (getContext) never injects a flagged row * outside its owning project, and never anywhere when the row has no * project origin. Explicit recall is unaffected - recalling a secret is * a deliberate act. * * This is deliberately a thin slice of the A4 lifecycle-compliance item * (no write-time scrubbing, no PII detection). * * Leaf module: keep free of imports from store/api/shared so all of them * can import it without cycles. */ /** Result of scanning one memory. `reason` names the tag or pattern that fired. */ export interface SecretDetection { flagged: boolean; reason: string | null; } /** * Scan a memory's tags + content for secret material. * Pure and deterministic; no filesystem or store access. */ export declare function detectSecret(entry: { content: string; tags: string[]; }): SecretDetection; /** * Replace secret-shaped substrings in free text with a redaction marker. * Reuses the same `SECRET_PATTERNS` / co-occurrence guard as `detectSecret` * (which only flags whole-entry content) so callers that must persist raw * text that never passes through the normal capture content gate — e.g. the * CS1 pre-compact snapshot fields — can scrub it in place instead. */ export declare function redactSecrets(text: string): string; //# sourceMappingURL=secret-detect.d.ts.map