AI Copilot
The Hub ships an optional AI Copilot: a chat assistant, backed by any OpenAI-compatible API, that can inspect the fleet and draft configuration changes. It is proposal-only: the Copilot never executes a mutation directly — everything it produces arrives as a proposal card that a human applies.
Use when: you want help composing stream configs or Job specs, or a natural-language entry point into fleet diagnostics. Skip it when your policy forbids sending fleet metadata to an external LLM — it is disabled by default and only runs when configured.
Safety model
- Proposal-only. Tool calls that produce configuration return a validated
proposal (
stream_configorjob_spec) rendered as a card in the console; applying it is a separate, human-confirmed action that follows the normal configuration/rollout path — including the approval gate when enabled. - RBAC-scoped tools. The tool list is filtered by the caller's principal: a viewer cannot ask the Copilot for something a viewer cannot see. Tool execution re-checks RBAC/scopes server-side; the model cannot escalate.
- Redaction before upstream calls. Config fragments sent to the LLM are
structurally redacted — literal credentials and URL passwords are masked,
Bearertokens stripped, while${secret:...}/${env:...}/${file:...}placeholders are preserved intact. - No mutation tools. The Copilot can read components, schemas, nodes, and diagnostics, and can validate drafts. It has no tool that starts, stops, or writes anything.
Configuration
The Copilot is Hub-only and disabled by default. Configure it in the startup
file's ai: section or with ARKFLOW_AI_* environment variables
(CLI reference):
| Key | Env | Default | Meaning |
|---|---|---|---|
enabled | ARKFLOW_AI_ENABLED | false | Master switch. |
api_base | ARKFLOW_AI_API_BASE | — | OpenAI-compatible base URL. |
model | ARKFLOW_AI_MODEL | — | Model name. |
api_key | ARKFLOW_AI_API_KEY | — | Bearer key; supports ${secret:} references in the file. |
timeout_ms | ARKFLOW_AI_TIMEOUT_MS | 90000 | Upstream request timeout. |
max_tool_rounds | ARKFLOW_AI_MAX_TOOL_ROUNDS | 8 | Tool-call loop bound per request. |
max_tokens | ARKFLOW_AI_MAX_TOKENS | 4096 | Completion token cap. |
requests_per_minute | ARKFLOW_AI_REQUESTS_PER_MINUTE | 20 | Per-principal chat rate limit. |
burst | ARKFLOW_AI_BURST | 5 | Rate-limit burst. |
Example startup-file section:
address: 127.0.0.1:8080
ai:
enabled: true
api_base: https://api.openai.com/v1
model: gpt-4o-mini
api_key: "${secret:OPENAI_API_KEY}"
timeout_ms: 45000
max_tool_rounds: 6
Limits enforced in addition to the config: at most 40 chat messages and 65,536 characters per request; tool outputs truncated; the upstream error body capped at 64 KiB.
What it can do
- Browse the component catalog and fetch a component's schema and example.
- Inspect nodes, jobs, streams, events, and operational status (read-only).
- Validate a drafted config through the same deep validation as
--validate. - Emit proposal cards: a validated stream config, a validated Job spec, or a diagnostic action linking to the right console route with parameters.
Audit and observability
- AI chat requests and the proposals they produced are part of the normal audit trail; identity writes and configuration applies remain actor-attributed human actions.
- Per-principal rate limiting applies on top of the general rate limits.
- Upstream provider failures surface as
ai_provider_errorresponses; the Copilot degrades to "unavailable" and never blocks control-plane operation.
Verify
- Start the Hub with
ai.enabled: trueand a reachableapi_base. - Open the console Copilot panel; ask it to describe a component — expect a schema-backed answer.
- Ask it to draft a config; expect a proposal card marked validated, not an applied change.
- With
approval_requiredon, apply the proposal and confirm it routes through approval.
Rollback
Set ARKFLOW_AI_ENABLED=false (or remove the ai: section) and restart the
Hub. The panel disappears; no other behavior changes.