Skip to main content

Interface: SqlActionLimiterOptions

Defined in: packages/agentos/src/safety/runtime/ActionLimiter.ts:63

How a SqlActionLimiter is built: the store its counts live in, every rule the host uses, the start of its tables' names, the length of a reservation's lease, and whether it refuses a store processes cannot share and makes its own tables.

Properties​

db​

db: StorageAdapter

Defined in: packages/agentos/src/safety/runtime/ActionLimiter.ts:64


ensureSchema?​

optional ensureSchema: boolean

Defined in: packages/agentos/src/safety/runtime/ActionLimiter.ts:87

As SqlSpendMeterOptions.ensureSchema: create the tables when they are missing. Default true.


leaseMs?​

optional leaseMs: number

Defined in: packages/agentos/src/safety/runtime/ActionLimiter.ts:83

How long a reservation lives without a renewal. Default 60000. A governed tool renews it three times a lease while its tool runs, so it runs out only when no renewal succeeds for a whole lease: the process that holds it stopped, or the store did not answer. A lease that runs out while the tool runs counts the action. The constructor refuses one that is not shorter than every rule's windowMs.


requireShared?​

optional requireShared: boolean

Defined in: packages/agentos/src/safety/runtime/ActionLimiter.ts:85

As SqlSpendMeterOptions.requireShared: refuse a store several processes cannot share. Default true.


rules​

rules: readonly ActionLimitRule[]

Defined in: packages/agentos/src/safety/runtime/ActionLimiter.ts:70

Every rule the host uses. The limiter builds its meters from this list, so a process that never reserves (a deletion job, a nightly purge) still knows every window and every key. reserve() throws for a rule that is not here or whose numbers differ: a configuration error, which a governed tool ends as limiter_unavailable.


tablePrefix?​

optional tablePrefix: string

Defined in: packages/agentos/src/safety/runtime/ActionLimiter.ts:76

Default agentos_action. Each distinct windowMs gets one SqlSpendMeter under <prefix>_w<windowMs>. That whole name must pass the meter's own rule (a lower-case letter and at most 37 more characters), so the constructor refuses a prefix and a window that together run past it.