Configuration
Complete reference for SentinelConfig and all nested configuration types
4 min read
Configuration
SentinelConfig is the top-level configuration object passed to Sentinel.create(). All fields use readonly for immutability. Once created, the config is deep-frozen.
SentinelConfig
typescript
interface SentinelConfig {
mode?: SentinelMode // default: 'full'
promptGuard?: PromptGuardConfig
executionSandbox?: ExecutionSandboxConfig
debug?: boolean
}
| Field | Type | Default | Description |
|---|---|---|---|
mode | SentinelMode | 'full' | Pipeline mode |
promptGuard | PromptGuardConfig? | — | Guard config; omit to disable |
executionSandbox | ExecutionSandboxConfig? | — | Sandbox config; omit to disable |
debug | boolean? | false | Enable verbose logging |
SentinelMode
typescript
type SentinelMode = 'full' | 'guard-only' | 'sandbox-only'
PromptGuardConfig
typescript
interface PromptGuardConfig {
mode: ScanMode
llm?: LLMJudgeConfig
rules?: RuleEngineConfig
enabled?: boolean
}
| Field | Type | Default | Description |
|---|---|---|---|
mode | ScanMode | required | 'rules', 'llm', or 'both' |
llm | LLMJudgeConfig? | — | Required when mode is 'llm' or 'both' |
rules | RuleEngineConfig? | — | Optional rule engine config |
enabled | boolean? | true | Set to false to disable at runtime |
LLMJudgeConfig
typescript
interface LLMJudgeConfig {
provider: LLMProvider
model?: string
apiKey?: string
apiKeyEnvVar?: string
baseUrl?: string
timeoutMs?: number
customPrompt?: string
}
| Field | Type | Default | Description |
|---|---|---|---|
provider | LLMProvider | required | 'anthropic', 'openai', or 'custom' |
model | string? | 'claude-haiku-4-5' | Model ID override |
apiKey | string? | — | Inline API key (prefer apiKeyEnvVar) |
apiKeyEnvVar | string? | — | Name of the env var containing the API key |
baseUrl | string? | — | Custom base URL (for 'custom' provider) |
timeoutMs | number? | 5000 | LLM call timeout in milliseconds |
customPrompt | string? | — | Replace the built-in security prompt |
RuleEngineConfig
typescript
interface RuleEngineConfig {
rulePacks?: string[]
customRulesPath?: string
}
| Field | Type | Description |
|---|---|---|
rulePacks | string[]? | Built-in pack names (e.g., ['default']) |
customRulesPath | string? | Path to a custom YAML rules file |
ExecutionSandboxConfig
typescript
interface ExecutionSandboxConfig {
rpcEndpoint: string
policy: PolicyConfig
enabled?: boolean
}
| Field | Type | Default | Description |
|---|---|---|---|
rpcEndpoint | string | required | Solana RPC URL |
policy | PolicyConfig | required | Transaction policy |
enabled | boolean? | true | Set to false to disable at runtime |
PolicyConfig
typescript
interface PolicyConfig {
spendingLimits: SpendingLimits
programAllowlist?: string[]
recipientBlocklist?: string[]
timeBounds?: TimeBoundConfig
cooldown?: CooldownConfig
rateLimit?: { maxTxPerHour: number }
riskThreshold?: number
}
| Field | Type | Default | Description |
|---|---|---|---|
spendingLimits | SpendingLimits | required | Per-tx, daily, and weekly SOL limits |
programAllowlist | string[]? | — | If set, only these program IDs are allowed |
recipientBlocklist | string[]? | — | Block transfers to these addresses |
timeBounds | TimeBoundConfig? | — | Restrict to certain hours/days |
cooldown | CooldownConfig? | — | Minimum ms between transactions |
rateLimit | object? | — | Max transactions per hour |
riskThreshold | number? | 70 | Block if risk score exceeds this value (0–100) |
SpendingLimits
typescript
interface SpendingLimits {
maxPerTx: number
maxDaily: number
maxWeekly: number
}
All values are in SOL.
TimeBoundConfig
typescript
interface TimeBoundConfig {
activeHours?: { start: string; end: string } // 'HH:MM' format
activeDays?: number[] // 0=Sunday, 6=Saturday
timezone?: string // IANA timezone
}
CooldownConfig
typescript
interface CooldownConfig {
minMs: number
}
Complete Example
typescript
const sentinel = await Sentinel.create({
mode: 'full',
debug: false,
promptGuard: {
mode: 'both',
rules: {
rulePacks: ['default'],
customRulesPath: './rules/custom.yaml',
},
llm: {
provider: 'anthropic',
apiKeyEnvVar: 'ANTHROPIC_API_KEY',
model: 'claude-haiku-4-5',
timeoutMs: 4000,
},
},
executionSandbox: {
rpcEndpoint: process.env.SOLANA_RPC_URL!,
policy: {
spendingLimits: {
maxPerTx: 5,
maxDaily: 50,
maxWeekly: 200,
},
programAllowlist: [
'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJe1bAe',
],
timeBounds: {
activeHours: { start: '08:00', end: '20:00' },
activeDays: [1, 2, 3, 4, 5],
timezone: 'America/New_York',
},
cooldown: { minMs: 2000 },
rateLimit: { maxTxPerHour: 30 },
riskThreshold: 65,
},
},
});