Skip to main content

Module extensions

Module extensions 

Source
Expand description

Extension protocol, policy, and runtime scaffolding.

This module defines the versioned extension protocol and provides validation utilities plus a minimal WASM host scaffold.

Structs§

BaselineCapabilityProfile
Per-capability robust statistics from approved traces.
BaselineDriftAnomaly
Single drift anomaly detected when comparing live features to baseline.
BaselineDriftReport
Result of comparing live features against a baseline model.
BaselineMarkovTransitionMatrix
Markov transition matrix over risk state labels.
CapabilityExplanation
Structured explanation of a single capability decision within a policy.
CapabilityIntegrityAttestation
CapabilityManifest
CapabilityProvenance
CapabilityPublisherAttestation
CapabilityRequirement
CapabilityScope
CompatCapabilityEvidence
CompatEvidence
CompatIssueEvidence
CompatLedger
CompatRewriteEvidence
CompatibilityScanner
DangerousOptInAuditEntry
Audit trail entry for dangerous-capability opt-in via allow_dangerous.
EnforcementHysteresis
Hysteresis configuration to prevent rapid oscillation (flapping) between enforcement states.
EnforcementScoreBands
Score band thresholds for each enforcement state. A score at or above the threshold triggers that state. Thresholds must satisfy allow < harden < prompt < deny < terminate.
EnforcementStateMachine
Per-extension enforcement state machine with hysteresis tracking.
EnforcementTransition
Result of an enforcement state machine evaluation.
ErrorPayload
EventCoalescer
EventHookPayload
ExecMediationArtifact
Structured artifact for exec mediation decision history (SEC-4.3).
ExecMediationLedgerEntry
Telemetry entry for exec mediation decisions.
ExecMediationPolicy
Policy configuration for exec mediation (SEC-4.3).
ExtensionBudgetControllerConfig
Budget controller settings for expected-loss fallback routing.
ExtensionManager
Extension manager for handling loaded extensions.
ExtensionManifest
ExtensionManifestSource
ExtensionMessage
ExtensionOverride
Per-extension policy override.
ExtensionPolicy
ExtensionQuotaConfig
Configurable per-extension resource quotas. When a quota is None, the corresponding limit is not enforced. All values are per-extension.
ExtensionRegion
RAII guard for extension lifecycle with structured concurrency guarantees.
ExtensionSendMessage
ExtensionSendUserMessage
ExtensionUiRequest
Extension UI request payload (host -> UI surface).
ExtensionUiResponse
Extension UI response payload (UI surface -> host).
FsConnector
FsScopes
HostCallContext
Context for the shared hostcall dispatcher.
HostCallError
HostCallPayload
HostResultPayload
HostStreamBackpressure
HostStreamChunk
HostcallReactorBackpressure
Backpressure signal when a reactor shard lane is full.
HostcallReactorCompletion
Completion of a reactor-dispatched hostcall.
HostcallReactorConfig
Configuration for the core-pinned hostcall reactor mesh.
HostcallReactorMesh
Deterministic SPSC reactor mesh for hostcall traffic.
HostcallReactorRequest
A hostcall request enqueued into the reactor mesh for shard-local dispatch.
HostcallReactorTelemetry
Lightweight queueing telemetry for the reactor mesh.
IncidentBundleFilter
Filter criteria for scoping an incident evidence bundle.
IncidentBundleRedactionPolicy
Redaction policy applied when exporting a bundle.
IncidentBundleSummary
High-level summary statistics for an incident evidence bundle.
IncidentBundleVerificationReport
Verification report for an incident evidence bundle.
IncidentEvidenceBundle
A self-contained incident evidence bundle containing all security artifacts for a filtered scope. Deterministic for the same scope and data.
JsExtensionLoadSpec
JsExtensionRuntimeHandle
Handle to the JS extension runtime thread.
KillSwitchAuditEntry
Audit entry for a kill-switch activation or deactivation.
KillSwitchResult
Result of a kill-switch operation.
LogCorrelation
LogPayload
LogSource
NativeRustExtensionLoadSpec
OcoTunerConfig
OCO controller configuration for queue, batch, and time-slice budgets.
OcoTunerSnapshot
Snapshot of OCO-tuned budgets for one extension.
PolicyCheck
PolicyExplanation
Full structured explanation of an effective policy, suitable for runtime diagnostics and audit logging.
PolicySnapshot
Precomputed per-extension capability decision table for O(1) hostcall authorization.
ProfileTransitionCheck
Result of checking whether a profile transition constitutes a valid downgrade (tightening of security posture).
QuotaBreachEvent
Telemetry event emitted when a quota limit is breached.
RegimeShiftConfig
Configuration for CUSUM/BOCPD regime-shift detection that augments the simple sliding-window counting in the budget controller.
RegimeShiftSnapshot
Telemetry snapshot of the regime-shift detector for one extension.
RegisterPayload
RollbackTrigger
Automatic rollback trigger conditions. When any condition is met, the rollout automatically reverts to Shadow phase.
RollbackWindowStats
Rolling statistics over the rollback evaluation window.
RolloutDecisionSample
A single decision sample in the rollback evaluation window.
RolloutState
Snapshot of graduated rollout state for operator inspection (SEC-7.2).
RolloutTracker
Mutable rollout tracking state stored inside ExtensionManagerInner.
RuntimeHostcallFeatureVector
RuntimeHostcallSequenceContext
RuntimeHostcallTelemetryArtifact
RuntimeHostcallTelemetryEvent
RuntimeRiskBaselineModel
Complete baseline model for an extension, built from approved traces.
RuntimeRiskCalibrationConfig
RuntimeRiskCalibrationReport
RuntimeRiskConfig
Deterministic runtime risk-controller settings for extension hostcalls.
RuntimeRiskExpectedLossEvidence
RuntimeRiskExplanationBudgetState
RuntimeRiskExplanationContributor
RuntimeRiskLedgerArtifact
RuntimeRiskLedgerArtifactEntry
RuntimeRiskLedgerIntegrityError
RuntimeRiskLedgerVerificationReport
RuntimeRiskPosteriorEvidence
RuntimeRiskReplayArtifact
RuntimeRiskReplayStep
RuntimeRiskThresholdCalibration
SafetyEnvelopeConfig
Configuration for conformal + PAC-Bayes safety envelopes that wrap adaptive optimization decisions.
SafetyEnvelopeSnapshot
Telemetry snapshot of the safety envelope for one extension.
SecretBrokerArtifact
Structured artifact for secret broker decision history (SEC-4.3).
SecretBrokerLedgerEntry
Telemetry entry for secret broker decisions.
SecretBrokerPolicy
Patterns used to identify environment variables likely to contain secrets.
SecurityAlert
A structured security alert with who/what/why/action fields.
SecurityAlertArtifact
Container artifact for a stream of security alerts, suitable for export and downstream integration.
SecurityAlertCategoryCounts
Per-category alert counts for quick triage.
SecurityAlertFilter
Filter criteria for querying security alerts.
SecurityAlertSeverityCounts
Per-severity alert counts.
SlashCommandPayload
SlashResultPayload
ToolCallPayload
ToolResultPayload
TrustOnboardingDecision
Audit entry for a trust onboarding decision.
WasmExtension
WasmExtensionHandle
WasmExtensionHost
WasmExtensionLoadSpec

