How to Configure Cursor SSH Approval
You set up cursor ssh approval by requiring user confirmation before the editor runs terminal commands. You also pair this editor check with strict OpenSSH host rules on your target servers. Many engineering teams start by giving the local agent full shell permissions for speed. If an agent holds broad SSH keys, one bad command can break a live server. How cursor ssh approval works in your workflow AI coding editors connect to remote machines by running standard shell commands on your worksta
Approval Chains & Escalation + SSH Access Management: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You set up cursor ssh approval by requiring user confirmation before the editor runs terminal commands. You also pair this editor check with strict OpenSSH host rules on your target servers. Many engineering teams start by giving the local agent full shell permissions for speed. If an agent holds broad SSH keys, one bad command can break a live server.
How cursor ssh approval works in your workflow
AI coding editors connect to remote machines by running standard shell commands on your workstation. When the assistant needs to inspect a host, it proposes a remote command in chat. Your local cursor ssh approval setting pauses execution and asks the developer to click approve. This local check stops the agent from running random scripts without a human looking first.
Once the developer approves the step, the command uses the local OpenSSH client to connect. The client reads your local config and presents a public key or certificate to log in. OpenSSH supports signed user certificates that hold identity data, allowed principals, and specific certificate options. A central authority signs these certificates so servers do not need static public key files.
You can also connect the editor to remote systems through the Model Context Protocol. Both MCP servers and direct shell tools run with the permissions of the local user. If your workstation can log in to a production host, the coding agent can too. That makes the local confirmation prompt your first line of defense during daily coding work.
Why local prompts and SSH keys leave a gap
Local editor prompts help catch obvious mistakes, but developers get tired after clicking approve often. When a developer approves a complex shell script, they may miss a destructive flag inside. Worse, if someone turns on auto-run mode for speed, the local prompt disappears right away. The agent can then open an SSH session and run any command the user is allowed to run.
On the server side, OpenSSH checks who can log in based on keys or certificates. Once the session starts, the Linux user account decides what commands can run on disk. Standard SSH keys often stay valid forever unless an admin revokes them on every host. Even when teams sign OpenSSH certificates, the validity window defaults to forever unless set otherwise.
Approval Chains & Escalation + SSH Access Management: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
This leaves a wide operational gap between local editor confirmation and actual server safety. Native SSH controls decide who logs in, not what individual commands do during a session. A local prompt only asks the user on the laptop, not a team lead. Teams need a way to inspect each remote command and require peer review before execution.
Best practices for safer agent SSH sessions
Start by keeping manual command confirmation turned on inside your coding editor at all times. Never add remote connection commands to an automatic allowlist on a developer laptop. Separate your development keys from production keys so an agent cannot reach live hosts accidentally. Give the remote Linux user only the exact file and service permissions needed for the task.
When using OpenSSH certificates, always set a short validity window when signing a public key. List only the specific user or host principals that the developer needs for that work. You can also add certificate options to restrict what features the SSH session allows. Combining short certificate lifetimes with careful command review keeps AI coding workflows under tight control.
Check SSH commands and file transfers on the host
OpenSSH keys and certificates decide who can log into a Linux host. They do not check what a one-shot command or file transfer does once the session starts. With hoop.dev, you run an open-source SSH server with guardrails inline on the host. On every one-shot command or file transfer an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.
When a caller runs a one-shot command or moves a file, hoop.dev guardrails check the command or path before it runs, and hoop.dev data masking masks matched sensitive patterns in downloads and output. Interactive shells carry no guardrails because keystrokes have no statement boundary. Teams can turn interactive shells off and allow only commands and file tasks. The audit trail logs who connected and what was allowed or refused, without storing keystrokes or file bytes. See the source on GitHub.
Frequently asked questions
Does Cursor have a separate setting just for SSH commands?
No, the editor controls SSH through its general terminal command confirmation settings. You require approval for shell commands so the agent must ask before running the SSH client.
Can an AI agent use my local SSH agent keys automatically?
Yes, once a terminal command is approved, it runs under your local operating system user. If your local SSH agent holds active keys, the command can use them without a passphrase.
How do OpenSSH certificates improve on static public keys for agent workflows?
OpenSSH certificates let a central authority sign a public key with an identity and expiration time. Without a defined window, keys work forever, so setting short lifetimes limits exposure if an agent misbehaves.
Related guides
In this post