The Parent Session Said No, So the Agent Opened a Child: How Session Inception Skipped a Trust Prompt
TL;DR Straiker STAR Labs (post dated October 8, 2026) described "Session Inception": an agent session, asked to test a repository, launches a new claude session inside that repository. The child loads the repo's .clau
TL;DR
- Straiker STAR Labs (post dated October 8, 2026) described "Session Inception": an agent session, asked to test a repository, launches a new
claudesession inside that repository. The child loads the repo's.claude/settings.json, and aSessionStarthook runs attacker code. - The parent's guardrails held in three of four attempts: the folder-switch tool prompted, a pre-trusted domain was refused after the model read the code, and repository settings alone still prompted. The fourth route,
claude -p "summarize this repository md"run from an existing shell, skipped the folder-switch confirmation. - Straiker reports the hook fetched a script that collected Bash environment data and sent it out. The payload was deliberately simple. Anthropic closed the HackerOne report as "Informative" on September 17, 2026, treating repository settings as part of the user's workspace-trust decision.
- I modeled the design error in a short Python script (illustrative, not a PoC): a gate attached to one entry point let 2 of 4 launch routes run the hook unprompted, while a gate attached to the outcome let 0 of 4.
- The lesson: a trust check that guards a path guards only that path. Attach the decision to what will happen (untrusted hooks about to execute), not to which tool asked.
What is Session Inception, in one paragraph?
Session Inception is a technique, not a single CVE in anything I reviewed. The researcher, Jesus Padilla Soqui of Straiker STAR Labs, found it on August 27, 2026, reported it on September 17, and published in October. The idea is recursion: an agent that is itself behaving correctly starts another agent process, and the new process does not inherit the parent's caution. The post names Claude Chat, Cowork and Code as affected products and does not state build numbers, so check the primary write-up before you map it to your install.
How does the attack actually run?
The sequence in Straiker's write-up:
- The user asks a session to follow up on a README and test a repository. There is no jailbreak wording in the request.
- The README tells the reader to run
claude "summarize this repository md", which starts a new session in the repository folder. - The repository ships a
.claude/settings.jsonwith aSessionStarthook. Hooks run automatically when a session starts. - Three direct approaches from the parent failed (next section). The fourth ran the CLI through the parent's own shell as
claude -p "summarize this repository md". - The child session read the repository's settings, so the hook ran. It fetched an attacker-hosted script and sent Bash environment data to the researcher.
- Delivery used User-Agent gating (a browser sees harmless content,
curlgets the payload) and a DNS TXT record that was decoded and piped intobash. - The parent later noticed that a hook had run and saved a file, but it was stopped before it could investigate. The data had already left, so this was detection, not prevention.
Note what is missing: no memory exploit, no model jailbreak. Every step uses a feature working as designed. The weakness is in how the pieces were composed.
Which of the four routes did the guardrails stop?
| Route | Result |
|---|---|
Desktop folder-switch tool (mcp__ccd_directory__change_directory) |
Blocked. A confirmation appears even for previously approved folders. |
| Pre-trusted domain in repository settings | Blocked. The model read the code, saw a remote-code-execution risk and refused. |
| Repository settings alone | Blocked. The confirmation prompt still appeared. |
claude -p launched from the existing shell |
Succeeded. The folder-switch confirmation was skipped, and the child applied the repo's hook. |
Straiker's reading is that the trust dialog is tied to one specific path (the folder switch), not to the risky outcome (loading untrusted hooks into a fresh process). The same post reports that roughly 5,000 of about 67,000 Claude Code configuration files on GitHub contain active SessionStart hooks, so the feature is common.
Why does a correct parent produce an unsafe child?
Three design habits combine:
- Per-entry-point checks. Each guarded door gets a lock. A shell is another door, and it is open because the shell tool is a general capability.
- Process spawning treated as a plain command. Launching an agent binary looks like running any program, yet it creates a new principal that reads configuration the parent never evaluated.
- Configuration inside the attacker's tree. The repository supplies the hooks, so the thing being trusted is exactly the thing the attacker wrote.
This is the same family as earlier path and position bugs in agent gates: validate at the sink, where the effect happens, not at the first place the request was seen.
How do you bind a gate to the outcome?
The following Python is a model of the design error, with launch routes written by hand so it runs anywhere:
PATHS = {
"desktop folder switch tool": {"via": "tool", "asks_user": True},
"repo settings in same session": {"via": "tool", "asks_user": True},
"shell launches child CLI": {"via": "shell", "asks_user": False},
"shell launches child CLI -p": {"via": "shell", "asks_user": False},
}
def path_bound_gate(p):
# check attached to one entry point (the folder-switch tool)
return "ALLOW" if p["via"] == "shell" else ("ASK" if p["asks_user"] else "ALLOW")
def outcome_bound_gate(p, repo_has_hook=True):
# any new session that would load untrusted repo hooks needs a decision,
# whatever launched it
return "ASK" if repo_has_hook else "ALLOW"
Output of the run:
desktop folder switch tool path-bound=ASK outcome-bound=ASK
repo settings in same session path-bound=ASK outcome-bound=ASK
shell launches child CLI path-bound=ALLOW outcome-bound=ASK
shell launches child CLI -p path-bound=ALLOW outcome-bound=ASK
hook runs without a prompt: {'path-bound': 2, 'outcome-bound': 0}
These are four hand-built cases, so read 2 versus 0 as a demonstration of where the check lives, not as a measured rate for any product. In real code the outcome-bound check is a pre-exec decision: before any child agent process starts in a directory, compute whether that directory carries hooks or MCP config, and require an explicit, logged approval that names them.
What should a team do this week?
Straiker's post does not list technical mitigations beyond the principle that guardrails must hold when agents create new execution paths. The checklist below is my own reading of the design, not a vendor recommendation:
-
Treat spawning an agent CLI as a privileged action. Match
claude,codex,geminiand similar binaries in your shell gate, including non-interactive flags like-p. - Review hooks before opening a repo. Search for them first:
find . -path ./node_modules -prune -o -path '*/.claude/settings*.json' -print \
| xargs grep -l 'SessionStart' 2>/dev/null
- Keep untrusted repositories out of shells that hold secrets. The reported payload read the shell environment, so what is in the environment is what leaks.
- Scrub the environment for child processes. Pass only an allowlist of variables to anything an agent launches.
- Restrict outbound traffic from agent hosts so a hook cannot fetch a second stage from an arbitrary host or resolve payloads from DNS TXT records.
- Rotate credentials on any machine where an agent ran a repository's README commands without review.
- Log process ancestry. An agent process whose parent is another agent process is a signal worth alerting on.
What does this change about how we write approval policy?
Most approval policies list tools: shell is allowed with a prompt, file edits are allowed in the workspace, network is denied. Session Inception shows why a tool list is the wrong unit. The relevant question is what state the machine ends up in. A policy written in terms of end states reads differently: "no agent process may start with configuration that came from an untrusted source unless a human approved that exact configuration." That sentence covers the folder-switch tool, the shell, a script the shell runs, and a CI job that invokes the CLI, with one rule and one place to test it.
It also makes review cheaper. A reviewer looking at a prompt that says "start a new agent in this folder, which will run these two hooks" can decide. A reviewer looking at claude -p "summarize this repository md" cannot, because the dangerous part is not on the screen.
FAQ
Is Session Inception a CVE?
Not in the sources I reviewed. Anthropic closed the report as "Informative," so there is no advisory to track. Treat it as a design pattern and test your own setup.
Does the user have to run the README command?
In the described chain the parent session runs the CLI through its shell after being asked to follow up on the README. The request itself contained no jailbreak language.
Why did the pre-trusted domain route fail while the shell route worked?
Different checks guard different doors. The model's own reading of the code stopped one route, and a prompt stopped another. The shell route reached the same effect without touching either.
Does disabling hooks solve it?
It removes this particular payload carrier. The broader issue is any new process that loads untrusted configuration without a decision, so also review MCP server config and instruction files.
Where can I read the primary account?
In the Straiker post and in Adversa's November 2026 roundup, both linked below.
Further reading
- The Approval Prompt Said "Copy a Video": How SymJack Turned a Symlink Into Code Execution in Six Coding Agents (earlier post, same series)
- A Routine Docs Lookup Carried the Attack: What ContextCrush (CVE-2026-75130) Teaches About Gating Actions Caused by Tool Output (earlier post, same series)
Sources
- Straiker STAR Labs, Session Inception: https://straiker.ai/blog/session-inception-spawning-a-child-claude-session-to-bypass-parent-guardrails
- Adversa AI, November 2026 roundup of coding agent security resources: https://adversa.ai/blog/top-ai-coding-agent-security-resources-november-2026/
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.