Repository navigation
Add a kizen service-accounts command group - #101
Merged
2 commits merged intoOct 27, 2026
Merged
2 commits merged into
2 commits merged into
Conversation
A Call LLM step runs its MCP tools as a service account, and builds had no way to make one without clicking through Settings. The new group lists, creates, updates, deletes and shows the history of integration accounts, with permission groups by name as roles takes them. Kizen returns the new account's API key in full on create, under an api_key object the schema doesn't declare. The API wrapper drops it before anything else sees the response, so no plan, result, table or --json output can contain it; reads show only Kizen's own preview. A rename sends the current api_name with the new name, because Kizen re-derives it from any PATCH that includes name. Update and delete refuse automation and plugin accounts, which Kizen or a plugin manages, and create refuses a duplicate name, which Kizen answers with a 500.
This was referenced Oct 27, 2026
Merged
Contributor
Author
|
Included in the 0.4.0 release PR #102; merge that instead. |
sangyeT
approved these changes
Oct 27, 2026
sangyeT
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the api module, read tools, planners and CLI. Good that the create response's api_key is popped inside the api layer before any plan result or --json can see it, that a rename pins the current api_name so Kizen doesn't re-derive it, and that automation/plugin accounts are refused for update and delete. Approving.
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.
Problem
A Call LLM step runs its MCP tools as a service account, and builds had no way to make one without clicking through Settings.
Solution
A new
kizen service-accountsgroup:list,get,create,update,deleteandhistoryfor integration accounts, with permission groups by name through--group/-g, resolved the wayrolesdoes. It follows therolessurface module for module, and writes go through the usual mutation path, so--dry-runand--yesbehave as everywhere else.kizen docs show service-accountdocuments it.Kizen returns the new account's API key in full on create, under an
api_keyobject the schema doesn't declare. The API wrapper deletes it before anything else sees the response, so no plan, result, table, log or--jsonoutput can contain it. Reads show only Kizen's own preview and the key count.createtakes no--api-name, since Kizen derives it from the name, and a name or derived api_name that already exists is refused at plan time (Kizen answers a duplicate with a 500). A rename sends the current api_name with the new name, because Kizen re-derives it from any PATCH that includesname.updateanddeleterefuse automation and plugin accounts, which Kizen or a plugin manages.Testing
Local checks after merging main: lint, format, typecheck, pytest (
2868 passed, 4 skipped, 1 xfailed) and the CLI-tree diff,passed: lint format typecheck test extra_checks. A sentinel key in a mocked create response is asserted absent from every output path.Live on a test tenant, with a scratch permission group and account:
create -ggave the predicted api_name and said a key was issued and not shown;listandgetshowed the group, one key and the preview; a rename kept the api_name;--clear-groupsleft it disabled; the refusals for an automation account, a plugin account and a duplicate name each exit 1 at--dry-run;deleteremoved it (404 after). No key-shaped string sharing the preview's prefix appears in the run log. Account and group counts were the same before and after. The drift tier wasn't run.Design notes / tradeoffs
Rejected: commands to reveal or rotate keys.
run_tools_asreferences the account by id and never needs a key, and keys shouldn't reach logs. Rotation, if wanted later, belongs in a separate command that writes the key to a mode-0600 file. Rejected too: a spec file, since the write body has three keys and flags cover them, as forroles.Overlaps: #100 (the
mcp-serverscommand group) adds a second command group and touches the same shared files: the CLI command registry (cli/__init__.py), the docs lists (commands.md,reference.md,specs/README.md),scripts/cli-tree-baseline.txt,tests/drift/contracts.py,tests/drift/schema_snapshot.json,tools/plans.py,CONTRIBUTING.mdandCHANGELOG.md. Whichever merges second should need a small conflict fix. #96 (the loops fix) also changes the CLI-tree baseline. The merge from main also refreshes that baseline for #92's newkizen upgrade --checkhelp text, which main's baseline lacks; every PR in this set carries that same line.