2 examples that come to mind are wuffs and wasm2c. Both produce C code that can be shown to be safe due to the properties of the code generator and its input language.
I am not sure LLM output is amenable to same kind of analysis, but you could conceive of an LLM trained on exclusively safe code.
A) “safe” languages at compile time or run time can avoid vulnerabilities
B) it is possible for a human to code safe patterns in an unsafe language (human error notwithstanding)
C) an LLM can detect patterns even adapt to an individual coder’s style
And then conclude:
There’s no possible way an LLM in real time can detect known vulnerability-causing patterns and recommend safe patterns
I’ll wait…
Concerning an IDE: you vision apparently doesn't reach far enough; imagine AI tools which are able to understand both, the requirements and the code, and are able to recognize logic deviations and other unmitigated risks. Btw. Rust is far from "actually-safe"; it helps avoid some memory issues (not all), but there is still a wide range of possibilities to create safety issues, even in Rust.
Now, the techno-mysticism will eventually become true when we get the AGI you describe but that’s both far beyond what we have now and would immediately raise the question of whether it’d be effort better spent migrating to a less poorly-designed language.