> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuro-tech.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Provisioning and decision support

> Turn owner consent into fail-closed device authorization rules

Provisioning has two sides:

* **Decision support for devices** answers whether an incoming friendship, sensor-read, or control request is allowed.
* **Provisioning for owners** lets owners answer new questions and manage the rules used for later decisions.

## Fail-closed flow

```mermaid theme={null}
sequenceDiagram
  participant R as Requester
  participant D as Device
  participant P as Provisioning server
  participant O as Owner
  R->>D: Sensor/control/friend request
  D->>P: May requester perform operation?
  alt Existing rule
    P-->>D: Allow or deny + constraints
  else Unknown situation
    P-->>D: Deny by default
    P->>O: Provisioning question
    O->>P: Create rule
    P->>D: Clear cached decision
  end
```

Devices cache decisions to avoid a network round trip for every operation. When an owner changes rules, the provisioning server instructs affected devices to clear cached answers.

## What a rule can constrain

* requester identity/domain;
* device, data source, node, and field;
* sensor field categories and time range;
* control parameter/action;
* service, device, or user token;
* time and contextual restrictions supported by the provider.

## Implementation rules

* Deny unknown situations by default.
* Cache the full constrained decision, not a broad boolean.
* Put an expiry on cached permissions where policy requires it.
* Authenticate provisioning messages and protect them end-to-end when sensitive.
* Make rule updates and cache clears idempotent.
* Keep an audit trail of owner decision, requester, resource, constraints, and outcome.
* Provide a safe offline policy for devices that cannot reach provisioning.

Smart contracts can automate provisioning when owner and service terms are already signed and machine readable.
