Open Agent Loops
API Reference

InMemoryPermissionStore

@open-agent-loops/core


Defined in: permissions/in-memory-permission-store.ts:66

RAM-backed PermissionStore with a fallback policy and seeded rules.

Remarks

Policies live in process memory and are lost on restart. Durable "always" choices made through permissionGate are written back via InMemoryPermissionStore.set.

Example

const store = new InMemoryPermissionStore({
  fallback: PermissionPolicy.Ask,
  rules: { read_file: PermissionPolicy.Allow },
});
await store.get("read_file", {}); // -> PermissionPolicy.Allow
await store.get("delete_file", {}); // -> PermissionPolicy.Ask (fallback)

See

Implements

Constructors

Constructor

new InMemoryPermissionStore(options?): InMemoryPermissionStore;

Defined in: permissions/in-memory-permission-store.ts:76

Create a store with the given fallback and seeded rules.

Parameters

ParameterTypeDescription
optionsInMemoryPermissionStoreOptionsFallback policy and seed rules; see InMemoryPermissionStoreOptions.

Returns

InMemoryPermissionStore

Methods

get()

get(toolName, _args?): Promise<PermissionPolicy>;

Defined in: permissions/in-memory-permission-store.ts:88

Return the policy for a tool, falling back to the configured default.

Parameters

ParameterTypeDescription
toolNamestringThe name of the tool being called.
_args?unknownThe call's arguments (unused; accepted for interface parity).

Returns

Promise<PermissionPolicy>

The seeded rule for toolName, or the fallback policy.

Implementation of

PermissionStore.get


set()

set(toolName, policy): Promise<void>;

Defined in: permissions/in-memory-permission-store.ts:98

Persist a durable allow/deny policy for a tool.

Parameters

ParameterTypeDescription
toolNamestringThe name of the tool the decision applies to.
policySettablePolicyThe durable policy to store.

Returns

Promise<void>

Implementation of

PermissionStore.set

On this page