A Hacker News post on November 9 says the ChatGPT desktop app forwards your local SSH agent to remote machines, so the agent running there "can authenticate using your local SSH credentials" and "push to your private repos on GitHub." The mechanism is visible in OpenAI's public Codex repository, but the pull request that shows it was closed without being merged, so it is not proof of what shipping builds do. What is not clear from public sources is whether or how broadly forwarding is switched on, and the post's wording is stronger than the evidence behind it. This post separates the two so you can decide what to change.
If you run Codex or the ChatGPT desktop app against remote hosts over SSH, the practical advice is short: treat any forwarded SSH agent as a credential that the agent, and every command it runs, can use for as long as the connection lives. Use a separate, low-privilege key for that work.
Quick answers
| Question | Answer |
|---|---|
| Is the mechanism real? | It is proposed in code. The Codex PR openai/codex#28131 adds a --forward-ssh-agent proxy mode that maintains a stable agent socket, but the PR was closed unmerged on June 29, 2026 by a stale bot. |
| Is it on by default? | Not established. The PR describes it as opt-in for the proxy; the PR author says the Codex app launches the server with the stable socket path. We could not confirm desktop defaults or that this shipped. |
| Are my private keys copied? | No evidence of it. An agent socket signs on request; key material stays local. |
| Can the remote agent use my keys? | Anything that can reach the socket can, while the connection is live. |
| Does data leave my machine? | Signing requests travel over your own SSH connection to the host you chose. Nothing here says they go to a third party. |
| What should I do? | Check ssh-add -l on the remote host, use a dedicated key, add -c confirmation, and prefer hardware-backed keys. |
What was claimed
The claim, posted to Hacker News by the submitter, is three sentences. The agent running on a remote machine can authenticate with your local SSH credentials. That means it can push to private GitHub repositories. And the proof is a review comment on an OpenAI Codex pull request.
The thread had a handful of comments when we read it. None of them reproduced the behaviour end to end; they were mostly opinions about convenience versus friction, plus one practical mitigation. Treat the HN post as a pointer to evidence rather than as evidence.
What the pull request actually says
The linked comment sits on openai/codex pull request 28131, "[codex] Refresh SSH agent for app-server proxy," opened by an OpenAI engineer (abhinav-oai) on June 13, 2026 and marked ready for review the next day. It was aimed at issue 22567 in the same repository, "Codex App Remote SSH does not honor ForwardAgent from ~/.ssh/config, breaking docker buildx --ssh". On June 29, 2026 a GitHub Actions bot closed it after more than 14 days without updates; it was not merged. The PR description gives the problem and the design:
- The problem. A long-running Codex app server can keep the
SSH_AUTH_SOCKpath from the SSH session that launched it. Once that session ends, the path points to a deleted socket, even though the current proxy connection has a live forwarded agent. - The change. The PR adds an opt-in
codex app-server proxy --forward-ssh-agentmode. The proxy validates its inherited agent socket and atomically refreshes a stableforwarded-ssh-agent.socksymlink next to the app server's control socket. - A safety property. A proxy without a usable agent leaves the existing link untouched, so it cannot disrupt another live proxy.
- The effect. A detached app server launched with that stable path "can therefore follow the current proxy connection across SSH reconnects without changing turn or command execution behavior."
An automated review comment on the PR points out that the managed daemon path would not pick up the new socket, because the app server rebuilds child process environments from its own environment. The PR author replied that the Codex app launches the server with the stable path set, quoting this command:
SSH_AUTH_SOCK=~/.codex/app-server-control/forwarded-ssh-agent.sock \
nohup codex app-server --listen unix://
That reply is the "proof" the HN post cites. It shows two things. First, when the Codex app starts the remote app server, SSH_AUTH_SOCK is set to a stable symlink that tracks your current forwarded agent. Second, because the app server builds the environment for the commands it runs from its own environment, those commands inherit that socket path. The review thread says exactly this about command execution.
It does not show how a given desktop release decides whether to start the proxy with --forward-ssh-agent, nor whether the app asks you first. The PR is from June and was closed unmerged, so the same or similar work may have landed in another change, or not at all. We did not run the desktop app against a test host, so we cannot say what it does today by default.
How SSH agent forwarding works, and why it matters for agents
SSH agent forwarding is an old feature. With ForwardAgent yes (or ssh -A), the SSH client opens a channel from the remote host back to the ssh-agent on your laptop and exposes it on the remote side as a Unix socket whose path is in SSH_AUTH_SOCK. When a program on the remote host wants to authenticate to, say, GitHub, it asks that socket to sign a challenge. Your laptop's agent signs it with the private key and returns the signature. The private key never leaves your machine.
The risk is about who can reach the socket. The OpenSSH documentation warns that users with the ability to bypass file permissions on the remote host (for the agent's Unix-domain socket) can access the local agent through the forwarded connection, and that an attacker cannot obtain key material from the agent but can perform operations on the keys that enable them to authenticate using the identities loaded into the agent. In human use, the remote host is usually a machine you trust. With a coding agent, the "user" on that host is a model that reads untrusted content: issues, READMEs, web pages, dependency code.
That changes the threat model in three concrete ways:
- Prompt injection gets a credential. If an injected instruction makes the agent run
git push,ssh other-host, orgit cloneof a private repo, the agent already holds a working identity. We described the same pattern for local files in the Downloads-folder AGENTS.md hijack. - Every command inherits it. Because the app server passes its environment to child processes, scripts, build steps and package install hooks that the agent runs can all talk to the socket. A malicious dependency does not need to find a key file; it just needs the socket path.
- The blast radius is whatever the key can reach. A personal SSH key often has write access to every repository you own and shell access to other servers. A key set up for one project is far less dangerous than your main one.
Infostealers already look for keys on disk, as in the Aokigahara campaign against Claude Code, Codex and Cursor users. A forwarded agent avoids that theft but replaces it with live use of the key.
What OpenAI's documentation says
OpenAI's remote connections page explains that in the ChatGPT desktop app you can add remote projects from an SSH host and run chats against the remote filesystem and shell. It says "Remote project chats run commands, read files, and write changes on the remote host," and that remote access "uses the connected host's projects, chats, files, credentials, permissions, plugins" and local tools. On security, it says to keep the remote host configured with the same expectations as normal SSH access: "trusted keys, least-privilege accounts, and no unauthenticated public listeners," and to add the host to your SSH config so Codex can discover it.
The page also says sandboxing settings, security controls and action approvals still apply to the connected session. Nothing we read on that page mentions agent forwarding specifically, which is why we treat the HN claim as "mechanism proposed in code, shipping and defaults unconfirmed." If OpenAI documents the behaviour or changes it, that will be the authoritative answer.
What developers are saying
The Hacker News thread was small, and we found two comments worth noting. User littlecranky67 suggested keeping SSH keys in the macOS Secure Enclave with a fingerprint requirement per new session, so an agent cannot start anything without you noticing. That is the commenter's own mitigation, and it fits the hardware-backed advice below. User recsv-heredoc argued that products keep removing friction in security-relevant flows, and that some ceremony is a feature. Neither reproduced the claim; they are opinions about design.
What this means if you run AI coding agents
These steps apply whether or not the desktop app forwards your agent by default. They are standard OpenSSH practice, not specific to Codex.
Check what is reachable. In a terminal on the remote host (or in a Codex session on it), run:
echo $SSH_AUTH_SOCK
ssh-add -l
ls -l ~/.codex/app-server-control/
If ssh-add -l lists your keys, anything in that session can use them. A forwarded-ssh-agent.sock symlink in the Codex control directory means the stable-socket mechanism from the PR is in play on that host.
Use a dedicated key for agent work. Create a key that can only reach the repositories the agent needs, register it as a deploy key or on a separate machine account, and load only that key into the agent you forward. Do not forward the agent that holds your personal key.
Require confirmation per use. ssh-add -c <key> marks a key as needing confirmation each time it is used, so a silent git push from an injected agent triggers a prompt on your laptop. This only helps if you read the prompt.
Prefer hardware-backed keys. FIDO2 keys (ed25519-sk) and Secure Enclave keys require a touch or fingerprint. As the HN commenter noted, that makes background use visible.
Turn forwarding off where you can. In ~/.ssh/config, set ForwardAgent no for hosts where an agent runs, and use ProxyJump rather than agent forwarding to reach intermediate hosts. If you need to authenticate from the remote host, a per-host deploy key is safer than a forwarded identity.
Review the logs. On GitHub, check your SSH key's last-used time and the audit log for pushes you do not recognise. On the remote host, the system auth log shows public-key authentications.
Rotate if in doubt. If an agent session ran untrusted content while a forwarded agent was live, assume the key could have been used and replace it. The signing operations do not leak the private key, but the access they granted is what you care about.
What Beam can and cannot do here
Beam watches Claude Code and Codex locally and, under an enforce policy, can deny risky commands through PreToolUse hooks before they run. That can catch a proposed command that pushes to an unexpected remote or reads ~/.ssh, and redaction removes known credential formats before anything is stored. Beam's scan also checks skills and MCP configs you add, which is where injected instructions often arrive. See how Beam fits into a safer vibe-coding setup and the introduction to Beam.
The limits are real. Beam's deny is hook-based and heuristic; it is not a kernel sandbox. It does not sit between a process and an agent socket, so a command that Beam does not flag can still ask the forwarded agent to sign. Beam also runs on your machine, and a remote host reached over SSH is outside what a local hook sees unless Beam is installed and configured there. Key hygiene from the section above is the control that actually bounds this risk.
What we could not verify
- Whether current ChatGPT desktop builds start the remote server with the forwarding proxy by default, or ask first.
- Whether the forwarding behaviour shipped in any release. The PR was closed without merging; we read its page and review thread, not a release note.
- Whether OpenAI scopes the forwarded socket to the app server only. The review thread suggests commands inherit it.
- Whether any real incident has involved this path. We found none.
If OpenAI's documentation or release notes address the behaviour, we will update this post.
Frequently asked questions
Does ChatGPT Desktop forward my SSH agent to remote machines?
Not established. An OpenAI Codex pull request (closed unmerged on June 29, 2026) proposed an opt-in codex app-server proxy --forward-ssh-agent mode, and the PR author states the Codex app launches the remote app server with SSH_AUTH_SOCK pointing at a stable forwarded-ssh-agent.sock. We did not test the desktop app ourselves, and we could not confirm from public docs whether it enables this by default.
Are my private keys copied to the remote machine?
No evidence of that. SSH agent forwarding exposes a socket that signs requests with your local keys; the key material stays on your machine. But any process on the remote host that can reach the socket, including a coding agent and the commands it runs, can ask the agent to authenticate as you while the connection is live.
Can the remote agent really push to my private GitHub repos?
If your GitHub access uses an SSH key held by the forwarded agent, then commands run by the agent on the remote host can authenticate with it. That is how SSH agent forwarding works, and it is the claim in the Hacker News post. Whether it happens in your setup depends on your SSH config and whether the app turns forwarding on.
How do I check whether an agent socket is reachable?
In a session on the remote host, run echo $SSH_AUTH_SOCK and ssh-add -l. If it lists your keys, processes in that session can use them. You can also look for forwarded-ssh-agent.sock under ~/.codex/app-server-control/.
How do I limit the exposure?
Use a separate, least-privilege key for remote agent work, load keys with ssh-add -c so each use needs confirmation, use hardware-backed keys that need a touch or fingerprint, and avoid ForwardAgent for hosts you do not fully trust. OpenAI's docs also say to keep the host to the same standards as normal SSH access.
Can Beam stop an agent from using my SSH agent?
Partly. Beam can flag and, under an enforce policy, deny risky commands that Claude Code or Codex propose through PreToolUse hooks, but it is not a kernel sandbox and cannot stop a process from talking to a socket it can already reach. Beam is a layer on top of key hygiene, not a replacement.
Related reading
- lend: remote coding agents with laptop-side gh and SSH approval (November 2026)
- Claude Code VS Code extension 2.1.313 compromised, with an SSH backdoor
- Malicious AGENTS.md in the Downloads folder hijacks Codex and Claude Code
- Aokigahara infostealer targeting Claude Code, Codex and Cursor credentials
- Hook-based agent security with jev
- OpenSSH documentation: ssh-agent(1) and ssh-add(1)
- Sources: openai/codex PR 28131, OpenAI remote connections docs
Details reflect public pages as read on November 9, 2026. Codex and ChatGPT desktop behaviour can change between releases; check OpenAI's current documentation before relying on this.

