Skip to main content

ElicitStep

Struct ElicitStep 

Source
pub struct ElicitStep {
    pub kind: ElicitKind,
    pub plugin_name: String,
    pub channel: Option<String>,
    pub from: String,
    pub purpose: Option<String>,
    pub scope: Option<String>,
    pub timeout: Option<String>,
    pub config_override: Option<Value>,
    pub on_error: Option<String>,
    pub source: String,
}
Expand description

One elicitation invocation inside policy: or post_policy: — the runtime dispatches a question to a human (approval, confirmation, step-up, …) through a channel plugin, holds a pending state across the agent’s retries, validates the response, and resumes.

Structurally the elicitation analogue of DelegateStep: the DSL carries the verb; apl-cpex dispatches resolution to the named ElicitationHandler plugin (plugin_name, resolved exactly like delegate(...)). The key difference from delegation — which completes within one request — is that an elicitation spans the gap between dispatch (the first request that hits this step) and resolution (a later retry). That gap is owned by the channel (e.g. Keycloak CIBA), never by a plugin call: each of dispatch/check/validate is short and synchronous to the request it runs in. See docs/apl-manager-approval-ciba-design.md.

§First arrival vs. retry

On the first request that reaches this step, the runtime dispatches the elicitation and the phase yields a pending entry (the host emits JSON-RPC -32120). On a later retry carrying the elicitation id, the runtime checks status and, once resolved, validates the response against scope before the phase may proceed.

config_override is a free-form map for channel-specific params (e.g. CIBA details_link, Slack block-kit options); apl-core treats it as opaque and hands it to the plugin via the same per-call config-override pathway delegation uses.

Fields§

§kind: ElicitKind

Which elicitation contract applies (selects runtime validation).

§plugin_name: String

Name of the ElicitationHandler plugin to invoke — the routing key, resolved name → entry exactly like delegate(...) resolves its plugin. The first positional argument of the sugar verb (e.g. require_approval(manager-approver, ...)). Which backend it speaks (CIBA / Slack / in-band) is the plugin’s own opaque config, not something apl-core interprets.

§channel: Option<String>

Optional channel label for audit/observability only (e.g. "ciba", "slack"). NOT a routing key — the framework never dispatches on it. Surfaced into the bag as elicitation.channel so the audit record can show how the human was reached. None when the author doesn’t declare one (a Phase 2 plugin may report its own channel instead).

§from: String

Who is being asked — an attribute reference resolved against the policy bag at dispatch (e.g. "user.manager", "user.sub"). For CIBA this becomes login_hint; the resolved identity is cross-checked against the responder at validate().

§purpose: Option<String>

Canonical, human-readable description of what’s being asked, with request-arg substitution. Audited verbatim and shown to the responder (CIBA binding_message) — the source of truth for “what was approved,” never an LLM summary. None for kinds that carry their prompt elsewhere.

§scope: Option<String>

APL boolean expression the runtime evaluates against the actual request args at validate() to confirm the response covers what was requested (e.g. "args.amount <= 25000"). This is the args-binding layer — kept in APL because Keycloak does not support RFC 9396 RAR. None for kinds without arg binding (e.g. a bare confirm).

§timeout: Option<String>

How long the elicitation stays valid before expiring (e.g. "24h"). Surfaces as CIBA requested_expiry. None defers to the channel plugin’s configured default.

§config_override: Option<Value>

Per-call config overrides for channel-specific params, layered on the plugin’s default config. Opaque to apl-core.

§on_error: Option<String>

deny | continue — what to do when dispatch or validation fails (channel error, invalid response). None defaults to "deny" (fail-closed; matches delegation/PDP step semantics).

§source: String

Human-readable source path (e.g. "route.payroll_adjust.policy[0]") — used in audit and Decision::Deny.rule_source when the step denies.

Trait Implementations§

Source§

impl Clone for ElicitStep

Source§

fn clone(&self) -> ElicitStep

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ElicitStep

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ElicitStep

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ElicitStep

Source§

fn eq(&self, other: &ElicitStep) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ElicitStep

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ElicitStep

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.