For the complete documentation index, see llms.txt. This page is also available as Markdown.

aiDecisionStore

Creates an IDecisionStore — the backing store for durable human-approval grants used by Human-in-the-Loop.

Creates an IDecisionStore — the backing store for durable human-approval grants (approve_always and approve_session) used by Human-in-the-Loop.

Syntax

aiDecisionStore( store, config )

Parameters

Parameter
Type
Required
Default
Description

store

string

settings.hitl.decisionStore.provider

cache, jdbc, file, or a full class path

config

struct

settings.hitl.decisionStore.config

Configuration for the chosen store

Called with no arguments, it resolves the application-wide default from module settings — the same fallback HumanInTheLoopMiddleware uses when it isn't given a store explicitly.

Returns

An IDecisionStore instance.

Throws

InvalidDecisionStoreType for an unrecognised type that isn't a class path.

Store Types

Type
Aliases
Backing
Config

cache

CacheDecisionStore

CacheBox

cacheName

jdbc

database, db, JdbcDecisionStore

Any datasource

datasource (required), table

file

FileDecisionStore

JSON on disk

directoryPath

Store Contract

Method
Returns
Description

grant( identity, toolName, scope, expiresAt )

void

Record a grant

isGranted( identity, toolName, scope )

boolean

Whether a live grant exists

revoke( identity, toolName, scope )

void

Remove a grant

listGrants( identity )

array

[ { toolName, scope, grantedAt, expiresAt } ]

Examples

Application-Wide Default

Explicit Stores

Attaching to HITL

Auditing and Revoking Grants

Events

Fires onAiDecisionStoreCreate with { storeType, storeClass, storeConfig }.

Last updated