KYE Scenario Testing™ · 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.

1 · What it is

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[].

4Risk levels (low / medium / high / critical)
4Recommended decisions (allow → deny)
12+Stressor kinds in the V1 lookup
same input → same outputDeterministic, replay-CI gated
  • 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_ms on every result, no Math.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_id so the approver sees the simulation evidence inline.
2 · The flow

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.

3 · Stressor kinds (V1)

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 kindBumpImplied control(s)
amount_above_threshold2dual_control:second_approver_required
novel_counterparty2enhanced_due_diligence
authority_chain_long1chain_replay
cross_border_transfer2sanctions_screening
outside_business_hours1business_hours_alert
sub_processor_first_use2sub_processor_review
scope_widening3scope_freeze, human_review
off_policy_action3policy_owner_review
recently_revoked_grant3block_until_reissue
bulk_action1batch_size_cap
velocity_spike2rate_cap
privacy_high_class_data2dp_review
Aggregation. Per-stressor bumps are summed (multiplied by intensity: low=1, medium=2, high=3). A score of 0–2 maps to 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.
4 · Use it

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
5 · Next

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.