kye.scenario_run.v1
Future-state testing for delegated AI actions.
Before an AI agent acts, KYE Scenario Testing™ runs the proposed action through a deterministic stress evaluator. The output: a signed kye.scenario_run.v1 with a risk level, a recommended decision, and a list of recommended controls — emitted to the PEP, the approval pipeline, and the Evidence Pack™. No surprises at execution time.
Pre-execution simulation, deterministic, replay-safe.
A scenario is a target object (an agent action, a delegation, a policy change) plus a list of stressors — perturbations that ask "what if this dimension moves?" The scenario engine evaluates each stressor against a small lookup table, aggregates the bumps, and emits a single deterministic outcome: risk_level · recommended_decision · recommended_controls[].
- Schema-conformant. Every run validates against
kye.scenario_run.v1— same artefact whether emitted by the V1 heuristic engine or the V1.1 rich engine. - Banking-grade hardening. Injectable structured logger,
latency_mson every result, noMath.random, no internal-error message leak. - Composable. The output feeds the Approval Brief™ composer and the Consequence Mapping™ engine without translation — the brief carries the
scenario_run_idso the approver sees the simulation evidence inline.
From action request to recommended decision.
arrow_forward 1. Action request
Agent or PEP describes the target object — id + object_type + summary.
tune 2. Stressor list
Caller (or Stress Test™ profile) supplies the list of perturbations to evaluate.
science 3. Engine evaluation
runScenario() aggregates per-stressor bumps from the V1 heuristic table; intensity multipliers apply.
verified 4. Scenario run emitted
kye.scenario_run.v1 with a deterministic scenario_run_id, risk_level, recommended_decision, recommended_controls, latency_ms.
forum 5. Hand-off
Run is referenced by the Approval Brief™ and sealed into the Approval Evidence Pack™ — auditable end-to-end.
A small lookup, auditable end-to-end.
V1 ships an intentionally small set of stressor kinds — enough to cover the highest-blast-radius shapes a banking-grade tenant sees. Each entry maps to a numeric risk-bump and a list of controls the bump implies. Unknown stressor kinds contribute zero risk by safe default; the rich engine (V1.1) replaces this with a learned + counterfactual evaluator.
| Stressor kind | Bump | Implied control(s) |
|---|---|---|
amount_above_threshold | 2 | dual_control:second_approver_required |
novel_counterparty | 2 | enhanced_due_diligence |
authority_chain_long | 1 | chain_replay |
cross_border_transfer | 2 | sanctions_screening |
outside_business_hours | 1 | business_hours_alert |
sub_processor_first_use | 2 | sub_processor_review |
scope_widening | 3 | scope_freeze, human_review |
off_policy_action | 3 | policy_owner_review |
recently_revoked_grant | 3 | block_until_reissue |
bulk_action | 1 | batch_size_cap |
velocity_spike | 2 | rate_cap |
privacy_high_class_data | 2 | dp_review |
low/allow; 3–5 to medium/allow_with_constraints; 6–8 to high/require_approval; 9+ to critical/deny. Same input → same output, every time.
One call from your PEP-Express or gateway.
The engine is a TypeScript edge worker library — mounted directly by PEP-Express and the runtime gateway in front of high-blast-radius agent actions. Library, not a deployed worker.
import { runScenario } from "@kye/scenario-engine";
const result = await runScenario({
scenario_id: "kye:scenario:payment-agent-scope-expansion",
tenant_id: "kye:tenant:acme-bank",
target_object: {
id: "kye:agent-action:expand-payment-limit-50k",
object_type: "agent_action",
summary: "Expand per-transaction limit from $10k to $50k on FedNow."
},
stressors: [
{ id: "s1", kind: "scope_widening", intensity: "high" },
{ id: "s2", kind: "amount_above_threshold", intensity: "high" },
{ id: "s3", kind: "novel_counterparty", intensity: "medium" }
],
evaluated_at: "2026-05-14T09:30:00.000Z"
}, { logger });
// result.risk_level === "critical"
// result.recommended_decision === "deny"
// result.recommended_controls === ["dual_control:second_approver_required",
// "enhanced_due_diligence",
// "human_review",
// "scope_freeze"]
// result.scenario_run_id === "kye:scenario-run:..." (deterministic)
// result.latency_ms === 0.42
Pair with Informed Approval for human sign-off.
A scenario run is the input to the Approval Brief™ — the structured, signed pack a human approver sees at decision time. No blind approvals.