LLM provider management: write tools (BYOM)#434
Open
mocha06 wants to merge 1 commit into
Open
Conversation
mocha06
requested review from
adriannoes and
gbrlcustodio
and removed request for
adriannoes
July 18, 2026 16:38
mocha06
force-pushed
the
rc-dev/feat/llm-provider-writes
branch
from
July 18, 2026 16:42
e3181cc to
5620bcd
Compare
…default set/reset) Adds custom (BYOM) LLM provider management across SDK, MCP, and CLI: create, update (full configuration replacement), delete, active-status toggle, and organization default set/reset — the write counterpart to the provider discovery surface. Secret handling: provider configuration is supplied only via a local JSON file path, never inline, so it never becomes a logged tool argument; the create and update mutations never select configuration back (secrets are never returned); and file/parse errors report only the path and a structural reason. Updates send a full replacement configuration and preserve stored secrets for any value left as the redaction placeholder returned on read. Owner-scoped operations (active-status, default set/reset) authorize against the credential's own organization context, so they require a service-account credential bound to that organization; create/update/delete authorize against the passed organization UUID. Deletes require confirmation; CLI create/update are gated on the read-access probe (clean only when ok and no problem).
mocha06
force-pushed
the
rc-dev/feat/llm-provider-writes
branch
from
July 18, 2026 17:30
5620bcd to
7b9a81d
Compare
This was referenced Jul 18, 2026
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.
Closes #415. Final phase of milestone 19 (AI Agents: Knowledge Bases, Capabilities & Model Selection); the write counterpart to the provider discovery surface (#411).
Motivation
The discovery phase (#411) made LLM providers readable but not manageable. Bringing your own model (BYOM) still required the Pipefy UI: there was no way to create a custom provider, rotate its credentials, toggle it, or set the organization default from an agent or script. This phase closes that gap while keeping provider secrets out of arguments, logs, errors, and responses.
What ships
Six write tools across SDK → MCP → CLI, plus docs and the AI-agents skill:
create_llm_providerpipefy ai-provider createupdate_llm_providerpipefy ai-provider updatedelete_llm_providerpipefy ai-provider deleteset_llm_provider_active_statuspipefy ai-provider set-active-statusset_default_llm_providerpipefy ai-provider default setreset_default_llm_providerpipefy ai-provider default resetProven contract
Verified against the live GraphQL schema and traced through the full delegation chain (GraphQL entry → downstream credential-validating service), per-argument:
configuration_file_path) and CLI (--config-file) accept the provider configuration only via a local JSON file, never inline — so it never becomes a logged tool argument. Theproviderkey selects the vendor; vendor/model membership and credential validity are validated server-side (a live credential test call), so the toolkit treats the object as opaque rather than coupling to the vendor schema.create/updatedeliberately omitconfigurationfrom their selection sets even though the payload exposes it; the response carries onlyid/name/type/active/organizationDefault. File/parse errors report only the path and a structural reason, never file contents.configurationis required on every update. A caller can fetch the (redacted) configuration, edit the non-secret fields, and resubmit: any value left as the__REDACTED__placeholder is stripped upstream and the stored secret is preserved — confirmed live (an update with the placeholder succeeds; the backend used the stored key, not the literal placeholder). Supplying a new real value rotates the secret.create/update/deletetake the organization UUID;set-default/resettake the numeric organization id;set-active-statustakes no organization argument;set-defaultrequires exactly one ofprovider_id/system_provider_id(enforced client-side and downstream).manage_ai_providersorganization permission and an eligible plan — distinct frommanage_ai_agents. The read-access probe proves read only, so a green probe does not imply write entitlement.set-active-status,set-default,reset, and the organization-ownerget_default_llm_providerauthorize against the credential's own organization context. A service account is bound to one organization and supplies that context; a bare personal token is denied regardless of the organization passed — even when the same token can create/update/delete providers there (those authorize against the passed UUID). Documented in the tool docstrings anddocs/mcp/tools/llm-providers.md.Behavior boundaries
okand carries noproblem(a presentproblemis partial denial, never full access); the 2. LLM provider discovery: read tools and access probe #411 probe docs now state this clean-gate contract explicitly.confirm; CLI prompt unless--yes).Known upstream issue
Provider credential-validation errors are forwarded from the backend and can echo a masked copy of the submitted credential plus an internal
error_codeblob. This originates upstream; the toolkit surfaces the classified message verbatim (no client-side scrub, by decision) and the upstream fix is tracked separately (here)Docs and skills touched
docs/mcp/tools/llm-providers.md(writes, secret handling, the update flow, the probe clean-gate contract, service-account requirement),docs/parity.md, README / packages/mcp/README tool counts (reconciled to 182), the AI-agents skill (BYOM provider management flow), and the registry.Testing
Unit tests assert configuration never appears in responses, logs, or errors; the XOR rule; full-replacement update; the redaction placeholder passthrough; confirm-delete; and the probe clean-gate. Live end-to-end against a lab organization:
__REDACTED____REDACTED____REDACTED__; model changed; stored secret preserved (no re-auth failure)PERMISSION_DENIED(documented auth boundary)