Repository navigation
feat(secrets)!: scoped secret release, no secrets for model commands - #631
Merged
Merged
Conversation
Owner decision 2026-11-11 (#598 part a, design secrets-integrations §4, §8.3). A new [secrets] table binds each secret NAME to the tools whose child processes may receive it, e.g. GITHUB_TOKEN = { tools = ["gh", "git"] }. Every launcher scrubs the secret-shaped variables (ENV-1) that the release does not bind to it. BREAKING: run_command, job_start and cron scripts get no secret by default, GITHUB_TOKEN included. The default keeps GITHUB_TOKEN for the gh and git tools and the owner's hooks and MCP servers only; a user config entry restores it for commands. A project config can only narrow a binding: a widening entry is ignored with a warning naming the remedy. A child session (agent_start or delegate) gets its parent's grant, the secrets it holds that its release binds to some tool, narrowed by a profile's grants, so it never holds a secret its parent may not use. Redaction is unchanged and covers every secret. [secrets] keys are secret names, so they are exempt from the forbidden-key rule; a key that is not a secret-shaped NAME or a tool entry that is not a tool name is a config error naming the remedy. Migration note: docs/secrets-integrations-design.md §9.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Nov 12, 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.
What
#598 part (a), scoped secret release. A new
[secrets]config table binds each secret NAME to the tools whose child processes may receive it. BREAKING:run_command,job_startand cron scripts get no secret by default,GITHUB_TOKENincluded. Theghandgittools keep the token. A child session gets only its parent's grant, narrowed by a profile.Why
Owner decision 2026-11-11 (
docs/secrets-integrations-design.md§4, §8.3). ENV-1 keptGITHUB_TOKENin every child process, so any command the model wrote could read it and send it anywhere, including a command steered by a prompt injection.Changes
tole-core/src/secret_release.rs(new): theReleasetable, mapping each secret name to its consumers.gh,git,run_command,job_start) or one of tole's own launchers (hook,mcp,cron,uteke,memory,cora,skills).GITHUB_TOKEN, togh,git,hookandmcp.held_grants()returns the secrets this process holds that are bound to some consumer: the most a child may be given.set_release);release()returns it, or the default.tole-core/src/subprocess.rs: the hardcodedGITHUB_TOKENexception is gone.scrub_env_for(cmd, consumer)keeps only what the release grants that consumer.scrub_env_for_childkeeps no secret.scrub_env_for_child_keepingkeeps exactly the listed names.RunCommandToolhas an optionalreleaseoverride, for tests and embedders.AgentStartToolno longer keepsGITHUB_TOKENimplicitly.agent_startchild gets the parent'sheld_grants().parent grant ∩ profile.grants. A secret the parent's release binds to nothing can never reach a child, even when a profile lists it.tole-cliconfig: a[secrets]table ofNAME = { tools = [...] }entries.[a-z0-9_].NAMEunder [secrets] in your user config").config checkshows each binding, and project lines carry the narrow-only note.Config::release()turns the table into a release;main.rssets it for the process.docs/secrets-integrations-design.md§9 (what changed, how to restore the old behaviour for one token, why);[secrets]section.Testing
All run locally on b5e40fc (develop 1c5b320), with
CARGO_TARGET_DIRset explicitly andCARGO_INCREMENTAL=0.cargo test --workspace --no-fail-fastpasses: 1556 passed, 0 failed (84 suites).cargo test -p tole-core --no-default-featurespasses: 539 passed;cargo check -p tole-core --no-default-features --testspasses.cargo test -p tole-cli --no-default-featurespasses: 462 passed. With--features shell-toolsadded: 625 passed.cargo fmt --all -- --checkpasses.cargo clippy -D warningspasses for--workspace --all-targets,-p tole-core --no-default-features --all-targets,-p tole-cli --no-default-featuresand-p tole-cli --no-default-features --features shell-tools.cora review --no-llm --staged: "No issues found".New tests:
run_command::tests::a_command_gets_no_secret_unless_one_is_granted_to_run_command: with the process release,printenv GITHUB_TOKENin arun_commandchild prints nothing. With a release grantingGITHUB_TOKENtorun_command, it prints the token, and another secret stays absent.secret_release::tests:GITHUB_TOKEN, while run_command, job_start, cron and the helpers do not;delegate::tests::a_profile_child_…(extended):config::tests::secrets_bind_names_to_tools_and_a_project_can_only_narrow_them:config checklines.Red/green: I broke each rule on purpose, saw the named test fail, then restored it and saw it pass. All 9 breaks were caught:
GITHUB_TOKENkept for every child (the old exception)Notes and deviations
GITHUB_TOKENby default. They are configured by the owner, not written by the model, and a GitHub MCP server or hook may rely on the token. Users can narrow this.GITHUB_TOKEN. tole's helper processes (uteke, memory, cora, skill index, review gate) no longer receive it; none of them needs it.web_searchis accepted but has no effect yet: release only governs child processes.job_startuses the same mechanism under thejob_startconsumer. Its policy is tested; the wiring is a one-line call with no end-to-end test (it is a detached job)..env*and key-file read redaction, and thetole doctorreport.Size: 645 changed lines (575 added, 70 removed) across 26 files.
Related Issues
Part (a) of #598 (secrets epic #594; follows #595 and #585).
Checklist
feat/scoped-secret-release)develop