Skip to content

[feat] Hide Daytona credentials by default - #5705

Merged
mmabrouk merged 1 commit into
release/v0.108.1from
feat/daytona-secrets-default-on
Aug 3, 2026
Merged

[feat] Hide Daytona credentials by default#5705
mmabrouk merged 1 commit into
release/v0.108.1from
feat/daytona-secrets-default-on

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Aug 3, 2026

Copy link
Copy Markdown
Member

Context

Hiding Daytona credentials shipped in #5670 behind AGENTA_RUNNER_DAYTONA_OPAQUE_SECRETS=process_local, off unless an operator opted in. This inverts that: hiding is on by default and the variable now switches it off.

The reasoning is about which choice should need a deliberate decision. Leaving provider keys readable inside a sandbox that runs model-written code is the surprising option, so it should be the one someone has to ask for in writing, not the one they get by never learning the variable exists.

Changes

The default. With the variable unset, a Daytona run stores each model and MCP key as a Daytona Secret restricted to the one host it authenticates against, and the sandbox gets a placeholder.

Turning it off takes off, false, 0, no, disabled, or plaintext, case-insensitively and with whitespace trimmed.

Anything unrecognized leaves hiding ON. This is the part worth reviewing closely. A typo now fails safe: someone who meant to switch hiding off and wrote of keeps the protection they would have had by doing nothing, instead of silently losing it. The opposite default would turn a one-character mistake into an unprotected deployment that looks configured.

process_local still works and is identical to leaving the variable unset. It stays because it names the cleanup guarantee (the runner tracks the Secret records it created in its own memory), which will matter when a durable mode arrives. That is also why the setting takes a mode name rather than a plain on.

Before:

unset            -> keys sent as plaintext environment variables
process_local    -> keys hidden
anything else    -> keys sent as plaintext

After:

unset            -> keys hidden
process_local    -> keys hidden
off / false / 0 / no / disabled / plaintext  -> keys sent as plaintext
anything else    -> keys hidden (a typo cannot remove the protection)

The operational cost, which is the real content of this PR

The runner's Daytona API key now needs permission to manage Secrets on every deployment that uses Daytona, not only on ones that opted in. That is a different permission from creating sandboxes. A key without it fails every run carrying a model or MCP key, at sandbox creation, with the named error added in #5670. There is still no silent plaintext fallback, because quietly doing the unprotected thing is worse than stopping.

The configuration reference now carries an upgrade warning saying exactly this, and gives =off as the way out for anyone who would rather not grant the permission. Our own keys across all environments were updated before this PR.

Tests / notes

  • Four tests encoded the old default and now encode the new one. Added coverage for every off spelling, for case and whitespace, and for typos leaving hiding on.
  • Runner tsc --noEmit clean, 99 files / 1538 tests.
  • One trap worth knowing about, now commented in values.yaml: a bare off in YAML parses as boolean false, the Helm template's if then skips the variable, and hiding stays on, the opposite of the intent. The value must be quoted. The schema types it as a string so an unquoted one fails validation rather than passing silently.
  • Config surfaces updated to match: the four env examples now show how to turn it off rather than on, and the Helm schema accepts process_local or off.

What to QA

  • With nothing set, run Claude on Daytona with a managed Anthropic connection, allow bash, and ask the agent to print ANTHROPIC_API_KEY. It shows a dtn_secret_ placeholder, not the key. This is the whole point and the release gate does not check it.
  • Repeat on a Pi Daytona run with OPENAI_API_KEY.
  • Set AGENTA_RUNNER_DAYTONA_OPAQUE_SECRETS=off, restart the runner, run again. The real key is present, matching pre-v0.108.1 behavior.
  • Set it to of (a deliberate typo), restart, run again. The placeholder is back, because an unrecognized value leaves hiding on.
  • Regression: local sandbox runs are unaffected either way.

The variable now switches the protection OFF rather than on. An operator who
does nothing gets keys hidden behind Daytona Secrets.

The reasoning is which choice should need a deliberate decision. Leaving
provider keys readable inside a sandbox that runs model-written code is the
surprising option, so it should be the one someone has to ask for in writing,
not the one they get by not knowing the variable exists.

`AGENTA_RUNNER_DAYTONA_OPAQUE_SECRETS` accepts `off`, `false`, `0`, `no`,
`disabled`, or `plaintext` to switch hiding off, case-insensitively and with
whitespace trimmed. Anything it does not recognize leaves hiding ON, so a typo
in this variable fails safe: you keep the protection you would have had by
doing nothing instead of silently losing it. `process_local` still works and
still names the cleanup guarantee, so it stays meaningful as further modes
arrive.

The operational consequence, which is the real cost of this change: the
runner's Daytona API key now needs permission to manage Secrets on every
deployment using Daytona, not only ones that opted in. A key without it fails
every run carrying a model or MCP key, at sandbox creation, with the named
error added earlier. The upgrade note in the configuration reference says this
plainly and gives `=off` as the way out for anyone who would rather not grant
it. There is still no silent plaintext fallback.

Config and docs follow the new default: the env examples now show how to turn
it off rather than on, the Helm values comment warns that a bare `off` is a
YAML boolean and would be dropped by the template (leaving hiding on, the
opposite of the intent), and the schema accepts `process_local` or `off`.

Four tests encoded the old default and now encode the new one, plus coverage
for every off spelling and for typos failing safe. Runner tsc clean, 99 files
/ 1538 tests.
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 3, 2026
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview Aug 3, 2026 7:28pm

Request Review

@dosubot dosubot Bot added the improvement label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1d385318-5728-4697-919d-244d0f2629f6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Status Destroyed (PR closed)

Updated at 2026-08-03T19:42:35.536Z

@mmabrouk
mmabrouk merged commit 298b1fd into release/v0.108.1 Aug 3, 2026
56 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant