Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
FREEDOM251

Freedom251 › Blog › actionable notifications

How to Add Approval and Safety Checks to AI-Controlled Home Assistant Automations

By Freedom251 Team · · 13 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Make the AI a proposer, not the authority. Let it identify an intent and suggest a narrowly defined operation, then have Home Assistant enforce deterministic conditions, request explicit human approval for high-impact actions, recheck those conditions, and call a fixed script. This design prevents a language model from issuing arbitrary service calls to a lock, garage door, alarm, or other safety-sensitive device.

The reliable sequence is: receive a request, normalize it against an allowlist, check presence and device state, send an Approve/Reject notification, validate the response and its expiry, execute one fixed script, and record the result. Home Assistant automations provide the trigger-condition-action flow, scripts provide a controlled execution boundary, actionable notifications return a button event, and traces show what actually happened.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What is the safest architecture for an AI-controlled Home Assistant action?

Use two separate planes: an AI proposal plane and a Home Assistant enforcement plane. The model may classify a sentence such as “unlock the front door when I arrive” into an intent, target, and proposed parameters. It must not decide whether the operation is permitted or emit an unrestricted Home Assistant service call.

Home Assistant should own every security decision. A local automation receives the proposal, maps it to an allowlisted script, applies policy conditions, and pauses for approval when the impact warrants it. The final device operation is a named script with fixed targets and bounded parameters. If any check fails, the device remains unchanged.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

The seven-stage control flow

  1. Receive: An Assist sentence, dashboard control, brokered request, webhook, or AI service creates a request record.
  2. Normalize: Convert the proposal into a known intent, approved target, and valid parameter set. Reject unknown entities, broad areas, missing values, or disallowed times.
  3. Pre-check: Evaluate presence, current device state, alarm state, occupancy, and whether another run is already handling the same request.
  4. Request approval: Send a notification that states the target, requested change, reason, and expiry, with explicit Approve and Reject choices.
  5. Validate: Accept only the expected event from the intended user or device within the validity window, then repeat the critical safety checks.
  6. Execute: Call one fixed script containing the exact service action and target.
  7. Record: Review the automation trace and send a completion or failure notification naming the actual result.

Separating proposal from execution limits the damage of a prompt injection, malformed model output, stale context, or compromised remote integration. A low-risk suggestion can still be automated, but the policy boundary remains deterministic.

How do Home Assistant triggers, conditions, actions, and scripts enforce safety?

A trigger starts an automation at a particular event or time. Conditions are gates: if one fails, the following actions do not run. Actions execute in order, and an action failure stops later actions unless the automation explicitly branches or continues. Each run can be inspected in a trace.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Component Safety role Typical use in an AI request
Trigger Starts a run when a proposal or approval event arrives Receive an ai_action_proposed event or mobile notification response
Condition Blocks every subsequent action when policy is false Require the resident to be home and the alarm disarmed
Action Performs a step in sequence Notify, wait, test the response, then call a script
Script Encapsulates a reusable, bounded operation Unlock one named front-door lock with no model-supplied service name
Trace and attributes Provide evidence of what ran and its current state Determine which trigger fired, which condition failed, and whether a run remains active

Scripts can be started from a dashboard, Assist, an automation, or another script. They are therefore a useful execution boundary: the approval branch selects one script, while the script itself contains the exact device call. Automation attributes expose information such as current runs, run mode, and last-triggered information, which helps detect overlapping or abandoned requests.

How should an AI proposal be normalized and allowlisted?

Define a small internal schema before any approval logic runs. A proposal should contain an intent, one target from an allowlist, only the parameters that intent requires, a request identifier, and an expiry. Treat every other field as untrusted text.

