The daemon's HTTP API is a control plane, not just a status endpoint. It can
change power profiles, send SIGSTOP/SIGCONT to game process trees, switch the
NPU power mode, take over EC fan control and change the RGB keyboard LEDs. Treat
it accordingly.
server.jwt_secret(or--jwt-secret/JWT_SECRET) enables HMAC-SHA256 JWT Bearer authentication.- Tokens must include
"authorized": true. A token without that claim is rejected even if the signature is valid. - Tokens generated by
framework-powerd tokenexpire after one year. - Non-Bearer
Authorizationschemes are rejected. - If no secret is configured, the daemon refuses to start unless
--disable-authis explicitly passed.
export TOKEN=$(framework-powerd token --jwt-secret="$(cat /etc/framework-powerd/jwt-secret)")Prefer server.jwt_secret in the config file or the JWT_SECRET environment
variable over --jwt-secret: command-line arguments are visible in the process
list.
make install writes a random secret to /etc/framework-powerd/env (mode
600) when no secret exists. The shipped unit loads it via
EnvironmentFile=-/etc/framework-powerd/env. Generate a Home Assistant token
with make token.
- Default bind address is
localhost. - To expose the daemon on a LAN, set
server.addressto0.0.0.0and use a firewall. Ideally restrict the port to the Home Assistant host. /healthzis unauthenticated by design. It exposes version, uptime, idle state, memory percentage, monitor booleans and the metrics file path/status. It does not expose the JWT secret or control-plane actions./network/statsis authenticated. It exposes listening addresses and local process, systemd unit and container names, but only reads procfs, cgroups, local runtime metadata and local firewall rules. No active network scan or connection capture is performed, and the inventory is not persisted.- All other endpoints require auth.
--disable-auth is an escape hatch for local development. It logs a warning and
leaves the control plane open. Only use it with server.address=localhost.
POST /mode, POST /activity, POST /npu/power-mode, POST /fan/mode and
POST /led/mode are limited to 1 request/second with a burst of 5 per client IP. The limiter keys on
the IP, not the TCP source port, so opening new connections does not bypass it.
Idle buckets are pruned.
The shipped unit uses:
User=root— required for/dev/input,/systunables andpowerprofilesctl.NoNewPrivileges=yesPrivateTmp=yesProtectHome=yesProtectSystem=fullProtectKernelModules=yesProtectKernelLogs=yesProtectControlGroups=yesProtectKernelTunables=no— must stay off, the daemon writes PCIe ASPM, EPP and CPU governor tunables under/sys.RestrictSUIDSGID=yes,RestrictRealtime=yes,LockPersonality=yesRestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
Type=notify plus WatchdogSec=30s lets systemd detect a hung daemon and
restart it.
metrics.jsoncontains only energy counters and timestamps.llm.jsoncontains request counts, IP addresses and daily aggregates. Treat it as usage data, not as a secret.alerts.jsoncontains SMART/NVMe alert history and device names.- None of these files contain credentials.
- The JWT secret lives in the config file or environment. Restrict permissions
on the config file (
chmod 600if it contains a secret). - Home Assistant diagnostics redact
token,jwt_secret,password,secretandauthorizationfields.
- Run the API on localhost and put Home Assistant on the same host, or firewall the port to the HA host only.
- Use a dedicated random JWT secret, not a password.
- Rotate the token if it leaks; changing the secret invalidates all tokens.
- Keep the daemon and Home Assistant updated.
- Review the systemd unit after upgrades; hardening options are part of the security boundary.