Skip to main content

Profile

Enum Profile 

Source
#[non_exhaustive]
pub enum Profile { Auditable(Arc<AuditLog>), Production, MultiTenant, LocalDevelopment, DurableProduction, RegulatedData, }
Expand description

A deployment profile, applied with RequestHandlerBuilder::with_profile.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Auditable(Arc<AuditLog>)

Available on crate feature audit only.

For a deployment whose records must stand up to an audit — the EU AI Act’s logging duties for a high-risk system (Articles 12, 19, 26(6)), or a customer’s.

Applies:

  • the audit trail, with this log (with_audit);
  • an ApprovalGate with its defaults, unless one is already set, so no unchecked approval reaches an executor.

And makes build() refuse, naming what is missing, unless:

  • the log is required (AuditLog::require_record): a call it cannot record is refused rather than served unrecorded;
  • the log signs checkpoints (AuditLog::with_signer): without them the end of a chain can be cut off without trace;
  • an interceptor that authenticates is installed: records otherwise name no caller;
  • the builder says how callers relate to each other’s tasks. The gate’s default approver is someone other than the requester, who cannot reach the requester’s task when tasks are isolated by caller, which is the default with an authenticating interceptor. Call share_tasks_across_callers, give the approvers a narrow grant, or set a gate that allows self-approval.

Retention is not configured here — purging is a job the deployment schedules (AuditLog::purge), with a floor it chooses.

§

Production

For a deployment other agents delegate to, at scale (ADR 0025).

Applies nothing: which stores to use is the deployment’s choice. It makes build() refuse, naming what is missing, unless:

  • an interceptor that authenticates is installed: otherwise any caller reaches every method, and tasks are not isolated by caller;
  • a halt store is set (with_halt_store): otherwise a halt reaches only the process it was given to, and a restart forgets it (ADR 0019);
  • a lease store is set (with_lease_store): otherwise a task delegated here runs on after the agent that delegated it has stopped (ADR 0020);
  • a content signer is set (with_content_signer, feature signing): otherwise nothing the agent sends says it made it, and an intermediary can alter it unseen (ADR 0027). Without the feature the profile cannot be met, and build() says to enable it.

Over a task store several processes share (one that hands out turn claims, as the SQL stores do), build() also refuses a halt, lease, push-config (when the card declares push notifications) or audit store that keeps its state in this process, naming the store to use: a halt given to one replica would not reach the tasks another runs. allow_process_local_stores accepts them for a deployment that routes every request for a task to one replica (ADR 0025, amended 2026-11-01).

The listener has its own half, ServeConfig::production, which refuses plaintext beyond loopback and a binding the agent card does not declare. A handler built without this profile keeps the defaults it always had.

§

MultiTenant

For a deployment that serves several tenants and must not let one reach another’s work, or take its capacity (adversarial review, 2026-11-12).

Applies:

And makes build() refuse, naming what is missing, unless:

  • an interceptor that authenticates is installed;
  • the tenant resolver was given through with_authorized_tenant_resolver, which asserts it names a tenant only from what the server verified or a gateway sets, never from what the client chose;
  • the task and push-config stores partition by tenant, and accept_unisolated_tenants was not called;
  • sharing across callers, if chosen, comes with a tenant-aware task store you supply (the default for a sharing handler is one set of records for every tenant);
  • every tenant has a concurrency limit (with_tenant_config, TenantLimits::with_max_concurrent_tasks), the default and each override: a tenant without one can take every executor slot a replica has.

What it cannot see, and leaves to you: that the resolver really is authorized (you asserted it); the limits are per replica, not for the fleet (see TenantLimits); a tool-using agent’s own strictness (ToolLoop::strict, ArgumentCheck, AuditedPolicy); and retention and erasure of what the stores hold.

§

LocalDevelopment

For a developer’s machine, a test or a demonstration: says that keeping everything in this process, and losing it at exit, is intended (adversarial review of 2026-11-13).

Applies nothing and requires nothing. What it changes is what the handler says of itself: RequestHandler::profile_report lists it as giving up durability and sharing between processes, so a configuration that keeps its tasks in memory says so instead of being read as a production one. build() refuses it together with Production or DurableProduction, which claim the opposite.

§

DurableProduction

For a single service whose tasks, webhooks, halts, leases and audit records must survive a restart (adversarial review of 2026-11-13: “a footgun when silently combined with a durable-production claim”).

Applies nothing. Makes build() refuse, naming what is missing, unless:

  • an interceptor that authenticates is installed;
  • a task store is set (with_task_store) and it does not keep its tasks in this process alone (TaskStore::is_process_local);
  • when the agent card declares push notifications, a push-config store and a push outbox are set and neither is process-local: otherwise a webhook registered, or a delivery owed, is lost with the process;
  • a halt, lease or audit store, when one is set, is not process-local.

The bundled in-memory stores, and the SQLite stores over sqlite::memory:, are process-local; the SQLite stores over a file and the PostgreSQL stores are not. A store of your own is taken to be durable unless it says otherwise.

For several replicas, combine it with Production, which also refuses a store only one replica can see, and with MultiTenant when tenants must be kept apart.

What it cannot see, and lists in RequestHandler::profile_report: backups and their restore, the database’s own availability, a tool loop’s step journal (the executor’s, not the handler’s), where keys are kept, and whether retention jobs are scheduled.

§

RegulatedData

For a deployment that holds personal or otherwise regulated data, and must show how it is protected (adversarial review of 2026-11-13: audit privacy, URL and egress policy, proxy trust, key management and retention).

Applies nothing. Makes build() refuse, naming what is missing, unless:

It does not require durable stores: combine it with DurableProduction for that, and with the Auditable profile (feature audit) for signed audit checkpoints and an approval gate. build() refuses it beside LocalDevelopment. What it cannot see: that a declaration is true, what an executor or a tool sends out (a tool’s own egress is the tool’s), and lawful basis, purpose or any other legal duty.

Trait Implementations§

Source§

impl Debug for Profile

Source§

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

Formats the value using the given formatter. Read more

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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more