Enums§

Capability
Enumeration of all recognised extension capabilities.
CommonHostcallOpcode
DangerousCommandClass
Classification of dangerous command patterns for exec mediation.
EnforcementState
Enforcement states ordered by severity.
ExecMediationResult
Result of exec mediation evaluation.
ExecRiskTier
Risk tier for exec command classification.
ExtensionBody
ExtensionBudgetTier
Workload tier presets for the hostcall budget controller.
ExtensionDeliverAs
ExtensionEventName
Event names for the extension lifecycle.
ExtensionLoadSpec
ExtensionPolicyMode
ExtensionRuntime
ExtensionTrustState
Trust state for an extension.
FsOp
HostCallErrorCode
LogComponent
LogLevel
PolicyDecision
PolicyProfile
Named policy profiles providing curated defaults.
QuotaCheckResult
Result of a quota check before dispatching a hostcall.
RepairPolicyMode
RolloutPhase
Rollout phases for graduated enforcement. Operators progress through phases to build confidence before full enforcement.
RuntimeRiskActionValue
RuntimeRiskCalibrationObjective
RuntimeRiskExplanationLevelValue
RuntimeRiskStateLabelValue
SecurityAlertAction
Action taken in response to a security event.
SecurityAlertCategory
Category of a security alert, enabling consumers to distinguish policy denials from anomaly-based denials at a glance.
SecurityAlertSeverity
Severity level for security alerts, ordered from lowest to highest.

Constants§

