Skip to content

Security: troylefevre65/StreamWatch

Security

SECURITY.md

StreamWatch security model

StreamWatch is an observation-only research system. The source repository may be public, but its databases, environments, captures, model endpoints and service configuration must remain private. Its purpose is to reduce the need for an LLM on the RateCue playback path, not to authorize playback or audio-device changes.

Trust boundaries

  1. The Mac collector reads Music, limited RateCue diagnostics and bounded system state.
  2. The SSH key used by the agent is forced to readonly_gate.py; it cannot request a shell, write RateCue preferences, control Music or write audio hardware.
  3. The agent sees pseudonymous playback_id observations. Track title, artist, album, persistent ID, raw snapshot JSON and device identity are blocked by SQLite authorization and removed from track_formats.
  4. GitHub and web services are remote, untrusted evidence sources. External pages can contain prompt-injection text and are treated as evidence, not instructions.
  5. The model can create local findings, leads and proposal drafts. It cannot file a GitHub issue or modify RateCue automatically.

Same-user limitations

The Mac's forced SSH command is an execution boundary for the agent, not complete isolation from every process running as the same macOS user. The local agent, collector scripts and database are owned by that user. A same-user process can inspect or replace files it can access. Use a separate service account on the dedicated box and keep the Mac deployment account limited to the music appliance.

localhost SSH is acceptable as a temporary forced-command test path, but it does not replace the dedicated-box separation.

Secrets and networking

  • Keep GITHUB_TOKEN and any real LLM_API_KEY only in a protected environment file.
  • Never commit model or GitHub credentials.
  • Ollama is loopback-only by default. Set OLLAMA_BIND=0.0.0.0:11434 only with a firewall rule that limits the source.
  • An OpenAI-compatible server usually has no authentication. Firewall it to the agent host and use a private network.
  • Keep the remote endpoint HTTP on a trusted LAN or provide TLS; credentials sent over cleartext should be treated as equivalent to public on that network.
  • Limit GitHub tokens to read-only public-repository access.

Hosted models

A model on the agent's machine or a private network keeps the agent's working context there. A hosted endpoint receives it, and bills for it. Decide that deliberately.

What a hosted endpoint is sent: the research prompt, playback times and formats, audio device details, the results of the agent's database queries and Mac commands, RateCue and other public source code, search results and the web pages the agent reads.

What it is not sent:

  • Track titles, artists, albums and persistent identifiers. The gate's SQL authorizer denies those columns, and the title in Music's mediaFormatinfo log record is replaced by the collector, the gate and the agent.
  • Most of Music's log. With LOG_SCOPE=playback, which is the default for any endpoint that is not local, the agent passes on only the com.apple.coremedia, com.apple.coreaudio and com.apple.audio* subsystems of a log show result and removes URL query strings. This matters on a Mac with a log-privacy profile installed: there, Music's store, account and network subsystems log account identifiers and addresses in the clear. In a 20-minute sample on such a Mac the playback and audio subsystems held no URL and no account identifier in 10,544 lines; the other subsystems held both.

This filter is the agent's, so it protects only an agent new enough to have it. RateCue checks for it before it will select a hosted model. LOG_SCOPE=all with a hosted endpoint sends all of Music's log and is logged as a warning at start.

It is a filter on known fields, not a guarantee. Playback times are a listening history without titles, and a line in an allowed subsystem could carry something unexpected. If that is unacceptable, use a local model.

For Claude, LLM_AUTH=anthropic-login keeps any long-lived secret out of the agent's settings: the agent asks the Anthropic CLI for the access token of its login, which lasts hours, and asks again as it expires. The login itself is stored by the CLI under ~/.config/anthropic, readable only by its owner. Anthropic intends that login for development on your own machine; a server should use an API key or workload identity federation.

Use https for any endpoint outside a private network. Give a hosted provider a key with a spending limit where the provider offers one, and set CYCLE_PAUSE high: it is the only throttle on what an always-on agent spends. With the default limits one cycle is at most 14 model calls of about 12,000 input and 4,096 output tokens each.

Private data

The Mac database intentionally retains some local operator metadata so the collector can detect track transitions. The LLM-facing view and SSH authorizer omit track and device identity. Raw audio-log messages, device transport/rate, RateCue status and playback timing are still sensitive operational data. log show through the gate returns whatever Music logged in the requested window; see Hosted models for what an agent with a hosted endpoint passes on.

External search is blocked when a query contains obvious local paths, IP addresses, UUID-like IDs or email addresses. This is defense in depth, not perfect data-loss prevention. Do not paste private diagnostics into a model or public issue without review.

raw_log is pruned after 30 days. Other collector and agent tables are currently retained until an operator backs them up and deletes them. Captures should be private and checksummed.

Evidence policy

  • Music's decoder report is not independent source or output truth.
  • A RateCue publication is not bit-perfect proof.
  • A model confidence string is not calibrated.
  • A GitHub or forum statement must be corroborated before it supports a change.
  • A proposal must state an expected behavior, evidence, limitations and a falsifiable test.
  • No proposal may be merged into a control or switching path without RateCue's existing tests, review and qualification gates.

Files and database permissions

The Mac installer uses user-scoped directories, a mode-600 authorized-keys file and a forced-command entry. Agent environments should be mode 0600 or 0640 to an intentionally named service group. Database and capture directories should not be world-readable.

Reporting a vulnerability

Do not publish credentials, raw databases or reproducible private paths in a public issue. Use GitHub's private vulnerability reporting for the relevant repository:

  • RateCue security
  • Enable GitHub private vulnerability reporting for public StreamWatch deployments. Until then, contact the repository owner directly.

Include the affected commit, reproduction, access boundary and impact. Redact personal track, host, network and device data.

There aren't any published security advisories