← Engineering Log
General

AI Automation Builder HACS: Managing Agent Permissions

Home Assistant Community Store (HACS) has become a go-to platform for developers who want to extend Home Assistant with custom integrations, scripts, and increasingly, AI-powered automation agents. As these agents grow more capable — controlling lights, locks, thermostats, and security systems — the question of who authorized that action becomes critical. This guide covers why consent infrastructure belongs in every HACS-based AI automation builder's toolkit, and how to implement it without rewiring your existing stack.

What Is HACS and Its Role in AI Automation

HACS is a community-maintained app store for Home Assistant that lets developers install third-party integrations, frontend elements, and automations outside the official add-on ecosystem. It dramatically lowers the barrier to extending Home Assistant's capabilities.

In recent years, AI automation builders have started using HACS as a distribution channel for LLM-powered agents — automations that don't just run on a schedule, but reason about context and take action on a user's behalf. These agents might:

  • Parse voice commands and trigger multi-step routines
  • Monitor sensor data and proactively adjust device states
  • Integrate with external APIs (calendars, weather, energy providers) to make decisions
  • Respond to anomalies without explicit user input at the moment of action

This shift from rule-based automations to AI-driven agents is powerful, but it creates a consent gap that most HACS developers haven't solved yet.

Why AI Automation Builders Need Consent Infrastructure

Traditional Home Assistant automations are user-authored. The user writes the trigger, the condition, and the action — they've implicitly consented by building it. AI agents are different. They reason, improvise, and act in ways the user may not have explicitly anticipated when they installed the integration.

Consent infrastructure bridges the gap between "the user installed this agent" and "the user approved this specific action." Without it, you're operating on implied permission — which is legally fragile, ethically questionable, and increasingly incompatible with emerging AI governance expectations.

Risks of Agents Acting Without User Permission

Shipping an AI automation builder without a consent layer exposes you and your users to real problems:

  • Unintended actions — an agent unlocks a door, adjusts a thermostat, or disables an alarm based on a misread context
  • No audit trail — when something goes wrong, there's no record of what the agent was authorized to do
  • Liability exposure — particularly relevant if your HACS integration is used in commercial or rental properties
  • User trust erosion — one surprising agent action can destroy confidence in an otherwise excellent tool
  • Compliance risk — regulations like GDPR and emerging AI-specific frameworks increasingly require explainable, documented authorization

Consent Challenges in HACS-Based AI Agents

HACS integrations run inside a user's Home Assistant instance — often on a local network, sometimes with cloud bridges. This architecture creates specific consent challenges:

  • No native consent screen — Home Assistant doesn't provide a built-in UI for per-action agent approval
  • Async execution — agents may queue actions that run hours after the user last interacted with the system
  • Multi-user households — which user's consent governs a shared smart home?
  • Scope creep — an agent installed to control lights may gradually expand its action surface

These aren't theoretical problems. They're the exact friction points developers run into when users ask "wait, did I authorize that?"

How a Consent Layer Fits Into Your Automation Stack

A consent layer sits between your agent's intent and its execution. The flow looks like this:

  1. Agent determines an action is needed
  2. Agent requests user consent via a hosted consent screen
  3. User approves or declines (and can revoke later)
  4. A signed token is issued and attached to the action
  5. Agent verifies the token at runtime before executing

This doesn't require rebuilding your automation logic. It's an infrastructure wrapper — similar to how OAuth wraps API access without changing the underlying API. For HACS-distributed agents, this pattern is especially clean because it separates your core automation logic from authorization concerns.

Implementing Permitly in Your AI Automation Builder

Permitly is built exactly for this pattern. It's a hosted consent SDK designed for AI agent developers — including those building HACS integrations and MCP server automations — who need to request, record, and verify user permission before an agent acts.

Integration is minimal:

import permitly

# 1. Request consent for a specific action
consent_request = permitly.request(
    user_id="homeassistant_user_abc",
    action="unlock_front_door",
    context={"triggered_by": "ai_agent", "reason": "departure_detected"}
)

# 2. Redirect user to the hosted consent screen
redirect_url = consent_request.consent_url

# 3. Verify the signed JWT before executing
permitly.verify(token=consent_request.token, action="unlock_front_door")

That's the core loop. Your agent requests consent, the user gets a hosted screen (no custom UI required), and you get back a signed JWT that your agent checks at runtime. Every step is logged.

Recording and Auditing Agent Actions

Every consent request through Permitly creates an immutable log entry that captures:

  • Who was asked (user identifier)
  • What was requested (action + context)
  • When the request was made and resolved
  • What the user decided — approved, declined, or revoked
  • Which agent made the request (your integration identifier)

For HACS developers, this means you can give your users a clear history of everything your agent has done — and everything it asked to do. That transparency is increasingly a differentiator, not just a compliance checkbox.

Signed JWTs for Runtime Permission Verification

Permitly's JWTs are cryptographically signed and scoped to a specific action and user. Your agent verifies the token before executing — if the token is invalid, expired, or revoked, the action doesn't run. This is runtime enforcement, not just logging after the fact.

For AI automation builders, this is significant: you can ship a HACS integration where users retain granular control over exactly what the agent is allowed to do, with revocation that takes effect immediately.

Compliance and Audit Trails for Home Automation Agents

As AI agents move into sensitive home environments — security systems, access control, energy management — regulatory scrutiny will follow. GDPR already covers automated decision-making. Emerging AI governance frameworks in the EU and US specifically target agentic systems.

Permitly's audit trail is built for this reality. Every approval, decline, and revocation is stored with a tamper-evident log that you can export for compliance review or surface directly to your users. If a regulator or an unhappy user asks "what did your agent do and who authorized it," you have a complete answer.

Next Steps for Consent-Ready AI Automation Builders

If you're building or maintaining a HACS-distributed AI automation agent, here's a practical path forward:

  1. Audit your agent's action surface — list every action your agent can take on a user's behalf
  2. Categorize by sensitivity — high-impact actions (access control, security) need explicit per-action consent; lower-impact actions may use broader scope approval
  3. Drop in Permitly — three lines of code adds the consent request, hosted screen, and JWT verification loop
  4. Surface the audit log — give users visibility into what your agent has done and what it's been authorized to do
  5. Handle revocation — make sure your agent checks token validity at runtime, not just at install time

FAQ

Does Permitly work with local Home Assistant instances? Yes. The consent screen is hosted by Permitly, so the user interaction happens via a redirect URL — your Home Assistant instance doesn't need to expose any public endpoints. The JWT verification can happen locally once the token is issued.

What if a user wants to pre-authorize a class of actions? Permitly supports scoped consent, so you can request approval for a defined action category (e.g., "climate control adjustments") rather than requiring per-action confirmation for every routine task.

How does Permitly handle multi-user households? Each consent request is tied to a specific user identifier, so different household members can hold independent consent records for the same agent. Your integration determines whose consent to request based on the context of the action — for example, the user who initiated a voice command, or the primary account holder for scheduled automations.