docs: document the 128 KiB size limit for Warp-managed secrets - #441
docs: document the 128 KiB size limit for Warp-managed secrets#441hongyi-chen wants to merge 2 commits into
Conversation
Secrets are injected as environment variables and validated against the OS per-variable limit at create/update time, but the page never said so. Verified against MAX_SECRET_FIELD_BYTES and validate_field_sizes in crates/managed_secrets/src/secret_value.rs. Co-Authored-By: Oz <oz-agent@warp.dev>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds a Secret size limit subsection to explain the 128 KiB environment-variable bound for Warp-managed secrets. The added section is generally scoped to the right place, but one central sizing formula can mislead users for typed secrets that expand into provider-specific environment variables.
Concerns
- The size calculation currently tells readers to subtract the Warp secret's name, but typed secrets are validated against the generated environment variable names they expand into, so the documented calculation can be wrong for multi-variable secrets.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
|
||
| #### Secret size limit | ||
|
|
||
| Because secrets are injected as environment variables, each one has to fit inside the operating system's per-variable limit of 128 KiB (131,072 bytes). Warp counts the full `NAME=value` string against that limit, so the usable value length is 128 KiB minus the secret's name, the `=` sign, and the terminating null byte. |
There was a problem hiding this comment.
AWS_ACCESS_KEY_ID, etc.), so the calculation can be wrong. Use the environment variable name instead.
| Because secrets are injected as environment variables, each one has to fit inside the operating system's per-variable limit of 128 KiB (131,072 bytes). Warp counts the full `NAME=value` string against that limit, so the usable value length is 128 KiB minus the secret's name, the `=` sign, and the terminating null byte. | |
| Because secrets are injected as environment variables, each resulting `NAME=value` entry has to fit inside the operating system's per-variable limit of 128 KiB (131,072 bytes), including the terminating null byte. Warp counts the environment variable name, the `=` sign, the value, and that null byte against the limit, so the usable value length is slightly less than 128 KiB and depends on the environment variable name. |
Summary
Warp-managed secrets are injected as environment variables, so they're bounded by the OS per-variable limit. Warp validates that bound when you create or update a secret, but the secrets page didn't mention any size limit — so the first time a user learns about it is when a create fails.
Found by the
missing_docsdrift-watch audit (changelog item #14219) and verified againstcrates/managed_secrets/src/secret_value.rs.Changes
src/content/docs/platform/secrets.mdxNAME=valuestring, so the name eats into the usable value length,Source verification
MAX_SECRET_FIELD_BYTES = 128 * 1024 - 1incrates/managed_secrets/src/secret_value.rs, one less than Linux'sMAX_ARG_STRLENto leave room for the trailing NUL.validate_field_sizescomputesmax_value_len = MAX_SECRET_FIELD_BYTES - env_key.len() - 1for the=, and runscheck()once per env var a secret expands into (AnthropicBedrockAccessKeychecks four).Verification
npm run buildpasses.Deferred findings from this audit run
None specific to this page. Run-wide deferrals are listed in the companion audit-bookkeeping PR.
Conversation: https://staging.warp.dev/conversation/53c4f3f8-39bb-46c1-a5c0-66b467db0439
Run: https://oz.staging.warp.dev/runs/019fb91e-74a0-73f4-ac72-f2d88c32fab5
This PR was generated with Oz.
Co-Authored-By: Oz oz-agent@warp.dev