Repository navigation
fix(aichecks): hold AI runs with real secrets to a runtime host allowlist - #631
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #631 +/- ##
==========================================
- Coverage 83.66% 83.61% -0.05%
==========================================
Files 1267 1268 +1
Lines 129598 129703 +105
==========================================
+ Hits 108431 108455 +24
- Misses 21158 21239 +81
Partials 9 9
🚀 New features to boost your workflow:
|
…list The repair and generation loops decided whether a candidate script may run with the check's real secrets by scanning its text (ScriptHosts). A URL built at runtime (concatenation, a host read from a response, Object.values(env)) was invisible to it, so a prompt injection in page content could send the secrets to any host. Runner.Run now puts an egress.HostAllowlist on the context of every run that holds a real secret value: the previous script's hosts for a repair, the hosts the user named for a generation. The checkjs runtime checks it on the host name, before resolution, for http (redirects included), websocket, tcp/udp, rdp and vnc. browser.open() and solidping.* sub-checks dial outside its reach and are refused while it is active. A refused run is an error (host not allowed while secrets are loaded), so the candidate is refused and the refusal lands in the attempt event. The verification run uses it too. repair: auto no longer applies a candidate whose text shows no host while the previous version's did: scheduled runs carry no allowlist, so it is proposed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Also lint fixes for the allowlist change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ets to scripts whose hosts are only checked by regex Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ts to scripts whose hosts are only checked by regex Co-Authored-By: Claude Opus 5.5 <[email protected]>
fclairamb
enabled auto-merge (squash)
October 22, 2026 16:42
Merged
fclairamb
added a commit
that referenced
this pull request
Oct 22, 2026
🤖 I have created a release *beep* *boop* --- ## [0.41.0](v0.40.1...v0.41.0) (2026-10-22) ### Features * **email:** calmer emails that say why a check is down ([#623](#623)) ([8dd68d3](8dd68d3)) * run crawl and discovery as worker tasks from private locations ([#633](#633)) ([062fd99](062fd99)) ### Bug Fixes * **aichecks:** hold AI runs with real secrets to a runtime host allowlist ([#631](#631)) ([c09fdd1](c09fdd1)) * **checkdns:** stub the resolver in TestDNSChecker_Execute ([#630](#630)) ([cca1d88](cca1d88)) * **dash0:** drag-to-zoom on the Timing chart ([#617](#617)) ([931816c](931816c)) * **deps:** update github.com/dop251/goja digest to 07c4b9d ([#637](#637)) ([0170643](0170643)) * **deps:** update github.com/dop251/goja digest to 64adc8b ([#626](#626)) ([1efd502](1efd502)) * **deps:** update github.com/dop251/goja digest to 7b1a022 ([#619](#619)) ([d3adde9](d3adde9)) * **deps:** update go dependencies (non-major) ([#622](#622)) ([adb622c](adb622c)) * **deps:** update go dependencies (non-major) ([#627](#627)) ([dee2fd0](dee2fd0)) * **deps:** update go dependencies (non-major) ([#635](#635)) ([da717a5](da717a5)) * **deps:** update module github.com/a2aproject/a2a-go/v2 to v2.7.0 ([#625](#625)) ([bb8c7ae](bb8c7ae)) * **deps:** update module github.com/anthropics/anthropic-sdk-go to v2 ([#628](#628)) ([90f70c2](90f70c2)) * **deps:** update module github.com/fergusstrange/embedded-postgres to v2 ([#614](#614)) ([913ece9](913ece9)) * **email:** usage-cap email links to the platform upgrade page, not billing ([#632](#632)) ([abf3a68](abf3a68)) * **status-pages:** close a grouped check's entry when it recovers ([#615](#615)) ([d4d9b21](d4d9b21)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>
fclairamb
added a commit
that referenced
this pull request
Oct 23, 2026
…646) Fixes finding Q1 of the 2026-10-23 security scan (medium): the AI repair and generation loops could relay an encoded secret through the model to `fetch_page` or to a run without secrets. Scrubbing only removes exact matches, so this got past the runtime host allowlist from the P1 fix (#631). Spec: `specs/done/2026/10/2026-10-23-02-ai-loop-secret-relay-through-model.md`. ## What changed - Once a loop has made a run with real secret values, it is held to the check's own hosts: `fetch_page` only reaches those hosts, `browser_snapshot` is refused, and a blank-secrets `run_script` gets the same allowlist (repair and generation). - A refused host that was built at runtime is no longer named in the error the model sees. - Exact-match scrubbing stays as defence in depth. Comments, the P1 done spec and `web/docs/docs/features/ai-authored-checks.md` now say so. - Regression tests for the repair and generation paths and the refused host, with positive controls (a loop without a real-secrets run can still fetch any host; a repair on the previous host still runs with the real secret). - `origin/main` merged in. Behaviour change: after a real-secrets run, repair and generation lose `browser_snapshot` and any `fetch_page` outside the check's hosts for the rest of that loop. Batch gate: `make build-backend lint-back test` green. ## Decided by autopilot No open questions in the spec: the recommended proposal (1, plus 3 and 4) was implemented. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Fixes the open finding of the daily security scan of 2026-10-22 (P1, medium).
What changes
egress.HostAllowlist), checked by name before any DNS lookup. Repair allows the hosts of the previous script, generation the hosts declared in the prompt, contract and env.tcp.connect,udp.open, rdp, vnc.browser.open()andsolidping.*sub-checks are refused while it is active.HostNotAllowedError, even if the script reported up. The refused host is scrubbed of secret values and fed back to the model.ScriptHostsscan stays as an early refusal only.repair: auto: a candidate whose hosts cannot be read from its text, when the previous version's could, is proposed instead of applied.ai-authored-checks.md.Behavior changes
aichecks.Runner.Runtakes a newallowed []stringargument.Residual risk (follow-up)
With
repair: auto, a candidate that keepsenv.BASE_URLvisible but sends secrets to a runtime-built host only under a condition the verification run does not meet (a date,Math.random()) is still applied, and its scheduled runs carry no allowlist. This is the design the spec recommended. Closing it needs its own spec.Checks
make build-backend lint-back test: green.make test-postgres: green except a 10 min timeout indb/postgreson a loaded machine (load above 11), untouched by this PR; that package passed alone in 478 s.Decided by autopilot
No open question to answer.
🤖 Generated with Claude Code