Allowlist intents and targets

  • Map unlock_front_door to script.unlock_front_door_fixed_target; never accept an arbitrary service name.
  • Map a target to a specific entity, not an area such as “all doors” or “downstairs.”
  • Reject entities that are unavailable, disabled, renamed unexpectedly, or outside the policy’s permitted domain.
  • Require parameters such as a duration or destination only when the mapped script defines a safe range.
  • Reject broad requests, missing values, unknown intents, and model output that contains templates or executable Home Assistant syntax.

Attach context to the request

Store the request identifier, proposer, target, proposed change, creation time, expiry time, and the policy version used for evaluation. Including this context in the notification makes the approval understandable and helps prevent one approval from being reused for another request.

Keep the AI’s output short and typed. A natural-language explanation can be displayed to the resident, but it should not be parsed as a service call. The automation should make the final decision from the normalized fields and current Home Assistant state.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I add an Approve/Reject notification before an unlock?

Use an actionable notification, wait for its event, reject timeouts, and recheck safety conditions immediately before the fixed script. The following is an illustrative design sketch; replace entity IDs, notification service names, event identifiers, and payload fields with the syntax for the integrations installed in your system.

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
alias: AI proposal - approval gate - unlock
triggers:
  - trigger: event
    event_type: ai_action_proposed
conditions:
  - condition: state
    entity_id: person.resident
    state: home
actions:
  - action: notify.mobile_app_phone
    data:
      title: "Approval required"
      message: "AI requests an unlock for the front door."
      data:
        actions:
          - action: APPROVE_UNLOCK
            title: "Approve"
          - action: REJECT_UNLOCK
            title: "Reject"
  - wait_for_trigger:
      - trigger: event
        event_type: mobile_app_notification_action
    timeout: "00:02:00"
    continue_on_timeout: false
  - condition: template
    value_template: "{{ wait.trigger.event.data.action == 'APPROVE_UNLOCK' }}"
  - condition: state
    entity_id: person.resident
    state: home
  - action: script.unlock_front_door_fixed_target

What each step protects

  1. The event trigger receives a proposal but does not unlock anything by itself.
  2. The initial presence condition stops obviously invalid requests before a notification is sent.
  3. The notification names the operation and offers two explicit choices rather than relying on a free-form reply.
  4. The wait has a two-minute validity window and does not continue when nobody responds.
  5. The template accepts only the expected approval action; rejection, a different action, malformed data, and timeout all stop the run.
  6. The second presence condition closes the stale-approval gap. Put equivalent checks for lock state, alarm state, occupancy, and any other critical policy immediately before the device action.
  7. The final action calls a fixed script instead of allowing the AI to provide a service, entity, or template.

Actionable notifications send a button event back to Home Assistant. The official examples include alarm activation and front-door lock or unlock controls, so the same pattern can be adapted to other high-impact devices.

Which safety conditions should be checked before and after approval?

Check the facts that can change while a person is deciding. A condition evaluated only before the notification can become false during the wait, leaving a stale approval able to trigger an unsafe operation.

Presence and identity

Require the intended resident to be home when that is part of the policy. Where the notification integration exposes a device or user identity, accept the response only from the expected person or device. Do not treat a response from an unknown phone as approval.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Device and alarm state

For a lock, verify that the door or lock is in the expected state and that no separate alarm or security rule has become active. For a garage door, check that the door is closed before opening and that the presence policy still permits the action. For an alarm, confirm the current armed mode and any entry-delay state.

Concurrency and occupancy

Check whether another automation is already operating the same device and whether occupancy or a conflicting scene has changed. A request that was safe when created may be unsafe after another run starts.

Approval validity

Use a short timeout appropriate to the action. Compare the response with the request identifier and expiry; never accept an approval event merely because its action label matches. Treat any missing, late, duplicated, or malformed response as rejection.

How can I prevent duplicate proposals and approval replay?

Give every proposal a unique request identifier and ensure that only one active run can consume it. Configure the automation’s run mode for the behavior you want, then make the approval event specific to that request.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Choose a run policy

