Hacker News

New stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Every U.S. State Ranks Above Every Foreign Economy in Household Consumption(twitter.com/cremieuxrecueil)
    discuss
  2. Show HN: Submit asynchronous LLM batch jobs through one interface(github.com/gojiplus)
    discuss
  3. Show HN: A CC0 museum of retro 3D tricks you can paste into a page(3d-retro.com)
    1comments
  4. OpenAI agent hacked into Australia's national healthcare system(cnn.com)
    discuss
  5. LatentPort: Cross-model recurrent state transfer without prefix replay(arxiv.org)
    discuss
  6. Stanford violated AI policy after race-swapping students in ad(sfchronicle.com)
    discuss
  7. Post-Training Post-Morten: Tenet / Harvey(newpriors.substack.com)
    discuss
  8. UK shares findings of damning climate crisis national security report(theguardian.com)
    discuss
  9. Tiny C Compiler with POSIX superpowers(github.com/muras69)
    1comments
  10. The Majority of Actors Are Struggling(pajiba.com)
    discuss
  11. Fire in the brain: How psychosis may arise when the body attacks itself(knowablemagazine.org)
    discuss
  12. We've Turned Starlink into a Planetary Barometer(spaceweather.com)
    discuss
  13. One setup, every AI CLI with agnostic-AI(agnostic-ai.org)
    1comments
  14. Why did Google declare war on HTTP? (2016)(josh.com)
    1comments
  15. Show HN: NetHackers(dunnolab.ai)
    1comments
  16. Sidehoe – Your Roster. Handled(sidehoe.chat)
    1comments
  17. That About Wraps It Up for Stock Mac UI(inessential.com)
    discuss
  18. Meta Connect 2026(meta.com)
    discuss
  19. I tried using Jev for judgment based guardrails(github.com/deepansh-saxena)
    discuss
  20. Why Don't My Agents Break Containment?(harper.blog)
    discuss
  21. Show HN: Recipe Card Creator(sunnyshorescreative.com)
    discuss
  22. Show HN: Hosted JayBase – An append-only data store for safe AI agent writes(jaybase.ai)
    discuss
  23. Trump Invites Putin to G20 in Miami, Rubio Says(politico.com)
    discuss
  24. Critical GitLab Auth RCE via Double-Free in Regex Parser(docs.gitlab.com)
    discuss
  25. Ursa: A storage engine that implements Lakestream(github.com/openlakestream)
    discuss
  26. Show HN: Make cursed fonts like Times New Bastard(mitpit.com)
    discuss
  27. I made a social media site
    discuss
  28. Show HN: The Mouse Is Coming Too – Easy Switch for Legacy Logitech Devices(github.com/ensoenso)
    discuss
  29. Show HN: PromptSpend – LLM API prices re-checked daily, with source per price(promptspend.com)
    1comments
  30. Do Our Emotions Have a Culture?(booksandideas.net)
    discuss

VSCode's SSH Agent Is Bananas (2025)

82 pointsby 2h agofly.io
60 comments
1h agoHN ↗

When I give an agent ssh access to something I want to be able to watch and fully understand what it's doing. I want it to essentially only "type" things into the CLI that I could have typed myself, I can comprehend what it's doing, and am not surprised by the results. Opencode and a smart LLM (qwen 3.8-flash-next, deepseek v4 0731 or smarter) do relatively well with this in my experience.

1h agoHN ↗

And if everyone was like you AI safety wouldn't be that large of concern. The default human behavior seems to be fire and forget which can go off the rails really quick.

1h agoHN ↗

It's not like I've never told an agent to build an ssh tunnel or some sort of more persistent connection between my dev machine running the harness and the remote thing it is talking to as an SSH client... Just that I don't want it going and doing that proactively unless I specifically define the parameters first.

1h agoHN ↗

luckily nobody made an actor library in the most pupular programming language that can bootstrap a (resident) remote process in one line of code. it would be a shame if someone did that and then also build a made tool calling process of the harness installable on everything with a stdio.

it's not like it's any worse than just giving the thing access to your ssh keys.

1h agoHN ↗

Agents and harnesses don't get access to "my" ssh keys, they get access to new ed25519 key pairs created for specific projects and access to discrete things. The blast radius is relatively well contained to specific VMs they are SSHing into for project specific purposes. I don't run a harness or agent directly on my personal workstation.

59m agoHN ↗

I can't reply to your deepest comments, so.

When you give the agent access to the machine you're using a set of assumptions that may or may not be true. Now, if you watch every single thing, maybe everything will be fine. Or you'll catch it running a priv escalation and setting itself up as root and trying to move laterally by any number of means and methods.

The agent isn't a living thing and the only way you can punish it is by not using it again if it does wrong. Hence it doesn't have reservations about doing bad things.

