Skip to content

Rulvar API reference


Rulvar API reference / @rulvar/core / AgentProfile

Interface: AgentProfile

Defined in: packages/core/src/engine/ctx.ts:165

The canonical, complete AgentProfile shape; M1 honors description, model, routing, effort, limits, and estCost. A profile never carries a prompt or a schema.

Properties

PropertyTypeDescriptionDefined in
cache?CachePolicyThe prompt-cache policy layer (RV2006): call opts over this profile over the engine default; absent everywhere means 'auto' (hints on explicit-caching adapters, nothing anywhere else).packages/core/src/engine/ctx.ts:194
compaction?{ threshold?: number; }Per-profile compaction threshold; default 0.8 of the loop model's contextWindow (M4-T03). Compaction is ON by default; history-processor plumbing stays engine-internal. The threshold is a fraction in (0, 1], validated at createEngine.packages/core/src/engine/ctx.ts:205
compaction.threshold?number-packages/core/src/engine/ctx.ts:205
countTokens?"allow" | "deny"The admission countTokens policy for this profile (RV1804): the pre-admission count probe is full-prompt provider egress billed to no invoice row. 'deny' forbids it for spawns of this profile (the flat reserve admits instead); wins over the engine-wide defaults.countTokens. Default: the engine default, else 'allow'.packages/core/src/engine/ctx.ts:215
description?string-packages/core/src/engine/ctx.ts:166
effort?Effort-packages/core/src/engine/ctx.ts:169
escalation?EscalationOptionsFlavor B opt-in lives here or on the call.packages/core/src/engine/ctx.ts:187
estCost?numberAdmission reserve hint in USD (budget layer 1).packages/core/src/engine/ctx.ts:207
evidenceContract?EvidenceContractThe declared evidence contract of the profile's task (RV303, the seventh comparison experiment; runtime enforcement RV507): how many evidence entries the spawned agent MUST record, and the declared call estimates behind them. Under the default enforce: 'warn' it is purely declarative, like estCost: preflightEstimate compares the resulting call floor (minEntries * estCallsPerEntry + overheadCalls, defaults 3 and 8) against the spawn's effective executed-call ceiling and warns tool-cap-below-evidence-floor when the cap cannot fit the contract. Under enforce: 'refuse' the floor additionally binds at the terminal: an ok settle with fewer successful record_evidence executions than minEntries becomes a typed error terminal. The experiment shape: 14 mandatory entries against an 84-call cap that two workers exhausted at 10 recorded entries.packages/core/src/engine/ctx.ts:232
isolation?IsolationSpecIsolation default; the RESOLVED value enters identity.packages/core/src/engine/ctx.ts:185
limits?UsageLimits-packages/core/src/engine/ctx.ts:188
model?ModelSpec-packages/core/src/engine/ctx.ts:167
permissions?AgentProfilePermissionsChain layers merged over engine defaults.packages/core/src/engine/ctx.ts:183
retry?RetryPolicyTransport RetryPolicy layer: call over profile over engine (M4-T05).packages/core/src/engine/ctx.ts:196
routing?Partial<Record<InvocationRole, ModelSpec>>-packages/core/src/engine/ctx.ts:168
taskClass?stringDeclared task class bridging ModelKnowledge; default unclassified (M4-T09).packages/core/src/engine/ctx.ts:198
tools?ToolsOptionToolset default; the resolved snapshot enters identity via toolsetHash.packages/core/src/engine/ctx.ts:171
toolsetAttestation?ToolsetAttestationThe attested toolset pin (RV1514): when present, every spawn of this profile must resolve its toolset to EXACTLY this hash, or the spawn refuses typed before any provider call. Record the pin with attestToolset(); the per-tool hashes it records turn the refusal into a named diff. The pin binds the spawn's RESOLVED toolset, so call-level tool overrides and the opt-in escalate tool drift it by design.packages/core/src/engine/ctx.ts:181