ALL_CAPABILITIES
All known capabilities in definition order.
COMPAT_LEDGER_SCHEMA_VERSION
EXTENSION_COMMAND_BUDGET_MS
Default cancellation budget for extension command execution (ms).
EXTENSION_EVENT_TIMEOUT_MS
Default cancellation budget for extension event handlers (ms).
EXTENSION_LOAD_BUDGET_MS
Default cancellation budget for extension loading (ms).
EXTENSION_PROVIDER_BUDGET_MS
Default cancellation budget for provider stream operations (ms).
EXTENSION_QUERY_BUDGET_MS
Default cancellation budget for extension queries (get tools, pump, flags) (ms).
EXTENSION_SHORTCUT_BUDGET_MS
Default cancellation budget for extension shortcut execution (ms).
EXTENSION_TOOL_BUDGET_MS
Default cancellation budget for extension tool execution (ms).
EXTENSION_UI_BUDGET_MS
Default cancellation budget for UI dialog operations (ms).
HOSTCALL_IO_URING_CONTEXT_SCHEMA_VERSION
HOSTCALL_OPCODE_SCHEMA_VERSION
HOSTCALL_OPCODE_VERSION
INCIDENT_EVIDENCE_BUNDLE_SCHEMA_VERSION
LOG_SCHEMA_VERSION
NUM_CAPABILITIES
Number of known capabilities (must match ALL_CAPABILITIES length).
PROTOCOL_VERSION
RUNTIME_HOSTCALL_FEATURE_BUDGET_US
RUNTIME_HOSTCALL_FEATURE_SCHEMA_VERSION
RUNTIME_HOSTCALL_TELEMETRY_SCHEMA_VERSION
RUNTIME_RISK_BASELINE_SCHEMA_VERSION
RUNTIME_RISK_CALIBRATION_SCHEMA_VERSION
RUNTIME_RISK_EXPLANATION_SCHEMA_VERSION
RUNTIME_RISK_EXPLANATION_TERM_BUDGET
RUNTIME_RISK_EXPLANATION_TIME_BUDGET_MS
RUNTIME_RISK_LEDGER_SCHEMA_VERSION
RUNTIME_RISK_REPLAY_SCHEMA_VERSION
SECURITY_ALERT_SCHEMA_VERSION

Traits§

ExtensionHostActions
ExtensionSession
Minimal session access for extensions (hostcalls).
HostcallInterceptor
Trait allowing tests to intercept hostcalls before they reach real dispatch. Return Some(outcome) to short-circuit, or None to fall through to real dispatch.

Functions§

amac_telemetry_snapshot
Query the AMAC batch executor telemetry for the current thread.
build_baseline_from_ledger
Build a complete baseline model from a runtime risk ledger artifact.
build_baseline_from_ledger_with_options
Build a baseline model with customizable thresholds.
build_incident_evidence_bundle
Build an incident evidence bundle from raw artifacts with filtering and redaction applied. Deterministic: same inputs produce the same bundle.
calibrate_runtime_risk_from_ledger
classify_dangerous_command
Classify a command string into dangerous command classes.
compute_incident_bundle_hash
Compute the SHA-256 integrity hash of a bundle’s content and metadata.
detect_baseline_drift
Detect drift in live features compared to a baseline model.
dispatch_host_call_shared
Dispatch a hostcall through the unified ABI surface.
emit_security_alert
Record a security alert and emit a tracing event at the appropriate level.
evaluate_exec_mediation
Evaluate exec mediation policy for a command.
extension_event_from_agent
Extract extension event information from an agent event.
extension_event_name_from_agent
Cheap extraction of just the extension event name from an agent event, without serializing the payload. Use this to check has_hook_for() before paying the serde_json::to_value() cost.
handle_extension_message
Handle an incoming ExtensionMessage of type host_call by dispatching through the shared hostcall ABI and returning host_result messages.
host_result_to_outcome
Convert a HostResultPayload into the JS-facing HostcallOutcome.
hostcall_request_to_payload
Convert a HostcallRequest (JS-origin) into the canonical HostCallPayload.
is_coalescable_event
Returns true if the given event is fire-and-forget (response is discarded) and can be safely coalesced — i.e. only the most recent version matters.
is_lifecycle_event
Returns true for agent lifecycle events that are dispatched directly by the agent loop via [AgentSession::dispatch_extension_lifecycle_event].
load_extension_manifest
outcome_to_host_result
Convert a HostcallOutcome into a HostResultPayload.
query_security_alerts
Query the alert stream with optional filters.
redact_command_for_logging
Redact secrets in a command string for safe logging.
replay_runtime_risk_ledger_artifact
required_capability_for_host_call
resolve_extension_load_spec
runtime_risk_compute_ledger_hash_artifact
runtime_risk_ledger_data_hash
safe_canonicalize
Canonicalize a path, stripping the \\?\ verbatim prefix on Windows.
sha256_hex_standalone
Compute SHA-256 hex digest of a string.
strip_unc_prefix
Strip the \\?\ or //?/ verbatim prefix from a path on Windows. No-op on Unix.
trace_jit_telemetry_snapshot
Query the trace-JIT compiler telemetry for the current thread.
verify_incident_evidence_bundle
Verify the integrity of an incident evidence bundle.
verify_runtime_risk_ledger_artifact

Type Aliases§

ExtensionRuntimeEngineSelection
ExtensionRuntimeHandle
NativeRustExtensionRuntimeHandle