Skip to content

Translation in progress Some entries still include text in the original language.

EventPast event

In testing, Claude Code read .env secrets in all 24 cases when unconfigured

1 reports1 reporting sourcesLatest report

Start here

AI overview

On October 18, 2026, a Qiita author published a hands-on test: using Claude Code 2.1.300 and Sonnet 5.5 on macOS, they ran 48 headless-mode tests, using a fake key CANARY to check whether .env contents entered the model context. With no protections at all, all 24 runs read it in, and the auto mode's permission classifier did not block in-project .env reads even once; with only permissions.deny added, 4 of 12 runs leaked, with the leaks occurring via wildcard grep searches and via error messages when running app.py.

Generated by AI from reports · Updated 2026-10-20

Progress timeline

Oct 18
  1. Qiita
    In testing, Claude Code read .env secrets into context in all 24 runs when unconfigured

    A Qiita author ran 48 headless-mode tests on macOS with Claude Code 2.1.300 and Sonnet 5.5, using a fake key CANARY to check whether .env contents would enter the model context. With no protection at all, it was read in all 24 runs, and the auto mode's permission classifier never once blocked reading the project's .env. With only permissions.deny added, 4 of 12 runs leaked, in cases using wildcard grep searches and when running app.py caused error messages to expose the connection string. With the sandbox added, there were zero leaks in 12 runs, but app.py also could not read .env due to Operation not permitted, making the practice of having AI run and debug the app ineffective. The author also found that the sandbox did not inherit Read(![

Related discussion

Total 1 items