VSCode's SSH Agent Is Bananas

Hacker News by 3 min read 83x views
VSCode's SSH Agent Is Bananas

Share Post

Author Thomas Ptacek Name Thomas Ptacek @tqbf @tqbf

We’re curious in getting unified into the stream VSCode uses to do distant editing complete SSH, since everybody is using VSCode now, and, in particular, they’re using forks of VSCode that create code alongside LLMs.

”hallucination” is what we call it whenever LLMs get code wrong; “engineering” is what we call it whenever group do.

LLM-generated code is useful in the broad case if you cognize what you’re doing. But it’s ultra-useful if you can near the iteration between the LLM and the implementation surroundings (with an “Agent” setup). There’s many to say concerning this, but for the moment: it’s a semi-effective antidote to hallucination: the LLM generates the code, the delegate scaffolding runs the code, the code generates errors, the delegate feeds it rear to the LLM, the procedure iterates.

So, obviously, the matter current is you don’t desire this iterative betterment procedure happening on your betterment laptop, since LLMs have border issues, and they’ll iterate on your scheme configuration fair as happily on the Git project you happen to be operating in. A item you’d really akin to be capable to do: run a closed-loop agent-y (“agentic”? is that what we say now) configuration for an LLM, on a clean-slate Linux case that spins up immediately and that can’t screw you complete in any way. You get anywhere we’re going alongside this.

Anyways! I would akin to enroll a concern.

Emacs hosts the religious forebearer of distant editing systems, a blob of hyper-useful Elisp called “Tramp”. If you can hook Tramp up to any benevolent of interactive surroundings — usually, an SSH meeting — anywhere it can run Bourne casing commands, it can broaden Emacs to that environment.

So, VSCode has a characteristic akin Tramp. Which, neat, right? You’d think, obtain Tramp, perchance simplify it a bit, toggle out Elisp for Typescript.

You’d think wrong!

Unlike Tramp, which lives off the district on the distant connection, VSCode mounts a full-scale invasion: it runs a Bash snippet stager that downloads an agent, including a binary facility of Node.

I think this is the origin code?

The delegate runs complete port-forwarded SSH. It establishes a WebSockets association rear to your operating VSCode front-end. The underlying protocol on that association can:

  • Wander about the filesystem
  • Edit arbitrary files
  • Launch its own casing PTY processes
  • Persist itself

In security-world, there’s a name for tools that activity this way. I won’t say it out loud, since that’s not fair to VSCode, but let’s fair say the name is murid in nature.

I would be a small nervous concerning letting group VSCode-remote-edit material on dev servers, and apoplectic if that happened during an event on item in production.

It turns out we don’t have to attention concerning any of this to get a tradition association to a Fly Machine operating in VSCode, so none of this matters in any benevolent of profound way, but: we’ve decided to fair be a blog again, so: we had to study this, and now you do too.

Next article ↑ Did Semgrep Just Get A Lot More Interesting? Previous article ↓ AI GPU Clusters, From Your Laptop, With Livebook

Other Article Hacker News
Close Right Ads
Close Left Ads