@node9/policy-engine 2.32.0 → 2.33.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.mts CHANGED
@@ -113,6 +113,19 @@ type ToolInspectionEntry = string | {
113
113
  field: string;
114
114
  };
115
115
  type ToolInspection = Record<string, ToolInspectionEntry>;
116
+ /**
117
+ * Inspection mappings by provenance. `trusted` is the shipped defaults plus the
118
+ * user's own and the workspace's entries, with full authority. `project` is a
119
+ * repository-carried config file, which an agent can write in-session: it may
120
+ * add a shell tool or a shell field, never turn a recognized executor into a
121
+ * non-shell tool or point its inspection at a decoy field (fw#338, review 3).
122
+ */
123
+ interface InspectionLayers {
124
+ trusted: ToolInspection;
125
+ project?: ToolInspection;
126
+ }
127
+ /** A plain map is read as trusted with no project layer. */
128
+ type InspectionInput = ToolInspection | InspectionLayers;
116
129
  type ShellInputResolution = {
117
130
  kind: 'not-shell';
118
131
  } | {
@@ -125,10 +138,17 @@ type ShellInputResolution = {
125
138
  };
126
139
  declare const BASH_TOOL_NAMES: Set<string>;
127
140
  declare function isBashTool(tool: string): boolean;
128
- declare function isShellShapedTool(tool: string, inspection?: ToolInspection): boolean;
129
- declare function resolveShellInput(tool: string, args: unknown, inspection?: ToolInspection): ShellInputResolution;
141
+ /** The merged policy's maps as layers; the host keeps the project layer apart. */
142
+ declare function inspectionLayers(policy: {
143
+ toolInspection: ToolInspection;
144
+ projectToolInspection?: ToolInspection;
145
+ }): InspectionLayers;
146
+ /** The first matching entry, trusted layer first. For legacy (SQL, explain) lookups. */
147
+ declare function inspectionEntry(tool: string, inspection?: InspectionInput): ToolInspectionEntry | undefined;
148
+ declare function isShellShapedTool(tool: string, inspection?: InspectionInput): boolean;
149
+ declare function resolveShellInput(tool: string, args: unknown, inspection?: InspectionInput): ShellInputResolution;
130
150
  /** Only Bash-scoped rules receive the canonical projection. Caller data is never mutated. */
131
- declare function shellRuleArgs(tool: string, args: unknown, ruleTool: string | string[] | undefined, inspection?: ToolInspection): unknown;
151
+ declare function shellRuleArgs(tool: string, args: unknown, ruleTool: string | string[] | undefined, inspection?: InspectionInput): unknown;
132
152
 
133
153
  type SsrfTier = 'metadata' | 'link-local' | 'multicast' | 'unspecified' | 'cgnat' | 'private';
134
154
  interface SsrfMatch {
@@ -511,7 +531,7 @@ declare const COMMAND_WRAPPERS: Set<string>;
511
531
  * `run_shell_command`, `execute_bash`, `terminal.execute`) must not silently
512
532
  * void them. An absent rule scope matches everything (callers' prior semantics).
513
533
  */
514
- declare function toolMatchesRule(toolName: string, ruleTool: string | string[] | undefined, toolInspection?: ToolInspection): boolean;
534
+ declare function toolMatchesRule(toolName: string, ruleTool: string | string[] | undefined, toolInspection?: InspectionInput): boolean;
515
535
  /** Strip leading wrappers/runners from a resolved arg list, returning the index
516
536
  * of the real command head. Handles `sudo -u www python3`, `env -u FOO python3`,
517
537
  * `timeout 5 python3`, `uv run python`, `conda run -n env python`,
@@ -689,6 +709,8 @@ interface PolicyConfig {
689
709
  dangerousWords: string[];
690
710
  ignoredTools: string[];
691
711
  toolInspection: ToolInspection;
712
+ /** Entries from a repository-carried config file; they may only add inspection. */
713
+ projectToolInspection?: ToolInspection;
692
714
  smartRules: SmartRule[];
693
715
  dlp: {
694
716
  enabled: boolean;
@@ -842,7 +864,7 @@ type ProtectedFileVerdict = PolicyVerdict & {
842
864
  declare function incompleteFileVerdict(operation?: FileAccess['operation']): ProtectedFileVerdict;
843
865
  /** Closed adapters: an arbitrary tool's path-shaped argument is not an operation. */
844
866
  declare function fileToolOperation(tool: string, args: unknown): FileAccess['operation'] | null;
845
- declare function collectFileAccesses(tool: string, args: unknown, context?: FileAccessContext, inspection?: ToolInspection): FileAccess[];
867
+ declare function collectFileAccesses(tool: string, args: unknown, context?: FileAccessContext, inspection?: InspectionInput): FileAccess[];
846
868
  declare function evaluateProtectedFileAccess(accesses: FileAccess[], context: FileAccessContext, settings: CatalogSettings): ProtectedFileVerdict | null;
847
869
 
848
870
  type InjectionConfidence = 'low' | 'medium' | 'high';
@@ -855,6 +877,10 @@ interface InjectionContext {
855
877
  /** Tool that produced the output. Untrusted origins (web/network) raise
856
878
  * confidence — a fetched page is attacker-influenceable; a local read isn't. */
857
879
  tool?: string;
880
+ /** The caller's own answer to "did this output come from outside?" (the
881
+ * #318 source roles: an unannotated MCP tool, a shell fetch). When set it
882
+ * decides the booster; when absent the tool-name regex below does. */
883
+ untrusted?: boolean;
858
884
  }
859
885
  /**
860
886
  * Scan tool output for indirect prompt injection. Returns the matched signals +
@@ -1185,6 +1211,63 @@ declare function isLoopbackHost(host: string): boolean;
1185
1211
  declare function gitRepoPath(url: string): string | null;
1186
1212
  declare function isDestructiveToolName(bareTool: string): boolean;
1187
1213
 
1214
+ /** The value as the gate compares it: email lower-cased, IBAN and account
1215
+ * upper-cased without spaces, host lower-cased. */
1216
+ declare function normalizeDestination(dest: string): string;
1217
+ /** 'iban:GB82 **** **** 5432', 'account:****5432', 'email:d***@acme.example';
1218
+ * a host (or anything else) is returned normalised and otherwise unchanged. */
1219
+ declare function maskDestination(dest: string): string;
1220
+ /** Whether a destination's kind is masked outside the machine. */
1221
+ declare function isMaskedKind(dest: string): boolean;
1222
+ /** SHA-256 (hex) of the normalised destination, kind prefix included. */
1223
+ declare function hashDestination(dest: string): string;
1224
+ /** Whether `entry` is a stored masked entry ('<masked>#sha256:<hex>'). */
1225
+ declare function isHashedEntry(entry: string): boolean;
1226
+ /** A full destination as it is stored on a trusted list outside the machine:
1227
+ * a masked kind becomes '<masked>#sha256:<hex>', a host stays as it is. */
1228
+ declare function trustedEntryOf(dest: string): string;
1229
+ /** Does a full destination match a stored entry (a hashed one, or a plain
1230
+ * value as the local list and older managed lists hold)? */
1231
+ declare function matchesTrustedEntry(dest: string, entry: string): boolean;
1232
+ /** Does a full destination match any entry of a list? Hashes it once. */
1233
+ declare function matchesTrustedList(dest: string, entries: readonly string[]): boolean;
1234
+ /**
1235
+ * A recipient as a person types it, in the stored destination form: an
1236
+ * address becomes `email:`, an IBAN `iban:`, a URL or hostname `host:`, and
1237
+ * `account:<number>` keeps its kind. A value that carries its kind is checked
1238
+ * against it. Null for anything else (a bare word, two values in one).
1239
+ */
1240
+ declare function normalizeRecipient(raw: unknown): string | null;
1241
+ /**
1242
+ * One entry of a trusted list outside the machine (the dashboard's workspace
1243
+ * list, the snapshot's personal list): a host in full; an address, IBAN or
1244
+ * account as '<masked>#sha256:<hex>'. A value already in that form passes
1245
+ * with its hash lower-cased; a full value is turned into it. Null when it is
1246
+ * neither. The backend mirror asserts the same vectors.
1247
+ */
1248
+ declare function normalizeTrustedEntry(raw: unknown): string | null;
1249
+ /** What a person reads for an entry: the masked part, without the hash. */
1250
+ declare function entryDisplay(entry: string): string;
1251
+ /**
1252
+ * IBANs (mod-97), card numbers (exactly what detectPii reports, so not the
1253
+ * fractional part of a number), account numbers (a whole IBAN-shaped value,
1254
+ * or a number under an account key) and email addresses inside a text,
1255
+ * masked the way destinations are. No quote or backslash is introduced or
1256
+ * removed, so a JSON string stays a JSON string; a card written as a bare
1257
+ * JSON number does not stay a number, so arguments go through
1258
+ * maskPersonalValue instead.
1259
+ */
1260
+ declare function maskPersonalData(text: string): string;
1261
+ /**
1262
+ * maskPersonalData over a JSON-shaped value (tool arguments), leaf by leaf, so
1263
+ * the result is always a value: a string leaf is masked in its JSON form under
1264
+ * its own key (the account-key and whole-value rules still see both), an
1265
+ * object key is masked as text, and a number whose text holds personal data (a
1266
+ * card passed as a number) becomes the masked string. Anything deeper than 64
1267
+ * levels is replaced by '[REDACTED]'. Pure, never throws.
1268
+ */
1269
+ declare function maskPersonalValue(value: unknown): unknown;
1270
+
1188
1271
  interface ShellExposure {
1189
1272
  /** The command brings outside content in: its output is a source. */
1190
1273
  fetches: boolean;
@@ -1866,7 +1949,7 @@ interface ExtractContext {
1866
1949
  }>;
1867
1950
  /** toolInspection map from PolicyConfig — drives shell-command extraction
1868
1951
  * for tools that aren't the standard 'bash' name. Defaults handled by caller. */
1869
- toolInspection: ToolInspection;
1952
+ toolInspection: InspectionInput;
1870
1953
  /** DLP enabled flag from PolicyConfig. */
1871
1954
  dlpEnabled: boolean;
1872
1955
  /** Decoy credentials registered on this machine (value plus kind and plant
@@ -1924,7 +2007,7 @@ declare const LONG_OUTPUT_THRESHOLD_BYTES: number;
1924
2007
  * and fails CI when the hash drifts without a version bump — forgetting
1925
2008
  * is loud, not silent.
1926
2009
  */
1927
- declare const CANONICAL_EXTRACTOR_VERSION = "canonical-v25";
2010
+ declare const CANONICAL_EXTRACTOR_VERSION = "canonical-v27";
1928
2011
  /**
1929
2012
  * SHA-256 prefix of the detector-source files
1930
2013
  * (canonical.ts + pii.ts + destructive-regex.ts).
@@ -1935,7 +2018,7 @@ declare const CANONICAL_EXTRACTOR_VERSION = "canonical-v25";
1935
2018
  * files changed, this hash must change too, and you must consciously
1936
2019
  * decide whether to bump CANONICAL_EXTRACTOR_VERSION."
1937
2020
  */
1938
- declare const CANONICAL_EXTRACTOR_HASH = "48ef4af5dd89198d";
2021
+ declare const CANONICAL_EXTRACTOR_HASH = "a358f47eacca6e14";
1939
2022
  declare function extractCanonicalFindings(call: ToolCallEntry, ctx: ExtractContext): CanonicalFinding[];
1940
2023
  declare function extractSessionLevelFindings(calls: ReadonlyArray<SessionToolCall>, ctx: SessionExtractContext): CanonicalFinding[];
1941
2024
  /**
@@ -2010,7 +2093,7 @@ declare function ssrfDestinationFloor(toolName: string, args: unknown, opts?: {
2010
2093
  declare const ARGUMENT_SCAN_LIMITS: {
2011
2094
  readonly maxDepth: 12;
2012
2095
  readonly maxNodes: 16384;
2013
- /** Raw text is matched in windows of this size; decoding views use the first window. */
2096
+ /** Text is matched and decoded in windows of this size. */
2014
2097
  readonly maxStringCharacters: 100000;
2015
2098
  /** Windows overlap by this much so a token on a window edge is still seen whole. */
2016
2099
  readonly windowOverlap: 4096;
@@ -2023,10 +2106,11 @@ declare const ARGUMENT_SCAN_LIMITS: {
2023
2106
  interface ArgumentInspectionResult {
2024
2107
  match: DlpMatch | null;
2025
2108
  /**
2026
- * `incomplete` when any part of the input was not fully inspected. Reasons
2027
- * starting with `argument-` mean raw text or structure was skipped; reasons
2028
- * starting with `decode-` mean every byte of raw text was matched but the
2029
- * derived decoding views were cut short.
2109
+ * `incomplete` when any part of the input was not fully inspected: raw text
2110
+ * or structure skipped (`argument-*`), a decoding layer past the nested
2111
+ * limits (`decode-nested`), a flood of joinable hostname labels
2112
+ * (`decode-labels`), or the recovery-phrase hash budget (`mnemonic-budget`).
2113
+ * Every reason requires review; none is a documented allow.
2030
2114
  */
2031
2115
  coverage: 'complete' | 'incomplete';
2032
2116
  reasons: string[];
@@ -2034,14 +2118,13 @@ interface ArgumentInspectionResult {
2034
2118
  /** Bounded input inspection. Output redaction deliberately retains its own API. */
2035
2119
  declare function inspectArgumentSecrets(args: unknown): ArgumentInspectionResult;
2036
2120
  /**
2037
- * Existing DLP approval routing. A finding wins. Otherwise raw text or
2038
- * structure that was skipped (`argument-*` reasons) requires review; a cut
2039
- * short decoding budget over fully matched raw text does not interrupt the
2040
- * call, because ordinary documents full of links or hashes exhaust it.
2121
+ * Existing DLP approval routing. A finding wins. Otherwise any part of the
2122
+ * input that was not fully inspected requires review: there is no limit an
2123
+ * attacker can reach that ends in a clean result.
2041
2124
  */
2042
2125
  declare function scanArgumentSecrets(args: unknown): DlpMatch | null;
2043
2126
 
2044
2127
  /** Engine version stamped on audit entries for future drift detection. */
2045
2128
  declare const ENGINE_VERSION = "1.4.0";
2046
2129
 
2047
- export { AGENT_INSTRUCTION_DIRS, AGENT_INSTRUCTION_FILES, ARGUMENT_SCAN_LIMITS, AST_FS_REGEX_RULES, type ArgumentInspectionResult, type AuditEntryForClassify, BASH_TOOL_NAMES, BUILTIN_DANGEROUS_WORDS, BUILTIN_SHIELDS, type BlastEnvFinding, type BlastFinding, type BlastResult, type BlastSummary, CANARY_MIN_LENGTH, CANONICAL_EXTRACTOR_HASH, CANONICAL_EXTRACTOR_VERSION, CHECKS, CHECK_BY_ID, CHECK_GROUPS, CHECK_TEXT, CHECK_VERDICT_RANK, COMMAND_WRAPPERS, CONFIGURABLE_CHECK_IDS, COPY_VERBS, COST_PER_LOOP_ITER_USD, type CanaryHit, type CanaryValue, type CanaryView, type CanonicalAgent, type CanonicalFinding, type CanonicalFindingType, type CanonicalSourceType, type CatalogSettings, type CheckDef, type CheckGroup, type CheckSource, type CheckText, DEFAULT_EGRESS_ALLOWLIST, DESTINATION_ARGS, DESTRUCTIVE_OP_RE, DLP_PATTERNS, DLP_SCAN_LIMITS, type Destination, type DestinationKind, type DlpMatch, ENGINE_VERSION, type EgressPolicy, type EgressVerdict, type ExtractContext, FILE_TOOLS, FLAGS_WITH_VALUES, FS_READ_TOOLS, type FileAccess, type FileAccessContext, type FsOpVerdict, type InjectionConfidence, type InjectionContext, type InjectionMatch, KNOB_GOVERNED, LONG_OUTPUT_THRESHOLD_BYTES, LOOP_MAX_RECORDS, LOOP_THRESHOLD_FOR_WASTE, type LegacyPolicyKnobs, type LoopWindowEvaluation, MAP_GOVERNED, MAX_BLAST_PATH, MAX_DESTINATIONS, NET_BINARIES, PATTERN_VERB_NAMES, PRIVILEGE_ESCALATION_RE, type PackageEcosystem, type PackageInstallRequest, type PiiPattern, type PipeChainAnalysis, type PolicyConfig, type PolicyContext, type PolicyHostHooks, type PolicyVerdict, type PositionedArg, type ProtectedFileVerdict, type ProvenanceLookup, type ProvenanceTrust, REALTIME_PII_PATTERNS, type ResolvedCheck, type RiskMetadata, SCAN_SIGNAL_WEIGHTS, SENSITIVE_PATH_RE, SENSITIVE_PATH_REGEXES, SSRF_MAX_HOST, STARTUP_NAMES, SYSTEM_AUTH_DIRS, SYSTEM_AUTH_FILES, type ScanFinding, type ScanSignals, type ScanSummary, type ScanView, type ScoreTier, type SessionExtractContext, type SessionToolCall, type Severity, type ShellCommandAnalysis, type ShellDestToken, type ShellDestination, type ShellExposure, type ShellInputResolution, type ShieldDefinition, type ShieldOverrides, type ShieldVerdict, type SmartCondition, type SmartRule, type SsrfFloorOptions, type SsrfMatch, type SsrfTier, type SsrfVerdict, TUNING_FIELDS, type ToolCallEntry, type ToolCallRecord, type ToolInspection, type ToolInspectionEntry, type TuningField, VERDICTS, type Verdict, analyzeFsOperation, analyzePipeChain, analyzeShellCommand, catalogSettingsFromConfig, checkDangerousSql, checkIdForCheckedBy, checkIdForRule, checkToLegacyPolicy, checkValue, checksFromLegacyPolicy, classifyAuditEntry, classifyRuleSeverity, classifyScanSignal, classifyShellExposure, classifySsrf, collectFileAccesses, computeAgentDeviceScore, computeArgsHash, computeBlendedSecurityScore, computeScanScore, computeSecurityScore, configurableValues, decodeEmbeddedBase64, decodeEmbeddedHex, dedupeCanonicalFindings, destinationDomain, destinationKind, destinationValue, detectArgsPii, detectDangerousEval, detectDangerousShellExec, detectInlineExec, detectPii, evaluateEgress, evaluateLoopWindow, evaluatePolicy, evaluateProtectedFileAccess, evaluateSmartConditions, extractAllSshHosts, extractArgDestinations, extractCanonicalFindings, extractContentDestinations, extractNetworkTargets, extractPackageInstalls, extractPositionalArgs, extractSessionLevelFindings, extractShellDestTokens, extractShellDestinations, extractToolDestinations, fileOperandFlagsOf, fileToolOperation, foldHomoglyphs, getCheck, getCompiledRegex, getNestedValue, gitRepoPath, hostMatches, incompleteFileVerdict, inspectArgumentSecrets, isAgentInstructionPath, isBashTool, isDestructiveToolName, isIgnoredTool, isInside, isKnobGoverned, isLegacySystemPath, isLockedCheck, isLoopbackHost, isPasswordHashPath, isPrivateHost, isProtectedHomePath, isShellShapedTool, isShieldVerdict, isStrictGatedTier, isVerdict, matchCanary, matchCanaryArgs, matchSensitivePath, matchesPattern, narrativeRuleLabel, normalizeCommandForPolicy, normalizeFilePath, normalizeForScan, normalizeIpLiteral, normalizePyPiName, parseAllSshHostsFromCommand, parseDestHost, patternShapeOf, positionedArgs, previewArgs, redactText, resolveAllChecks, resolveCheck, resolveCheckMap, resolvePinned, resolveShellInput, safeMessage, sampleCopyCommand, scanArgs, scanArgumentSecrets, scanInjection, scanText, scanViews, sensitivePathMatch, shellRuleArgs, ssrfCheckId, ssrfDestinationFloor, ssrfExemptMatches, ssrfFloor, ssrfReason, stripControlChars, stripInvisible, stripTerminalEscapes, summarizeBlast, summarizeScan, toScanFinding, toolMatchesRule, truncateBlastPath, tuningFromLegacyPolicy, tuningToLegacyPolicy, unwrapCommandHead, validateOverrides, validateRegex, validateShieldDefinition };
2130
+ export { AGENT_INSTRUCTION_DIRS, AGENT_INSTRUCTION_FILES, ARGUMENT_SCAN_LIMITS, AST_FS_REGEX_RULES, type ArgumentInspectionResult, type AuditEntryForClassify, BASH_TOOL_NAMES, BUILTIN_DANGEROUS_WORDS, BUILTIN_SHIELDS, type BlastEnvFinding, type BlastFinding, type BlastResult, type BlastSummary, CANARY_MIN_LENGTH, CANONICAL_EXTRACTOR_HASH, CANONICAL_EXTRACTOR_VERSION, CHECKS, CHECK_BY_ID, CHECK_GROUPS, CHECK_TEXT, CHECK_VERDICT_RANK, COMMAND_WRAPPERS, CONFIGURABLE_CHECK_IDS, COPY_VERBS, COST_PER_LOOP_ITER_USD, type CanaryHit, type CanaryValue, type CanaryView, type CanonicalAgent, type CanonicalFinding, type CanonicalFindingType, type CanonicalSourceType, type CatalogSettings, type CheckDef, type CheckGroup, type CheckSource, type CheckText, DEFAULT_EGRESS_ALLOWLIST, DESTINATION_ARGS, DESTRUCTIVE_OP_RE, DLP_PATTERNS, DLP_SCAN_LIMITS, type Destination, type DestinationKind, type DlpMatch, ENGINE_VERSION, type EgressPolicy, type EgressVerdict, type ExtractContext, FILE_TOOLS, FLAGS_WITH_VALUES, FS_READ_TOOLS, type FileAccess, type FileAccessContext, type FsOpVerdict, type InjectionConfidence, type InjectionContext, type InjectionMatch, type InspectionInput, type InspectionLayers, KNOB_GOVERNED, LONG_OUTPUT_THRESHOLD_BYTES, LOOP_MAX_RECORDS, LOOP_THRESHOLD_FOR_WASTE, type LegacyPolicyKnobs, type LoopWindowEvaluation, MAP_GOVERNED, MAX_BLAST_PATH, MAX_DESTINATIONS, NET_BINARIES, PATTERN_VERB_NAMES, PRIVILEGE_ESCALATION_RE, type PackageEcosystem, type PackageInstallRequest, type PiiPattern, type PipeChainAnalysis, type PolicyConfig, type PolicyContext, type PolicyHostHooks, type PolicyVerdict, type PositionedArg, type ProtectedFileVerdict, type ProvenanceLookup, type ProvenanceTrust, REALTIME_PII_PATTERNS, type ResolvedCheck, type RiskMetadata, SCAN_SIGNAL_WEIGHTS, SENSITIVE_PATH_RE, SENSITIVE_PATH_REGEXES, SSRF_MAX_HOST, STARTUP_NAMES, SYSTEM_AUTH_DIRS, SYSTEM_AUTH_FILES, type ScanFinding, type ScanSignals, type ScanSummary, type ScanView, type ScoreTier, type SessionExtractContext, type SessionToolCall, type Severity, type ShellCommandAnalysis, type ShellDestToken, type ShellDestination, type ShellExposure, type ShellInputResolution, type ShieldDefinition, type ShieldOverrides, type ShieldVerdict, type SmartCondition, type SmartRule, type SsrfFloorOptions, type SsrfMatch, type SsrfTier, type SsrfVerdict, TUNING_FIELDS, type ToolCallEntry, type ToolCallRecord, type ToolInspection, type ToolInspectionEntry, type TuningField, VERDICTS, type Verdict, analyzeFsOperation, analyzePipeChain, analyzeShellCommand, catalogSettingsFromConfig, checkDangerousSql, checkIdForCheckedBy, checkIdForRule, checkToLegacyPolicy, checkValue, checksFromLegacyPolicy, classifyAuditEntry, classifyRuleSeverity, classifyScanSignal, classifyShellExposure, classifySsrf, collectFileAccesses, computeAgentDeviceScore, computeArgsHash, computeBlendedSecurityScore, computeScanScore, computeSecurityScore, configurableValues, decodeEmbeddedBase64, decodeEmbeddedHex, dedupeCanonicalFindings, destinationDomain, destinationKind, destinationValue, detectArgsPii, detectDangerousEval, detectDangerousShellExec, detectInlineExec, detectPii, entryDisplay, evaluateEgress, evaluateLoopWindow, evaluatePolicy, evaluateProtectedFileAccess, evaluateSmartConditions, extractAllSshHosts, extractArgDestinations, extractCanonicalFindings, extractContentDestinations, extractNetworkTargets, extractPackageInstalls, extractPositionalArgs, extractSessionLevelFindings, extractShellDestTokens, extractShellDestinations, extractToolDestinations, fileOperandFlagsOf, fileToolOperation, foldHomoglyphs, getCheck, getCompiledRegex, getNestedValue, gitRepoPath, hashDestination, hostMatches, incompleteFileVerdict, inspectArgumentSecrets, inspectionEntry, inspectionLayers, isAgentInstructionPath, isBashTool, isDestructiveToolName, isHashedEntry, isIgnoredTool, isInside, isKnobGoverned, isLegacySystemPath, isLockedCheck, isLoopbackHost, isMaskedKind, isPasswordHashPath, isPrivateHost, isProtectedHomePath, isShellShapedTool, isShieldVerdict, isStrictGatedTier, isVerdict, maskDestination, maskPersonalData, maskPersonalValue, matchCanary, matchCanaryArgs, matchSensitivePath, matchesPattern, matchesTrustedEntry, matchesTrustedList, narrativeRuleLabel, normalizeCommandForPolicy, normalizeDestination, normalizeFilePath, normalizeForScan, normalizeIpLiteral, normalizePyPiName, normalizeRecipient, normalizeTrustedEntry, parseAllSshHostsFromCommand, parseDestHost, patternShapeOf, positionedArgs, previewArgs, redactText, resolveAllChecks, resolveCheck, resolveCheckMap, resolvePinned, resolveShellInput, safeMessage, sampleCopyCommand, scanArgs, scanArgumentSecrets, scanInjection, scanText, scanViews, sensitivePathMatch, shellRuleArgs, ssrfCheckId, ssrfDestinationFloor, ssrfExemptMatches, ssrfFloor, ssrfReason, stripControlChars, stripInvisible, stripTerminalEscapes, summarizeBlast, summarizeScan, toScanFinding, toolMatchesRule, truncateBlastPath, trustedEntryOf, tuningFromLegacyPolicy, tuningToLegacyPolicy, unwrapCommandHead, validateOverrides, validateRegex, validateShieldDefinition };
package/dist/index.d.ts CHANGED
@@ -113,6 +113,19 @@ type ToolInspectionEntry = string | {
113
113
  field: string;
114
114
  };
115
115
  type ToolInspection = Record<string, ToolInspectionEntry>;
116
+ /**
117
+ * Inspection mappings by provenance. `trusted` is the shipped defaults plus the
118
+ * user's own and the workspace's entries, with full authority. `project` is a
119
+ * repository-carried config file, which an agent can write in-session: it may
120
+ * add a shell tool or a shell field, never turn a recognized executor into a
121
+ * non-shell tool or point its inspection at a decoy field (fw#338, review 3).
122
+ */
123
+ interface InspectionLayers {
124
+ trusted: ToolInspection;
125
+ project?: ToolInspection;
126
+ }
127
+ /** A plain map is read as trusted with no project layer. */
128
+ type InspectionInput = ToolInspection | InspectionLayers;
116
129
  type ShellInputResolution = {
117
130
  kind: 'not-shell';
118
131
  } | {
@@ -125,10 +138,17 @@ type ShellInputResolution = {
125
138
  };
126
139
  declare const BASH_TOOL_NAMES: Set<string>;
127
140
  declare function isBashTool(tool: string): boolean;
128
- declare function isShellShapedTool(tool: string, inspection?: ToolInspection): boolean;
129
- declare function resolveShellInput(tool: string, args: unknown, inspection?: ToolInspection): ShellInputResolution;
141
+ /** The merged policy's maps as layers; the host keeps the project layer apart. */
142
+ declare function inspectionLayers(policy: {
143
+ toolInspection: ToolInspection;
144
+ projectToolInspection?: ToolInspection;
145
+ }): InspectionLayers;
146
+ /** The first matching entry, trusted layer first. For legacy (SQL, explain) lookups. */
147
+ declare function inspectionEntry(tool: string, inspection?: InspectionInput): ToolInspectionEntry | undefined;
148
+ declare function isShellShapedTool(tool: string, inspection?: InspectionInput): boolean;
149
+ declare function resolveShellInput(tool: string, args: unknown, inspection?: InspectionInput): ShellInputResolution;
130
150
  /** Only Bash-scoped rules receive the canonical projection. Caller data is never mutated. */
131
- declare function shellRuleArgs(tool: string, args: unknown, ruleTool: string | string[] | undefined, inspection?: ToolInspection): unknown;
151
+ declare function shellRuleArgs(tool: string, args: unknown, ruleTool: string | string[] | undefined, inspection?: InspectionInput): unknown;
132
152
 
133
153
  type SsrfTier = 'metadata' | 'link-local' | 'multicast' | 'unspecified' | 'cgnat' | 'private';
134
154
  interface SsrfMatch {
@@ -511,7 +531,7 @@ declare const COMMAND_WRAPPERS: Set<string>;
511
531
  * `run_shell_command`, `execute_bash`, `terminal.execute`) must not silently
512
532
  * void them. An absent rule scope matches everything (callers' prior semantics).
513
533
  */
514
- declare function toolMatchesRule(toolName: string, ruleTool: string | string[] | undefined, toolInspection?: ToolInspection): boolean;
534
+ declare function toolMatchesRule(toolName: string, ruleTool: string | string[] | undefined, toolInspection?: InspectionInput): boolean;
515
535
  /** Strip leading wrappers/runners from a resolved arg list, returning the index
516
536
  * of the real command head. Handles `sudo -u www python3`, `env -u FOO python3`,
517
537
  * `timeout 5 python3`, `uv run python`, `conda run -n env python`,
@@ -689,6 +709,8 @@ interface PolicyConfig {
689
709
  dangerousWords: string[];
690
710
  ignoredTools: string[];
691
711
  toolInspection: ToolInspection;
712
+ /** Entries from a repository-carried config file; they may only add inspection. */
713
+ projectToolInspection?: ToolInspection;
692
714
  smartRules: SmartRule[];
693
715
  dlp: {
694
716
  enabled: boolean;
@@ -842,7 +864,7 @@ type ProtectedFileVerdict = PolicyVerdict & {
842
864
  declare function incompleteFileVerdict(operation?: FileAccess['operation']): ProtectedFileVerdict;
843
865
  /** Closed adapters: an arbitrary tool's path-shaped argument is not an operation. */
844
866
  declare function fileToolOperation(tool: string, args: unknown): FileAccess['operation'] | null;
845
- declare function collectFileAccesses(tool: string, args: unknown, context?: FileAccessContext, inspection?: ToolInspection): FileAccess[];
867
+ declare function collectFileAccesses(tool: string, args: unknown, context?: FileAccessContext, inspection?: InspectionInput): FileAccess[];
846
868
  declare function evaluateProtectedFileAccess(accesses: FileAccess[], context: FileAccessContext, settings: CatalogSettings): ProtectedFileVerdict | null;
847
869
 
848
870
  type InjectionConfidence = 'low' | 'medium' | 'high';
@@ -855,6 +877,10 @@ interface InjectionContext {
855
877
  /** Tool that produced the output. Untrusted origins (web/network) raise
856
878
  * confidence — a fetched page is attacker-influenceable; a local read isn't. */
857
879
  tool?: string;
880
+ /** The caller's own answer to "did this output come from outside?" (the
881
+ * #318 source roles: an unannotated MCP tool, a shell fetch). When set it
882
+ * decides the booster; when absent the tool-name regex below does. */
883
+ untrusted?: boolean;
858
884
  }
859
885
  /**
860
886
  * Scan tool output for indirect prompt injection. Returns the matched signals +
@@ -1185,6 +1211,63 @@ declare function isLoopbackHost(host: string): boolean;
1185
1211
  declare function gitRepoPath(url: string): string | null;
1186
1212
  declare function isDestructiveToolName(bareTool: string): boolean;
1187
1213
 
1214
+ /** The value as the gate compares it: email lower-cased, IBAN and account
1215
+ * upper-cased without spaces, host lower-cased. */
1216
+ declare function normalizeDestination(dest: string): string;
1217
+ /** 'iban:GB82 **** **** 5432', 'account:****5432', 'email:d***@acme.example';
1218
+ * a host (or anything else) is returned normalised and otherwise unchanged. */
1219
+ declare function maskDestination(dest: string): string;
1220
+ /** Whether a destination's kind is masked outside the machine. */
1221
+ declare function isMaskedKind(dest: string): boolean;
1222
+ /** SHA-256 (hex) of the normalised destination, kind prefix included. */
1223
+ declare function hashDestination(dest: string): string;
1224
+ /** Whether `entry` is a stored masked entry ('<masked>#sha256:<hex>'). */
1225
+ declare function isHashedEntry(entry: string): boolean;
1226
+ /** A full destination as it is stored on a trusted list outside the machine:
1227
+ * a masked kind becomes '<masked>#sha256:<hex>', a host stays as it is. */
1228
+ declare function trustedEntryOf(dest: string): string;
1229
+ /** Does a full destination match a stored entry (a hashed one, or a plain
1230
+ * value as the local list and older managed lists hold)? */
1231
+ declare function matchesTrustedEntry(dest: string, entry: string): boolean;
1232
+ /** Does a full destination match any entry of a list? Hashes it once. */
1233
+ declare function matchesTrustedList(dest: string, entries: readonly string[]): boolean;
1234
+ /**
1235
+ * A recipient as a person types it, in the stored destination form: an
1236
+ * address becomes `email:`, an IBAN `iban:`, a URL or hostname `host:`, and
1237
+ * `account:<number>` keeps its kind. A value that carries its kind is checked
1238
+ * against it. Null for anything else (a bare word, two values in one).
1239
+ */
1240
+ declare function normalizeRecipient(raw: unknown): string | null;
1241
+ /**
1242
+ * One entry of a trusted list outside the machine (the dashboard's workspace
1243
+ * list, the snapshot's personal list): a host in full; an address, IBAN or
1244
+ * account as '<masked>#sha256:<hex>'. A value already in that form passes
1245
+ * with its hash lower-cased; a full value is turned into it. Null when it is
1246
+ * neither. The backend mirror asserts the same vectors.
1247
+ */
1248
+ declare function normalizeTrustedEntry(raw: unknown): string | null;
1249
+ /** What a person reads for an entry: the masked part, without the hash. */
1250
+ declare function entryDisplay(entry: string): string;
1251
+ /**
1252
+ * IBANs (mod-97), card numbers (exactly what detectPii reports, so not the
1253
+ * fractional part of a number), account numbers (a whole IBAN-shaped value,
1254
+ * or a number under an account key) and email addresses inside a text,
1255
+ * masked the way destinations are. No quote or backslash is introduced or
1256
+ * removed, so a JSON string stays a JSON string; a card written as a bare
1257
+ * JSON number does not stay a number, so arguments go through
1258
+ * maskPersonalValue instead.
1259
+ */
1260
+ declare function maskPersonalData(text: string): string;
1261
+ /**
1262
+ * maskPersonalData over a JSON-shaped value (tool arguments), leaf by leaf, so
1263
+ * the result is always a value: a string leaf is masked in its JSON form under
1264
+ * its own key (the account-key and whole-value rules still see both), an
1265
+ * object key is masked as text, and a number whose text holds personal data (a
1266
+ * card passed as a number) becomes the masked string. Anything deeper than 64
1267
+ * levels is replaced by '[REDACTED]'. Pure, never throws.
1268
+ */
1269
+ declare function maskPersonalValue(value: unknown): unknown;
1270
+
1188
1271
  interface ShellExposure {
1189
1272
  /** The command brings outside content in: its output is a source. */
1190
1273
  fetches: boolean;
@@ -1866,7 +1949,7 @@ interface ExtractContext {
1866
1949
  }>;
1867
1950
  /** toolInspection map from PolicyConfig — drives shell-command extraction
1868
1951
  * for tools that aren't the standard 'bash' name. Defaults handled by caller. */
1869
- toolInspection: ToolInspection;
1952
+ toolInspection: InspectionInput;
1870
1953
  /** DLP enabled flag from PolicyConfig. */
1871
1954
  dlpEnabled: boolean;
1872
1955
  /** Decoy credentials registered on this machine (value plus kind and plant
@@ -1924,7 +2007,7 @@ declare const LONG_OUTPUT_THRESHOLD_BYTES: number;
1924
2007
  * and fails CI when the hash drifts without a version bump — forgetting
1925
2008
  * is loud, not silent.
1926
2009
  */
1927
- declare const CANONICAL_EXTRACTOR_VERSION = "canonical-v25";
2010
+ declare const CANONICAL_EXTRACTOR_VERSION = "canonical-v27";
1928
2011
  /**
1929
2012
  * SHA-256 prefix of the detector-source files
1930
2013
  * (canonical.ts + pii.ts + destructive-regex.ts).
@@ -1935,7 +2018,7 @@ declare const CANONICAL_EXTRACTOR_VERSION = "canonical-v25";
1935
2018
  * files changed, this hash must change too, and you must consciously
1936
2019
  * decide whether to bump CANONICAL_EXTRACTOR_VERSION."
1937
2020
  */
1938
- declare const CANONICAL_EXTRACTOR_HASH = "48ef4af5dd89198d";
2021
+ declare const CANONICAL_EXTRACTOR_HASH = "a358f47eacca6e14";
1939
2022
  declare function extractCanonicalFindings(call: ToolCallEntry, ctx: ExtractContext): CanonicalFinding[];
1940
2023
  declare function extractSessionLevelFindings(calls: ReadonlyArray<SessionToolCall>, ctx: SessionExtractContext): CanonicalFinding[];
1941
2024
  /**
@@ -2010,7 +2093,7 @@ declare function ssrfDestinationFloor(toolName: string, args: unknown, opts?: {
2010
2093
  declare const ARGUMENT_SCAN_LIMITS: {
2011
2094
  readonly maxDepth: 12;
2012
2095
  readonly maxNodes: 16384;
2013
- /** Raw text is matched in windows of this size; decoding views use the first window. */
2096
+ /** Text is matched and decoded in windows of this size. */
2014
2097
  readonly maxStringCharacters: 100000;
2015
2098
  /** Windows overlap by this much so a token on a window edge is still seen whole. */
2016
2099
  readonly windowOverlap: 4096;
@@ -2023,10 +2106,11 @@ declare const ARGUMENT_SCAN_LIMITS: {
2023
2106
  interface ArgumentInspectionResult {
2024
2107
  match: DlpMatch | null;
2025
2108
  /**
2026
- * `incomplete` when any part of the input was not fully inspected. Reasons
2027
- * starting with `argument-` mean raw text or structure was skipped; reasons
2028
- * starting with `decode-` mean every byte of raw text was matched but the
2029
- * derived decoding views were cut short.
2109
+ * `incomplete` when any part of the input was not fully inspected: raw text
2110
+ * or structure skipped (`argument-*`), a decoding layer past the nested
2111
+ * limits (`decode-nested`), a flood of joinable hostname labels
2112
+ * (`decode-labels`), or the recovery-phrase hash budget (`mnemonic-budget`).
2113
+ * Every reason requires review; none is a documented allow.
2030
2114
  */
2031
2115
  coverage: 'complete' | 'incomplete';
2032
2116
  reasons: string[];
@@ -2034,14 +2118,13 @@ interface ArgumentInspectionResult {
2034
2118
  /** Bounded input inspection. Output redaction deliberately retains its own API. */
2035
2119
  declare function inspectArgumentSecrets(args: unknown): ArgumentInspectionResult;
2036
2120
  /**
2037
- * Existing DLP approval routing. A finding wins. Otherwise raw text or
2038
- * structure that was skipped (`argument-*` reasons) requires review; a cut
2039
- * short decoding budget over fully matched raw text does not interrupt the
2040
- * call, because ordinary documents full of links or hashes exhaust it.
2121
+ * Existing DLP approval routing. A finding wins. Otherwise any part of the
2122
+ * input that was not fully inspected requires review: there is no limit an
2123
+ * attacker can reach that ends in a clean result.
2041
2124
  */
2042
2125
  declare function scanArgumentSecrets(args: unknown): DlpMatch | null;
2043
2126
 
2044
2127
  /** Engine version stamped on audit entries for future drift detection. */
2045
2128
  declare const ENGINE_VERSION = "1.4.0";
2046
2129
 
2047
- export { AGENT_INSTRUCTION_DIRS, AGENT_INSTRUCTION_FILES, ARGUMENT_SCAN_LIMITS, AST_FS_REGEX_RULES, type ArgumentInspectionResult, type AuditEntryForClassify, BASH_TOOL_NAMES, BUILTIN_DANGEROUS_WORDS, BUILTIN_SHIELDS, type BlastEnvFinding, type BlastFinding, type BlastResult, type BlastSummary, CANARY_MIN_LENGTH, CANONICAL_EXTRACTOR_HASH, CANONICAL_EXTRACTOR_VERSION, CHECKS, CHECK_BY_ID, CHECK_GROUPS, CHECK_TEXT, CHECK_VERDICT_RANK, COMMAND_WRAPPERS, CONFIGURABLE_CHECK_IDS, COPY_VERBS, COST_PER_LOOP_ITER_USD, type CanaryHit, type CanaryValue, type CanaryView, type CanonicalAgent, type CanonicalFinding, type CanonicalFindingType, type CanonicalSourceType, type CatalogSettings, type CheckDef, type CheckGroup, type CheckSource, type CheckText, DEFAULT_EGRESS_ALLOWLIST, DESTINATION_ARGS, DESTRUCTIVE_OP_RE, DLP_PATTERNS, DLP_SCAN_LIMITS, type Destination, type DestinationKind, type DlpMatch, ENGINE_VERSION, type EgressPolicy, type EgressVerdict, type ExtractContext, FILE_TOOLS, FLAGS_WITH_VALUES, FS_READ_TOOLS, type FileAccess, type FileAccessContext, type FsOpVerdict, type InjectionConfidence, type InjectionContext, type InjectionMatch, KNOB_GOVERNED, LONG_OUTPUT_THRESHOLD_BYTES, LOOP_MAX_RECORDS, LOOP_THRESHOLD_FOR_WASTE, type LegacyPolicyKnobs, type LoopWindowEvaluation, MAP_GOVERNED, MAX_BLAST_PATH, MAX_DESTINATIONS, NET_BINARIES, PATTERN_VERB_NAMES, PRIVILEGE_ESCALATION_RE, type PackageEcosystem, type PackageInstallRequest, type PiiPattern, type PipeChainAnalysis, type PolicyConfig, type PolicyContext, type PolicyHostHooks, type PolicyVerdict, type PositionedArg, type ProtectedFileVerdict, type ProvenanceLookup, type ProvenanceTrust, REALTIME_PII_PATTERNS, type ResolvedCheck, type RiskMetadata, SCAN_SIGNAL_WEIGHTS, SENSITIVE_PATH_RE, SENSITIVE_PATH_REGEXES, SSRF_MAX_HOST, STARTUP_NAMES, SYSTEM_AUTH_DIRS, SYSTEM_AUTH_FILES, type ScanFinding, type ScanSignals, type ScanSummary, type ScanView, type ScoreTier, type SessionExtractContext, type SessionToolCall, type Severity, type ShellCommandAnalysis, type ShellDestToken, type ShellDestination, type ShellExposure, type ShellInputResolution, type ShieldDefinition, type ShieldOverrides, type ShieldVerdict, type SmartCondition, type SmartRule, type SsrfFloorOptions, type SsrfMatch, type SsrfTier, type SsrfVerdict, TUNING_FIELDS, type ToolCallEntry, type ToolCallRecord, type ToolInspection, type ToolInspectionEntry, type TuningField, VERDICTS, type Verdict, analyzeFsOperation, analyzePipeChain, analyzeShellCommand, catalogSettingsFromConfig, checkDangerousSql, checkIdForCheckedBy, checkIdForRule, checkToLegacyPolicy, checkValue, checksFromLegacyPolicy, classifyAuditEntry, classifyRuleSeverity, classifyScanSignal, classifyShellExposure, classifySsrf, collectFileAccesses, computeAgentDeviceScore, computeArgsHash, computeBlendedSecurityScore, computeScanScore, computeSecurityScore, configurableValues, decodeEmbeddedBase64, decodeEmbeddedHex, dedupeCanonicalFindings, destinationDomain, destinationKind, destinationValue, detectArgsPii, detectDangerousEval, detectDangerousShellExec, detectInlineExec, detectPii, evaluateEgress, evaluateLoopWindow, evaluatePolicy, evaluateProtectedFileAccess, evaluateSmartConditions, extractAllSshHosts, extractArgDestinations, extractCanonicalFindings, extractContentDestinations, extractNetworkTargets, extractPackageInstalls, extractPositionalArgs, extractSessionLevelFindings, extractShellDestTokens, extractShellDestinations, extractToolDestinations, fileOperandFlagsOf, fileToolOperation, foldHomoglyphs, getCheck, getCompiledRegex, getNestedValue, gitRepoPath, hostMatches, incompleteFileVerdict, inspectArgumentSecrets, isAgentInstructionPath, isBashTool, isDestructiveToolName, isIgnoredTool, isInside, isKnobGoverned, isLegacySystemPath, isLockedCheck, isLoopbackHost, isPasswordHashPath, isPrivateHost, isProtectedHomePath, isShellShapedTool, isShieldVerdict, isStrictGatedTier, isVerdict, matchCanary, matchCanaryArgs, matchSensitivePath, matchesPattern, narrativeRuleLabel, normalizeCommandForPolicy, normalizeFilePath, normalizeForScan, normalizeIpLiteral, normalizePyPiName, parseAllSshHostsFromCommand, parseDestHost, patternShapeOf, positionedArgs, previewArgs, redactText, resolveAllChecks, resolveCheck, resolveCheckMap, resolvePinned, resolveShellInput, safeMessage, sampleCopyCommand, scanArgs, scanArgumentSecrets, scanInjection, scanText, scanViews, sensitivePathMatch, shellRuleArgs, ssrfCheckId, ssrfDestinationFloor, ssrfExemptMatches, ssrfFloor, ssrfReason, stripControlChars, stripInvisible, stripTerminalEscapes, summarizeBlast, summarizeScan, toScanFinding, toolMatchesRule, truncateBlastPath, tuningFromLegacyPolicy, tuningToLegacyPolicy, unwrapCommandHead, validateOverrides, validateRegex, validateShieldDefinition };
2130
+ export { AGENT_INSTRUCTION_DIRS, AGENT_INSTRUCTION_FILES, ARGUMENT_SCAN_LIMITS, AST_FS_REGEX_RULES, type ArgumentInspectionResult, type AuditEntryForClassify, BASH_TOOL_NAMES, BUILTIN_DANGEROUS_WORDS, BUILTIN_SHIELDS, type BlastEnvFinding, type BlastFinding, type BlastResult, type BlastSummary, CANARY_MIN_LENGTH, CANONICAL_EXTRACTOR_HASH, CANONICAL_EXTRACTOR_VERSION, CHECKS, CHECK_BY_ID, CHECK_GROUPS, CHECK_TEXT, CHECK_VERDICT_RANK, COMMAND_WRAPPERS, CONFIGURABLE_CHECK_IDS, COPY_VERBS, COST_PER_LOOP_ITER_USD, type CanaryHit, type CanaryValue, type CanaryView, type CanonicalAgent, type CanonicalFinding, type CanonicalFindingType, type CanonicalSourceType, type CatalogSettings, type CheckDef, type CheckGroup, type CheckSource, type CheckText, DEFAULT_EGRESS_ALLOWLIST, DESTINATION_ARGS, DESTRUCTIVE_OP_RE, DLP_PATTERNS, DLP_SCAN_LIMITS, type Destination, type DestinationKind, type DlpMatch, ENGINE_VERSION, type EgressPolicy, type EgressVerdict, type ExtractContext, FILE_TOOLS, FLAGS_WITH_VALUES, FS_READ_TOOLS, type FileAccess, type FileAccessContext, type FsOpVerdict, type InjectionConfidence, type InjectionContext, type InjectionMatch, type InspectionInput, type InspectionLayers, KNOB_GOVERNED, LONG_OUTPUT_THRESHOLD_BYTES, LOOP_MAX_RECORDS, LOOP_THRESHOLD_FOR_WASTE, type LegacyPolicyKnobs, type LoopWindowEvaluation, MAP_GOVERNED, MAX_BLAST_PATH, MAX_DESTINATIONS, NET_BINARIES, PATTERN_VERB_NAMES, PRIVILEGE_ESCALATION_RE, type PackageEcosystem, type PackageInstallRequest, type PiiPattern, type PipeChainAnalysis, type PolicyConfig, type PolicyContext, type PolicyHostHooks, type PolicyVerdict, type PositionedArg, type ProtectedFileVerdict, type ProvenanceLookup, type ProvenanceTrust, REALTIME_PII_PATTERNS, type ResolvedCheck, type RiskMetadata, SCAN_SIGNAL_WEIGHTS, SENSITIVE_PATH_RE, SENSITIVE_PATH_REGEXES, SSRF_MAX_HOST, STARTUP_NAMES, SYSTEM_AUTH_DIRS, SYSTEM_AUTH_FILES, type ScanFinding, type ScanSignals, type ScanSummary, type ScanView, type ScoreTier, type SessionExtractContext, type SessionToolCall, type Severity, type ShellCommandAnalysis, type ShellDestToken, type ShellDestination, type ShellExposure, type ShellInputResolution, type ShieldDefinition, type ShieldOverrides, type ShieldVerdict, type SmartCondition, type SmartRule, type SsrfFloorOptions, type SsrfMatch, type SsrfTier, type SsrfVerdict, TUNING_FIELDS, type ToolCallEntry, type ToolCallRecord, type ToolInspection, type ToolInspectionEntry, type TuningField, VERDICTS, type Verdict, analyzeFsOperation, analyzePipeChain, analyzeShellCommand, catalogSettingsFromConfig, checkDangerousSql, checkIdForCheckedBy, checkIdForRule, checkToLegacyPolicy, checkValue, checksFromLegacyPolicy, classifyAuditEntry, classifyRuleSeverity, classifyScanSignal, classifyShellExposure, classifySsrf, collectFileAccesses, computeAgentDeviceScore, computeArgsHash, computeBlendedSecurityScore, computeScanScore, computeSecurityScore, configurableValues, decodeEmbeddedBase64, decodeEmbeddedHex, dedupeCanonicalFindings, destinationDomain, destinationKind, destinationValue, detectArgsPii, detectDangerousEval, detectDangerousShellExec, detectInlineExec, detectPii, entryDisplay, evaluateEgress, evaluateLoopWindow, evaluatePolicy, evaluateProtectedFileAccess, evaluateSmartConditions, extractAllSshHosts, extractArgDestinations, extractCanonicalFindings, extractContentDestinations, extractNetworkTargets, extractPackageInstalls, extractPositionalArgs, extractSessionLevelFindings, extractShellDestTokens, extractShellDestinations, extractToolDestinations, fileOperandFlagsOf, fileToolOperation, foldHomoglyphs, getCheck, getCompiledRegex, getNestedValue, gitRepoPath, hashDestination, hostMatches, incompleteFileVerdict, inspectArgumentSecrets, inspectionEntry, inspectionLayers, isAgentInstructionPath, isBashTool, isDestructiveToolName, isHashedEntry, isIgnoredTool, isInside, isKnobGoverned, isLegacySystemPath, isLockedCheck, isLoopbackHost, isMaskedKind, isPasswordHashPath, isPrivateHost, isProtectedHomePath, isShellShapedTool, isShieldVerdict, isStrictGatedTier, isVerdict, maskDestination, maskPersonalData, maskPersonalValue, matchCanary, matchCanaryArgs, matchSensitivePath, matchesPattern, matchesTrustedEntry, matchesTrustedList, narrativeRuleLabel, normalizeCommandForPolicy, normalizeDestination, normalizeFilePath, normalizeForScan, normalizeIpLiteral, normalizePyPiName, normalizeRecipient, normalizeTrustedEntry, parseAllSshHostsFromCommand, parseDestHost, patternShapeOf, positionedArgs, previewArgs, redactText, resolveAllChecks, resolveCheck, resolveCheckMap, resolvePinned, resolveShellInput, safeMessage, sampleCopyCommand, scanArgs, scanArgumentSecrets, scanInjection, scanText, scanViews, sensitivePathMatch, shellRuleArgs, ssrfCheckId, ssrfDestinationFloor, ssrfExemptMatches, ssrfFloor, ssrfReason, stripControlChars, stripInvisible, stripTerminalEscapes, summarizeBlast, summarizeScan, toScanFinding, toolMatchesRule, truncateBlastPath, trustedEntryOf, tuningFromLegacyPolicy, tuningToLegacyPolicy, unwrapCommandHead, validateOverrides, validateRegex, validateShieldDefinition };