Add secure Proto AI chat - #761
Draft
mcharles-square wants to merge 13 commits into
Draft
Conversation
🔐 Codex Security Review
Review SummaryOverall Risk: MEDIUM Findings[MEDIUM] Tool confirmations execute with stale stream-time permissions
[MEDIUM] Rack slot write tools can leave partial state on failure
[MEDIUM] Stored LLM credentials are usable by every fleet-read user
NotesNo changed hunk showed direct SQL injection, shell command injection, protobuf wire-format breakage, hardcoded wallet/payout addresses, or mining-pool hijack behavior. The new pool-related tool returns pool names only and intentionally omits stratum URLs, usernames, wallet identifiers, and credentials. Generated by Codex Security Review | |
mcharles-square
force-pushed
the
feat/ai-chat-poc
branch
2 times, most recently
from
July 17, 2026 20:37
96c4767 to
65b687e
Compare
mcharles-square
force-pushed
the
feat/ai-chat-poc
branch
2 times, most recently
from
July 23, 2026 13:26
9274f7e to
0cc8901
Compare
The new llm_config migration originally used version 000126, colliding with 000126_add_curtailment_pending_dispatch_clock. main has since also added 000127_backfill_curtailment_pending_dispatch_clock, so the next free version against the PR merge base is 000128. Renumbering to 000128 keeps migrations sequential and gap-free and clears Migration Hygiene, the DB-backed server tests (migration driver duplicate-version init failure), and all ProtoFleet E2E shards. Migration contents unchanged. Co-authored-by: Marvin Charles <mcharles@squareup.com> Signed-off-by: Marvin Charles <mcharles@squareup.com>
Add write-capable chat agent tools with preview/execute pairs: - preview_miner_action / execute_miner_action (explicit, all_devices, filter selectors) - preview_downtime_window / create_downtime_window (maintenance schedules) - list_actionable_miner_issues Wire new services in main.go and update agent guidance + tests.
mcharles-square
force-pushed
the
feat/ai-chat-poc
branch
from
July 23, 2026 15:56
b7b41f5 to
ae31014
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reviewable diff: +3193/-3 across 34 files (excludes generated, test, and story files).
Summary
Proto Fleet gains a permission-aware Proto AI chat launched from a floating action button, with streamed agent activity, conversational history, and structured Markdown responses. Operators configure the agent under Settings > Agents by selecting a harness and an OpenAI, Anthropic, or Ollama provider, discovering compatible models dynamically, and storing provider credentials encrypted on the Fleet server. The embedded agent is intentionally read-only, bounds tool execution, and minimizes fleet data before sharing tool results with an external provider.
How it works
Areas of the code involved
proto/chat/v1and generated clientsserver/internal/domain/chatserver/internal/handlers/chatserver/migrations,server/sqlcclient/src/protoFleet/features/aiChatclient/src/protoFleet/features/settings/agentsplus routing/navigationKey technical decisions & trade-offs
CHAT_ALLOW_PRIVATE_OLLAMA=true. Link-local, metadata, reserved, redirect, and DNS-rebinding paths remain blocked.Testing & validation
go test ./cmd/fleetd ./internal/domain/chat ./internal/handlers/chatpassed, including Ollama policy, provider-error redaction, pool disclosure, deduplication, and tool-budget regressions.just lintpassed across Buf, client ESLint, server golangci-lint, and affected plugins.