Feat/credential upgrade - #7
Merged
Merged
Conversation
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.
LLM keys left the guest. The host now owns credential storage and provider HTTPS. MCP tokens still go into the guest.
Why
• Keys used to live in ~/.abox/credentials.env and get copied into every session’s guest-config.json / config.raw.
• The untrusted guest then exported every key and dialed providers itself.
• Goal: host-only LLM credentials, resolve only what this session needs, broker provider HTTPS on the host.
Credential sources (host-only)
• New internal/credsource: env, macOS keychain, Vault KV v2, Azure Key Vault, AWS Secrets Manager.
• Config stores a reference (source + name), never the secret. credential_env still works as {source: env, name: …}.
• Azure name is the secret URI (https://.vault.azure.net/secrets/).
• /provider and /mcp save keychain-first, credentials.env fallback. abox creds migrate moves existing file entries into the keychain.
• New /credential command to add in your credential provider
Secrets off disk and out of the guest
• Session start no longer writes LLM keys into guest-config.json or config.raw.
• Startup scrubs leftover "secrets" from old session dirs, and leftover ~/Library/Application Support/ABox/credentials.env.
• Protocol 2 still pushes the selected LLM key + MCP tokens after hello (legacy).
• Protocol 3 never sends the LLM key. MCP tokens still get pushed because the guest still dials MCP.
Host LLM broker (protocol 3)
• Protocol bumped 2 → 3. Guest sends provider_open / provider_send / provider_cancel (model alias + conversation). Host resolves the credential, dials the configured base_url, streams provider_event back.
• Guest no longer allowlists api.x.ai / OpenAI / Anthropic. TSI inet is MCP-only.
• Proto-2 guests cannot reach the broker. Canceled opens cancel the host stream so slots do not leak.
• Old hosts hang without a protocol check; the guest fails fast (make build).