# `Jido.Agent.Directive.StartSensor`
[🔗](https://github.com/agentjido/jido/blob/v2.3.0/lib/jido/agent/directive.ex#L483)

Start or replace a tagged sensor runtime owned by the current agent runtime.

Sensors are tracked separately from child agents under `{:sensor, tag}` and
do not participate in child-agent hierarchy signals.

By default sensors are unlinked but owner-monitored: a sensor crash emits
`jido.agent.sensor.exit` to the owning agent, and the sensor stops itself if
the owner exits. Use `link?: true` only for fail-fast input paths where a
sensor crash should also crash the owning agent runtime.

## Fields

- `tag` - Agent-local tag for the sensor runtime
- `sensor` - Sensor module to run under `Jido.Sensor.Runtime`
- `config` - Sensor configuration map (default: `%{}`)
- `meta` - Metadata stored on the tracked sensor child info (default: `%{}`)
- `replace?` - Stop and replace an existing sensor with this tag (default: `true`)
- `link?` - Link the sensor to the owning AgentServer so abnormal sensor
  exits can take the owner down (default: `false`)

## Examples

    %StartSensor{tag: :market_data, sensor: MyApp.MarketDataSensor}
    %StartSensor{
      tag: {:poller, "AAPL"},
      sensor: MyApp.MarketDataSensor,
      config: %{symbol: "AAPL", interval: 1000}
    }

# `t`

```elixir
@type t() :: %Jido.Agent.Directive.StartSensor{
  config: map(),
  link?: boolean(),
  meta: map(),
  replace?: boolean(),
  sensor: atom(),
  tag: any()
}
```

# `schema`

```elixir
@spec schema() :: Zoi.schema()
```

Returns the Zoi schema for StartSensor.
