Repository navigation
Add secretEnv and claudeHooks to session.launchContext - #446
Merged
Merged
Conversation
Extensions can now hand a launch secret variables whose values never reach argv, the tmux start command, logs or the graph: pane launches source and delete a 0600 file (copied into the container for devcontainer), headless launches get them in-process. Extensions can also add Claude PreToolUse and PostToolUse hooks, appended after core's own. Host API 1.62.0. Made with Agent Wrangler and the PortSwigger/wrangler-squared extension Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PortSwiggerRussell
requested review from
ClaireCooper,
charlie-ps and
psjamesh
as code owners
November 5, 2026 15:51
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.
Summary
Two additions to the
session.launchContexthook (host API 1.62.0):secretEnv: environment variables whose values never appear in argv, the tmux start command, logs, the graph or the mappings file.export NAME='value'lines to a 0600 file in<AW_DATA_DIR>/launch-secrets/. The pane command carries only the file's path, and the pane sources and deletes it before the agent starts.host.sessions.launchEnv, archive review): the values are merged into the child process env in-process.buildLaunchruntimes, cannot take secrets. Their variables are skipped and logged by name only, and theirwrapLaunchnever sees the values.envandsecretEnvis delivered as a secret only. Secrets are never cached inlastLaunchContext.claudeHooks:PreToolUseandPostToolUsegroups added to a Claude launch's--settings, after core's own. Core's PR-attachPostToolUsehook is kept and stays first. Codex ignores them. In a devcontainer, a hook under a directory granted withaddDirsis rewritten to the container copy.Documented in
docs/extensions.md, with limits: the agent's own environment is still readable by the same OS user, and keeping values out of agent output is the extension's job.Verification
npm test: 5144 pass, 0 fail. New tests:launchEnv.env. The value appeared in no pane command, process argv, log, data file or graph frame. The runningclaude's--settingsheld core'sPostToolUsehook and the extension'sPreToolUsehook, and the hook fired.Made with Agent Wrangler and the PortSwigger/wrangler-squared extension
🤖 Generated with Claude Code
Model: claude-opus-5-5