Policy goal Suitable behavior Risk to consider
One request at a time Block or discard a new proposal while an approval is pending A legitimate second request may need to be retried
Queue requests Process proposals in order A queued unlock may become unsafe unless every item is rechecked when it reaches the front
Parallel handling Allow independent devices to proceed simultaneously Shared locks, alarms, or notifications can race unless targets are partitioned
Cancel and replace Cancel the old request when a newer proposal arrives The resident may approve a notification whose run has already been canceled

Whatever mode you select, include the request identifier in the notification and require the returned event to match it. Mark a request consumed after approval, rejection, timeout, or execution failure. This prevents a delayed notification event from being applied to a later run.

Are webhooks safe for remote AI requests?

An unauthenticated or guessable webhook is not an acceptable trigger for unlocking a lock, opening a garage door, activating an alarm, or performing another destructive or safety-sensitive operation. Home Assistant’s trigger guidance explicitly warns against using webhooks for those purposes, including unlocking a lock or opening a garage door.

If a webhook is unavoidable

  • Treat the webhook ID like a password and generate a unique, non-guessable value.
  • Keep the ID secret; do not put it in public prompts, client-side code, screenshots, or logs.
  • Leave local_only enabled when internet access is unnecessary.
  • Make the webhook create only a constrained proposal record. It must not call the device service directly.
  • Require the same local conditions and human approval used for an on-site request.

For an AI reachable from outside the home, prefer a brokered request that enters a constrained local automation. Remote reachability can deliver a proposal, but it must not remove the local approval event, final condition check, or fixed-script boundary.

What should the fixed execution script contain?

The script should be deliberately boring: a known service, a known entity, and only the parameters that have been validated. Keep policy decisions in the automation and device execution in the script so the boundary is easy to audit.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Good script properties

  • A descriptive name tied to one operation and target.
  • No model-provided service name, entity ID, area, or unrestricted template.
  • Optional device-state verification before the service call when the integration reports state reliably.
  • A clear success or failure path that allows the calling automation to notify the resident.
  • Idempotent behavior where possible, such as locking only when the lock is not already locked.

What not to put in the script

Do not accept a raw YAML fragment, a templated service call copied from model output, or an entity list assembled from untrusted text. Do not hide a broad “run anything” script behind an approval button; the human should be approving a specific, understandable operation.

How should failures, timeouts, and device errors behave?

Design failure behavior as deliberately as success behavior. A timeout means rejection and leaves the device unchanged. A failed condition stops later actions. A failed device action normally stops subsequent actions, so add an explicit failure notification or a continuation branch where that is safe.

Stale approval

Recheck presence, device state, alarm state, occupancy, request identifier, and run status after the response. If any value is no longer acceptable, notify that the approval expired or the situation changed.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Notification timeout

End the run without touching the device. Record the timeout so the resident can distinguish “no approval” from “device failure.” Avoid automatically retrying a high-impact request without a new approval.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Action failure

Send a failure notification that names the operation and, where the integration exposes it, the device’s reported state. Do not claim success merely because the script was called; success should reflect the actual device result.

Automation interruption

Use traces and run attributes to find whether the run stopped at the trigger, a condition, the wait, or the device action. If an integration becomes unavailable, require a fresh request and approval after it recovers rather than replaying an old event.

How do I make the approval flow observable and auditable?

Use the automation trace for each run. It shows which trigger fired, the order of actions, condition results, waits, and the point at which execution stopped. Automation attributes provide complementary information such as the configured run mode, current runs, and last-triggered information.

Record these fields

  • Request identifier and normalized intent.
  • Target script and target entity.
  • Proposal and approval timestamps.
  • Approving user or device, when available.
  • Condition results before and after the wait.
  • Script result, device-reported state, or error.
  • Whether the run ended by rejection, timeout, cancellation, or completion.

Keep notifications understandable to the person who must make the decision. “AI requests an unlock for the front door until 18:30; resident is home; expires in two minutes” is more useful than a model-generated paragraph with no target or deadline.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Which approval design should I choose?