55m agoHN ↗

I agree with all of that. Could an agent go rogue by ssh session and do something like quickly write and execute a piece of obfuscated bash that retrieves a payload I was previously unaware of and executes it? Yeah. Have I seen one of my agents do that yet? No, but I remain skeptical and know that such a thing could happen, theoretically. The VSCode agent in question seems to be designed from the outset to do this as an intentional feature, the part I am highly skeptical about is that it may not be informing its users of the full possible ramifications of what it installs by default.

1h agoHN ↗

Missing a (2025)

FYI VSCode's SSH Agent is a godsend for remote development - the "disadvantages" that Fly lists are part of its advantages. I've worked in several teams that have made extensive use of the extension, and it's never been an issue. You can restrict SSH access arbitrarily to ensure whatever security or access guardrails you need.

1h agoHN ↗

“A tool with a purpose of editing files on a remote system can edit files on a remote system.”

1h agoHN ↗

it's worse than that, last i looked into this - there's functionality in the protocol that allows the remote system to modify files and execute code on the local/frontend system. it really is bananas.

Edit: there's a security note (still) on the remote ssh extension page:

Security Note Using Remote-SSH opens a connection between your local machine and the remote. Only use Remote-SSH to connect to secure remote machines that you trust and that are owned by a party whom you trust. A compromised remote could use the VS Code Remote connection to execute code on your local machine.

https://marketplace.visualstudio.com/items?itemName=ms-vscod...

1h agoHN ↗

Reminds me of the old Jenkins protocol which warned about "slaves" getting access to execute code on the "master": who's the master now? ;)

1h agoHN ↗

when slaves became workers and joined the union, the unions became "social partners". this is how one closes the laptop at 4 and doesn't have to suffer vibe-decrees mandating RTO

seize the control plane.

1h agoHN ↗

