API Reference
PermissionStore
Defined in: permissions/permissions.types.ts:43
The configuration the gate consults.
Remarks
Reads the policy for a tool and persists durable ("always") decisions. Back it with RAM, a JSON file (CLI), or a DB — the gate only depends on this interface.
See
- InMemoryPermissionStore for the v1 RAM-backed implementation.
- permissionGate for the consumer of this interface.
Methods
get()
get(toolName, args): Promise<PermissionPolicy>;Defined in: permissions/permissions.types.ts:51
Current policy for a call.
Parameters
| Parameter | Type | Description |
|---|---|---|
toolName | string | The name of the tool being called. |
args | unknown | The call's arguments, passed so rules can be arg-aware. |
Returns
Promise<PermissionPolicy>
The PermissionPolicy to apply to this call.
set()
set(toolName, policy): Promise<void>;Defined in: permissions/permissions.types.ts:59
Persist a durable decision — the "always" half of an approval choice.
Parameters
| Parameter | Type | Description |
|---|---|---|
toolName | string | The name of the tool the decision applies to. |
policy | | Allow | Deny | The durable policy to store (PermissionPolicy.Allow or PermissionPolicy.Deny). |
Returns
Promise<void>