/** * sc4sap-compatible data-extraction blocklist (L4 enforcement). * * Guards `GetTableContents` and `GetSqlQuery` against reading row data from * SAP tables that contain PII, credentials, payroll, banking, or other * protected content — regardless of who is calling the MCP server. * * **Activation model**: enforcement only runs when sc4sap is detected on the * machine. Specifically, when a `.sc4sap/config.json` is found by walking up * from the server's working directory. That file is written by the * `/sc4sap:setup` skill and holds `blocklistProfile`. No sc4sap = no * enforcement (other MCP users are unaffected). * * **Override precedence**: * 1. `SC4SAP_POLICY=off|false|0` — hard disable, even if sc4sap is detected * 2. `.sc4sap/config.json → blocklistProfile` — primary source of truth * 3. `SC4SAP_POLICY=on|strict|standard|minimal|custom` — force-enable without config * 4. otherwise — inactive * * Additional environment variables: * SC4SAP_POLICY_PROFILE — overrides the profile resolved above * SC4SAP_BLOCKLIST_PATH — absolute path to an extra table_exception.md * (auto-resolves to the sc4sap plugin's file if * `.sc4sap/config.json` is found next to it) * SC4SAP_ALLOW_TABLE — comma-separated table names to exempt from blocking * for the current session (emergency override). Logged. * * Schema/DDIC metadata reads (GetTable, GetStructure, etc.) are intentionally * NOT guarded here — they are covered upstream. Only row-returning calls are * blocked. */ export type Tier = 'minimal' | 'standard' | 'strict'; export type Profile = Tier | 'custom' | 'off'; export type Action = 'deny' | 'warn'; export interface BlocklistEntry { name: string; category: string; why: string; tier: Tier; action: Action; } export interface BlocklistMatch { table: string; category: string; why: string; tier: Tier; action: Action; } export interface BlocklistResult { denyHits: BlocklistMatch[]; warnHits: BlocklistMatch[]; } /** * Resolve the active profile following the precedence rules. * 1. SC4SAP_POLICY=off → 'off' (kill switch) * 2. .sc4sap/config.json found → its blocklistProfile * 3. SC4SAP_POLICY=on| → force-active with that/default profile * 4. otherwise → 'off' (sc4sap not installed, no enforcement) * SC4SAP_POLICY_PROFILE always overrides the chosen profile (except kill switch). */ export declare function resolveProfile(): Profile; export declare function isPolicyEnabled(): boolean; /** Build the effective blocklist for the active profile. */ export declare function buildBlocklist(profile: Profile): BlocklistEntry[]; /** Extract table names from a SQL SELECT query (FROM/JOIN tokens). */ export declare function extractTablesFromSql(sql: string): string[]; /** Check a list of table names against the blocklist; returns hits split by action. */ export declare function checkTables(tables: string[], profile?: Profile): BlocklistResult; /** Format a deny (hard block) message. */ export declare function formatBlockMessage(profile: Profile, hits: BlocklistMatch[]): string; /** Format a warn (soft) notice that will be prepended to a successful result. */ export declare function formatWarnMessage(profile: Profile, hits: BlocklistMatch[]): string; //# sourceMappingURL=blocklist.d.ts.map