The right design depends on impact, frequency, reachability, and how much ambiguity the target allows. Compare designs using the same criteria rather than treating every AI action as equally risky.

Design Approval behavior Allowlisting Best fit Main drawback
Always approve Every request pauses for an explicit response One fixed script per operation Locks, garage doors, alarms, and other high-impact actions Slower and inconvenient for frequent, low-risk requests
Exception approval Routine requests run automatically; unusual context requires approval Strict limits on time, presence, target, and parameter ranges Frequent actions with a well-defined safe baseline Policy mistakes can classify an unsafe request as routine
Local-only approval Approval is accepted from a local, trusted device Targets and scripts remain local and fixed Homes that do not need remote control Cannot approve while away
Remote approval through a broker Remote request enters the same local gate and requires approval Broker can submit proposals, never raw service calls Residents who need controlled access while away More identity, connectivity, and notification failure modes
Two-person approval Two independent approval events are required Separate identities and non-reusable request IDs Exceptional operations requiring stronger human oversight Higher friction and more complex timeout handling

For a front-door unlock, always-approve with a fixed target and a short expiry is the clearest starting point. For lights or a thermostat change, an exception policy may be reasonable only after you have bounded the target, value range, time window, and presence context.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

How should I test an AI approval automation before trusting it?

Test each branch with a harmless target or a simulated event first. The goal is to prove that unsafe states stop the run and that only the intended approval can reach the script.

  1. Send a valid proposal while the resident is home and confirm that no device action occurs before approval.
  2. Choose Reject and verify that the script is never called.
  3. Let the notification expire and verify that the device remains unchanged.
  4. Change presence, alarm state, or device state while the notification is waiting; confirm the post-approval condition blocks execution.
  5. Send an approval event with the wrong action label, request identifier, user, or device; confirm rejection.
  6. Submit two proposals rapidly and verify the configured run mode and request-ID rules prevent cross-approval.
  7. Simulate an unavailable device and confirm the failure notification reports failure rather than success.
  8. Inspect the trace for every test and verify that the recorded path matches the expected branch.
  9. Attempt a remote trigger with an invalid or missing secret and confirm it cannot reach the execution script.

Repeat these tests after changing integrations, notification payloads, run modes, scripts, or entity names. A safe design is not only a correct YAML snippet; it is a maintained policy whose failure paths remain visible.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What are the essential rules to retain?

  • AI output proposes an intent; Home Assistant decides whether it is allowed.
  • Conditions gate later actions, and the final condition belongs immediately before the device action.
  • Actionable notifications provide explicit approval events; rejection and timeout must leave the device unchanged.
  • Allowlisted fixed scripts are safer than model-generated service calls.
  • Request identifiers, short expiries, identity checks, and run-mode choices prevent replay and duplicate execution.
  • Traces, run attributes, and result notifications make every outcome reviewable.
  • Do not expose destructive operations through unauthenticated or internet-facing webhooks.

Frequently Asked Questions

Can Home Assistant require two people to approve an AI request?

Yes. Create two distinct approval events tied to the same request identifier and require approvals from separate trusted users or devices before calling the execution script. Give the pair a shared expiry so an old first approval cannot be combined with a later request.

What should happen if the phone with the approval notification is offline?

The wait should expire and the automation should end without changing the device. Provide a separate, authenticated local control path if emergency operation is necessary, rather than silently approving when delivery fails.

Can I use a voice response instead of notification buttons?

A voice interface can submit a proposal or an approval event, but treat speech recognition as untrusted input. Require the same normalized request, identity checks, expiry, and final conditions as a button-based approval.

How do I revoke a pending approval?

Maintain a request state that can be marked canceled by a trusted dashboard control or policy event. Check that state after the approval wait and before the script call, so cancellation wins even if a notification button was pressed moments earlier.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

actionable notificationsAI automationautomation safetyHome Assistantsmart home security

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.