ARCHITECTURE

    The 9-phase evaluation pipeline that powers xBPP decisions.

    EVALUATION PIPELINE

    When an agent requests a transaction, xBPP evaluates it through a 9-phase pipeline. Each phase can produce reason codes that contribute to the final verdict. Phases are evaluated in order - if any phase produces a BLOCK, the pipeline short-circuits.

    1

    Validation

    Schema validation - is the action well-formed? Are required fields present and correctly typed?

    2

    Emergency

    Kill switch check - is a global, principal, or agent-level emergency stop active?

    3

    Input Validation

    Value sanity - is the amount negative, zero, or exceeding precision limits?

    4

    Core Limits

    Spending bounds - does the transaction exceed single, daily, weekly, or monthly limits?

    5

    Duplicate Detection

    Action hash check - has this exact transaction been seen within the duplicate window?

    6

    Verification

    Counterparty verification - is the target known, trusted, and not revoked or blocklisted?

    7

    Profile Rules

    Chain rules, rate limits, gas rules, confidence thresholds - domain-specific checks.

    8

    Escalation

    Human review triggers - does the value, context, or risk level require human approval?

    9

    Final Decision

    Aggregate all check results into a single Verdict with reason codes and metadata.

    DATA FLOW

    // Inputs
    Action → { type, value, currency, target, metadata }
    Policy → { posture, limits, rules, verification }
    State → { daily_spent, weekly_spent, history }

    // Evaluation
    evaluate(action, policy, state) → Verdict

    // Output
    Verdict → { decision, reasons[], confidence, metadata }

    POSTURE SYSTEM

    The posture controls how the evaluator handles ambiguous situations - cases where the spec says "varies" rather than a fixed decision.

    SituationAggressiveBalancedCautious
    New counterpartyAllowEscalateBlock
    Verification unavailableAllowEscalateBlock
    Near daily limit (>80%)AllowWarnEscalate
    Unknown chainEscalateBlockBlock
    Low confidenceWarnEscalateBlock

    SDK VS SPEC

    Note: The reference SDK (@vanar/xbpp v0.1.0-beta.1) implements a simplified 12-check flat evaluation model covering core policy checks. The full 9-phase pipeline described above is the protocol specification - the SDK will expand to cover it in future releases.

    The interactive Playground simulates the full 9-phase model as a spec visualization tool. For production use, refer to the SDK documentation for what's currently implemented.