Skip to content

feat(secrets): request_secret can store a value straight into agenix - #10

Merged
caniko merged 1 commit into
canixfrom
feat/secret-agenix-delivery
Nov 17, 2026
Merged

caniko merged 1 commit into
canixfrom
feat/secret-agenix-delivery

Conversation

@caniko

@caniko caniko commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Closes #9.

An agent that needs a token to keep asked with delivery: "file", and canix then moved that file into agenix in a second step. On 2026-11-17 T3 swept its secret files before that second step ran, so the Cloudflare token was lost and had to be entered again.

request_secret now takes delivery: "agenix" with an agenix target: one of user/rootModule/host, name, env[] (omitted means bare), category, expires (YYYY-MM-DD or never), custodian, project and verifyUrl (https only). The target is recorded on the turn item when the agent asks, so a client's answer can't redirect it. The web and mobile cards show where the value goes and warn that a verify URL receives the value as a Bearer token.

On save, SecretRequests.answer runs the agenixSecretCommand setting (default ["canix", "secret", "store"]) with --flag=value arguments, so a name starting with - can't turn into a flag. The value goes on stdin only.

  • Nothing kept in T3. No ref, no file, nothing in argv or env, and a secret-provider read no longer stays in the resolver cache.
  • On success, the command's JSON { path, committed_sha, verify, rekey, rops_id? } is recorded as agenixResult and is the only thing the agent receives.
  • On failure, the card shows the command's { error: { code, message } }, or its error: stderr line for usage errors. The card stays open so the user can retry or decline.
  • Configuration. An empty command list refuses the mode at request time. The setting is read from settings.json only and isn't in ServerSettingsPatch, so a remote client can't change which command runs.

The tool description now recommends agenix for secrets meant to persist. docs/user/secrets.md has a new section. The MCP tool-list budget went from 48119 to 48764 bytes for the new schema. I didn't run the model evals.

The base is native/20261114-3d53030d91, the commit the Atlas native fork runs today, so the diff contains only this change.

Tests:

  • A fake store command records its argv, environment and stdin. The value arrives on stdin and never appears in argv, the environment, T3's secret store or the files directory, and the flag order is pinned.
  • JSON errors, clap-style exit-2 output, and an unconfigured command each leave the card pending with nothing kept.
  • Schema rows cover the exactly-one-owner rule, expiry format, https-only URLs and shell-identifier env names.
  • At the MCP level: refusals for a target without the delivery mode, the mode without a target, a pasted value, or an empty command, plus a metadata-only success result.
  • vp run check:changed passes. Its only failure, "unused patches", is a pre-existing pnpm peer-dependency issue in infra/relay.

Reviewed with sol-loop: 2 rounds with openai/gpt-6.1-sol. Sol verdict: approved at 1cfc367

🤖 Generated with Claude Code

An agent that needed a persistent secret asked with `delivery: "file"`, and a
second tool moved the file into agenix. On 2026-11-17 T3 swept its secret
files before that second step ran, the token was lost, and the user had to
create and paste it again.

`delivery: "agenix"` with an `agenix` target (user, root module or host,
name, env or bare, category, expiry, custodian, project, verify URL) keeps
the card as the entry surface but removes the second step. The card shows
where the value will go. On save the server runs the `agenixSecretCommand`
setting (default `canix secret store`, settings.json only) with the target
as `--flag=value` arguments and the value on stdin only. T3 writes nothing:
no ref, no file, no argv or env, and a secret-provider read no longer stays
in the resolver cache. The agent gets only the command's JSON result (path,
commit, verify and rekey state); a failure shows on the card, which stays
open to retry or decline. An empty command refuses the mode at request
time.

Closes #9
@caniko
caniko changed the base branch from native/20261114-3d53030d91 to canix November 17, 2026 13:37
@caniko
caniko merged commit 1cfc367 into canix Nov 17, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant