fix(security): harden toolsBySender sender-key matching

This commit is contained in:
Peter Steinberger
2026-02-22 21:03:09 +01:00
parent 3461dda880
commit 5547a2275c
10 changed files with 324 additions and 36 deletions

View File

@@ -176,6 +176,18 @@ export type GroupToolPolicyConfig = {
deny?: string[];
};
/**
* Per-sender overrides.
*
* Prefer explicit key prefixes:
* - id:<senderId>
* - e164:<phone>
* - username:<handle>
* - name:<display-name>
* - * (wildcard)
*
* Legacy unprefixed keys are supported for backward compatibility and are matched as senderId only.
*/
export type GroupToolPolicyBySenderConfig = Record<string, GroupToolPolicyConfig>;
export type ExecToolConfig = {