Interface ToolPermissionManagerConfig

Configuration options for the ToolPermissionManager. This allows administrators to fine-tune how tool permissions are evaluated and enforced.

ToolPermissionManagerConfig

Example

// Example: Only users with "AdvancedAnalysisTools" and "PremiumSupport" features can use "financial_data_analyzer_v2"
const config: ToolPermissionManagerConfig = {
strictCapabilityChecking: true,
logToolCalls: true,
toolToSubscriptionFeatures: {
"financial_data_analyzer_v2": [
{ flag: "FEATURE_ADVANCED_ANALYSIS", description: "Access to advanced analysis tools" },
{ flag: "FEATURE_PREMIUM_SUPPORT_TOOLS", description: "Access to tools included with premium support" }
]
}
};
interface ToolPermissionManagerConfig {
    strictCapabilityChecking?: boolean;
    toolToSubscriptionFeatures?: Record<string, FeatureFlag[]>;
    logToolCalls?: boolean;
}

Properties

strictCapabilityChecking?: boolean

If true (default), the Persona must possess all capabilities listed in the tool.requiredCapabilities array. If false, this check might be bypassed or handled with more leniency (though generally not recommended for tools accessing sensitive resources).

toolToSubscriptionFeatures?: Record<string, FeatureFlag[]>

Optional. A mapping where keys are tool IDs (ITool.id) or tool names (ITool.name), and values are arrays of FeatureFlag objects (or their string identifiers). This allows linking specific tools to subscription features, meaning a user must have the corresponding features enabled via their subscription tier to use the tool.

logToolCalls?: boolean

If true, detailed information about permission checks for tool calls will be logged. Defaults to false.