LIMs (Ledger-Integrated Modules)
Policy evaluation modules that produce deterministic judgments
Last reviewed: 2025-01-25
LIMs (Ledger-Integrated Modules)
LIMs are the policy evaluation layer of ΔOS. They take Intents as input and produce deterministic Judgments as output.
LIM evaluation is deterministic. The same Intent with the same evidence always produces the same Judgment.
What Are LIMs?
LIMs are modular policy evaluators that:
- Receive Intents — When an agent submits an Intent, relevant LIMs evaluate it
- Apply Policies — Each LIM applies its specific policy logic
- Produce Judgments — The combined LIM output determines the Intent's Judgment
Intent → [LIM₁] → Judgment₁ ─┐
[LIM₂] → Judgment₂ ─┼→ Combined Judgment → Final Judgment
[LIM₃] → Judgment₃ ─┘
LIM Properties
Deterministic
Given the same inputs, a LIM always produces the same output. This enables:
- Replay for debugging
- Verification of historical decisions
- Predictable behavior
Composable
LIMs can be combined. Multiple LIMs evaluate each Intent, and their judgments are combined according to policy.
Auditable
Every LIM evaluation is recorded with its inputs and outputs.
LIM Types
Built-in LIMs
ΔOS provides standard LIMs for common governance patterns:
| LIM | Purpose |
|---|---|
rate-limiter | Enforce rate limits per agent, action, or resource |
threshold-gate | Block actions exceeding defined thresholds |
time-window | Restrict actions to specific time windows |
pattern-matcher | Match Intent properties against patterns |
escalation-router | Route to human based on criteria |
Custom LIMs
Define custom LIMs for domain-specific policies:
import { defineLIM } from '@deltaos/sdk';
export const highValueTransactionLIM = defineLIM({
id: 'high-value-transaction',
// Which Intents this LIM evaluates
appliesTo: (intent) => intent.action === 'payment.initiate',
// Evaluation logic
evaluate: async (intent, evidence) => {
const amount = intent.parameters.amount;
if (amount > 10000) {
return {
judgment: 'escalate',
reason: 'Transaction exceeds $10,000 threshold',
escalateTo: 'finance-team'
};
}
if (amount > 1000 && evidence.agent.trustScore < 0.8) {
return {
judgment: 'block',
reason: 'Low trust agent attempting significant transaction'
};
}
return { judgment: 'allow' };
}
});
LIM Evaluation Flow
1. Intent Reception
When an Intent is submitted, ΔOS identifies which LIMs apply.
2. Evidence Collection
Before evaluation, ΔOS collects evidence needed by the applicable LIMs.
3. Parallel Evaluation
Applicable LIMs evaluate the Intent in parallel:
// Conceptual flow
const limResults = await Promise.all(
applicableLIMs.map(lim => lim.evaluate(intent, evidence))
);
4. Judgment Combination
Results are combined according to combination policy:
| Policy | Behavior |
|---|---|
| Any Block | If any LIM returns Block, final is Block |
| Any Escalate | If any LIM returns Escalate (and no Block), final is Escalate |
| All Allow | All LIMs must Allow for final to be Allow |
5. Result Recording
The final Judgment and all LIM evaluations are recorded to the ledger.
Configuring LIMs
Enable/Disable
await deltaos.lims.configure('rate-limiter', {
enabled: true,
priority: 1
});
Set Parameters
await deltaos.lims.configure('threshold-gate', {
parameters: {
maxDailyTransactions: 100,
maxTransactionValue: 50000
}
});
Scope LIMs
Apply LIMs to specific agents, actions, or resources:
await deltaos.lims.configure('high-value-transaction', {
scope: {
actions: ['payment.*'],
agents: ['agent-category:autonomous'],
resources: ['accounts/*']
}
});
LIM Authority Boundaries
- →Define policies
- →Configure thresholds
- →Enable/disable LIMs
- →Handle escalations
- →Route Intents to LIMs
- →Collect evidence
- →Combine judgments
- →Record audit trail
- →Evaluate Intents
- →Produce judgments
- →Request evidence
- →Report confidence
LIM Versioning
LIMs are versioned. When policy changes:
- New version is deployed
- Both versions can run simultaneously
- New Intents use new version
- Old version remains for audit replay
const lim = await deltaos.lims.get('rate-limiter');
console.log(lim.version); // "1.2.0"
console.log(lim.previousVersions); // ["1.1.0", "1.0.0"]
Debugging LIMs
Dry Run
Test LIM evaluation without affecting production:
const result = await deltaos.lims.dryRun({
intent: testIntent,
lims: ['rate-limiter', 'threshold-gate']
});
console.log(result.evaluations);
// [
// { lim: 'rate-limiter', judgment: 'allow', reason: 'Within limits' },
// { lim: 'threshold-gate', judgment: 'block', reason: 'Exceeds threshold' }
// ]
Explain
Get detailed explanation of a LIM evaluation:
const explanation = await deltaos.lims.explain(
'threshold-gate',
intent
);
console.log(explanation);
// {
// appliesTo: true,
// evidenceUsed: ['agent.dailySpend', 'limits.maxDaily'],
// decisionPath: [
// 'Check daily spend: $45,000',
// 'Compare to max: $50,000',
// 'Result: Within limit → Allow'
// ]
// }
See Also
- Intent — The input to LIMs
- Judgments — The output of LIMs
- Evidence — Context for LIM evaluation
- Custom LIM Development — Build your own LIMs