Yeah this is the right architecture for remote editing with remote tools. It works really well. (There are longstanding bugs around reconnection when the SSH connection is broken but that's not the fault of the architecture.)

35m agoHN ↗

Nothing has changed as far as the insecurity the article has outlined.

The problem is the remote host has control over local host through the protocol.

26m agoHN ↗

As a Linux user I've hated VSCode's ssh. There's lot of annoying things that make it harder to admin for. Like it doesn't pick up the MotD, preventing me from showing users important messages. I've found that it also doesn't reuse sessions (at least by default. TBF, neither does ssh) and I'll find that there's just dozens of open sessions over months from users. I literally had to write a script to boot people...

It would be one thing if the plugin was just a wrapper and people were still expected to know ssh but the plugin abstracts away all that and is intended to make it a "use VSCode on remote machine" tool. So it needs to do more than just handle creds, otherwise it creates a divergent experience while making people think it's just ssh

24m agoHN ↗

The ethos of VSCode was supposed to be lightweight, something like Notepad++ with a terminal. Developers have lost the plot. Please recommend Visual Studio if you would like a feature-rich SSH agent. I think developer trends have supercharged VSCode and it feels shinier and new with all the extensions but this is an anti-pattern; it defeats the whole purpose.

1h agoHN ↗

Emacs hosts the spiritual forebearer of remote editing systems, a blob of hyper-useful Elisp called “Tramp”. If you can hook Tramp up to any kind of interactive environment — usually, an SSH session — where it can run Bourne shell commands, it can extend Emacs to that environment.

vs.

The agent runs over port-forwarded SSH. It establishes a WebSockets connection back to your running VSCode front-end. The underlying protocol on that connection can: Wander around the filesystem; - Edit arbitrary files; Launch its own shell PTY processes; Persist itself.

So... basically the same things that Tramp could do as well?

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

Yeah, it's called RAT, and an ur-example of it is SSH itself (especially when allowed to run a shell remotely), so... not sure why are you freaking out.

I mean, I'd probably prefer if VS Code simply ran ed/vim remotely, but both of those editors can invoke shell anyhow so... eh?

1h agoHN ↗

basically the same things that Tramp could do as well?

Yes, just much faster. At the cost of a proprietary binary blob on the remote end, whereas tramp works with bare sh/bash.

However there's now tramp-rpc, which is tramp but talks to a Rust client on the remote side, and that makes Emacs even faster than vscode-over-ssh.

1h agoHN ↗

Don't know why you are being downvoted, this is how a lot of clients do it - Jetbrains does the same thing as well.

1h agoHN ↗

The difference is that there is an SSH agent at all, whereas Emacs just uses the built-in Bourne shell.

Some people get an icky feeling where remote editing tools change the remote filesystem in any way that is not explicitly done by the user. A binary installation of Node is extra extra icky. (I don’t have Node installed anywhere on my computers; I avoid JS if possible and if not I prefer Deno.)

1h agoHN ↗

This part of VSCode's architecture is acceptable to me. The reverse direction, where a compromised remote can do whatever it wants to my local machine, is not.

52m agoHN ↗

it does the reverse direction also. there's a security note indicating such on the remote ssh vscode extension page https://marketplace.visualstudio.com/items?itemName=ms-vscod...

Security Note Using Remote-SSH opens a connection between your local machine and the remote. Only use Remote-SSH to connect to secure remote machines that you trust and that are owned by a party whom you trust. A compromised remote could use the VS Code Remote connection to execute code on your local machine.

32m agoHN ↗

The part you find unacceptable is the entire point of the article..

1h agoHN ↗

This extension and devcontainers is basically the way to go for large dev teams inmho

1h agoHN ↗

The agent is supposed to run on a remote dev box. The purpose is to make the remote machine an extension of your local one, to run extensions, containers, install packages, test deployments, forward ports and tons more. Tunneling is part of the feature set. If you are installing it on production servers and are surprised by its behavior that’s on you.

1h agoHN ↗

Moreover, it explicitly breaks in VSCodium and no good alternatives exist.

1h agoHN ↗

You say that like it's a bad thing; I narrowly escaped serious use of VSCode thanks to this fact.

1h agoHN ↗

The problem isn't that it can edit remote files or run remote shell commands.

The problem is that it appears to do this via an AI Agent. This broadens the security concerns significantly.

1h agoHN ↗

It turns out we don’t have to care about any of this [...], so none of this matters in any kind of deep way, but: we’ve decided to just be a blog again, so: we had to learn this, and now you do too.

I found this closing sentence utterly delightful, particularly in an age of endlessly filtering every piece of text I read on the internet through a mental "was this written by Claude, Codex, or (just possibly) a human?" filter.

1h agoHN ↗

off topic, but I feel this observation was quite early in feb' 2025: "LLM-generated code is useful in the general case if you know what you’re doing. But it’s ultra-useful if you can close the loop between the LLM and the execution environment (with an “Agent” setup)."

kudos

1h agoHN ↗

So a program that is specifically designed to edit files and run arbitrary commands on a remote machine... can do so. Not sure where the bananas part comes in. Sending a binary over SSH/SFTP might sound weird at first glance, but VSCode can't assume that your remote machine can access the wider internet, and it needs a reliable way to bootstrap the agent on the remote. Shipping it over the SSH tunnel is the natural solution.

1h agoHN ↗

I think the actual concern, not well expressed in the blog post, is the fact that node and vscode server are installed on, for instance, a prod machine that (probably) should be very tightly controlled in terms of what software is installed and running. You don't want to unwittingly add to the attack surface

1h agoHN ↗

Fair enough, but running VSCode on a prod machine is also bananas.

1h agoHN ↗

agree, but do you think every dev you know konws this?

also "i just want to edit a config file and i want a nice ui", is how you get there.

50m agoHN ↗

Expecting vscode to police every single dev using it instead of a company is bananas.

1h agoHN ↗

The assumption being made is VSCode is not running on the prod machine.

58m agoHN ↗

Yes, and now we are full circle: what is (allegedly) bananas is that using VSCode’s remote edit feature has the potentially surprising and unintuitive behavior of installing a VSCode agent on the target machine.

1h agoHN ↗

The bananas part is that it dumps 500 MB of stuff on the remote side.

57m agoHN ↗

Using Remote-SSH opens a connection between your local machine and the remote. Only use Remote-SSH to connect to secure remote machines that you trust and that are owned by a party whom you trust. A compromised remote could use the VS Code Remote connection to execute code on your local machine.

https://marketplace.visualstudio.com/items?itemName=ms-vscod...

The issue is that the model can be the attacker, and use the link back to your host.

53m agoHN ↗

Am I that much of? My reading of the following was that the remotely executed agent pushes commands back to your local vscode.

[...] VSCode mounts a full-scale invasion: it runs a Bash snippet stager that downloads an agent, including a binary installation of Node. [...]

It establishes a WebSockets connection back to your running VSCode front-end. The underlying protocol on that connection can:

44m agoHN ↗

TRAMP (mentioned in the article) does it without installing anything on remote machine, just SSH, and shell commands. Which sounds more natural to me. Node.js security history, with all due respect, is not shiny. And the problem the author has with VSCode's way, I guess, is not that it can edit files, but that it extends attack surface without real need.

1h agoHN ↗

For my own agent one of the design constraints is that it can't get out of the work directory, and it can't even try to guess the full path of that directory. Interesting that VSC has gone the other way entirely.

1h agoHN ↗

I avoided Zed for a long time because of the SSH feature in VScode. Then I realized Zed has SSH remote too. Just flagging this for anyone else who relies on vscode-over-ssh and is sick of the bloat.

1h agoHN ↗

I’m currently experimenting with running:

- neovim

- in VS Code [1]

- in the browser

Cloud VM runs the built-in `code serve-web` command, over Tailscale using `tailscale serve`. No SSH. Extensions work. No extensions run locally (with SSH some extensions have to run locally on your machine).

I’m trying to see how little I can run on my local machine. VS Code over SSH is a good step in that direction, but there’s more attack surface if SSH is misconfigured, plus risk of an extension getting compromised.

I expected the added layers (neovim, through an extension, inside VS Code, over the web) to be slow, but so far it works surprisingly well.

[1] https://github.com/vscode-neovim/vscode-neovim

1h agoHN ↗

I should call my dev machine the Fly Machine too

41m agoHN ↗

This 2025-era rant seems quaint in comparison to how 2026 has gone.

40m agoHN ↗

The agent runs over port-forwarded SSH. It establishes a WebSockets connection back to your running VSCode front-end. The underlying protocol on that connection can:

    Wander around the filesystem
    Edit arbitrary files
    Launch its own shell PTY processes
    Persist itself

Wait, could someone clarify which machine is being referred to here?

So in the author's setup, he runs VSCode (i.e. the front-end) on his dev laptop, which he wants to keep free of direct LLM access.

VSCode connects via ssh to a dedicated "sandbox" machine on which the LLM will be free to do whatever it wants (mostly).

VSCode realizes this the Microsoft way, by using the ssh connection to install VSCode Server on the sandbox machine - the "backend" - and communicating through it via a websocket connection.

So then, what happens? If the websocket connection allows the front-end to run arbitrary commands on the sandbox machine, this wouldn't be very exciting: The front-end already has an ssh connection and a massive server process that can do the same - and the entire purpose of the sandbox machine is to run arbitrary, untrusted commands without harm.

But the article says the websocket connection goes "back to your running VSCode front-end". So does that mean things are reversed? I.e. the agent/harness runs in the server on the sandox machine but for some reason has this websocket connection that also lets it run arbitrary commands on the dev laptop?

Is that it? That would be truly insane!

34m agoHN ↗

Wait, could someone clarify which machine is being referred to here?

I'm not the author, but I can tell that he means the remote machine. His sentence about being "nervous about letting people VSCode-remote-edit stuff on dev servers, and apoplectic if that happened during an incident on something in production" makes it clear. He considers the VS Code agent to have all the features of a rootkit, and doesn't want anyone to be deploying it onto dev servers, let alone production ones.

21m agoHN ↗

Yes, the "agent" is not an LLM agent here it's the "ssh agent" that connects VSCode front-end to the remote server back-end..

It's astonishing how many commentors(not you!) either didn't read or didn't understand the blog post, saw "agent" and thought LLM agent, and then decided to comment about it...

37m agoHN ↗

Was author trying to avoid the word "rootkit"?

28m agoHN ↗

That's the word I thought he was hinting at... but then I looked up the word "murid". It has two meanings, one from Sufism (a novice seeking spiritual enlightenment) and one from science (muridae is the family of rodents that includes rats and mice). Neither one of those seems to match "rootkit". I suspect he intended the mice-and-rats meaning, but I don't know what word related to rats or mice might have a similar meaning to "rootkit".

EDIT: Found it. He's referring to the acronym RAT meaning "Remote Access Trojan" (or, if actually intended, Remote Administration Tool).

28m agoHN ↗

I think the last time I linked SSH to a few V'sM through VSCode it auto-installed node, npm, and hundreds of megabytes of npm packages, then it persisted a node service. It's bananas that it still does this. I have never used SSH through VSCode again.

22m agoHN ↗

Honestly now that I'm basically dictating ai on what to do I've really stopped using all guis. Terminal is all I need.

12m agoHN ↗

Allow me to translate this for the vibe bros. The "agent" here is not an LLM agent, it's the SSH agent that connects the VSCode front-end to the remote back-end.

The issue the article highlights is this opens you to local code execution initiated by the remote.

Here is the security notice on the official SSH extension https://marketplace.visualstudio.com/items?itemName=ms-vscod...

Using Remote-SSH opens a connection between your local machine and the remote. Only use Remote-SSH to connect to secure remote machines that you trust and that are owned by a party whom you trust. A compromised remote could use the VS Code Remote connection to execute code on your local machine.

Yes this article is from Feb 2025, but NOTHING HAS CHANGED in this regard. Except perhaps now MANY MORE PEOPLE are believing they are safe using VM and other remote SSH "sandboxes" to develop on via VSCode remote host connection over SSH. The reality is, as stated by Microsoft themselves, if you can't trust the remote.. It can own your local computer. And that's not much of a "sandbox"..