Repository navigation
feat(profile): freeze the files an agent runs as its tools (MCP code mode) - #997
Merged
sandstream merged 1 commit intoNov 23, 2026
Merged
Conversation
…mode) In code mode the agent calls MCP servers through generated files and saves code as skills for its next run; an edit to one changes a tool without any call a gate sees. Operator-declared globs in .kit-profile.toml (code_tool_paths); freeze hashes the matching files and check reports a file added, removed or changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
|
Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published. |
sandstream
deleted the
claude/web-kit-status-sync-p6fg9a-profile-code-tools
branch
November 23, 2026 23:26
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.
Owner decision from kit-research
mcp-code-mode-vs-kit: yes.Why
With MCP "code mode" (Anthropic's code execution with MCP), the agent sees each MCP tool as a file it calls from code, for example
servers/salesforce/updateRecord.ts, and it may save working code underskills/for its next run. Those files are the tool definitions. An edit toupdateRecord.tsthat sends the record elsewhere changes what the tool does, and no gate sees a tool call for it.kit profilerecorded skills, MCP servers, plugins and (since #986) hooks, but not these files.What
The operator lists the globs in
.kit-profile.toml:kit profile freezekeeps the globs (operator-authored, likescope) and records[[code_tools]]: each matching file's POSIX path and the first 16 hex digits of its SHA-256. The summary line adds "3 code tool file(s)".kit profile checkcompares them like the other kinds, under a code tools heading: an edited wrapper is version drift, a new file isADDED, a deleted oneREMOVED.--gatefails on them..gitandnode_modulesare skipped, symbolic links are not followed, at most 2,000 files.kit does not guess the globs. A
servers/directory is just as often application code, and freezing it by default would turn every commit into drift.The glob matcher is
globToRegExpfromsrc/adr.ts(imported, not changed).Compatibility
An older kit rejects a profile that holds
code_tool_pathsorcode_tools(the schema is strict), as it does forhookssince #986.Verification
src/profile/code-tools.test.ts: nine tests, one through the real CLI: freeze three files,check --gatepasses, edit the Salesforce wrapper,check --gatefails naming it.contracts/kit.opencli.jsonregenerated for the help text.node scripts/prepush.mjs: build, format, lint, tests of the changed files, self-audit pass;kit adr checkpasses.kit reviewand the new-source-file check fail locally for container reasons. Semgrep did not run (not installed here).Generated by Claude Code