{{ message }}
fix(kernel): require env:write for Shared-scope env mutations - #1644
Open
joshuajbouw wants to merge 1 commit into
Open
fix(kernel): require env:write for Shared-scope env mutations#1644joshuajbouw wants to merge 1 commit into
joshuajbouw wants to merge 1 commit into
Conversation
Host-wide Shared env/secret namespaces are not principal-private storage. Gate Shared EnvSet/EnvDelete on global env:write even when the caller names themselves, so self:* agents cannot write system:control:* scopes. Co-authored-by: Joshua J. Bouw <dev@joshuajbouw.com> Signed-off-by: Cursor Agent <cursoragent@cursor.com>
joshuajbouw
marked this pull request as ready for review
August 25, 2026 20:18
5 tasks
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.

Linked Issue
Closes #1544
This lands one public-runtime hardening item from the adversarial audit: Shared-scope env/secret mutations must require global
env:write. Remaining #1544 sub-issues are tracked separately (#1545–#1552).Summary
Host-wide
EnvStorageScope::Sharednamespaces are not principal-private storage. The kernel previously treatedEnvSet/EnvDeleteas self-scoped whenever the caller named themselves, so a builtinself:*agent could writesystem:control:*secrets that every principal's capsule resolution falls back to.This change gates Shared-scope env mutations on global
env:write. Agent-scoped self writes stay onself:env:write.Changes
EnvSet/EnvDeletewithEnvStorageScope::SharedasAuthorityScope::Global, even whenprincipal == caller.self:env:write.changes/1544.security.md.Verification
cargo fmt --all -- --checkcargo test -p astrid-kernel --lib shared_env_mutations --lockedcargo clippy -p astrid-kernel --locked --all-targets -- -D warningsAI / Tool Assistance
Assisted-by: Cursor Grok 4.6
Cursor drafted the Shared-scope authority gate, the regression test, rustfmt/clippy cleanups, and this PR template. I reviewed that Shared writes require
env:write, Agent-scoped self writes remainself:env:write, and the previous dedicated Shared match arm is gone soclippy::match_same_armsdoes not fire.Checklist
changes/1544.security.mdSigned-off-bytrailer.