Skip to content

agent-sessions / Exports / PermissionEnforcer

Class: PermissionEnforcer

Table of contents

Constructors

Methods

Constructors

constructor

new PermissionEnforcer(options): PermissionEnforcer

Parameters

NameType
optionsIPermissionEnforcerOptions

Returns

PermissionEnforcer

Defined in

agent-sessions/src/permission-enforcer.ts:104

Methods

wrapTools

wrapTools(tools): IToolWithEventService<TToolParameters, IToolResult>[]

Wrap all tools with permission checking

Parameters

NameType
toolsIToolWithEventService<TToolParameters, IToolResult>[]

Returns

IToolWithEventService<TToolParameters, IToolResult>[]

Defined in

agent-sessions/src/permission-enforcer.ts:116


getSessionAllowedTools

getSessionAllowedTools(): string[]

Get tools that have been session-approved (via "Allow always" choice).

Returns

string[]

Defined in

agent-sessions/src/permission-enforcer.ts:121


clearSessionAllowedTools

clearSessionAllowedTools(): void

Clear all session-scoped allow rules.

Returns

void

Defined in

agent-sessions/src/permission-enforcer.ts:126


checkPermission

checkPermission(toolName, toolArgs): Promise<boolean>

Evaluate permission for a tool call using the current mode and config

Parameters

NameType
toolNamestring
toolArgsTToolArgs

Returns

Promise<boolean>

Defined in

agent-sessions/src/permission-enforcer.ts:260

Released under the MIT License.